# design-system-ui Full Context
> A TanStack Start template for publishing a shadcn-compatible registry.
This file expands the Markdown pages listed in https://reactdocs.canceydejean.dev/llms.txt. Use https://reactdocs.canceydejean.dev/registry.json for the machine-readable shadcn registry index.
---
URL: https://reactdocs.canceydejean.dev/docs.md
Copy-paste React utilities, hooks, and blocks installable with the shadcn CLI.
# Introduction
Copy-paste React utilities, hooks, and blocks installable with the shadcn CLI.
**Design System UI** is a collection of copy-paste developer utility components, hooks, and blocks for React. Each item is ready to drop into your project without locking you into a heavyweight package dependency.
Install anything from the catalog with the [shadcn CLI](https://ui.shadcn.com/docs/cli). Items land in your codebase as source you own, so you can read, adapt, and extend them like the rest of your app.
Start with [styles](/docs/styles) for the design system CSS foundation before installing components.
Browse [components](/components), [hooks](/utilities), and [blocks](/blocks) to find what you need, then follow the install command on each page to add it to your project.
---
URL: https://reactdocs.canceydejean.dev/docs/installation.md
Install Design System UI items with the shadcn CLI.
# Installation
Install Design System UI items with the shadcn CLI.
Install any item from **Design System UI** with the [shadcn CLI](https://ui.shadcn.com/docs/cli). Replace `example-card` with the item name from the catalog.
Start with [styles](/docs/styles) so your project has the design system CSS foundation before adding components. Then apply your brand accents in [Theming](/docs/theming).
## Configure the registry
Your project must already be set up with [shadcn](https://ui.shadcn.com/docs/installation). Then add this registry to `components.json` so the CLI can resolve `@design-system-ui/*` items:
```json
{
"registries": {
"@design-system-ui": "https://reactdocs.canceydejean.dev/r/{name}.json"
}
}
```
Do this once per project. Without it, installs fail with `Unknown registry "@design-system-ui"`.
## Install an item
### npm
```sh
npx shadcn@latest add @design-system-ui/example-card
```
### pnpm
```sh
pnpm dlx shadcn@latest add @design-system-ui/example-card
```
### yarn
```sh
yarn dlx shadcn@latest add @design-system-ui/example-card
```
### bun
```sh
bunx shadcn add "@design-system-ui/example-card"
```
Browse [components](/components), [hooks](/utilities), and [blocks](/blocks) for the exact install command on each item page.
---
URL: https://reactdocs.canceydejean.dev/docs/registry.md
Scaffold and author installable registry items under registry/items.
# Registry
Scaffold and author installable registry items under registry/items.
Registry items live under `registry/items/**` and can be installed by shadcn-compatible CLIs. Start new items with the scaffold command so the folder, `_registry.mdx`, source file, metadata, and generated registry JSON paths follow the template conventions.
```sh
bun --bun ./scripts/new.ts --type registry:ui --name example-card --description "A compact card component."
```
Or, run the command without flags if you want an interactive prompt (recommended).
```sh
bun --bun ./scripts/new.ts
```
[Make sure Bun is installed before running these scripts.](https://bun.com/)
## Item Types
Choose the registry type from what the item installs:
| Type | Use For | Folder |
| -------------------- | ----------------------------------------- | ------------------------------ |
| `registry:ui` | Shadcn-style UI components | `registry/items/components/**` |
| `registry:component` | Components outside `components/ui` | `registry/items/components/**` |
| `registry:block` | Larger composed UI patterns | `registry/items/blocks/**` |
| `registry:hook` | React hooks | `registry/items/hooks/**` |
| `registry:lib` | Utility or helper modules | `registry/items/lib/**` |
| `registry:page` | App page files with explicit targets | `registry/items/pages/**` |
| `registry:file` | Other files with explicit install targets | `registry/items/files/**` |
| `registry:style` | Style-level CSS and dependency metadata | `registry/items/styles/**` |
| `registry:theme` | Theme CSS variables | `registry/items/themes/**` |
| `registry:font` | Font metadata | `registry/items/fonts/**` |
| `registry:base` | Design system base configuration | `registry/items/bases/**` |
| `registry:item` | Universal or metadata-only items | `registry/items/items/**` |
The scaffold creates each item in its own folder:
```text
registry/items/components/example-card/
_registry.mdx
_preview.tsx
example-card.tsx
```
## CLI Flags
Use flags for agent-friendly and CI-friendly scaffolding:
```sh
bun --bun ./scripts/new.ts --type registry:block --name stats-panel --description "A metrics panel with reusable sample data."
bun --bun ./scripts/new.ts --type registry:ui --name prompt-input --description "An AI prompt input." --target @ui/ai/prompt-input.tsx
bun --bun ./scripts/new.ts --type registry:page --name dashboard-page --description "A starter dashboard page." --target app/dashboard/page.tsx
bun --bun ./scripts/new.ts --type registry:file --name chart-theme --description "Shared chart theme tokens." --target styles/chart-theme.css --file-extension css
bun --bun ./scripts/new.ts --type registry:font --name font-inter --description "Inter font metadata." --font-family "'Inter Variable', sans-serif" --font-import Inter --font-variable=--font-sans
```
Supported flags:
- `--type`: registry item type. Defaults to `registry:ui`.
- `--name`: required kebab-case item name.
- `--title`: optional public title. Defaults from the name.
- `--description`: required public description.
- `--target`: required for `registry:page` and `registry:file`; optional for source-backed items that need a custom install path, including shadcn target placeholders like `@ui/ai/prompt-input.tsx`.
- `--file-extension`: for `registry:file` and targeted `registry:item`; defaults to `ts`.
- `--font-family`, `--font-import`, `--font-variable`: required for noninteractive `registry:font` scaffolds.
Use `bun --bun ./scripts/new.ts --help` to print the full usage.
## Authoring
Use `_registry.mdx` for public metadata and usage docs. Put the optional named `Preview` export in `_preview.tsx`. Keep both files private to authoring; never list them in `files`.
For one-file `registry:ui` items, the catalog infers `.tsx`. Hooks, libs, blocks, pages, target paths, and multi-file items should list `files` explicitly. Metadata-only styles, themes, fonts, bases, and universal items can omit `files`.
List authored source files with paths relative to the item `_registry.mdx` file. The catalog automatically emits `files[].target` placeholders such as `@ui/.tsx`, `@components/.tsx`, `@hooks/.ts`, and `@lib/.ts` for file types that should install through the user's `components.json` aliases. Use explicit `target` values for `registry:page`, `registry:file`, and nested alias installs like `@ui/ai/prompt-input.tsx`; do not add `registry/items/**` prefixes or a separate `sourcePath` field.
Use `localRegistryDependencies` for dependencies on other local registry items.
## Component Variants
If a component uses `cva` from `class-variance-authority`, keep that definition in a colocated `.variants.ts` file. Do not call `cva` in the component `.tsx`. Use `.ts`, not `.tsx`.
Treat [`button`](/components/button) as the reference:
```text
registry/items/components/button/
_registry.mdx
_preview.tsx
button.tsx
button.types.ts
button.variants.ts
```
`button.tsx` imports the CVA helper and renders. `button.variants.ts` owns every `cva()` call for that item. If one folder has several CVA helpers, keep them in the same `.variants.ts` file. Put `VariantProps` in a colocated `.types.ts` file when the item has named variant types, as Button does.
Each variants file should follow this shape:
```ts
import { cva } from "class-variance-authority";
import { cn } from "cn";
const exampleBase = cn("inline-flex items-center rounded-md");
const exampleConfig = {
variants: {
variant: {
primary: "bg-primary text-primary-foreground",
outline: "border border-border bg-background",
},
size: {
sm: "h-8 px-3",
md: "h-9 px-4",
},
},
compoundVariants: [],
defaultVariants: {
variant: "primary",
size: "md",
},
} as const;
export const exampleCva = cva(exampleBase, {
...exampleConfig,
compoundVariants: [...exampleConfig.compoundVariants],
});
export const EXAMPLE_VARIANTS = Object.keys(
exampleConfig.variants.variant,
) as (keyof typeof exampleConfig.variants.variant)[];
export const EXAMPLE_SIZES = Object.keys(
exampleConfig.variants.size,
) as (keyof typeof exampleConfig.variants.size)[];
export const exampleVariants = exampleCva;
```
Always include `compoundVariants` on the config, even when it is empty, and spread it into `cva()` so the `as const` config stays compatible. Export a key array for each variant axis that stories or other items need to iterate. Re-export the CVA helper from the component file only when another item already consumes that public name.
List the variants file in `_registry.mdx` `files`, and add `class-variance-authority` to `dependencies`. Include `.types.ts` when the item has one:
```yaml
dependencies:
- class-variance-authority
files:
- path: example.tsx
type: registry:ui
target: components/ui/example/example.tsx
- path: example.types.ts
type: registry:ui
target: components/ui/example/example.types.ts
- path: example.variants.ts
type: registry:ui
target: components/ui/example/example.variants.ts
```
After editing an item, run `vp check --fix` on touched files and `bun --bun ./scripts/doctor.ts`. Run `vp build` when registry docs, routes, JSON output, catalog loading, or source loading changed.
---
URL: https://reactdocs.canceydejean.dev/docs/styles.md
Install the design system CSS foundation with the shadcn CLI.
# Styles
Install the design system CSS foundation with the shadcn CLI.
Before components look correct, add the design system style files. This installs `globals.css` and the theme CSS files into `src/styles/`.
## Prerequisites
Your project should already be set up with [shadcn](https://ui.shadcn.com/docs/installation) and Tailwind CSS.
Add the Design System UI registry to `components.json` (once per project):
```json
{
"registries": {
"@design-system-ui": "https://reactdocs.canceydejean.dev/r/{name}.json"
}
}
```
Without this, the CLI returns `Unknown registry "@design-system-ui"`. See [Installation](/docs/installation) for the full setup flow.
## Install
### npm
```sh
npx shadcn@latest add @design-system-ui/styles
```
### pnpm
```sh
pnpm dlx shadcn@latest add @design-system-ui/styles
```
### yarn
```sh
yarn dlx shadcn@latest add @design-system-ui/styles
```
### bun
```sh
bunx shadcn add "@design-system-ui/styles"
```
## What gets installed
| File | Destination |
| ---------------------- | --------------------------------- |
| `globals.css` | `src/styles/globals.css` |
| `theme.css` | `src/styles/theme.css` |
| `theme-secondary.css` | `src/styles/theme-secondary.css` |
| `theme-tertiary.css` | `src/styles/theme-tertiary.css` |
The CLI also installs related packages used by the stylesheet (`tw-animate-css`, Geist font packages, and `@tailwindcss/typography`).
If those paths already exist, the CLI may ask before overwriting them.
## Import in your app
Import the globals entry once in your root layout or main stylesheet:
```tsx
import "@/styles/globals.css";
```
`globals.css` already imports `./theme.css`, `./theme-secondary.css`, and `./theme-tertiary.css`, so you do not need extra imports for the theme tokens. See [Theming](/docs/theming) to apply a shipped accent or your own brand colors.
## Next steps
Apply your brand accents in [Theming](/docs/theming), then browse [components](/components), [hooks](/utilities), and [blocks](/blocks) and follow each item page install command.
---
URL: https://reactdocs.canceydejean.dev/docs/agents.md
Give AI coding tools Markdown context for this registry.
# Agents
Give AI coding tools Markdown context for this registry.
Point AI tools at Markdown routes instead of scraping HTML.
The generated [`/llms.txt`](/llms.txt) route is a compact map of the docs, registry catalog, and item pages.
Use [`/llms-full.txt`](/llms-full.txt) when a tool needs expanded context with generated Markdown inlined.
Every docs page, the registry catalog, and each registry item also has a Markdown route:
- [`/docs.md`](/docs.md)
- [`/docs/agents.md`](/docs/agents.md)
- [`/registry.md`](/registry.md)
- [`/components/button.md`](/components/button.md)
---
URL: https://reactdocs.canceydejean.dev/docs/theming.md
Apply your brand accents after installing the design system styles, including multi-brand palettes.
# Theming
Apply your brand accents after installing the design system styles, including multi-brand palettes.
Installed components read semantic CSS tokens such as `primary`, `ring`, and `sidebar-primary`. After you install [styles](/docs/styles), you brand the product by changing those tokens — not by editing component source.
## Theme files
`globals.css` pulls in the default tokens and optional accent palettes:
```css
@import "./theme.css";
@import "./theme-secondary.css";
@import "./theme-tertiary.css";
```
| File | When it applies |
| ---------------------- | --------------------------------------- |
| `theme.css` | Default palette on `:root` and `.dark` |
| `theme-secondary.css` | When `data-theme="theme-secondary"` |
| `theme-tertiary.css` | When `data-theme="theme-tertiary"` |
With no `data-theme` attribute, the app stays on the default tokens in `theme.css`. Accent files only override the brand-facing tokens (`--primary`, `--ring`, `--sidebar-primary`, `--selection`, and `--chart-*`). Surfaces such as `--background` and `--foreground` stay on the default palette.
Light and dark mode still use the `.dark` class. Each accent file includes a `.dark[data-theme="…"]` block so the brand color can shift in dark mode.
## Use a shipped accent
Set `data-theme` on the root element in your layout so the palette is present on first paint:
```html
```
`theme-secondary` is amber and `theme-tertiary` is violet. To let users switch palettes, install [Theme Toggle](/utilities/theme-toggle).
## Use your own brand color
Pick one of these approaches.
### Edit the default tokens
For a single-brand app that does not need named palettes, change the accent tokens in `src/styles/theme.css` under `:root` and `.dark`:
```css
:root {
--primary: oklch(0.55 0.19 250);
--primary-foreground: oklch(0.985 0 0);
--ring: oklch(0.55 0.19 250);
--sidebar-primary: oklch(0.55 0.19 250);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-ring: oklch(0.55 0.19 250);
--selection: oklch(0.55 0.19 250);
--selection-foreground: oklch(0.985 0 0);
}
```
Leave `data-theme` unset. Buttons, focus rings, and other `primary` styles pick up the new values.
### Add a named palette
To keep the default palette and add your brand as a selectable accent, create a file next to the shipped themes — for example `src/styles/theme-brand.css`:
```css
[data-theme="theme-brand"] {
--primary: oklch(0.55 0.19 250);
--primary-foreground: oklch(0.985 0 0);
--ring: oklch(0.55 0.19 250);
--sidebar-primary: oklch(0.55 0.19 250);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-ring: oklch(0.55 0.19 250);
--selection: oklch(0.55 0.19 250);
--selection-foreground: oklch(0.985 0 0);
--chart-1: oklch(0.55 0.19 250);
--chart-2: oklch(0.6 0.16 220);
--chart-3: oklch(0.65 0.12 190);
--chart-4: oklch(0.5 0.2 270);
--chart-5: oklch(0.7 0.1 230);
}
.dark[data-theme="theme-brand"] {
--primary: oklch(0.72 0.16 248);
--primary-foreground: oklch(0.145 0 0);
--ring: oklch(0.72 0.16 248);
--sidebar-primary: oklch(0.72 0.16 248);
--sidebar-primary-foreground: oklch(0.145 0 0);
--sidebar-ring: oklch(0.72 0.16 248);
--selection: oklch(0.72 0.16 248);
--selection-foreground: oklch(0.145 0 0);
--chart-1: oklch(0.72 0.16 248);
--chart-2: oklch(0.75 0.14 218);
--chart-3: oklch(0.78 0.11 188);
--chart-4: oklch(0.65 0.18 268);
--chart-5: oklch(0.82 0.09 228);
}
```
Import it from `globals.css` with the other theme files:
```css
@import "./theme.css";
@import "./theme-secondary.css";
@import "./theme-tertiary.css";
@import "./theme-brand.css";
```
Then set the matching attribute:
```html
```
You can also replace the values in `theme-secondary.css` or `theme-tertiary.css` instead of adding a new file. The selector name (`theme-secondary`) and the `data-theme` value must match.
## Multi-brand teams
Named accent palettes are for teams that ship more than one product, partner, or white-label from the same component set. Each brand is a CSS file that only overrides accent tokens; buttons, focus rings, and charts restyle without forking components or duplicating layouts.
That is useful when:
- Several products share density, type, and surfaces (`--background`, `--foreground`, `--muted`) but need distinct `--primary` colors.
- A platform app switches brand per tenant, environment, or route by setting `data-theme` on `` at render time.
- Designers and engineers preview every brand on one docs or Storybook surface, using [Theme Toggle](/utilities/theme-toggle) or a `data-theme` attribute on a subtree. Because the selectors are `[data-theme="…"]` rather than `:root` only, a nested region can use a different accent than the rest of the page.
Keep one palette file per brand (`theme-acme.css`, `theme-partner.css`) and import them all from `globals.css`. The shared component library stays the source of truth; brand teams own only their token file.
## Accent tokens
Override this set when you brand an accent. Copy the same keys into both the light and `.dark` blocks.
| Token | Typical use |
| ------------------------------ | ----------------------------------- |
| `--primary` | Buttons, key actions, brand fills |
| `--primary-foreground` | Text and icons on `--primary` |
| `--ring` | Focus rings |
| `--sidebar-primary` | Sidebar brand and active states |
| `--sidebar-primary-foreground` | Text on `--sidebar-primary` |
| `--sidebar-ring` | Sidebar focus rings |
| `--selection` | Text selection background |
| `--selection-foreground` | Text selection foreground |
| `--chart-1` … `--chart-5` | Chart series colors |
---
URL: https://reactdocs.canceydejean.dev/docs/changelog.md
Track user-facing changes to this registry.
# Changelog
Track user-facing changes to this registry.
Use this page to publish notable registry updates, new items, breaking changes, and migration notes.
---
## v1.5.5: September 20, 2026
- **Docs:** Pointed the `@design-system-ui` registry URL on [Installation](/docs/installation) and [Styles](/docs/styles) at `https://reactdocs.canceydejean.dev/r/{name}.json`.
---
## v1.5.4: September 17, 2026
- **Docs:** Replaced leftover `_cn` template copy on [Agents](/docs/agents) with the Markdown and `llms.txt` routes coding tools actually need.
- **Docs:** Updated the Bun install command on [Installation](/docs/installation) and [Styles](/docs/styles) to `bunx shadcn add "@design-system-ui/..."`, which works in new Bun projects.
- **Theming:** Documented how consumer apps apply brand accents after installing [Styles](/docs/styles): ship `data-theme` palettes from `globals.css`, add a custom `[data-theme]` CSS file, or keep one component set with a palette file per brand for multi-brand teams. See [Theming](/docs/theming).
- **Styles:** The `styles` item now publishes `theme-secondary.css` and `theme-tertiary.css` so the accent imports in `globals.css` resolve after install.
---
## v1.5.3: September 2, 2026
- Added `useBodyOverflow`, a hook that locks page scroll by toggling `overflow-hidden` on `document.body`.
- Added `useCloseMobileMenuOnResize`, a hook that dismisses mobile menus and overlays when the viewport is resized.
---
## v1.5.2: August 31, 2026
- **Announcement Bar:** Moved the block from `registry/items/blocks/hero/announcement-bar/` to `registry/items/blocks/announcement-bar/` as a standalone block item. Install targets now publish under `components/ui/announcement-bar/` and declare `container` as a local registry dependency.
---
## v1.5.1: August 15, 2026
- **Logos:** The Instagram logo now renders the full-color gradient brand mark instead of the flat black glyph. It sizes from its `viewBox` rather than fixed `width`/`height`, so it scales with the `Logo` `size` variants.
---
## v1.5.0: August 14, 2026
- **Component variants:** Components that use `class-variance-authority` now keep every `cva()` call in a colocated `.variants.ts` file (`.ts`, not `.tsx`). The component file imports the helper; it does not define CVA inline.
- **Extracted variants:** Moved CVA out of component source for `Alert`, `Attachment`, `Badge`, `Bubble`, `Button Group`, `Empty`, `Field`, `Input Group`, `Item`, `Marker`, `Navigation Menu`, `Sidebar`, `Tabs`, and `Toggle`. `Toggle Group` now imports `toggleVariants` from `toggle.variants.ts`.
- **Container:** Renamed `container.variants.tsx` / `container.types.tsx` to `.ts` so the file extension matches the variants convention.
- **Docs:** Documented the Component Variants pattern on the [Registry](/docs/registry) authoring page, with pointers from Agents docs, `AGENTS.md`, and the `shadcn-registry` skill so maintainers and coding agents follow the same layout as `button.variants.ts`.
---
## v1.4.0: August 10, 2026
- **Install paths:** Multi-file components now publish nested folder structure instead of flattening basename-only into `ui/`. Nested packages such as `Icons` and `Logos` install under `components/icons/**` and `components/logos/**` (including `icon/`, `icon-set/`, `logo/`, and `logo-set/`).
- **Published package imports:** Same-item relative imports are preserved in installed source so multi-file packages keep working after `shadcn add` (for example `./icon.variants`, `./logo-set/apple`, `../index`).
- **Icons / Logos:** Added explicit install `target`s for every published file; removed unused `icon-set/types.ts` and `logo-set/types.ts` stubs.
- **Data Table:** Sample `payments.tsx` (columns + fixture data) is now a published registry file, not story-only source.
- **Targets & docs:** Install targets and usage examples updated across registry items (including `Accordion`, `Button`, `Hero`, and many component `_registry.mdx` pages) so install paths match consumers’ `components.json` aliases.
- **Previews:** Component registry preview exports and docs samples tightened for catalog rendering.
---
## v1.3.0: July 22, 2026
- Documented how to register `@design-system-ui` in `components.json` on the [Installation](/docs/installation) and [Styles](/docs/styles) pages, so new projects can resolve namespaced install commands.
- Added `Container`, a centered content wrapper with max-width size variants.
- Published registry metadata and preview files for `Container` so it is discoverable in the registry catalog and docs.
- Added `Icons`, a typed icon component with size variants and a searchable gallery for browsing and copying icons.
- Published registry metadata and preview files for `Icons` so it is discoverable in the registry catalog and docs.
- Added `Logos`, brand logo SVGs with a searchable gallery for browsing and copying.
- Published registry metadata and preview files for `Logos` so it is discoverable in the registry catalog and docs.
---
## v1.2.0: July 20, 2026
- Added a new `Heading` preview component to demonstrate sizing in the docs.
- Updated `Heading` styles to use CSS variables for size and tone, improving theme consistency.
- Improved Heading component compatibility and docs examples/stories.
- Added centralized theme style imports and refined global selection styling.
- Added `Link Text`, a polymorphic text-link component with tone, underline, size, and external-link options.
- Added `Link Spread`, an absolute-positioned anchor helper for making full card surfaces clickable.
- Published registry metadata and preview files for both link components so they are discoverable in the registry catalog and docs.
- Added `Section`, a semantic wrapper component with responsive vertical padding variants.
- Published registry metadata and preview files for `Section` so it is discoverable in the registry catalog and docs.
- Added a reusable `DemoSection` for Storybook and aligned the `Section` story to render that shared demo.
- Added `Spinner`, an accessible loading indicator built on Lucide's Loader2 icon.
- Published registry metadata and preview files for `Spinner` so it is discoverable in the registry catalog and docs.
- Added `Text`, a polymorphic body-text component with size, weight, tone, and alignment controls.
- Published registry metadata and preview files for `Text` so it is discoverable in the registry catalog and docs.
- Published `Hero` as a registry block, including metadata and preview files so it is discoverable in the registry catalog and docs.
---
## v1.1.0: July 19, 2026
- Updated `Button` variants and sizes to use CSS variables for colors and typography, improving theme support (including dark mode on the primary variant).
- Simplified default icon (`svg`) sizing inside buttons.
- **Breaking:** Removed the `link` variant. Use an `as="a"` button (or a link styled separately) instead.
- **Breaking:** Removed the `icon-xs` size. Use `icon-sm`, `icon-md`, or `icon-lg`.
- **Breaking:** Resized icon buttons — `icon-md` is now `size-9` (was `size-10`) and `icon-lg` is now `size-10` (was `size-12`).
---
## v1.0.1: April 21, 2026
- Fixed the pointer cursor when hovering `Button` components.
---
URL: https://reactdocs.canceydejean.dev/components.md
Installable UI primitives and components.
# Components
Installable UI primitives and components.
- [Accordion](https://reactdocs.canceydejean.dev/components/accordion): A vertically stacked set of interactive headings that each reveal a section of content.
- [Alert](https://reactdocs.canceydejean.dev/components/alert): Displays a callout for user attention with optional title, description, and action.
- [Alert Dialog](https://reactdocs.canceydejean.dev/components/alert-dialog): A modal dialog that interrupts the user with important content and expects a response.
- [Aspect Ratio](https://reactdocs.canceydejean.dev/components/aspect-ratio): Displays content within a desired aspect ratio.
- [Attachment](https://reactdocs.canceydejean.dev/components/attachment): Displays a file or image attachment with media, metadata, upload state, and actions.
- [Avatar](https://reactdocs.canceydejean.dev/components/avatar): An image element with a fallback for representing the user.
- [Badge](https://reactdocs.canceydejean.dev/components/badge): Displays a badge or a component that looks like a badge.
- [Breadcrumb](https://reactdocs.canceydejean.dev/components/breadcrumb): Displays the path to the current resource using a hierarchy of links.
- [Bubble](https://reactdocs.canceydejean.dev/components/bubble): Colored message surfaces for chat and conversation UIs, with optional reactions.
- [Button](https://reactdocs.canceydejean.dev/components/button): A polymorphic button with variants, sizes, icons, and a CTA group helper.
- [Button Group](https://reactdocs.canceydejean.dev/components/button-group): A container that groups related buttons with shared borders and orientation.
- [Calendar](https://reactdocs.canceydejean.dev/components/calendar): A date field component that allows users to enter and edit dates.
- [Card](https://reactdocs.canceydejean.dev/components/card): Displays a card with header, content, and footer.
- [Carousel](https://reactdocs.canceydejean.dev/components/carousel): A carousel with motion and swipe built using Embla.
- [Chart](https://reactdocs.canceydejean.dev/components/chart): Beautiful charts built using Recharts with a themed chart container, tooltip, and legend.
- [Checkbox](https://reactdocs.canceydejean.dev/components/checkbox): A control that allows the user to toggle between checked and not checked.
- [Collapsible](https://reactdocs.canceydejean.dev/components/collapsible): An interactive component which expands/collapses a panel.
- [Combobox](https://reactdocs.canceydejean.dev/components/combobox): Autocomplete input with a list of suggestions.
- [Command](https://reactdocs.canceydejean.dev/components/command): Command menu for search and quick actions.
- [Container](https://reactdocs.canceydejean.dev/components/container): A centered content wrapper with max-width size variants.
- [Context Menu](https://reactdocs.canceydejean.dev/components/context-menu): Displays a menu of actions triggered by a right click.
- [Data Table](https://reactdocs.canceydejean.dev/components/data-table): Powerful table and datagrids built using TanStack Table.
- [Date Picker](https://reactdocs.canceydejean.dev/components/datepicker): A date picker component with range and presets.
- [Dialog](https://reactdocs.canceydejean.dev/components/dialog): A window overlaid on either the primary window or another dialog window.
- [Direction](https://reactdocs.canceydejean.dev/components/direction): A provider component that sets the text direction for your application.
- [Drawer](https://reactdocs.canceydejean.dev/components/drawer): A drawer component for menus and content that slides from an edge of the screen.
- [Dropdown Menu](https://reactdocs.canceydejean.dev/components/dropdown-menu): Displays a menu of actions or options triggered by a button.
- [Empty](https://reactdocs.canceydejean.dev/components/empty): Use the Empty component to display an empty state.
- [Field](https://reactdocs.canceydejean.dev/components/field): Combine labels, controls, descriptions, and errors into accessible form fields.
- [Heading](https://reactdocs.canceydejean.dev/components/heading): A semantic heading with independent size, weight, and tone controls.
- [Hover Card](https://reactdocs.canceydejean.dev/components/hover-card): For sighted users to preview content available behind a link.
- [Icons](https://reactdocs.canceydejean.dev/components/icons): A typed icon component with size variants and a custom icon set.
- [Input](https://reactdocs.canceydejean.dev/components/input): Displays a form input field or a component that looks like an input field.
- [Input Group](https://reactdocs.canceydejean.dev/components/input-group): Display additional information or actions to an input or textarea.
- [Input OTP](https://reactdocs.canceydejean.dev/components/input-otp): Accessible one-time password component with copy-paste support.
- [Item](https://reactdocs.canceydejean.dev/components/item): A versatile component for displaying content in lists, cards, or menus.
- [Kbd](https://reactdocs.canceydejean.dev/components/kbd): Used to display textual user input from keyboard.
- [Label](https://reactdocs.canceydejean.dev/components/label): Renders an accessible label associated with controls.
- [Link Spread](https://reactdocs.canceydejean.dev/components/link-spread): An absolute positioned anchor that makes an entire container clickable.
- [Link Text](https://reactdocs.canceydejean.dev/components/link-text): A polymorphic text link with tone, underline, size, and external-link controls.
- [Logos](https://reactdocs.canceydejean.dev/components/logos): A typed logo component with size variants and a brand logo set.
- [Marker](https://reactdocs.canceydejean.dev/components/marker): A marker for labeling sections with optional icons, borders, and separators.
- [Menubar](https://reactdocs.canceydejean.dev/components/menubar): A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands.
- [Message](https://reactdocs.canceydejean.dev/components/message): Layout primitives for chat rows with avatars, headers, and footers.
- [Message Scroller](https://reactdocs.canceydejean.dev/components/message-scroller): Auto-scrolling container for chat message lists with jump-to controls.
- [Native Select](https://reactdocs.canceydejean.dev/components/native-select): A styled native HTML select element with options and option groups.
- [Navigation Menu](https://reactdocs.canceydejean.dev/components/navigation-menu): A collection of links for navigating websites.
- [Pagination](https://reactdocs.canceydejean.dev/components/pagination): Pagination with page navigation, next and previous links.
- [Popover](https://reactdocs.canceydejean.dev/components/popover): Displays rich content in a portal, triggered by a button.
- [Progress](https://reactdocs.canceydejean.dev/components/progress): Displays an indicator showing the completion progress of a task.
- [Questionnaire](https://reactdocs.canceydejean.dev/components/questionnaire): A multi-step questionnaire with single-choice, multiple-choice, freeform, and skippable questions.
- [Radio Group](https://reactdocs.canceydejean.dev/components/radio-group): A set of checkable buttons where only one can be checked at a time.
- [Resizable](https://reactdocs.canceydejean.dev/components/resizable): Accessible resizable panel groups and layouts with keyboard support.
- [Scroll Area](https://reactdocs.canceydejean.dev/components/scroll-area): Augments native scroll functionality for custom, cross-browser styling.
- [Section](https://reactdocs.canceydejean.dev/components/section): A semantic section wrapper with responsive vertical padding variants.
- [Select](https://reactdocs.canceydejean.dev/components/select): Displays a list of options for the user to pick from—triggered by a button.
- [Separator](https://reactdocs.canceydejean.dev/components/separator): Visually or semantically separates content.
- [Sheet](https://reactdocs.canceydejean.dev/components/sheet): Extends the Dialog component to display content that complements the main content of the screen.
- [Sidebar](https://reactdocs.canceydejean.dev/components/sidebar): A composable, themeable, and customizable sidebar component.
- [Skeleton](https://reactdocs.canceydejean.dev/components/skeleton): Use to show a placeholder while content is loading.
- [Slider](https://reactdocs.canceydejean.dev/components/slider): An input where the user selects a value from within a given range.
- [Spinner](https://reactdocs.canceydejean.dev/components/spinner): An accessible loading spinner built on Lucide's Loader2 icon.
- [Switch](https://reactdocs.canceydejean.dev/components/switch): A control that allows the user to toggle between checked and not checked.
- [Table](https://reactdocs.canceydejean.dev/components/table): A responsive table component.
- [Tabs](https://reactdocs.canceydejean.dev/components/tabs): A set of layered sections of content—known as tab panels—that are displayed one at a time.
- [Text](https://reactdocs.canceydejean.dev/components/text): A polymorphic body text component with size, weight, tone, and alignment controls.
- [Textarea](https://reactdocs.canceydejean.dev/components/textarea): Displays a multi-line text input field.
- [Toast](https://reactdocs.canceydejean.dev/components/toast): A succinct message that is displayed temporarily.
- [Toggle](https://reactdocs.canceydejean.dev/components/toggle): A two-state button that can be either on or off.
- [Toggle Group](https://reactdocs.canceydejean.dev/components/toggle-group): A set of two-state buttons that can be toggled on or off.
- [Tooltip](https://reactdocs.canceydejean.dev/components/tooltip): A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
---
URL: https://reactdocs.canceydejean.dev/components/accordion.md
A vertically stacked set of interactive headings that each reveal a section of content.
# Accordion
A vertically stacked set of interactive headings that each reveal a section of content.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/accordion.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/accordion.json)
## Preview
```tsx
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion/accordion";
export function Preview() {
return (
Is it accessible?
Yes. It adheres to the WAI-ARIA design pattern and is built on Base UI primitives.
Is it styled?
Yes. It comes with default styles that match the other components in your design system.
Is it animated?
Yes. Height is animated with accordion open and close transitions.
);
}
```
## Source
### accordion.tsx
```tsx
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
import { cn } from "cn";
function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
return (
);
}
function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
return (
);
}
function AccordionTrigger({
className,
children,
...props
}: AccordionPrimitive.Trigger.Props) {
return (
{children}
);
}
function AccordionContent({
className,
children,
...props
}: AccordionPrimitive.Panel.Props) {
return (
{children}
);
}
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
```
## Usage
Use the accordion for FAQs, settings sections, and other progressive disclosure patterns.
```tsx
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/accordion/accordion";
export function Example() {
return (
Is it accessible?
Yes. It adheres to the WAI-ARIA design pattern.
Is it styled?
Yes. It comes with default styles that match the other components.
);
}
```
Open multiple sections with `multiple`.
---
URL: https://reactdocs.canceydejean.dev/components/alert.md
Displays a callout for user attention with optional title, description, and action.
# Alert
Displays a callout for user attention with optional title, description, and action.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/alert.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/alert.json)
## Preview
```tsx
import { IconTerminal } from "@tabler/icons-react";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert/alert";
export function Preview() {
return (
Heads up!
You can add components and dependencies to your app using the CLI.
);
}
```
## Source
### alert.tsx
```tsx
import { type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "cn";
import { alertVariants } from "./alert.variants";
function Alert({
className,
variant,
...props
}: React.ComponentProps<"div"> & VariantProps) {
return (
);
}
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3",
className,
)}
{...props}
/>
);
}
function AlertDescription({
className,
...props
}: React.ComponentProps<"div">) {
return (
);
}
function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
return (
);
}
export { Alert, AlertTitle, AlertDescription, AlertAction };
```
### alert.variants.ts
```ts
import { cva } from "class-variance-authority";
import { cn } from "cn"
const alertBase = cn(
"group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
);
const alertConfig = {
variants: {
variant: {
default: "bg-card text-card-foreground",
destructive:
"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
},
},
compoundVariants: [],
defaultVariants: {
variant: "default",
},
} as const;
export const alertCva = cva(alertBase, {
...alertConfig,
compoundVariants: [...alertConfig.compoundVariants],
});
// Export the variant variants
export const ALERT_VARIANTS = Object.keys(
alertConfig.variants.variant,
) as (keyof typeof alertConfig.variants.variant)[];
export const alertVariants = alertCva;
```
## Usage
Use alerts for status messages, warnings, and important callouts.
```tsx
import {
Alert,
AlertAction,
AlertDescription,
AlertTitle,
} from "@/components/alert/alert";
export function Example() {
return (
Heads up!
You can add components and dependencies to your app using the CLI.
);
}
```
Pass `variant="destructive"` for error-style callouts. Compose an icon as a child of `Alert` for
leading indicators, and use `AlertAction` for a corner action.
---
URL: https://reactdocs.canceydejean.dev/components/alert-dialog.md
A modal dialog that interrupts the user with important content and expects a response.
# Alert Dialog
A modal dialog that interrupts the user with important content and expects a response.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/alert-dialog.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/alert-dialog.json)
## Preview
```tsx
import { Button } from "@/components/ui/button";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog/alert-dialog";
export function Preview() {
return (
}>Show Dialog
Are you absolutely sure?
This action cannot be undone. This will permanently delete your account and remove your
data from our servers.
CancelContinue
);
}
```
## Source
### alert-dialog.tsx
```tsx
"use client";
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
import * as React from "react";
import { Button } from "@/components/ui/button";
import { cn } from "cn";
function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
return ;
}
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
return (
);
}
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
return (
);
}
function AlertDialogOverlay({
className,
...props
}: AlertDialogPrimitive.Backdrop.Props) {
return (
);
}
function AlertDialogContent({
className,
size = "default",
...props
}: AlertDialogPrimitive.Popup.Props & {
size?: "default" | "sm";
}) {
return (
);
}
function AlertDialogHeader({
className,
...props
}: React.ComponentProps<"div">) {
return (
);
}
function AlertDialogFooter({
className,
...props
}: React.ComponentProps<"div">) {
return (
);
}
function AlertDialogMedia({
className,
...props
}: React.ComponentProps<"div">) {
return (
);
}
function AlertDialogTitle({
className,
...props
}: React.ComponentProps) {
return (
);
}
function AlertDialogDescription({
className,
...props
}: React.ComponentProps) {
return (
);
}
function AlertDialogAction({
className,
...props
}: React.ComponentProps) {
return (
);
}
function AlertDialogCancel({
className,
variant = "outline",
size = "default",
...props
}: AlertDialogPrimitive.Close.Props &
Pick, "variant" | "size">) {
return (
}
{...props}
/>
);
}
export {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogMedia,
AlertDialogOverlay,
AlertDialogPortal,
AlertDialogTitle,
AlertDialogTrigger,
};
```
## Usage
Use alert dialogs for destructive or confirm-before-acting flows that need an explicit response.
```tsx
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/alert-dialog/alert-dialog";
import { Button } from "@/components/button/button";
export function Example() {
return (
}>
Show Dialog
Are you absolutely sure?
This action cannot be undone. This will permanently delete your
account and remove your data from our servers.
CancelContinue
);
}
```
Pass `size="sm"` on `AlertDialogContent` for a compact layout. Add `AlertDialogMedia` for a leading
icon in the header.
---
URL: https://reactdocs.canceydejean.dev/components/aspect-ratio.md
Displays content within a desired aspect ratio.
# Aspect Ratio
Displays content within a desired aspect ratio.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/aspect-ratio.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/aspect-ratio.json)
## Preview
```tsx
import { AspectRatio } from "@/components/ui/aspect-ratio/aspect-ratio";
export function Preview() {
return (
);
}
```
## Source
### aspect-ratio.tsx
```tsx
import type * as React from "react";
import { cn } from "cn";
function AspectRatio({
ratio,
className,
style,
...props
}: React.ComponentProps<"div"> & { ratio: number }) {
const aspectStyle: React.CSSProperties & { "--ratio": number } = {
...style,
"--ratio": ratio,
};
return (
);
}
export { AspectRatio };
```
## Usage
Use aspect ratio to constrain media and placeholders so layout does not shift as content loads.
```tsx
import { AspectRatio } from "@/components/aspect-ratio/aspect-ratio";
export function Example() {
return (
);
}
```
Pass `ratio` as a number (for example `16 / 9`, `1`, or `4 / 3`).
---
URL: https://reactdocs.canceydejean.dev/components/attachment.md
Displays a file or image attachment with media, metadata, upload state, and actions.
# Attachment
Displays a file or image attachment with media, metadata, upload state, and actions.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/attachment.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/attachment.json)
## Preview
```tsx
import { IconFileText, IconX } from "@tabler/icons-react";
import {
Attachment,
AttachmentAction,
AttachmentActions,
AttachmentContent,
AttachmentDescription,
AttachmentMedia,
AttachmentTitle,
} from "@/components/ui/attachment/attachment";
export function Preview() {
return (
sales-dashboard.pdfPDF · 2.4 MB
);
}
```
## Source
### attachment.tsx
```tsx
import { mergeProps } from "@base-ui/react/merge-props";
import { useRender } from "@base-ui/react/use-render";
import { type VariantProps } from "class-variance-authority";
import * as React from "react";
import { Button } from "@/components/ui/button";
import { cn } from "cn";
import {
attachmentMediaVariants,
attachmentVariants,
} from "./attachment.variants";
function Attachment({
className,
state = "done",
size = "default",
orientation = "horizontal",
...props
}: React.ComponentProps<"div"> &
VariantProps & {
state?: "idle" | "uploading" | "processing" | "error" | "done";
}) {
return (
);
}
function AttachmentMedia({
className,
variant = "icon",
...props
}: React.ComponentProps<"div"> & VariantProps) {
return (
);
}
function AttachmentContent({
className,
...props
}: React.ComponentProps<"div">) {
return (
);
}
function AttachmentTitle({
className,
...props
}: React.ComponentProps<"span">) {
return (
);
}
function AttachmentDescription({
className,
...props
}: React.ComponentProps<"span">) {
return (
);
}
function AttachmentActions({
className,
...props
}: React.ComponentProps<"div">) {
return (
);
}
function AttachmentAction({
className,
variant,
size = "icon-xs",
...props
}: React.ComponentProps) {
return (
);
}
function AttachmentTrigger({
className,
render,
type,
...props
}: useRender.ComponentProps<"button">) {
return useRender({
defaultTagName: "button",
props: mergeProps<"button">(
{
type: render ? type : (type ?? "button"),
className: cn("absolute inset-0 z-10 outline-none", className),
},
props,
),
render,
state: {
slot: "attachment-trigger",
},
});
}
function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
);
}
export {
Attachment,
AttachmentGroup,
AttachmentMedia,
AttachmentContent,
AttachmentTitle,
AttachmentDescription,
AttachmentActions,
AttachmentAction,
AttachmentTrigger,
};
```
### attachment.variants.ts
```ts
import { cva } from "class-variance-authority";
import { cn } from "cn"
const attachmentBase = cn(
"group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed",
);
const attachmentConfig = {
variants: {
size: {
default:
"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1",
},
orientation: {
horizontal: "min-w-40 items-center",
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30",
},
},
compoundVariants: [],
defaultVariants: {},
} as const;
export const attachmentCva = cva(attachmentBase, {
...attachmentConfig,
compoundVariants: [...attachmentConfig.compoundVariants],
});
// Export the size variants
export const ATTACHMENT_SIZES = Object.keys(
attachmentConfig.variants.size,
) as (keyof typeof attachmentConfig.variants.size)[];
// Export the orientation variants
export const ATTACHMENT_ORIENTATIONS = Object.keys(
attachmentConfig.variants.orientation,
) as (keyof typeof attachmentConfig.variants.orientation)[];
export const attachmentVariants = attachmentCva;
const attachmentMediaBase = cn(
"relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5",
);
const attachmentMediaConfig = {
variants: {
variant: {
icon: "",
image:
"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover",
},
},
compoundVariants: [],
defaultVariants: {
variant: "icon",
},
} as const;
export const attachmentMediaCva = cva(attachmentMediaBase, {
...attachmentMediaConfig,
compoundVariants: [...attachmentMediaConfig.compoundVariants],
});
// Export the media variant variants
export const ATTACHMENT_MEDIA_VARIANTS = Object.keys(
attachmentMediaConfig.variants.variant,
) as (keyof typeof attachmentMediaConfig.variants.variant)[];
export const attachmentMediaVariants = attachmentMediaCva;
```
## Usage
Use attachments for files and images in chat composers, message threads, and upload lists.
```tsx
import {
Attachment,
AttachmentAction,
AttachmentActions,
AttachmentContent,
AttachmentDescription,
AttachmentMedia,
AttachmentTitle,
} from "@/components/attachment/attachment";
export function Example() {
return (
sales-dashboard.pdfPDF · 2.4 MB
);
}
```
Supports `state` (`idle`, `uploading`, `processing`, `error`, `done`), `size` (`default`,
`sm`, `xs`), and `orientation` (`horizontal`, `vertical`). Wrap multiple items in
`AttachmentGroup` for a scrollable row. Requires `shimmer` and `scroll-fade` utilities from
`shadcn/tailwind.css` (or this registry's shimmer / scroll-fade items) for progress and group
edge fade.
---
URL: https://reactdocs.canceydejean.dev/components/avatar.md
An image element with a fallback for representing the user.
# Avatar
An image element with a fallback for representing the user.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/avatar.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/avatar.json)
## Preview
```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar/avatar";
export function Preview() {
return (
CN
);
}
```
## Source
### avatar.tsx
```tsx
"use client";
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
import * as React from "react";
import { cn } from "cn";
function Avatar({
className,
size = "default",
...props
}: AvatarPrimitive.Root.Props & {
size?: "default" | "sm" | "lg";
}) {
return (
);
}
function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
return (
);
}
function AvatarFallback({
className,
...props
}: AvatarPrimitive.Fallback.Props) {
return (
);
}
function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
return (
svg]:hidden",
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
className,
)}
{...props}
/>
);
}
function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
);
}
function AvatarGroupCount({
className,
...props
}: React.ComponentProps<"div">) {
return (
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
className,
)}
{...props}
/>
);
}
export {
Avatar,
AvatarImage,
AvatarFallback,
AvatarGroup,
AvatarGroupCount,
AvatarBadge,
};
```
## Usage
Use avatars for user photos, initials, status badges, and stacked groups.
```tsx
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/components/avatar/avatar";
export function Example() {
return (
CN
);
}
```
Pass `size` (`sm`, `default`, `lg`) on the root. Compose `AvatarBadge` for status
indicators, and `AvatarGroup` / `AvatarGroupCount` for overlapping stacks.
---
URL: https://reactdocs.canceydejean.dev/components/badge.md
Displays a badge or a component that looks like a badge.
# Badge
Displays a badge or a component that looks like a badge.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/badge.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/badge.json)
## Preview
```tsx
import { Badge } from "@/components/ui/badge/badge";
export function Preview() {
return Badge;
}
```
## Source
### badge.tsx
```tsx
import { mergeProps } from "@base-ui/react/merge-props";
import { useRender } from "@base-ui/react/use-render";
import { type VariantProps } from "class-variance-authority";
import { cn } from "cn"
import { badgeVariants } from "./badge.variants";
function Badge({
className,
variant = "default",
render,
...props
}: useRender.ComponentProps<"span"> & VariantProps) {
return useRender({
defaultTagName: "span",
props: mergeProps<"span">(
{
className: cn(badgeVariants({ variant }), className),
},
props,
),
render,
state: {
slot: "badge",
variant,
},
});
}
export { Badge, badgeVariants };
```
### badge.variants.ts
```ts
import { cva } from "class-variance-authority";
import { cn } from "cn"
const badgeBase = cn(
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
);
const badgeConfig = {
variants: {
variant: {
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
destructive:
"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
link: "text-primary underline-offset-4 hover:underline",
},
},
compoundVariants: [],
defaultVariants: {
variant: "default",
},
} as const;
export const badgeCva = cva(badgeBase, {
...badgeConfig,
compoundVariants: [...badgeConfig.compoundVariants],
});
// Export the variant variants
export const BADGE_VARIANTS = Object.keys(
badgeConfig.variants.variant,
) as (keyof typeof badgeConfig.variants.variant)[];
export const badgeVariants = badgeCva;
```
## Usage
Use badges for status, counts, labels, and compact metadata.
```tsx
import { Badge } from "@/components/badge/badge";
export function Example() {
return Badge;
}
```
Variants: `default`, `secondary`, `destructive`, `outline`, `ghost`, and `link`. Render as a link
with `render={}`.
---
URL: https://reactdocs.canceydejean.dev/components/breadcrumb.md
Displays the path to the current resource using a hierarchy of links.
# Breadcrumb
Displays the path to the current resource using a hierarchy of links.
## Installation
```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/breadcrumb.json
```
[Registry JSON](https://reactdocs.canceydejean.dev/r/breadcrumb.json)
## Preview
```tsx
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb/breadcrumb";
export function Preview() {
return (
HomeComponentsBreadcrumb
);
}
```
## Source
### breadcrumb.tsx
```tsx
import { mergeProps } from "@base-ui/react/merge-props";
import { useRender } from "@base-ui/react/use-render";
import { IconChevronRight, IconDots } from "@tabler/icons-react";
import * as React from "react";
import { cn } from "cn";
function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
return (
);
}
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
return (
);
}
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
return (
);
}
function BreadcrumbLink({
className,
render,
...props
}: useRender.ComponentProps<"a">) {
return useRender({
defaultTagName: "a",
props: mergeProps<"a">(
{
className: cn("transition-colors hover:text-foreground", className),
},
props,
),
render,
state: {
slot: "breadcrumb-link",
},
});
}
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
return (
);
}
function BreadcrumbSeparator({
children,
className,
...props
}: React.ComponentProps<"li">) {
return (