Guide
Install your first component
Add editable UI components to an Astro project.
On this page
Before you start
- Bun installed, even if your project uses npm, pnpm, or Yarn.
- An Astro application with its dependencies installed.
Add a Button to an Astro page using the hulla CLI. The command copies the component into your project, where you can edit its source.
Install the CLI as a development dependency in the application. The exact beta pin keeps team members and CI on the same CLI release; the hulla CLI itself requires Bun at runtime.
bun add -D hulla@0.0.0-beta.1npm install --save-dev hulla@0.0.0-beta.1pnpm add -D hulla@0.0.0-beta.1yarn add -D hulla@0.0.0-beta.1Verify the installed executable before changing the project. These equivalent commands run the same pinned version through each package manager; Bun must be available even when the project uses npm, pnpm, or Yarn.
bunx hulla@0.0.0-beta.1 --versionnpx hulla@0.0.0-beta.1 --versionpnpm dlx hulla@0.0.0-beta.1 --versionyarn dlx hulla@0.0.0-beta.1 --versionThe command prints hulla v0.0.0-beta.1. Keep that exact version in your project so another install uses the same CLI behavior.
Package scripts can find a locally installed hulla executable automatically. For the terminal commands below, add the project’s executable directory to your current shell’s search path. Run this from the project root:
export PATH="$PWD/node_modules/.bin:$PATH"From the project root, create .hulla/hulla.json. The --yes flag accepts confirmations and prevents prompts; for this initialization, the CLI detects the package manager and records its package scripts.
hulla init --yesThe success signal is a new .hulla/hulla.json containing the package scripts and references to subsystem configuration. Commit this file so local development and automation use the same choices.
Run UI setup from the same project to choose the registry, framework, component paths, and support files. Then add a component by its registry name; specify the framework whenever the registry contains that component in more than one target.
hulla ui init
hulla ui add --framework astro buttonThe add command copies the Astro button’s files and any declared dependencies or support files into the configured paths. Review the changed files and run the application’s build or type checks so missing peer setup is visible in your own project. Use UI components for other framework targets.
The files are installed; now use them. Follow Build a reading counter to compose Card and Button into a working Astro page. You can skip its UI initialization step because you’ve already done it here.
Use UI components for registry pinning and updates, or Configuration to understand the generated settings.