# Changelog
URL: /docs/changelog
# Introduction
URL: /docs
## What is Caprice UI?
Caprice UI is a collection of accessible, modern, and highly customizable React components built on top of [Base UI](https://base-ui.com/), [React Aria Hooks](https://react-spectrum.adobe.com/react-aria/hooks.html), [shadcn/ui](https://ui.shadcn.com/), and [Tailwind CSS v4](https://tailwindcss.com).
### Differences from shadcn/ui
* The main difference is the primitive layer. Caprice UI uses [Base UI](https://base-ui.com/) while [shadcn/ui](https://ui.shadcn.com/) uses [Radix UI](https://www.radix-ui.com/).
* Comes with refined styling and a different opinionated design language.
* Distributed via **shadcn registry** (recommended) or as an npm package (`@caprice-ui/react`)
We built Caprice UI as an extension of [shadcn/ui](https://ui.shadcn.com/), not as a replacement.
### About the name
The name **Caprice** comes from the French word *caprice* (pronounced "ka·pris"), borrowed from the Italian *capriccio*, meaning a sudden whim or fancy. As the ecosystem around [shadcn/ui](https://ui.shadcn.com/) emerged with countless forks and variations, we embraced our own little *caprice*: building a component collection that reflects our personal opinions, aesthetics, and the way we believe modern UI should feel.
## Maintainers
Caprice UI is designed, built, and maintained by [Thomas Marrec](https://x.com/Gomah) & [Léa Fabre](https://x.com/lea_kiwi).
## Acknowledgments
Powered by great open-source projects:
* [Base UI](https://base-ui.com/) – Component primitives
* [Tailwind CSS](https://tailwindcss.com/) – Styling
* [React Aria](https://react-spectrum.adobe.com/react-aria/hooks.html) – Interaction hooks
* [shadcn/ui](https://ui.shadcn.com/) – Component design and registry distribution
* [Fumadocs](https://fumadocs.com/) – Documentation
## Next steps
Check out our [installation guide](/docs/installation) to get started.
{/* Curious about what's coming next? Take a look at our [roadmap](/docs/roadmap) to see planned features and improvements. */}
Want to contribute? Please read our [Contributing Guide](https://github.com/caprice-ui/ui/blob/main/.github/CONTRIBUTING.md) to get started. Whether you're fixing bugs, improving documentation, or adding new features, your contributions help make Caprice UI better for everyone.
# Theming
URL: /docs/theming
You can choose between using CSS variables (recommended) or utility classes for theming.
## CSS Variables
```tsx
// [!code word:bg-background]
// [!code word:text-foreground]
```
To use CSS variables for theming set `tailwind.cssVariables` to `true` in your `components.json` file.
```json title="components.json" lineNumbers
{
"style": "new-york",
"rsc": true,
"tailwind": {
"config": "",
"css": "app/globals.css",
"baseColor": "neutral",
// [!code highlight]
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
```
## Utility classes
```tsx
// [!code word:bg-zinc-950]
// [!code word:dark\:bg-white]
```
To use utility classes for theming set `tailwind.cssVariables` to `false` in your `components.json` file.
```json title="components.json" lineNumbers
{
"style": "new-york",
"rsc": true,
"tailwind": {
"config": "",
"css": "app/globals.css",
"baseColor": "neutral",
// [!code highlight]
"cssVariables": false
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
```
## Convention
We use a simple `background` and `foreground` convention for colors. The `background` variable is used for the background color of the component and the `foreground` variable is used for the text color.
The `background` suffix is omitted when the variable is used for the background color of the component.
Given the following CSS variables:
```css
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
```
The `background` color of the following component will be `var(--primary)` and the `foreground` color will be `var(--primary-foreground)`.
```tsx
Hello
```
## List of variables
Here's the list of variables available for customization:
```css title="app/globals.css" lineNumbers
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
```
## Adding new colors
To add new colors, you need to add them to your CSS file under the `:root` and `dark` pseudo-classes. Then, use the `@theme inline` directive to make the colors available as CSS variables.
### Using oklch values
```css title="app/globals.css" lineNumbers
:root {
--warning: oklch(0.84 0.16 84);
--warning-foreground: oklch(0.28 0.07 46);
}
.dark {
--warning: oklch(0.41 0.11 46);
--warning-foreground: oklch(0.99 0.02 95);
}
@theme inline {
--color-warning: var(--warning);
--color-warning-foreground: var(--warning-foreground);
}
```
### Using Tailwind CSS colors
```css title="app/globals.css" lineNumbers
:root {
--warning: var(--color-yellow-500);
--warning-foreground: var(--color-yellow-950);
}
.dark {
--warning: var(--color-yellow-900);
--warning-foreground: var(--color-yellow-500);
}
@theme inline {
--color-warning: var(--warning);
--color-warning-foreground: var(--warning-foreground);
}
```
You can now use the `warning` utility class in your components.
```tsx
// [!code word:bg-warning]
// [!code word:text-warning-foreground]
```
## Other color formats
See the [Tailwind CSS documentation](https://tailwindcss.com/docs/colors) for more information on using colors in Tailwind CSS.
## Base Colors
Caprice provides two approaches to theming:
1. **Caprice Theme** (Default): Uses Tailwind CSS color references for better integration
2. **Shadcn Themes**: Direct oklch values for precise color control
### Using Base Colors
Import base color themes from the `@caprice-ui/tailwind` package:
### Caprice (Default)
The default Caprice theme maps to Tailwind CSS colors, making it easy to leverage the existing Tailwind color system:
```css title="app/globals.css" lineNumbers
:root {
--background: var(--color-white);
--foreground: var(--color-neutral-950);
--card: var(--color-white);
--card-foreground: var(--color-neutral-950);
--popover: var(--color-white);
--popover-foreground: var(--color-neutral-950);
--primary: var(--color-zinc-900);
--primary-foreground: var(--color-neutral-50);
--secondary: var(--color-neutral-100);
--secondary-foreground: var(--color-neutral-900);
--muted: var(--color-neutral-100);
--muted-foreground: var(--color-neutral-500);
--accent: var(--color-neutral-100);
--accent-foreground: var(--color-neutral-900);
--destructive: var(--color-red-600);
--destructive-foreground: var(--color-red-600);
--border: var(--color-neutral-200);
--input: var(--color-neutral-200);
--ring: var(--color-neutral-400);
--chart-1: var(--color-orange-600);
--chart-2: var(--color-teal-600);
--chart-3: var(--color-cyan-900);
--chart-4: var(--color-amber-400);
--chart-5: var(--color-amber-500);
--radius: 0.625rem;
--sidebar: var(--color-neutral-50);
--sidebar-foreground: var(--color-neutral-950);
--sidebar-primary: var(--color-neutral-900);
--sidebar-primary-foreground: var(--color-neutral-50);
--sidebar-accent: var(--color-neutral-100);
--sidebar-accent-foreground: var(--color-neutral-900);
--sidebar-border: var(--color-neutral-200);
--sidebar-ring: var(--color-neutral-400);
}
.dark {
--background: var(--color-neutral-950);
--foreground: var(--color-neutral-50);
--card: var(--color-neutral-950);
--card-foreground: var(--color-neutral-50);
--popover: var(--color-neutral-950);
--popover-foreground: var(--color-neutral-50);
--primary: var(--color-neutral-50);
--primary-foreground: var(--color-neutral-900);
--secondary: var(--color-neutral-800);
--secondary-foreground: var(--color-neutral-50);
--muted: var(--color-neutral-800);
--muted-foreground: var(--color-neutral-400);
--accent: var(--color-neutral-800);
--accent-foreground: var(--color-neutral-50);
--destructive: var(--color-red-400);
--destructive-foreground: var(--color-red-600);
--border: var(--color-neutral-800);
--input: var(--color-neutral-800);
--ring: var(--color-neutral-600);
--chart-1: var(--color-blue-700);
--chart-2: var(--color-emerald-500);
--chart-3: var(--color-amber-500);
--chart-4: var(--color-purple-500);
--chart-5: var(--color-rose-500);
--sidebar: var(--color-neutral-900);
--sidebar-foreground: var(--color-neutral-50);
--sidebar-primary: var(--color-blue-700);
--sidebar-primary-foreground: var(--color-neutral-50);
--sidebar-accent: var(--color-neutral-800);
--sidebar-accent-foreground: var(--color-neutral-50);
--sidebar-border: var(--color-neutral-800);
--sidebar-ring: var(--color-neutral-600);
}
```
You can import it in your `global.css` file using the `@caprice-ui/tailwind` package:
```css title="app/globals.css" lineNumbers
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
```
## Shadcn Base Colors
The following themes use oklch color values and can be imported from `@caprice-ui/tailwind/themes/shadcn/*`.
### Neutral
```css title="app/globals.css" lineNumbers
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
```
Or import it in your `global.css` file:
```css title="app/globals.css" lineNumbers
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/shadcn";
@import "@caprice-ui/tailwind/preset";
```
### Stone
```css title="app/globals.css" lineNumbers
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.147 0.004 49.25);
--card: oklch(1 0 0);
--card-foreground: oklch(0.147 0.004 49.25);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.147 0.004 49.25);
--primary: oklch(0.216 0.006 56.043);
--primary-foreground: oklch(0.985 0.001 106.423);
--secondary: oklch(0.97 0.001 106.424);
--secondary-foreground: oklch(0.216 0.006 56.043);
--muted: oklch(0.97 0.001 106.424);
--muted-foreground: oklch(0.553 0.013 58.071);
--accent: oklch(0.97 0.001 106.424);
--accent-foreground: oklch(0.216 0.006 56.043);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.923 0.003 48.717);
--input: oklch(0.923 0.003 48.717);
--ring: oklch(0.709 0.01 56.259);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0.001 106.423);
--sidebar-foreground: oklch(0.147 0.004 49.25);
--sidebar-primary: oklch(0.216 0.006 56.043);
--sidebar-primary-foreground: oklch(0.985 0.001 106.423);
--sidebar-accent: oklch(0.97 0.001 106.424);
--sidebar-accent-foreground: oklch(0.216 0.006 56.043);
--sidebar-border: oklch(0.923 0.003 48.717);
--sidebar-ring: oklch(0.709 0.01 56.259);
}
.dark {
--background: oklch(0.147 0.004 49.25);
--foreground: oklch(0.985 0.001 106.423);
--card: oklch(0.216 0.006 56.043);
--card-foreground: oklch(0.985 0.001 106.423);
--popover: oklch(0.216 0.006 56.043);
--popover-foreground: oklch(0.985 0.001 106.423);
--primary: oklch(0.923 0.003 48.717);
--primary-foreground: oklch(0.216 0.006 56.043);
--secondary: oklch(0.268 0.007 34.298);
--secondary-foreground: oklch(0.985 0.001 106.423);
--muted: oklch(0.268 0.007 34.298);
--muted-foreground: oklch(0.709 0.01 56.259);
--accent: oklch(0.268 0.007 34.298);
--accent-foreground: oklch(0.985 0.001 106.423);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.553 0.013 58.071);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.216 0.006 56.043);
--sidebar-foreground: oklch(0.985 0.001 106.423);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0.001 106.423);
--sidebar-accent: oklch(0.268 0.007 34.298);
--sidebar-accent-foreground: oklch(0.985 0.001 106.423);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.553 0.013 58.071);
}
```
Or import it in your `global.css` file:
```css title="app/globals.css" lineNumbers
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/shadcn/stone";
@import "@caprice-ui/tailwind/preset";
```
### Zinc
```css title="app/globals.css" lineNumbers
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.141 0.005 285.823);
--card: oklch(1 0 0);
--card-foreground: oklch(0.141 0.005 285.823);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.141 0.005 285.823);
--primary: oklch(0.21 0.006 285.885);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.967 0.001 286.375);
--secondary-foreground: oklch(0.21 0.006 285.885);
--muted: oklch(0.967 0.001 286.375);
--muted-foreground: oklch(0.552 0.016 285.938);
--accent: oklch(0.967 0.001 286.375);
--accent-foreground: oklch(0.21 0.006 285.885);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.92 0.004 286.32);
--input: oklch(0.92 0.004 286.32);
--ring: oklch(0.705 0.015 286.067);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.141 0.005 285.823);
--sidebar-primary: oklch(0.21 0.006 285.885);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.967 0.001 286.375);
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
--sidebar-border: oklch(0.92 0.004 286.32);
--sidebar-ring: oklch(0.705 0.015 286.067);
}
.dark {
--background: oklch(0.141 0.005 285.823);
--foreground: oklch(0.985 0 0);
--card: oklch(0.21 0.006 285.885);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.21 0.006 285.885);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.92 0.004 286.32);
--primary-foreground: oklch(0.21 0.006 285.885);
--secondary: oklch(0.274 0.006 286.033);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.274 0.006 286.033);
--muted-foreground: oklch(0.705 0.015 286.067);
--accent: oklch(0.274 0.006 286.033);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.552 0.016 285.938);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.21 0.006 285.885);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.274 0.006 286.033);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.552 0.016 285.938);
}
```
Or import it in your `global.css` file:
```css title="app/globals.css" lineNumbers
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/shadcn/zinc";
@import "@caprice-ui/tailwind/preset";
```
### Gray
```css title="app/globals.css" lineNumbers
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.13 0.028 261.692);
--card: oklch(1 0 0);
--card-foreground: oklch(0.13 0.028 261.692);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.13 0.028 261.692);
--primary: oklch(0.21 0.034 264.665);
--primary-foreground: oklch(0.985 0.002 247.839);
--secondary: oklch(0.967 0.003 264.542);
--secondary-foreground: oklch(0.21 0.034 264.665);
--muted: oklch(0.967 0.003 264.542);
--muted-foreground: oklch(0.551 0.027 264.364);
--accent: oklch(0.967 0.003 264.542);
--accent-foreground: oklch(0.21 0.034 264.665);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--ring: oklch(0.707 0.022 261.325);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0.002 247.839);
--sidebar-foreground: oklch(0.13 0.028 261.692);
--sidebar-primary: oklch(0.21 0.034 264.665);
--sidebar-primary-foreground: oklch(0.985 0.002 247.839);
--sidebar-accent: oklch(0.967 0.003 264.542);
--sidebar-accent-foreground: oklch(0.21 0.034 264.665);
--sidebar-border: oklch(0.928 0.006 264.531);
--sidebar-ring: oklch(0.707 0.022 261.325);
}
.dark {
--background: oklch(0.13 0.028 261.692);
--foreground: oklch(0.985 0.002 247.839);
--card: oklch(0.21 0.034 264.665);
--card-foreground: oklch(0.985 0.002 247.839);
--popover: oklch(0.21 0.034 264.665);
--popover-foreground: oklch(0.985 0.002 247.839);
--primary: oklch(0.928 0.006 264.531);
--primary-foreground: oklch(0.21 0.034 264.665);
--secondary: oklch(0.278 0.033 256.848);
--secondary-foreground: oklch(0.985 0.002 247.839);
--muted: oklch(0.278 0.033 256.848);
--muted-foreground: oklch(0.707 0.022 261.325);
--accent: oklch(0.278 0.033 256.848);
--accent-foreground: oklch(0.985 0.002 247.839);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.551 0.027 264.364);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.21 0.034 264.665);
--sidebar-foreground: oklch(0.985 0.002 247.839);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0.002 247.839);
--sidebar-accent: oklch(0.278 0.033 256.848);
--sidebar-accent-foreground: oklch(0.985 0.002 247.839);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.551 0.027 264.364);
}
```
Or import it in your `global.css` file:
```css title="app/globals.css" lineNumbers
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/shadcn/gray";
@import "@caprice-ui/tailwind/preset";
```
### Slate
```css title="app/globals.css" lineNumbers
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.129 0.042 264.695);
--card: oklch(1 0 0);
--card-foreground: oklch(0.129 0.042 264.695);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.129 0.042 264.695);
--primary: oklch(0.208 0.042 265.755);
--primary-foreground: oklch(0.984 0.003 247.858);
--secondary: oklch(0.968 0.007 247.896);
--secondary-foreground: oklch(0.208 0.042 265.755);
--muted: oklch(0.968 0.007 247.896);
--muted-foreground: oklch(0.554 0.046 257.417);
--accent: oklch(0.968 0.007 247.896);
--accent-foreground: oklch(0.208 0.042 265.755);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.929 0.013 255.508);
--input: oklch(0.929 0.013 255.508);
--ring: oklch(0.704 0.04 256.788);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.984 0.003 247.858);
--sidebar-foreground: oklch(0.129 0.042 264.695);
--sidebar-primary: oklch(0.208 0.042 265.755);
--sidebar-primary-foreground: oklch(0.984 0.003 247.858);
--sidebar-accent: oklch(0.968 0.007 247.896);
--sidebar-accent-foreground: oklch(0.208 0.042 265.755);
--sidebar-border: oklch(0.929 0.013 255.508);
--sidebar-ring: oklch(0.704 0.04 256.788);
}
.dark {
--background: oklch(0.129 0.042 264.695);
--foreground: oklch(0.984 0.003 247.858);
--card: oklch(0.208 0.042 265.755);
--card-foreground: oklch(0.984 0.003 247.858);
--popover: oklch(0.208 0.042 265.755);
--popover-foreground: oklch(0.984 0.003 247.858);
--primary: oklch(0.929 0.013 255.508);
--primary-foreground: oklch(0.208 0.042 265.755);
--secondary: oklch(0.279 0.041 260.031);
--secondary-foreground: oklch(0.984 0.003 247.858);
--muted: oklch(0.279 0.041 260.031);
--muted-foreground: oklch(0.704 0.04 256.788);
--accent: oklch(0.279 0.041 260.031);
--accent-foreground: oklch(0.984 0.003 247.858);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.551 0.027 264.364);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.208 0.042 265.755);
--sidebar-foreground: oklch(0.984 0.003 247.858);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.984 0.003 247.858);
--sidebar-accent: oklch(0.279 0.041 260.031);
--sidebar-accent-foreground: oklch(0.984 0.003 247.858);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.551 0.027 264.364);
}
```
Or import it in your `global.css` file:
```css title="app/globals.css" lineNumbers
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/shadcn/slate";
@import "@caprice-ui/tailwind/preset";
```
# MCP Server
URL: /docs/ai/mcp
Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools.
The shadcn MCP Server allows AI assistants to interact with items from registries. You can browse available components, search for specific ones, and install them directly into your project using natural language.
## Quick start
First, make sure the Caprice UI registry is present in your components.json file:
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
Then select your MCP client and follow the instructions to configure the shadcn MCP server. If you'd like to do it manually, see the official [shadcn MCP documentation](https://ui.shadcn.com/docs/mcp#configuration).
**Run the following command** in your project:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest mcp init --client claude
```
```bash
pnpm dlx shadcn@latest mcp init --client claude
```
```bash
yarn dlx shadcn@latest mcp init --client claude
```
```bash
bun x shadcn@latest mcp init --client claude
```
**Restart Claude Code** and try the following prompts:
* Show me all available components in the shadcn registry
* Add the button, dialog and card components to my project
* Create a contact form using components from the shadcn registry
**Note:** You can use `/mcp` command in Claude Code to debug the MCP server.
**Run the following command** in your project:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest mcp init --client cursor
```
```bash
pnpm dlx shadcn@latest mcp init --client cursor
```
```bash
yarn dlx shadcn@latest mcp init --client cursor
```
```bash
bun x shadcn@latest mcp init --client cursor
```
Open **Cursor Settings** and **Enable the MCP server** for shadcn. Then try the following prompts:
* Show me all available components in the shadcn registry
* Add the button, dialog and card components to my project
* Create a contact form using components from the shadcn registry
**Run the following command** in your project:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest mcp init --client vscode
```
```bash
pnpm dlx shadcn@latest mcp init --client vscode
```
```bash
yarn dlx shadcn@latest mcp init --client vscode
```
```bash
bun x shadcn@latest mcp init --client vscode
```
Open `.vscode/mcp.json` and click **Start** next to the shadcn server. Then try the following prompts with GitHub Copilot:
* Show me all available components in the shadcn registry
* Add the button, dialog and card components to my project
* Create a contact form using components from the shadcn registry
**Note:** The `shadcn` CLI cannot automatically update `~/.codex/config.toml`.
You'll need to add the configuration manually for Codex.
**Run the following command** in your project:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest mcp init --client codex
```
```bash
pnpm dlx shadcn@latest mcp init --client codex
```
```bash
yarn dlx shadcn@latest mcp init --client codex
```
```bash
bun x shadcn@latest mcp init --client codex
```
**Then, add the following configuration** to `~/.codex/config.toml`:
```toml
[mcp_servers.shadcn]
command = "npx"
args = ["shadcn@latest", "mcp"]
```
**Restart Codex** and try the following prompts:
* Show me all available components in the shadcn registry
* Add the button, dialog and card components to my project
* Create a contact form using components from the shadcn registry
## Usage
You can now ask your IDE to use any Caprice UI component. Here are some prompt examples:
* Add Button component from the Caprice UI registry.
* Show me all available components in the Caprice UI registry.
{/* Todo: Add more examples later on. */}
## Learn more
To learn more about using the shadcn MCP server, including manual setup for different clients, please visit the official [shadcn MCP documentation](https://ui.shadcn.com/docs/mcp#configuration).
# Accordion
URL: /docs/components/accordion
## Installation
## Usage
```tsx lineNumbers
What is Base UI?
Base UI is a library of high-quality unstyled React components for design systems
and web apps.
```
## Examples
### Single
### Multiple
You can set up the accordion to allow multiple panels to be open at the same time using the `multiple` prop.
### Controlled
## Differences with shadcn/ui / Radix
If you're familiar with Radix UI and shadcn/ui, most patterns will carry over. This guide points out the differences so you can start using Caprice UI without surprises.
### Key changes
| Feature | shadcn/ui | Caprice UI |
| -------------------- | ----------------------------------- | ---------------------------------------------------- |
| Primitive | Radix Accordion | Base UI Accordion |
| Multiple items | `type="multiple"` | `multiple={true}` |
| Single item | `type="single"` | Default (no prop needed) |
| Collapsible | `collapsible` prop | Always collapsible |
| Default value | String (single) or Array (multiple) | Always Array |
| Composition | `asChild` prop | `render` prop |
| Panel component | `AccordionContent` | `AccordionPanel` (`AccordionContent` deprecated) |
| Open state attribute | `data-state="open"` | `data-panel-open` |
| Animation | CSS keyframe animations | CSS height transition via `--accordion-panel-height` |
| Hidden until found | Not supported | `hiddenUntilFound={true}` |
| Reduced motion | Not included | `motion-reduce:transition-none` |
| Disabled opacity | `opacity-50` | `opacity-60` |
The `hiddenUntilFound` prop enables browser find-in-page (⌘/Ctrl + F) to search content inside collapsed panels. When a match is found, the browser automatically expands the accordion item.
### Comparison Example
```tsx title="shadcn/ui" lineNumbers
Is it accessible?Yes. It adheres to the WAI-ARIA pattern.
```
```tsx title="Caprice UI" lineNumbers
Is it accessible?Yes. It adheres to the WAI-ARIA pattern.
```
## API Reference
### Root
### Item
### Trigger
### Panel
# Alert Dialog
URL: /docs/components/alert-dialog
## Installation
## Usage
```tsx
Discard draft} />
Discard draft?You can't undo this action.CancelDiscard
```
## Examples
### Open from a menu
### Close confirmation (nested dialogs)
## API Reference
### Root
### Trigger
### Popup
### Title
### Description
### Footer
### Close
# Alert
URL: /docs/components/alert
## Installation
## Usage
## Examples
### Icon
### info
### Warning
### Success
### Destructive
### Dismissible
### Custom
{/* todo: add actions & dismissible */}
## Differences with shadcn/ui / Radix
If you're familiar with Radix UI and shadcn/ui, most patterns will carry over. This guide points out the differences so you can start using Caprice UI without surprises.
### Key changes
| Feature | shadcn/ui | Caprice UI |
| ----------------- | ------------------------------------ | ----------------------------------------------------------- |
| Primitive | Native `
` elements | Base UI `useRender` + native `
` |
| Composition | None | `render` prop |
| API pattern | Flat exports (`Alert`, `AlertTitle`) | Namespace pattern (`Alert.Root`, `Alert.Title`) |
| Variants | `default`, `destructive` | `default`, `success`, `info`, `warning`, `destructive` |
| Border radius | `rounded-lg` | `rounded-xl` |
| Destructive style | `text-destructive bg-card` | `border-destructive/30 bg-destructive/5` with icon coloring |
| Semantic colors | Not included | `success`, `info`, `warning` with opacity-based bg/border |
### Comparison Example
```tsx title="shadcn/ui" lineNumbers
ErrorSomething went wrong.
```
```tsx title="Caprice UI" lineNumbers
ErrorSomething went wrong.
```
## Variants
## API Reference
### Root
### Title
### Description
# Autocomplete
URL: /docs/components/autocomplete
## Installation
## Usage
## Examples
## API Reference
### Root
# Avatar Group
URL: /docs/components/avatar-group
## Installation
## Usage
## Examples
## API Reference
### Root
# Avatar
URL: /docs/components/avatar
## Installation
## Usage
## Examples
### Open from a menu
### Close confirmation (nested dialogs)
## API Reference
### Root
### Image
# Badge
URL: /docs/components/badge
## Installation
## Usage
## Examples
## API Reference
# Button Group
URL: /docs/components/button-group
## Installation
## Usage
## Examples
## API Reference
### Root
# Button
URL: /docs/components/button
## Installation
## Usage
```tsx
```
## Examples
### Rendering as another tag
You can use the [`render`](https://base-ui.com/react/handbook/composition) prop to make another component look like a button. Here's an example of a link that looks like a button.
The button can remain keyboard accessible while being rendered as another tag, such as a `
```
### Add all components at once
You can install all Caprice UI components at once with a single command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
The command above will add all caprice ui components to your project.
### Create project
Start by creating a new Astro project:
npm
pnpm
yarn
bun
```bash
npx create-astro@latest astro-app --template with-tailwindcss --install --add react --git
```
```bash
pnpm dlx create-astro@latest astro-app --template with-tailwindcss --install --add react --git
```
```bash
yarn dlx create-astro@latest astro-app --template with-tailwindcss --install --add react --git
```
```bash
bun x create-astro@latest astro-app --template with-tailwindcss --install --add react --git
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="src/styles/globals.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Import components
```astro title="src/pages/index.astro" lineNumbers
---
// [!code highlight]
import { Button } from "@caprice-ui/react/button"
---
Astro + TailwindCSS
// [!code highlight]
Button
```
# Installation
URL: /docs/installation
If you already have your project setup with [shadcn/ui](https://ui.shadcn.com), please skip to the [registry configuration](#configure-registry) section.
## Quick setup
npm
pnpm
yarn
bun
```bash
npx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
pnpm dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
yarn dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
bun x shadcn@latest init https://caprice-ui.com/r/init.json
```
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
## 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.
Next.js
}
title="Next.js"
href="/docs/installation/nextjs"
>
Setup instructions for Next.js
Vite
}
title="Vite"
href="/docs/installation/vite"
>
Setup instructions for Vite
}
title="TanStack Start"
href="/docs/installation/tanstack-start"
>
Setup instructions for TanStack Start
}
title="TanStack Router"
href="/docs/installation/tanstack-router"
>
Setup instructions for TanStack Router
Astro
}
title="Astro"
href="/docs/installation/astro"
>
Setup instructions for Astro
}
title="Laravel"
href="/docs/installation/laravel"
>
Setup instructions for Laravel
}
title="React Router"
href="/docs/installation/react-router"
>
Setup instructions for React Router
React
}
title="Manual"
href="/docs/installation/manual"
>
Setup instructions for any React related framework
## Configure registry
### Add the Caprice UI registry to your `components.json` file.
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
Learn more about [namespaces](https://ui.shadcn.com/docs/registry/namespace) and how to use them in your project.
### Install Caprice UI core & utils
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/setup
```
```bash
pnpm dlx shadcn@latest add @caprice/setup
```
```bash
yarn dlx shadcn@latest add @caprice/setup
```
```bash
bun x 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](https://base-ui.com/react/overview/quick-start#set-up)
```jsx title="layout.tsx"
// [!code word:relative]
// [!code word:isolate]
{children}
```
### 🎉 Voilà!
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/button
```
```bash
pnpm dlx shadcn@latest add @caprice/button
```
```bash
yarn dlx shadcn@latest add @caprice/button
```
```bash
bun x shadcn@latest add @caprice/button
```
Alternatively, you can add all components at once with the following command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
This will add all caprice ui components to your project.
# Laravel
URL: /docs/installation/laravel
### Create project
Start by creating a new Laravel project with Inertia and React using the laravel installer `laravel new my-app`:
```bash
laravel new my-app --react
```
### Add Caprice UI Registry to your `components.json`
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
### Add Components
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/switch
```
```bash
pnpm dlx shadcn@latest add @caprice/switch
```
```bash
yarn dlx shadcn@latest add @caprice/switch
```
```bash
bun x shadcn@latest add @caprice/switch
```
The command above will add the `Switch` component to `resources/js/components/caprice-ui/switch.tsx`. You can then import it like this:
```tsx title="resources/js/pages/index.tsx" lineNumbers
// [!code highlight]
import { Switch } from "@/components/caprice-ui/switch"
const MyPage = () => {
return (
// [!code highlight]
)
}
export default MyPage
```
### Add all components at once
You can install all Caprice UI components at once with a single command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
The command above will add all caprice ui components to your project.
### Create project
Start by creating a new Laravel project with Inertia and React using the laravel installer `laravel new my-app`:
```bash
laravel new my-app --react
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="resources/css/app.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Import components
```tsx title="resources/js/pages/index.tsx" lineNumbers
// [!code highlight]
import { Switch } from "@caprice-ui/react/switch"
const MyPage = () => {
return (
// [!code highlight]
)
}
export default MyPage
```
# Manual Installation
URL: /docs/installation/manual
### Add Tailwind CSS
Components are styled using Tailwind CSS. You need to install Tailwind CSS in your project.
[Follow the Tailwind CSS installation instructions to get started.](https://tailwindcss.com/docs/installation)
### Add dependencies
Add the following dependencies to your project:
npm
pnpm
yarn
bun
```bash
npm install @base-ui/react cva@beta lucide-react react-aria tailwind-merge tw-animate-css
```
```bash
pnpm add @base-ui/react cva@beta lucide-react react-aria tailwind-merge tw-animate-css
```
```bash
yarn add @base-ui/react cva@beta lucide-react react-aria tailwind-merge tw-animate-css
```
```bash
bun add @base-ui/react cva@beta lucide-react react-aria tailwind-merge tw-animate-css
```
### Configure path aliases
Configure the path aliases in your `tsconfig.json` file.
```json title="tsconfig.json" lineNumbers
{
"compilerOptions": {
// [!code highlight:4]
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
}
```
The `@` alias is a preference. You can use other aliases if you want.
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="src/styles/globals.css"
@import "tailwindcss";
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
:root {
--background: var(--color-white);
--foreground: var(--color-neutral-950);
--card: var(--color-white);
--card-foreground: var(--color-neutral-950);
--popover: var(--color-white);
--popover-foreground: var(--color-neutral-950);
--primary: var(--color-zinc-900);
--primary-foreground: var(--color-neutral-50);
--secondary: var(--color-neutral-100);
--secondary-foreground: var(--color-neutral-900);
--muted: var(--color-neutral-100);
--muted-foreground: var(--color-neutral-500);
--accent: var(--color-neutral-100);
--accent-foreground: var(--color-neutral-900);
--destructive: var(--color-red-600);
--destructive-foreground: var(--color-red-600);
--border: var(--color-neutral-200);
--input: var(--color-neutral-200);
--ring: var(--color-neutral-400);
--chart-1: var(--color-orange-600);
--chart-2: var(--color-teal-600);
--chart-3: var(--color-cyan-900);
--chart-4: var(--color-amber-400);
--chart-5: var(--color-amber-500);
--radius: 0.625rem;
--sidebar: var(--color-neutral-50);
--sidebar-foreground: var(--color-neutral-950);
--sidebar-primary: var(--color-neutral-900);
--sidebar-primary-foreground: var(--color-neutral-50);
--sidebar-accent: var(--color-neutral-100);
--sidebar-accent-foreground: var(--color-neutral-900);
--sidebar-border: var(--color-neutral-200);
--sidebar-ring: var(--color-neutral-400);
}
.dark {
--background: var(--color-neutral-950);
--foreground: var(--color-neutral-50);
--card: var(--color-neutral-950);
--card-foreground: var(--color-neutral-50);
--popover: var(--color-neutral-950);
--popover-foreground: var(--color-neutral-50);
--primary: var(--color-neutral-50);
--primary-foreground: var(--color-neutral-900);
--secondary: var(--color-neutral-800);
--secondary-foreground: var(--color-neutral-50);
--muted: var(--color-neutral-800);
--muted-foreground: var(--color-neutral-400);
--accent: var(--color-neutral-800);
--accent-foreground: var(--color-neutral-50);
--destructive: var(--color-red-400);
--destructive-foreground: var(--color-red-600);
--border: var(--color-neutral-800);
--input: var(--color-neutral-800);
--ring: var(--color-neutral-600);
--chart-1: var(--color-blue-700);
--chart-2: var(--color-emerald-500);
--chart-3: var(--color-amber-500);
--chart-4: var(--color-purple-500);
--chart-5: var(--color-rose-500);
--sidebar: var(--color-neutral-900);
--sidebar-foreground: var(--color-neutral-50);
--sidebar-primary: var(--color-blue-700);
--sidebar-primary-foreground: var(--color-neutral-50);
--sidebar-accent: var(--color-neutral-800);
--sidebar-accent-foreground: var(--color-neutral-50);
--sidebar-border: var(--color-neutral-800);
--sidebar-ring: var(--color-neutral-600);
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
Alternatively, you can use the `@caprice-ui/tailwind` preset:
```css title="src/styles/globals.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Add a cn helper
```ts lineNumbers title="lib/utils.ts"
import { defineConfig, type VariantProps } from 'cva';
import { twMerge } from 'tailwind-merge';
export const {
compose,
cva,
cx: cn,
} = defineConfig({
hooks: {
onComplete: (className: string) => twMerge(className),
},
});
export type { VariantProps };
```
### Create a `components.json` file
Create a `components.json` file in the root of your project.
```json title="components.json" lineNumbers
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
},
"tailwind": {
"config": "",
"css": "src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
```
### That's it!
You can now start adding components to your project.
# Next.js
URL: /docs/installation/nextjs
### Create project
Run the `init` command to create a new Next.js project or to setup an existing one:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
pnpm dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
yarn dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
bun x shadcn@latest init https://caprice-ui.com/r/init.json
```
Run the `init` command to create a new Next.js project or to setup an existing one:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
pnpm dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
yarn dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
bun x shadcn@latest init https://caprice-ui.com/r/init.json
```
Choose between a Next.js project or a Monorepo.
### Add Caprice UI Registry to your `components.json`
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
### Add Components
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/button
```
```bash
pnpm dlx shadcn@latest add @caprice/button
```
```bash
yarn dlx shadcn@latest add @caprice/button
```
```bash
bun x shadcn@latest add @caprice/button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx title="app/page.tsx"
// [!code highlight]
import { Button } from "@/components/caprice-ui/button"
export default function Home() {
return (
// [!code highlight]
Click me
)
}
```
Alternatively, you can add all components at once with the following command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
This will add all caprice ui components to your project.
### Create a new Next.js project
npm
pnpm
yarn
bun
```bash
npx create-next-app@latest my-app
```
```bash
pnpm dlx create-next-app@latest my-app
```
```bash
yarn dlx create-next-app@latest my-app
```
```bash
bun x create-next-app@latest my-app
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="app/globals.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Import components
```tsx title="app/page.tsx"
// [!code highlight]
import { Button } from "@caprice-ui/react/button"
// or import { Button } from "@caprice-ui/react"
export default function Home() {
return (
// [!code highlight]
Click me
)
}
```
# React Router
URL: /docs/installation/react-router
### Create project
npm
pnpm
yarn
bun
```bash
npx create-react-router@latest my-app
```
```bash
pnpm dlx create-react-router@latest my-app
```
```bash
yarn dlx create-react-router@latest my-app
```
```bash
bun x create-react-router@latest my-app
```
### Run the CLI
Run the `shadcn` init command to setup your project:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
pnpm dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
yarn dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
bun x shadcn@latest init https://caprice-ui.com/r/init.json
```
### Add Caprice UI Registry to your `components.json`
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
### Add Components
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/button
```
```bash
pnpm dlx shadcn@latest add @caprice/button
```
```bash
yarn dlx shadcn@latest add @caprice/button
```
```bash
bun x shadcn@latest add @caprice/button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx lineNumbers title="app/routes/home.tsx"
// [!code highlight]
import { Button } from "~/components/caprice-ui/button"
import type { Route } from "./+types/home"
export function meta({}: Route.MetaArgs) {
return [
{ title: "New React Router App" },
{ name: "description", content: "Welcome to React Router!" },
]
}
export default function Home() {
return (
// [!code highlight]
Click me
)
}
```
### Add all components at once
You can install all Caprice UI components at once with a single command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
The command above will add all caprice ui components to your project.
### Create project
npm
pnpm
yarn
bun
```bash
npx create-react-router@latest my-app
```
```bash
pnpm dlx create-react-router@latest my-app
```
```bash
yarn dlx create-react-router@latest my-app
```
```bash
bun x create-react-router@latest my-app
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="app/app.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Import components
```tsx lineNumbers title="app/routes/home.tsx"
// [!code highlight]
import { Button } from "@caprice-ui/react/button"
// or import { Button } from "@caprice-ui/react"
import type { Route } from "./+types/home"
export function meta({}: Route.MetaArgs) {
return [
{ title: "New React Router App" },
{ name: "description", content: "Welcome to React Router!" },
]
}
export default function Home() {
return (
// [!code highlight]
Click me
)
}
```
# TanStack Router
URL: /docs/installation/tanstack-router
### Create project
Start by creating a new TanStack Router project:
npm
pnpm
yarn
bun
```bash
npx create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcn
```
```bash
pnpm dlx create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcn
```
```bash
yarn dlx create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcn
```
```bash
bun x create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcn
```
### Add Caprice UI Registry to your `components.json`
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
### Add Components
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/button
```
```bash
pnpm dlx shadcn@latest add @caprice/button
```
```bash
yarn dlx shadcn@latest add @caprice/button
```
```bash
bun x shadcn@latest add @caprice/button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx title="src/routes/index.tsx" lineNumbers
import { createFileRoute } from "@tanstack/react-router"
// [!code highlight]
import { Button } from "@/components/caprice-ui/button"
export const Route = createFileRoute("/")({
component: App,
})
function App() {
return (
// [!code highlight]
Click me
)
}
```
### Add all components at once
You can install all Caprice UI components at once with a single command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
The command above will add all caprice ui components to your project.
### Create project
Start by creating a new TanStack Router project:
npm
pnpm
yarn
bun
```bash
npx create-tsrouter-app@latest my-app --template file-router --tailwind
```
```bash
pnpm dlx create-tsrouter-app@latest my-app --template file-router --tailwind
```
```bash
yarn dlx create-tsrouter-app@latest my-app --template file-router --tailwind
```
```bash
bun x create-tsrouter-app@latest my-app --template file-router --tailwind
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="src/styles.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Import components
```tsx title="src/routes/index.tsx" lineNumbers
import { createFileRoute } from "@tanstack/react-router"
// [!code highlight]
import { Button } from "@caprice-ui/react/button"
// or import { Button } from "@caprice-ui/react"
export const Route = createFileRoute("/")({
component: App,
})
function App() {
return (
// [!code highlight]
Click me
)
}
```
# TanStack Start
URL: /docs/installation/tanstack-start
### Create project
Run the following command to create a new TanStack Start project with shadcn/ui:
npm
pnpm
yarn
bun
```bash
npm create @tanstack/start@latest --tailwind --add-ons shadcn
```
```bash
pnpm create @tanstack/start --tailwind --add-ons shadcn
```
```bash
yarn create @tanstack/start --tailwind --add-ons shadcn
```
```bash
bunx @tanstack/create-start@latest --tailwind --add-ons shadcn
```
### Add Caprice UI Registry to your `components.json`
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
### Add Components
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/button
```
```bash
pnpm dlx shadcn@latest add @caprice/button
```
```bash
yarn dlx shadcn@latest add @caprice/button
```
```bash
bun x shadcn@latest add @caprice/button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx title="app/routes/index.tsx" lineNumbers
import { Button } from "@/components/caprice-ui/button"
function App() {
return (
Click me
)
}
```
### Add all components at once
You can install all Caprice UI components at once with a single command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
The command above will add all caprice ui components to your project.
### Create project
Run the following command to create a new TanStack Start project with shadcn/ui:
npm
pnpm
yarn
bun
```bash
npm create @tanstack/start@latest --tailwind
```
```bash
pnpm create @tanstack/start --tailwind
```
```bash
yarn create @tanstack/start --tailwind
```
```bash
bunx @tanstack/create-start@latest --tailwind
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind
```
### Configure styles
Add the following to your styles/globals.css file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
```css title="src/styles.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Import components
```tsx title="app/routes/index.tsx" lineNumbers
import { Button } from "@caprice-ui/react/button"
// or import { Button } from "@caprice-ui/react"
function App() {
return (
Click me
)
}
```
# Vite
URL: /docs/installation/vite
### Create project
Start by creating a new React project using `vite`. Select the **React + TypeScript** template:
npm
pnpm
yarn
bun
```bash
npm create vite@latest
```
```bash
pnpm create vite
```
```bash
yarn create vite
```
```bash
bunx create-vite
```
### Add Tailwind CSS
npm
pnpm
yarn
bun
```bash
npm install tailwindcss @tailwindcss/vite
```
```bash
pnpm add tailwindcss @tailwindcss/vite
```
```bash
yarn add tailwindcss @tailwindcss/vite
```
```bash
bun add tailwindcss @tailwindcss/vite
```
Replace everything in `src/index.css` with the following:
```css title="src/index.css"
@import "tailwindcss";
```
### Edit tsconfig.json file
The current version of Vite splits TypeScript configuration into three files, two of which need to be edited.
Add the `baseUrl` and `paths` properties to the `compilerOptions` section of the `tsconfig.json` and
`tsconfig.app.json` files:
```ts title="tsconfig.json" lineNumbers
{
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.node.json"
}
],
// [!code focus:6]
// [!code highlight:6]
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
```
### Edit tsconfig.app.json file
Add the following code to the `tsconfig.app.json` file to resolve paths, for your IDE:
```ts title="tsconfig.app.json" lineNumbers
{
"compilerOptions": {
// ...
// [!code highlight:6]
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
// ...
}
}
```
### Update vite.config.ts
Add the following code to the vite.config.ts so your app can resolve paths without error:
npm
pnpm
yarn
bun
```bash
npm install -D @types/node
```
```bash
pnpm add -D @types/node
```
```bash
yarn add --dev @types/node
```
```bash
bun add --dev @types/node
```
```typescript title="vite.config.ts" lineNumbers
// [!code highlight:2]
import path from "path"
import tailwindcss from "@tailwindcss/vite"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
// https://vite.dev/config/
export default defineConfig({
// [!code highlight:6]
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
})
```
### Run the CLI
Run the `shadcn` init command to setup your project:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
pnpm dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
yarn dlx shadcn@latest init https://caprice-ui.com/r/init.json
```
```bash
bun x shadcn@latest init https://caprice-ui.com/r/init.json
```
### Add Caprice UI Registry to your `components.json`
```json title="components.json"
{
"registries": {
"@caprice": "https://caprice-ui.com/r/{name}.json"
}
}
```
### Add Components
You can now start adding components to your project.
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add button
```
```bash
pnpm dlx shadcn@latest add button
```
```bash
yarn dlx shadcn@latest add button
```
```bash
bun x shadcn@latest add button
```
The command above will add the `Button` component to your project. You can then import it like this:
```tsx lineNumbers title="src/App.tsx"
import { Button } from "@/components/caprice-ui/button"
function App() {
return (
Click me
)
}
export default App
```
### Add all components at once
You can install all Caprice UI components at once with a single command:
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/ui
```
```bash
pnpm dlx shadcn@latest add @caprice/ui
```
```bash
yarn dlx shadcn@latest add @caprice/ui
```
```bash
bun x shadcn@latest add @caprice/ui
```
The command above will add all caprice ui components to your project.
### Create project
Start by creating a new React project using `vite`. Select the **React + TypeScript** template:
npm
pnpm
yarn
bun
```bash
npm create vite@latest
```
```bash
pnpm create vite
```
```bash
yarn create vite
```
```bash
bunx create-vite
```
### Install Caprice UI dependencies
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/react @caprice-ui/tailwind tailwindcss @tailwindcss/vite
```
```bash
pnpm add @caprice-ui/react @caprice-ui/tailwind tailwindcss @tailwindcss/vite
```
```bash
yarn add @caprice-ui/react @caprice-ui/tailwind tailwindcss @tailwindcss/vite
```
```bash
bun add @caprice-ui/react @caprice-ui/tailwind tailwindcss @tailwindcss/vite
```
Replace everything in `src/index.css` with the following:
```css title="src/index.css"
@import "tailwindcss";
@import "@caprice-ui/tailwind/themes/caprice";
@import "@caprice-ui/tailwind/preset";
@source "../node_modules/@caprice-ui";
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
```
### Update vite.config.ts
Add the following code to the vite.config.ts so your app can resolve paths without error:
npm
pnpm
yarn
bun
```bash
npm install -D @types/node
```
```bash
pnpm add -D @types/node
```
```bash
yarn add --dev @types/node
```
```bash
bun add --dev @types/node
```
```typescript title="vite.config.ts" lineNumbers
// [!code highlight:2]
import tailwindcss from "@tailwindcss/vite"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
// https://vite.dev/config/
export default defineConfig({
// [!code highlight:6]
plugins: [react(), tailwindcss()],
})
```
### Import components
```tsx lineNumbers title="src/App.tsx"
import { Button } from "@caprice-ui/react/button"
// or import { Button } from "@caprice-ui/react"
function App() {
return (
Click me
)
}
export default App
```
# Corner Shape
URL: /docs/utilities/corner-shape
## Installation
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/corner-shape
```
```bash
pnpm dlx shadcn@latest add @caprice/corner-shape
```
```bash
yarn dlx shadcn@latest add @caprice/corner-shape
```
```bash
bun x shadcn@latest add @caprice/corner-shape
```
npm
pnpm
yarn
bun
```bash
@caprice-ui/tailwind
```
```bash
@caprice-ui/tailwind
```
```bash
@caprice-ui/tailwind
```
```bash
@caprice-ui/tailwind
```
### Install the following dependencies:
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/tailwind
```
### Copy and paste the following code into your project.
## Usage
Import the utility into your global.css file:
```css title="global.css"
@import "tailwindcss";
// [!code ++]
@import "@caprice-ui/tailwind/utility/corner-shape";
```
Add the utility classes to your markup / components:
```tsx title="example.tsx" lineNumbers
// [!code word:corner-smooth]
// [!code word:supports-corner\:rounded-2xl]
I'm smooth on chromium, but have similar radius on non corner-shape supporting browsers with the supports media query
```
# Touch Hitbox
URL: /docs/utilities/touch-hitbox
## Installation
npm
pnpm
yarn
bun
```bash
npx shadcn@latest add @caprice/touch-hitbox
```
```bash
pnpm dlx shadcn@latest add @caprice/touch-hitbox
```
```bash
yarn dlx shadcn@latest add @caprice/touch-hitbox
```
```bash
bun x shadcn@latest add @caprice/touch-hitbox
```
npm
pnpm
yarn
bun
```bash
@caprice-ui/tailwind
```
```bash
@caprice-ui/tailwind
```
```bash
@caprice-ui/tailwind
```
```bash
@caprice-ui/tailwind
```
### Install the following dependencies:
npm
pnpm
yarn
bun
```bash
npm install @caprice-ui/tailwind
```
```bash
pnpm add @caprice-ui/tailwind
```
```bash
yarn add @caprice-ui/tailwind
```
```bash
bun add @caprice-ui/tailwind
```
### Copy and paste the following code into your project.
## Usage
Import the utility into your global.css file:
```css title="global.css"
@import "tailwindcss";
// [!code ++]
@import "@caprice-ui/tailwind/utility/touch-hitbox";
```
Add the utility classes to your markup / components:
```tsx title="example.tsx" lineNumbers
// [!code word:touch-hitbox]
```
Additionally, you can use the `pointer-coarse:` variant to apply the expanded touch target only on touchscreen devices:
```tsx title="example.tsx" lineNumbers
// [!code word:pointer-coarse:touch-hitbox]
```
# Heading
URL: /docs/foundations/typography/heading
## Installation
## Usage
## Examples
## API Reference
# Text
URL: /docs/foundations/typography/text
## Installation
## Usage
## Examples
## API Reference