Caprice LogoCaprice UI

Installation

How to install and set up Caprice UI components in your project.

Caprice UI Registry

If you already have your project setup with shadcn/ui, please skip to the registry configuration section.

Quick setup

npx shadcn@latest init https://caprice-ui.com/r/init.json

Pick Your Framework

Start by selecting your framework of choice. Then follow the instructions to install the dependencies and structure your app.

Caprice UI is built to work with all React frameworks.

Configure registry

Add the Caprice UI registry to your components.json file.

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

Learn more about namespaces and how to use them in your project.

Install Caprice UI core & utils

npx shadcn@latest add @caprice/setup

It install the key dependencies, theme and utils.ts.

Setup Base UI Portals

Base UI uses portals for components that render popups, such as Dialog and Popover. To make portaled components always appear on top of the entire page, add the following style to your application layout root. Learn more

layout.tsx
<body className="relative">
  <div className="isolate">
    {children}
  </div>
</body>

🎉 Voilà!

You can now start adding components to your project.

npx shadcn@latest add @caprice/button

Alternatively, you can add all components at once with the following command:

npx shadcn@latest add @caprice/ui

This will add all caprice ui components to your project.