Caprice LogoCaprice UI
Installation

TanStack Router

Install and configure Caprice UI for TanStack Router.

Create project

Start by creating a new TanStack Router project:

npx create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcn

Add Caprice UI Registry to your components.json

components.json
{
  "registries": {
    "@caprice": "https://caprice-ui.com/r/{name}.json"
  }
}

Add Components

You can now start adding components to your project.

npx shadcn@latest add @caprice/button

The command above will add the Button component to your project. You can then import it like this:

src/routes/index.tsx
import { createFileRoute } from "@tanstack/react-router"
import { Button } from "@/components/caprice-ui/button"

export const Route = createFileRoute("/")({
  component: App,
})

function App() {
  return (
    <div>
      <Button>Click me</Button>
    </div>
  )
}

Add all components at once

You can install all Caprice UI components at once with a single command:

npx shadcn@latest add @caprice/ui

The command above will add all caprice ui components to your project.