Skip to documentation content

Get Started

Set up Honest UI, add a component, and verify the files in your project.

Set up Honest UI, add a Button, and confirm that its source is part of your project. The CLI creates the shared configuration, copies component files, and installs the dependencies they need.

Before you start

Run this guide from the root of an existing project with:

  • Node.js 20.18.1 or later.
  • React 19.
  • Tailwind CSS v4.
  • A global stylesheet, such as app/globals.css.

The CLI detects supported project structures and asks where shared styles and copied files should go. You can use aliases such as @/components and @/lib, but the exact aliases are your choice.

1. Initialize Honest UI

Run:

npx honestui@latest init

The CLI creates components.json, records your aliases and stylesheet path, and installs the base styles and dependencies used by copied components. Review the prompts before accepting them because they determine where later components are written.

If components.json already exists, the CLI asks before replacing it. Review the current file and commit or save your work before choosing to overwrite it.

2. Add your first component

Add Button after initialization:

npx honestui@latest add button

The CLI shows the files and packages it plans to add. To inspect the change without writing files, run:

npx honestui@latest add button --dry-run

With the common @/components/ui alias, the copied source is available from @/components/ui/button. Your configured path may differ.

3. Render the component

import { Button } from "@/components/ui/button"

export function SaveProfileButton() {
  return <Button>Save profile</Button>
}

Start your application and confirm that:

  • The button renders with the base styles.
  • The focus indicator is visible when you reach it with Tab.
  • The copied component file is present at the path configured in components.json.

You can now edit the component source and its variants as normal project code.

Add more UI components

Every component page includes its CLI name. For example:

npx honestui@latest add dialog select tabs

Start with Field and the specific controls you need for forms. Use Dialog for focused work, Table for tabular data, and Toast for brief, noncritical feedback.

Install manually

Use manual installation when you want to review and place every file yourself:

  1. Open the component page.
  2. Select the manual installation tab.
  3. Copy the component source and any supporting files.
  4. Install the listed dependencies.
  5. Confirm that the shared Honest UI styles are available.
  6. Update imports to match your aliases.
  7. Test the rendered component and its keyboard behavior.

Copy the complete component structure. Removing labels, descriptions, focus handling, or primitive parts can change its behavior and accessibility.

Package-based collections

The component CLI is not the installation path for every Honest UI collection. Charts, icons, logos, vectors, and shaders are installed from the honestui package and imported through dedicated entry points.

CollectionNext step
ChartsInstall charts
Icons, logos, and vectorsInstall visual assets
ShadersInstall shaders

Read Theme before changing shared tokens, Styling before changing copied component classes, and Accessibility before changing component semantics or interaction behavior.