# Installation

Add FewTone UI components to a Next.js project with one shadcn CLI command, or copy the source by hand. Either way, the code ends up in your project, and nothing else in your app changes.

## Requirements

| What | Version | Why |
| --- | --- | --- |
| React | 19 | Components use React 19 APIs |
| Tailwind CSS | v4 | Styles use Tailwind v4 syntax, such as `h-(--size-control-md)` |
| Next.js | App Router | What FewTone UI is built and tested with |
| shadcn CLI | latest | Installs components from the registry (`npx shadcn@latest`) |

Your global CSS file should import Tailwind with `@import "tailwindcss";`. If it uses `@tailwind base;` instead, the project is on Tailwind v3: [upgrade to v4](https://tailwindcss.com/docs/upgrade-guide) first.

## Install with the shadcn CLI

### 1. Create a Next.js app (new projects only)

Skip this step if you already have a Next.js project. Answer yes to Tailwind CSS and the App Router.

```bash
npx create-next-app@latest my-app
```

### 2. Set up shadcn

Run this once per project. It creates `components.json` (where your components and helpers go), the `cn` helper that every component imports, and your theme's CSS variables. If your project already uses shadcn/ui, skip it: never run `init` again on an existing project, as it rewrites your theme.

```bash
npx shadcn@latest init
```

### 3. Add a component

Copy the command from any component page, or from here. Pick your package manager: the choice is remembered across the site.

```bash
npx shadcn@latest add https://ui.fewtone.com/r/button.json
```

### 4. Use it

The component is now in `components/ui`. Import it like any of your own components.

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

export function Actions() {
  return <Button>Continue</Button>
}
```

## What the CLI adds

Each component brings its source file and the npm packages it needs:

| Component | Files | npm packages |
| --- | --- | --- |
| [Accordion](https://ui.fewtone.com/components/accordion.md) | components/ui/accordion.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion, radix-ui |
| [Alert Dialog](https://ui.fewtone.com/components/alert-dialog.md) | components/ui/alert-dialog.tsx | class-variance-authority, motion, radix-ui |
| [Avatar](https://ui.fewtone.com/components/avatar.md) | components/ui/avatar.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Badge](https://ui.fewtone.com/components/badge.md) | components/ui/badge.tsx, components/ui/badge-shine.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Breadcrumb](https://ui.fewtone.com/components/breadcrumb.md) | components/ui/breadcrumb.tsx, lib/motion.ts | lucide-react, motion, radix-ui |
| [Button](https://ui.fewtone.com/components/button.md) | components/ui/button.tsx | class-variance-authority, radix-ui |
| [Calendar](https://ui.fewtone.com/components/calendar.md) | components/ui/calendar.tsx, lib/motion.ts | lucide-react, motion |
| [Card](https://ui.fewtone.com/components/card.md) | components/ui/card.tsx | class-variance-authority, radix-ui |
| [Checkbox](https://ui.fewtone.com/components/checkbox.md) | components/ui/checkbox.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Combobox](https://ui.fewtone.com/components/combobox.md) | components/ui/combobox.tsx, lib/motion.ts | lucide-react, motion, radix-ui |
| [Command](https://ui.fewtone.com/components/command.md) | components/ui/command.tsx, lib/motion.ts | lucide-react, motion |
| [Context Menu](https://ui.fewtone.com/components/context-menu.md) | components/ui/context-menu.tsx | lucide-react, radix-ui |
| [Copy Button](https://ui.fewtone.com/components/copy-button.md) | components/ui/copy-button.tsx, lib/motion.ts | lucide-react, motion |
| [Date Picker](https://ui.fewtone.com/components/date-picker.md) | components/ui/date-picker.tsx, lib/motion.ts | lucide-react, motion |
| [Dialog](https://ui.fewtone.com/components/dialog.md) | components/ui/dialog.tsx, lib/motion.ts | lucide-react, motion, radix-ui |
| [Drawer](https://ui.fewtone.com/components/drawer.md) | components/ui/drawer.tsx, lib/motion.ts | lucide-react, motion, vaul |
| [Dropdown Menu](https://ui.fewtone.com/components/dropdown-menu.md) | components/ui/dropdown-menu.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion, radix-ui |
| [Hover Card](https://ui.fewtone.com/components/hover-card.md) | components/ui/hover-card.tsx, lib/motion.ts | motion, radix-ui |
| [Input](https://ui.fewtone.com/components/input.md) | components/ui/input.tsx | class-variance-authority |
| [Input OTP](https://ui.fewtone.com/components/input-otp.md) | components/ui/input-otp.tsx, lib/motion.ts | lucide-react, motion, radix-ui |
| [Loading Button](https://ui.fewtone.com/components/loading-button.md) | components/ui/loading-button.tsx, lib/motion.ts | motion |
| [Marquee](https://ui.fewtone.com/components/marquee.md) | components/ui/marquee.tsx, lib/motion.ts | motion |
| [Navigation Menu](https://ui.fewtone.com/components/navigation-menu.md) | components/ui/navigation-menu.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion, radix-ui |
| [Number Input](https://ui.fewtone.com/components/number-input.md) | components/ui/number-input.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion |
| [Number Ticker](https://ui.fewtone.com/components/number-ticker.md) | components/ui/number-ticker.tsx, lib/motion.ts | motion |
| [Pagination](https://ui.fewtone.com/components/pagination.md) | components/ui/pagination.tsx, components/ui/pagination-pill.tsx, lib/motion.ts | lucide-react, motion, radix-ui |
| [Popover](https://ui.fewtone.com/components/popover.md) | components/ui/popover.tsx, lib/motion.ts | motion, radix-ui |
| [Progress](https://ui.fewtone.com/components/progress.md) | components/ui/progress.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Radio Group](https://ui.fewtone.com/components/radio-group.md) | components/ui/radio-group.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Scroll Area](https://ui.fewtone.com/components/scroll-area.md) | components/ui/scroll-area.tsx | radix-ui |
| [Select](https://ui.fewtone.com/components/select.md) | components/ui/select.tsx, lib/motion.ts | lucide-react, motion, radix-ui |
| [Sheet](https://ui.fewtone.com/components/sheet.md) | components/ui/sheet.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion, radix-ui |
| [Sidebar](https://ui.fewtone.com/components/sidebar.md) | components/ui/sidebar.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion, radix-ui |
| [Skeleton](https://ui.fewtone.com/components/skeleton.md) | components/ui/skeleton.tsx, components/ui/skeleton-sheen.tsx, lib/motion.ts | motion |
| [Slider](https://ui.fewtone.com/components/slider.md) | components/ui/slider.tsx, lib/motion.ts | motion |
| [Spinner](https://ui.fewtone.com/components/spinner.md) | components/ui/spinner.tsx, lib/motion.ts | class-variance-authority, motion |
| [Stepper](https://ui.fewtone.com/components/stepper.md) | components/ui/stepper.tsx, lib/motion.ts | motion, radix-ui |
| [Switch](https://ui.fewtone.com/components/switch.md) | components/ui/switch.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Switcher](https://ui.fewtone.com/components/switcher.md) | components/ui/switcher.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Table](https://ui.fewtone.com/components/table.md) | components/ui/table.tsx, components/ui/table-motion.tsx, lib/motion.ts | lucide-react, motion |
| [Tabs](https://ui.fewtone.com/components/tabs.md) | components/ui/tabs.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Text Effects](https://ui.fewtone.com/components/text-effects.md) | components/ui/text-effects.tsx, lib/motion.ts | motion |
| [Textarea](https://ui.fewtone.com/components/textarea.md) | components/ui/textarea.tsx, lib/motion.ts | motion |
| [Theme Toggle](https://ui.fewtone.com/components/theme-toggle.md) | components/ui/theme-toggle.tsx, lib/motion.ts | motion, next-themes |
| [Toast](https://ui.fewtone.com/components/toast.md) | components/ui/toast.tsx, lib/motion.ts | class-variance-authority, lucide-react, motion, radix-ui |
| [Toggle Group](https://ui.fewtone.com/components/toggle-group.md) | components/ui/toggle-group.tsx, lib/motion.ts | class-variance-authority, motion, radix-ui |
| [Tooltip](https://ui.fewtone.com/components/tooltip.md) | components/ui/tooltip.tsx | radix-ui |

The first install also adds the **FewTone UI tokens** to your global CSS file: control and icon sizes, motion durations and easings, the focus ring, the popover layer, and the open and close animations. The CLI only adds the variables your project doesn't define yet, so your colours, fonts and radius stay exactly as they are.

Components that animate with JavaScript, such as Select and Switch, also add `lib/motion.ts`: the spring presets they share.

Running the same command again is safe. If the CLI asks to overwrite a file you've changed, answer no to keep your edits.

## Install several components at once

Pass several addresses to one command:

```bash
npx shadcn@latest add https://ui.fewtone.com/r/button.json https://ui.fewtone.com/r/select.json
```

## Shorter commands with the @fewtone namespace

To write `@fewtone/button` instead of the full address, add the FewTone UI registry to `components.json`:

```json
{
  "registries": {
    "@fewtone": "https://ui.fewtone.com/r/{name}.json"
  }
}
```

```bash
npx shadcn@latest add @fewtone/button @fewtone/select
```

## Install with an AI assistant

Every component page has a **Copy prompt** button. It copies a detailed brief for your AI coding assistant: Claude Code, Cursor, Copilot or ChatGPT. The brief has your assistant:

1. check your package manager, React and Tailwind versions, and import paths
2. install with the shadcn CLI, or by hand if the CLI isn't set up
3. change nothing else: no overwritten files and no theme changes
4. type-check the result and list every file it touched

To let your assistant find and install components by itself, connect it to the [FewTone UI MCP server](https://ui.fewtone.com/docs/mcp).

## Install manually

You can also install without the CLI. Every component page has an **Installation** section with the steps in order:

1. install the npm dependencies
2. add the FewTone UI tokens to your global CSS file (only the variables you don't have)
3. add `lib/motion.ts`, if the component animates with JavaScript
4. copy the component's source into `components/ui`
5. update the import paths to match your project

If your project has no `cn` helper, add one at `lib/utils.ts`:

```ts
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
}
```

## Customize the theme

FewTone UI components take their colours, corners and fonts from CSS variables, so they follow your theme in light and dark mode without any changes.

**Colours.** Components use the same semantic names as shadcn/ui: `background`, `foreground`, `primary`, `secondary`, `muted`, `accent`, `border`, `input` and `ring`. Change them and every component follows.

```css
:root {
  --primary: oklch(0.17 0 0);
  --primary-foreground: oklch(1 0 0);
}

