Getting started
CLI
The NexUI CLI lets you add components to your project with a single command, instead of manually copying source files. It writes the component file directly into your codebase — you own it from the start.
nexui init
Run once in a new or existing project. Creates lib/utils.ts and adds the required CSS variables to your globals.css.
bash
$ npx nexui@latest init
Detecting project structure... Writing lib/utils.ts Adding CSS variables to globals.css Done. NexUI is ready.
nexui add [component]
Downloads one or more components into components/nexui/. The file is plain TypeScript — edit it however you like.
bash
$ npx nexui@latest add button
Resolving button... Writing components/nexui/button.tsx Added button. Import: import { Button } from "@/components/nexui/button"
Add multiple components at once:
bash
$ npx nexui@latest add button badge input card
nexui list
Prints every available component name so you know exactly what you can add.
bash
$ npx nexui@latest list
Available components (50+): accordion alert auth-panel avatar badge button card carousel chart checkbox command dialog dropdown input kanban popover progress select sheet skeleton slider switch table tabs textarea toast tooltip view-switcher ...
Package manager variants
npmnpx nexui@latest add button
pnpmpnpm dlx nexui@latest add button
yarnyarn dlx nexui@latest add button
bunbunx nexui@latest add button
Note — The CLI is a thin file-fetcher. All it does is write the component source to your filesystem. You can always copy components manually from the component library instead.