- Accordion
- Alert Dialog
- Alert
- Autocomplete
- Avatar
- Badge
- Button Group
- Button
- Calendar
- Checkbox Group
- Checkbox
- Collapsible
- Combobox
- Command
- Dialog
- Field
- Form
- Input Group
- Input
- Kbd
- Label
- Menu
- Meter
- Navigation Menu
- Number Field
- Number InputNew
- OTP Field
- Pagination
- Popover
- Radio Group
- Scroll Area
- Select
- Sheet
- Sidebar
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Tooltip
Initialize your project and install components with the ZBM UI CLI.
The ZBM UI CLI (@zbmui/cli) is the easiest way to set up ZBM UI. It copies components into your project as source files you own and maintain — nothing is hidden behind an npm package. Components can then be updated independently, without waiting for a new library release.
Prerequisites
The CLI validates your project before doing anything. Make sure you have:
- Node.js 24 or later
- A Next.js or Vite project
- Tailwind CSS v4 (CSS-first configuration)
- A
tsconfig.jsonwith path aliases, such as"@/*": ["./src/*"]
init
Run the following command at the root of your project:
pnpm dlx @zbmui/cli@latest init
init sets up everything ZBM UI needs:
- Detects your framework and checks that Tailwind CSS v4 and your tsconfig path aliases are in place.
- Asks where your global CSS file lives and which import aliases to use (skipped with
-y). - Writes a
components.jsonconfig file to your project root. - Installs the
cn()utility into your lib directory. - Writes the theme CSS files to
src/styles/(orstyles/if your project has nosrcdirectory) and injects the@importlines into your global CSS, right after@import "tailwindcss";. - Installs any missing base dependencies using your detected package manager (pnpm, npm, yarn, or bun).
If a components.json already exists, the CLI asks before overwriting it.
init options
| Option | Description |
|---|---|
-y, --yes | Use the default configuration without prompting. Fails if components.json already exists. |
--cwd <path> | Run against a project directory other than the current working directory. |
--registry <url> | Use a custom registry — an HTTP URL or a local directory containing registry JSON. |
add
Add components to your project by name:
pnpm dlx @zbmui/cli@latest add button
You can install multiple components in one command:
pnpm dlx @zbmui/cli@latest add button dialog tabs
Running add with no arguments opens an interactive picker listing every available component. Registry dependencies (hooks and utilities such as cn()) are resolved and installed automatically, along with any npm packages the components rely on.
add options
| Option | Description |
|---|---|
-a, --all | Install all available components. |
-o, --overwrite | Overwrite existing files. Without this flag, the CLI keeps existing files and asks before replacing them. |
-y, --yes | Skip confirmation prompts. Never overwrites existing files — combine with --overwrite for that. |
--cwd <path> | Project directory. Defaults to the current working directory. |
--registry <url> | Registry URL or local directory. Overrides the registry from components.json. |
In non-interactive environments (CI, piped input), pass component names or --all — without a terminal, add can't show the picker and exits with an error instead.
list
See everything the registry offers, grouped by type (ui, hook, lib, ...):
pnpm dlx @zbmui/cli@latest list
Pass --json to print the raw registry index instead.
Configuration
init writes a components.json file into your project root. The CLI reads it on every add to know where to place files:
{
"$schema": "https://ui.zubayer.dev/schema.json",
"rsc": true,
"tsx": true,
"tailwind": {
"css": "src/app/globals.css"
},
"aliases": {
"components": "@/components",
"ui": "@/components/ui",
"hooks": "@/hooks",
"lib": "@/lib"
}
}| Field | Description |
|---|---|
rsc | Whether the project uses React Server Components (set automatically for Next.js). |
tsx | Whether the project uses TSX syntax. |
tailwind.css | Path to the global CSS file where the ZBM UI theme imports are injected. |
aliases.components | Import alias for example components. Must resolve via the paths in your tsconfig. |
aliases.ui | Import alias for UI components. |
aliases.hooks | Import alias for hooks. |
aliases.lib | Import alias for lib utilities such as cn(). |
Every alias must resolve through your tsconfig paths — that is how the CLI decides where to write files. Change them here (or re-run init) if your project uses a different layout.
Custom registry
By default, the CLI fetches components from https://ui.zubayer.dev/r. You can point it at a different registry — an HTTP URL or a local directory containing registry JSON — in three ways, in order of precedence:
- The
--registryflag on any command. - The
ZBMUI_REGISTRY_URLenvironment variable. - The
registryfield incomponents.json.
pnpm dlx @zbmui/cli@latest add button --registry ./my-registry