.dark {
  --primary: oklch(0.97 0 0);
  --primary-foreground: oklch(0.13 0 0);
}
```

**Dark mode.** Dark values apply under the `dark` class on the `html` element, which is how [next-themes](https://github.com/pacocoursey/next-themes) works.

**Radius.** Corners come from `--radius`. Set it once to make every component rounder or sharper.

**Sizes and motion.** The FewTone UI tokens tune every component at once:

```css
:root {
  --size-control-md: 2.25rem; /* height of buttons, inputs and selects */
  --duration-fast: 150ms; /* hover and press transitions */
  --scale-press: 0.97; /* how far buttons sink when pressed */
}
```

When the operating system asks for reduced motion, the durations drop to almost nothing and spring animations become instant.

## Troubleshooting

**The CLI says `components.json` was not found.** Run `npx shadcn@latest init` once in the project, then add the component again.

**Components render without styles.** The project is probably on Tailwind CSS v3. FewTone UI needs v4: check that your global CSS file has `@import "tailwindcss";`.

**`Cannot find module '@/lib/utils'`.** Your import alias or utils path is different. Check the `aliases` in `components.json` and `paths` in `tsconfig.json`, or add the `cn` helper shown above.

**A file already exists.** The CLI asks before overwriting. Answer no to keep your version.

**Animations don't play.** Check whether reduced motion is turned on in your operating system's accessibility settings. FewTone UI turns animations off when it is.

## Frequently asked questions

**How do I install FewTone UI in Next.js?**

Run npx shadcn@latest init once in your project, then run the install command from any component page, such as npx shadcn@latest add https://ui.fewtone.com/r/button.json. The component's source is added to components/ui.

**Can I use pnpm, yarn or bun?**

Yes. Use pnpm dlx, yarn dlx or bunx --bun in place of npx. Every install command on the site has a switch for your package manager.

**Will installing a component change my theme?**

No. The CLI only adds the FewTone UI variables your project doesn't already define, and never changes your existing colours, fonts or radius.

**Can I install FewTone UI without the shadcn CLI?**

Yes. Every component page lists the manual steps: the npm packages, the tokens for your global CSS file, and the full source to copy.

**Does FewTone UI work with Tailwind CSS v3?**

No. FewTone UI is written for Tailwind CSS v4. Upgrade the project to v4 first.

## Next steps

- [Browse all components](https://ui.fewtone.com/components) and add the ones you need.
- [Read the introduction](https://ui.fewtone.com/docs) to see how FewTone UI is built.
