Skip to content
Browse documentation

Installation

Every component installs with the shadcn CLI into your own components folder, as source you can read and change. Set up shadcn/ui once, then add any of the 298 with one command.

Requirements

React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

Any shadcn style works: the components read its theme variables, so they look like the rest of your app in light and dark. They don’t need a provider, a runtime or an animation library. See Theming for the tokens they read.

Next.js

  1. 01

    Create the app

    Skip this if you have one. Pick Tailwind CSS when it asks.

    $ npx create-next-app@latest my-app
  2. 02

    Set up shadcn/ui

    It writes components.json and the theme variables into your global CSS.

    $ npx shadcn@latest init
  3. 03

    Add a component

    $ npx shadcn@latest add @hairline/number-roll
  4. 04

    Use it

    app/page.tsx
    import { NumberRoll } from "@/components/number-roll";<NumberRoll value={downloads} /><NumberRoll value={price} format={{ style: "currency", currency: "USD", maximumFractionDigits: 0 }} />

Components that move or listen are client components (they start with "use client"), so you can import them straight into a server page.

Vite

Follow shadcn’s Vite guide to add Tailwind CSS v4 and the @/ import alias, then run shadcn init. From there it is the same command as Next.js. Nothing here depends on Next.js: no server components, no router, no next/image.

Add a component

Each component page has its command under the preview. They all follow one pattern: @hairline/ and the component’s name. There is nothing to set up first: @hairline is listed in shadcn’s registry directory, so the CLI knows where to find it.

$ npx shadcn@latest add @hairline/status-button

Several at once work too, and the CLI asks before it overwrites a file that is already there.

$ npx shadcn@latest add @hairline/number-roll @hairline/text-morph

By URL

On a shadcn CLI before 3.0, or on a network that blocks ui.shadcn.com, install by the component’s registry URL instead. It is the same file.

$ npx shadcn@latest add https://hairlineui.com/r/status-button.json

To keep the short names working without the directory, add the registry to components.json yourself:

components.json
{  "registries": {    "@hairline": "https://hairlineui.com/r/{name}.json"  }}

Premium blocks

Premium blocks come with All-Access and install through a second namespace, @hairline-pro, that sends your token. This one you add to components.json yourself. Make a token in your account settings, put it in .env.local, and keep that file out of git.

.env.local
HAIRLINE_TOKEN=hl_your_token
components.json
{  "registries": {    "@hairline-pro": {      "url": "https://hairlineui.com/r/pro/{name}.json",      "headers": { "Authorization": "Bearer ${HAIRLINE_TOKEN}" }    }  }}
$ npx shadcn@latest add @hairline-pro/<name>

A teammate gets their own token, so you can revoke one without the others. Every request checks your All-Access, and premium blocks are under the commercial license, not MIT.

What the CLI adds

  • The component file in components/, plus its supporting files when it has them (a drag hook, a parser), so the install is complete.
  • Other components it builds on. Status button brings Text morph; Pricing toggle brings Number roll. Each page lists them under Requirements.
  • The keyframes it uses, added to your global CSS once. They are all named ui-*, so they don’t clash with yours.
  • npm packages, only when a component needs one, such as lucide-react for icons.

By hand

Every component page shows its full source under Source. Copy each file into your components folder, then copy the keyframes it names from the registry item (/r/<name>.json, under css) into your global CSS.

With your coding agent

Connect Claude Code, Codex, Cursor or any MCP client and ask for what you need. Your agent finds the component, reads its props and runs the same install command.

terminal
claude mcp add --transport http --scope user hairline-ui https://hairlineui.com/api/mcp

Setup for every other client is on the MCP page. Agents that browse instead can read /llms.txt or any component as markdown.