Skip to main content
The add command adds components to your project. It fetches components from the registry, transforms them based on your configuration, and installs them with all dependencies.

Usage

Arguments

string[]
Names, URL, or local path to components. If not provided, you’ll see an interactive component selector.

Options

boolean
default:"false"
Skip confirmation prompt.
boolean
default:"false"
Overwrite existing files.
string
The working directory. Defaults to the current directory.
boolean
default:"false"
Add all available components.
string
The path to add the component to.
boolean
default:"false"
Mute output.
boolean
default:"false"
Use the src directory when creating a new project.
boolean
Do not use the src directory when creating a new project.
boolean
default:"true"
Use CSS variables for theming.
boolean
Do not use CSS variables for theming.

Examples

Add a single component

Add multiple components

Add with interactive selector

Displays an interactive list of all available components.

Add all components

Add and overwrite existing files

Add from a URL

Add from local path

Add to a specific path

Silent mode

What it does

  1. Checks for components.json (runs init if missing)
  2. Fetches component from the registry
  3. Resolves all component dependencies
  4. Transforms component code based on your configuration:
    • Updates import paths
    • Applies CSS variables or inline colors
    • Adjusts for TypeScript/JavaScript
    • Handles RSC (React Server Components)
  5. Installs npm dependencies
  6. Writes component files to your project

Registry types

The add command supports different registry item types:
  • registry:ui - UI components
  • registry:block - Larger UI blocks/sections
  • registry:hook - React hooks
  • registry:lib - Library utilities
  • registry:theme - Theme configurations
  • registry:style - Complete style systems
  • registry:base - Base configurations

Special handling

Styles and themes

When adding a registry:style or registry:theme, you’ll be warned that:
  • Existing CSS variables will be overwritten
  • Existing components may be affected
You’ll need to confirm before proceeding (unless using --yes).

Universal components

Some components are framework-agnostic and work across all project types without transformation.

Output