# Colors (/docs/colors) ## Overview [#overview] Tokens mirror [Tailwind color conventions](https://tailwindcss.com/docs/colors#core-concepts), so names align with utility classes and stay predictable in your project. ## Core concepts [#core-concepts] The UI draws from one of nine neutral gray scales. The scale you choose sets backgrounds, borders, and muted tones for the whole theme. The default palette is `neutral`, anchored at `neutral-50` in light mode and `neutral-950` in dark mode. Preview another scale with the swatches below: Click a swatch to switch the neutral scale and preview the theme across the docs. Subtle differences between grays are easiest to judge in dark mode. Build your own color palette Try the [Theme editor](/themes) to visually customize primary, neutral colors and radius. ## Theme Tokens [#theme-tokens] These tokens live in your CSS file under `:root` and `.dark`. ### background / foreground [#background--foreground] The default app background and text color for the page shell, page sections, and default text. * `--background` * `--foreground` ### card [#card] Elevated surfaces and the content inside them, including Card, dashboard panels, and settings panels. * `--card` * `--card-foreground` ### popover [#popover] Floating surfaces and the content inside them, such as Popover, DropdownMenu, ContextMenu, and other overlays. * `--popover` * `--popover-foreground` ### primary [#primary] High-emphasis actions and brand surfaces, including the default Button, selected states, badges, and active accents. * `--primary` * `--primary-foreground` ### secondary [#secondary] Lower-emphasis filled actions and supporting surfaces, such as secondary buttons, secondary badges, and supporting UI. * `--secondary` * `--secondary-foreground` ### muted [#muted] Subtle surfaces and lower-emphasis content for descriptions, placeholders, empty states, helper text, and subdued surfaces. * `--muted` * `--muted-foreground` ### accent [#accent] Interactive hover, focus, and active surfaces for ghost buttons, menu highlight states, hovered rows, and selected items. * `--accent` * `--accent-foreground` ### destructive [#destructive] Destructive actions and error emphasis for destructive buttons, invalid states, and destructive menu items. * `--destructive` * `--destructive-foreground` ### info [#info] Informational actions and emphasis for informational buttons, badges, alerts, status, etc. * `--info` * `--info-foreground` ### success [#success] Success actions and emphasis for success buttons, badges, alerts, status, etc. * `--success` * `--success-foreground` ### warning [#warning] Warning actions and emphasis for warning buttons, badges, alerts, status, etc. * `--warning` * `--warning-foreground` ### border [#border] Default borders and separators on cards, menus, tables, separators, and layout dividers. * `--border` * `--border-foreground` ### input [#input] Form control borders and input surface treatment on Input, Textarea, Select, and outline-style controls. * `--input` * `--input-foreground` ### ring [#ring] Focus rings and outlines on buttons, inputs, checkboxes, menus, and other focusable controls. It follows the primary color. * `--ring` * `--ring-foreground` ### sidebar [#sidebar] The base sidebar surface and default sidebar text on the Sidebar container and its default content. * `--sidebar` * `--sidebar-foreground` ### sidebar-primary [#sidebar-primary] High-emphasis actions inside the sidebar for active items, icon tiles, badges, and sidebar CTAs. * `--sidebar-primary` * `--sidebar-primary-foreground` ### sidebar-accent [#sidebar-accent] Hover and selected states inside the sidebar for menu hover states, open items, and interactive rows. * `--sidebar-accent` * `--sidebar-accent-foreground` ### sidebar-border [#sidebar-border] Sidebar-specific borders and separators on sidebar headers, groups, and internal dividers. * `--sidebar-border` ### sidebar-ring [#sidebar-ring] Sidebar-specific focus rings on focused controls inside the sidebar. It follows the primary color. * `--sidebar-ring` ### radius [#radius] The base corner radius scale for cards, inputs, buttons, popovers, and the derived `radius-*` tokens. Preset theme classes are documented in [Styling](/docs/styling). # Components (/docs/components) # Forms (/docs/forms) ## Picking a form library [#picking-a-form-library] For detailed guides with examples, validation, and field-type-specific patterns, see the linked pages above. ## Field Context [#field-context] Form components automatically integrate with `Field` through context. When nested inside a `Field`, they inherit `disabled`, `invalid`, `required`, and `readOnly` states automatically. Also `htmlFor` and `id` are automatically handled by the `Field` component. Never use them directly. ```tsx import { Field } from "@/registry/react/components/field" import { NumberInput } from "@/registry/react/components/number-input" const Demo = () => ( ) ``` ## Input states [#input-states] ### Invalid [#invalid] Pass the `invalid` prop to the `Field` component. The `FieldError` is only visible when the `invalid` prop is `true`. ```tsx import { Field, FieldLabel, FieldError, } from "@/registry/react/components/field" import { Input } from "@/registry/react/components/input" const Demo = () => (
Username Username is required.
) ``` ### Required [#required] Pass the `required` prop to the `Field` component. Optionally, you can use the `FieldRequiredIndicator` to indicate that the field is required. ```tsx import { Field, FieldLabel, FieldRequiredIndicator, FieldError, } from "@/registry/react/components/field" import { Input } from "@/registry/react/components/input" export const Demo = () => (
Username Username is required.
) ``` # Introduction (/docs) Built on top of [Ark UI](https://ark-ui.com) and [shadcn](https://ui.shadcn.com), it includes sensible defaults for styling, variants, and structure, so you can drop components into a project without starting from scratch. It’s not a black-box framework; you own the code, tweak what you need, and build on top of something that’s already thought through. The name blends the two projects it’s built on: **sh** from shadcn and **ark** from Ark UI. **Shark**. ## Motivation [#motivation] [Ark UI](https://ark-ui.com) offers a broad set of headless components and serves as a direct alternative to [Radix Primitives](https://radix-ui.com/primitives) and [Base UI](https://base-ui.com). It gives you accessible primitives and state management, but it leaves styling and layout entirely to you. **shadcn**, on the other hand, ships copy-paste components that look great. The gap is that Ark’s docs don’t show how to pair its primitives with Tailwind, or how to turn them into a reusable design system you can install, theme, and extend. ## How it works [#how-it-works] Instead of only installing a package from npm and importing opaque pieces, you keep source in your repository and change it with your app. That sidesteps the usual spiral of wrappers, style overrides, and mismatched APIs when defaults are not enough. This approach, where you keep and own the source code, means: * **Full transparency:** You see exactly how each component is built, with no hidden layers between you and the implementation. * **Easy customization:** Adjust any part of a component to match your design and functionality; you edit the source instead of working around a package API. * **AI-friendly workflows:** Because the code lives in your repo, LLMs and teammates can read, reason about, and help improve components without reverse-engineering a library. ## AI Ready [#ai-ready] The library is designed so **people and AI tools** can rely on it equally. Components are written to stay clear, readable, and predictable so assistants can understand structure, reason about changes, and modify files with less guesswork. Because the source sits in your repository with **inspectable implementations** and **consistent patterns** from component to component, models get the context they need to read your UI layer end to end. An assistant can learn how your pieces work, propose refactors or small fixes, or generate new components that match your existing tokens, layout, and conventions. # Installation (/docs/installation) ## Prerequisites [#prerequisites] Components require [Tailwind CSS v4](https://tailwindcss.com). Before you begin, make sure you have a project set up with Tailwind CSS installed. ## Adding components [#adding-components] ### CLI [#cli] ```bash npx shadcn@latest add @shark/ ``` ### Manual [#manual] Copy component source from the component docs via the Manual tab. ### All at once [#all-at-once] ```bash npx shadcn@latest add @shark/ui ``` ## New Project Setup [#new-project-setup] For new projects, you have the `CLI` and `Manual` setup. ### CLI [#cli-1] ```bash npx shadcn@latest init @shark/style ``` ### Manual [#manual-1] ## Styling [#styling] For theming and layout setup, see [Styling](/docs/styling). ## Color system [#color-system] See [Colors](/docs/colors) for the full palette and variable reference. # LLMs.txt (/docs/llms-txt) Shark UI provides [LLMs.txt](https://llmstxt.org/) endpoints so AI coding assistants can fetch documentation directly by URL. ## Available Files [#available-files] **Core documentation:** * [/llms.txt](/llms.txt) — Quick reference index for documentation * [/llms-full.txt](/llms-full.txt) — Complete Shark UI documentation **For limited context windows:** * [/llms-components.txt](/llms-components.txt) — Component documentation only * [/llms-patterns.txt](/llms-patterns.txt) — Common patterns and recipes **All platforms:** * [/llms.txt](/llms.txt) — Quick reference index * [/llms-full.txt](/llms-full.txt) — Complete documentation * [/llms-components.txt](/llms-components.txt) — All component documentation * [/llms-patterns.txt](/llms-patterns.txt) — All patterns and recipes ## Integration [#integration] **Claude Code:** Reference the docs in your prompt or add to your project’s `.claude` file: ```bash Use Shark UI documentation from https://shark.vini.one/llms.txt ``` **Cursor:** Use the `@Docs` feature: ```bash @Docs https://shark.vini.one/llms-full.txt ``` [Learn more](https://docs.cursor.com/context/@-symbols/@-docs) **Windsurf:** Add to your `.windsurfrules` file: ```bash #docs https://shark.vini.one/llms-full.txt ``` [Learn more](https://docs.codeium.com/windsurf/memories#memories-and-rules) **Other AI tools:** Most assistants accept documentation URLs: ```bash https://shark.vini.one/llms.txt ``` For component-specific documentation: ```bash https://shark.vini.one/llms-components.txt ``` For patterns and best practices: ```bash https://shark.vini.one/llms-patterns.txt ``` ## Contributing [#contributing] Spotted an issue with AI-generated code? Contributions to improve the LLMs.txt output are welcome on [GitHub](https://github.com/sharkui-inc/shark-ui). # RTL (/docs/rtl) ## Setup [#setup] Wrap your app with `LocaleProvider` and pass an RTL locale. Use this when you know the user’s language ahead of time or when the app switches locale dynamically. ```tsx showLineNumbers {4,6} import { LocaleProvider } from "@/components/ui/locale"; export const App = () => ( {/* Your app */} ); ``` Common RTL locales include `ar-BH`, `ar-SA`, `he-IL`, and `fa-IR`. > **Note:** If no `LocaleProvider` is set up, the default locale is `en-US` and the direction stays `ltr`. ## Applying Direction [#applying-direction] Read the current `dir` from `useLocale` and pass it to your root element—usually ``—so the layout renders correctly and child components inherit the right text direction. ```tsx import { LocaleProvider, useLocale } from "@/components/ui/locale"; const AppContent = () => { const { locale, dir } = useLocale(); return ( {/* Your app content */} ); }; ``` ## How it works [#how-it-works] Shark UI components rely on logical CSS properties wherever possible. That means spacing and layout use `ms-*`, `me-*`, `ps-*`, `pe-*`, and `start-*` / `end-*` instead of physical ones like `ml-*`, `mr-*`, `left-*`, or `right-*`. When you flip `dir` to `rtl`, the layout adapts automatically because those utilities follow the text direction. Setting `dir={dir}` on the root ensures that direction propagates down. Ark UI’s overlays, tooltips, and menus respect the document direction, so they position themselves correctly whether the user reads left-to-right or right-to-left. ## Animations [#animations] Animations should follow the reading direction. Physical utilities like `slide-in-from-right` will slide the wrong way in RTL. Use logical alternatives so motion stays consistent: * `slide-in-from-end` / `slide-out-to-end` instead of `slide-in-from-right` / `slide-out-to-right` * `slide-in-from-start` / `slide-out-to-start` instead of `slide-in-from-left` / `slide-out-to-left` *** For the full API reference, see the [Ark UI documentation](https://ark-ui.com/docs/utilities/locale). # Skills (/docs/skills) This skill covers Shark UI components, patterns, and styling. Your assistant uses it to implement those pieces correctly in your project. You can ask for something concrete: * *“Add a settings dialog with a form and save/cancel buttons.”* * *“Add a combobox with search filtering.”* * *“Migrate this shadcn dropdown to Shark’s Menu.”* * *“Add a Select with grouped options and a placeholder.”* ## Installation [#installation] ```bash npx skills add sharkui-inc/shark-ui ``` The public directory and leaderboard live at [skills.sh](https://skills.sh). ## What you get [#what-you-get] The layout matches other mature UI skills: a compact entry file and deeper material you load only when the task needs it. ### Component knowledge [#component-knowledge] Your assistant gets a map of the registry: what to import, how parts nest, and where the sharp edges are. Overlays (**Dialog** vs **Sheet**), menus (**Menu** vs **Context Menu**), list controls (**Select** vs **Combobox** with collections and filters), **Field**-driven forms, and **Sidebar** shells each have a short guide in the skill pack. That material stays aligned with the published component list in this project and the MDX on this site, so “what the skill says” and “what the docs say” stay in sync. ### Styling conventions [#styling-conventions] Tailwind CSS v4, semantic tokens, and the small habits that keep Shark visually consistent, plus the editorial rules we keep for examples and previews (thumbs, field widths, chart tooltips, sidebar preview framing, and similar detail). ### Migration patterns [#migration-patterns] When someone pastes radix, base-ui, or shadcn-shaped code, the skill nudges the rewrite toward **Shark UI**: collection objects for list primitives, and the chart or sidebar patterns we actually ship, not a generic “swap the import path” pass. ### CLI and registry [#cli-and-registry] The same workflow this site documents for adding components (shadcn-style CLI and the public registry JSON hosted here). The skill reminds agents to follow each component’s installation section, dependency list, and registry entry. ### Registry examples [#registry-examples] Every serious answer should look at the shipped examples that sit beside each component in source. Those snippets are the library’s own compositions; matching them keeps generated UI aligned with how Shark is maintained, not a one-line stub from a model’s training cut-off. ## How it works [#how-it-works] 1. **Activation:** After install, your agent discovers the skill the same way it discovers other Agent Skills. 2. **Progressive depth:** The **SKILL.md** file links into the registry index, shared rule files, and per-component notes only when the prompt touches that surface. 3. **Pattern enforcement:** The assistant follows Shark composition, combobox collection and filtering, chart tooltip wiring where applicable, sidebar preview layout, and the import conventions. 4. **Examples before invention:** The workflow tells the model to read the MDX for the component and the matching example snippets. ## Supported agents [#supported-agents] Any editor or CLI that implements the [Agent Skills](https://agentskills.io) layout can consume this bundle: Claude Code, Cursor, Codex, Cline, Windsurf, GitHub Copilot, and the rest of the list on [skills.sh](https://skills.sh). ## In the repository [#in-the-repository] The skill is versioned in the same open-source project as Shark UI. If you want to read or change it, open the project on [GitHub](https://github.com/sharkui-inc/shark-ui/tree/main/skills/shark-ui). # Styling (/docs/styling) ## Overview [#overview] Shark UI’s styling system is built for clarity and consistent theming. It follows [shadcn/ui theme tokens](https://ui.shadcn.com/docs/theming#theme-tokens) and adds three extra tokens: `success`, `warning`, and `info` to cover status states. ## CSS Configuration [#css-configuration] See [Installation](/docs/installation#new-project-setup) for installing with CLI. To add the theme yourself, paste the following into `globals.css`: ```css title="globals.css" @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-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --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); --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-xs: calc(var(--radius) * 0.25); --radius-sm: calc(var(--radius) * 0.5); --radius-md: calc(var(--radius) * 0.75); --radius-lg: calc(var(--radius) * 1); --radius-xl: calc(var(--radius) * 1.5); --radius-2xl: calc(var(--radius) * 2); --radius-3xl: calc(var(--radius) * 3); --radius-4xl: calc(var(--radius) * 4); } :root { --radius: 0.5rem; --background: var(--color-neutral-50); --foreground: var(--color-neutral-800); --card: var(--color-neutral-50); --card-foreground: var(--color-neutral-800); --popover: var(--color-neutral-50); --popover-foreground: var(--color-neutral-800); --primary: var(--color-neutral-800); --primary-foreground: var(--color-neutral-50); --secondary: color-mix( in srgb, var(--color-neutral-950) 6%, var(--background) ); --secondary-foreground: var(--color-neutral-800); --muted: color-mix(in srgb, var(--color-neutral-950) 6%, var(--background)); --muted-foreground: color-mix( in srgb, var(--color-neutral-500) 80%, var(--color-neutral-950) ); --accent: color-mix(in srgb, var(--color-neutral-950) 6%, var(--background)); --accent-foreground: var(--color-neutral-800); --destructive: var(--color-red-500); --destructive-foreground: var(--color-red-700); --info: var(--color-blue-500); --info-foreground: var(--color-blue-700); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-700); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-700); --border: color-mix(in srgb, var(--color-neutral-950) 12%, var(--background)); --input: color-mix(in srgb, var(--color-neutral-950) 13%, var(--background)); --ring: var(--color-neutral-400); --sidebar: var(--color-neutral-50); --sidebar-foreground: color-mix( in srgb, var(--color-neutral-800) 64%, var(--sidebar) ); --sidebar-primary: var(--color-neutral-800); --sidebar-primary-foreground: var(--color-neutral-50); --sidebar-accent: color-mix( in srgb, var(--color-neutral-950) 6%, var(--sidebar) ); --sidebar-accent-foreground: var(--color-neutral-800); --sidebar-border: color-mix( in srgb, var(--color-neutral-950) 11%, var(--sidebar) ); --sidebar-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); } .dark { --background: var(--color-neutral-950); --foreground: var(--color-neutral-100); --card: color-mix(in srgb, var(--background) 98%, var(--color-neutral-50)); --card-foreground: var(--color-neutral-100); --popover: color-mix( in srgb, var(--background) 96%, var(--color-neutral-50) ); --popover-foreground: var(--color-neutral-100); --primary: var(--color-neutral-100); --primary-foreground: var(--color-neutral-800); --secondary: color-mix(in srgb, var(--color-white) 8%, var(--background)); --secondary-foreground: var(--color-neutral-100); --muted: color-mix(in srgb, var(--color-neutral-50) 8%, var(--background)); --muted-foreground: color-mix( in srgb, var(--color-neutral-500) 70%, var(--color-neutral-50) ); --accent: color-mix(in srgb, var(--color-neutral-50) 8%, var(--background)); --accent-foreground: var(--color-neutral-100); --destructive: color-mix( in srgb, var(--color-red-600) 90%, var(--color-neutral-50) ); --destructive-foreground: var(--color-red-400); --info: var(--color-blue-500); --info-foreground: var(--color-blue-400); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-400); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-400); --border: color-mix(in srgb, var(--color-neutral-50) 12%, var(--background)); --input: color-mix(in srgb, var(--color-neutral-50) 13%, var(--background)); --ring: var(--color-neutral-500); --sidebar: color-mix( in srgb, var(--color-neutral-950) 97%, var(--color-neutral-50) ); --sidebar-foreground: color-mix( in srgb, var(--color-neutral-100) 64%, var(--sidebar) ); --sidebar-primary: var(--color-neutral-100); --sidebar-primary-foreground: var(--color-neutral-800); --sidebar-accent: color-mix( in srgb, var(--color-neutral-50) 8%, var(--sidebar) ); --sidebar-accent-foreground: var(--color-neutral-100); --sidebar-border: color-mix( in srgb, var(--color-neutral-50) 11%, var(--sidebar) ); --sidebar-ring: var(--color-neutral-400); --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); } ``` {/* TODO: work on font-heading ## Font Variables The theme preset defines `--font-sans` with system fallbacks. To use custom typefaces, set this variable in your layout via `next/font` or `@fontsource-variable`: ```tsx title="app/layout.tsx" import { Inter } from "next/font/google"; const fontSans = Inter({ variable: "--font-sans", subsets: ["latin"] }); export default function RootLayout({ children }) { return ( {children} ); } ``` */} ## Token convention [#token-convention] Each color has two tokens: the base name is the **fill**. The same name with **`-foreground`** is the **text** and **icon** color meant to sit on that fill. Use both together on every new surface so content stays readable. ```tsx
``` ## Adding new tokens [#adding-new-tokens] New variables must be wired through **`@theme inline`** as `--color-*` entries. See [Tailwind CSS](https://tailwindcss.com/docs/theme) ```css title="globals.css" @theme inline { --color-brand: var(--brand); --color-brand-foreground: var(--brand-foreground); } :root { --brand: oklch(0.55 0.18 250); --brand-foreground: oklch(0.99 0 0); } ``` ## Customizing colors [#customizing-colors] Override variables on `:root` and `.dark`. Always update foreground when you change a fill. ```css title="globals.css" :root { --primary: oklch(76.8% 0.233 130.85); --primary-foreground: oklch(98.6% 0.031 120.757); } .dark { --primary: oklch(53.2% 0.157 131.589); --primary-foreground: oklch(96.7% 0.067 122.328); } ``` ## Radius Scale [#radius-scale] `--radius` is the base radius token for your theme. We derive a small radius scale from it so components can use consistent corner sizes while still sharing a single source of truth. ```css title="app/globals.css" showLineNumbers @theme inline { --radius-xs: calc(var(--radius) * 0.25); --radius-sm: calc(var(--radius) * 0.5); --radius-md: calc(var(--radius) * 0.75); --radius-lg: calc(var(--radius) * 1); --radius-xl: calc(var(--radius) * 1.5); --radius-2xl: calc(var(--radius) * 2); --radius-3xl: calc(var(--radius) * 3); --radius-4xl: calc(var(--radius) * 4); } :root { --radius: 0.5rem; } ``` This means: * `radius-lg` is the base value. * Smaller radius scale down from `--radius`. * Larger radius scale up from `--radius`. * Changing `--radius` updates the entire radius scale. ## Color system [#color-system] See [Colors](/docs/colors) for the full token reference, and naming rules. # January 2026 - Beta 1 (/docs/changelog/26-01-first-beta) Beta 1 marks the first public release of Shark UI. The goal was to build a set of components on [Ark UI](https://ark-ui.com) styled with [Tailwind CSS](https://tailwindcss.com), so you can add accessible primitives to a project without wiring up styles from scratch. ## Components [#components] Roughly 80+ components are available, grouped into several categories: * **UI primitives**: Accordion, Alert, Avatar, Badge, Button, Card, Separator, Skeleton, Tabs * **Overlays and dialogs**: Dialog, Menu, Popover, Sheet, Tooltip, Hover Card, Context Menu * **Forms and inputs**: Input, Textarea, Checkbox, Radio Group, Select, Native Select, Field, Combobox, Input OTP, File Upload, Editable * **Layout and navigation**: Sidebar, Scroll Area, Resizable, Pagination, Breadcrumb, Bottom Navigation * **Feedback and display**: Progress, Slider, Rating Group, Toggle, Toggle Group, Steps, Carousel Components are copy-paste: they land in your project, and you own the code. Tailwind and Ark UI are the only runtime dependencies. ## Theme editor [#theme-editor] The theme editor lets you tweak colors and copy the resulting CSS variables into your project. Themes follow the shadcn color convention, with extra variables for success, warning, info, and destructive states. ## Limitations [#limitations] This is a beta. Some components may change before a stable release. If you run into issues, open an issue on [GitHub](https://github.com/sharkui-inc/shark-ui). # March 2026 - Release Candidate (/docs/changelog/26-03-rc) This release candidate builds on Beta 1 with new components, utilities, theme editor enhancements, and improved documentation. The component registry has been restructured with thumbs and consistent example naming. ## New Components [#new-components] * **Announcement** — Banner-style component for promotions and notices * **Calendar** — Full calendar with month/year navigation and range selection * **Color Picker** — Color selection with swatches and input fields * **Date Picker** — Date input with calendar popover and presets * **Drawer** — Slide-out panel for mobile-first layouts * **Image Cropper** — Crop images with zoom, aspect ratio, and constraints * **Prose** — Typography styles for markdown and long-form content * **Signature Pad** — Canvas-based signature capture * **Skip Nav** — Accessibility link to skip to main content * **Timer** — Countdown, interval, and Pomodoro timers ## New Utilities [#new-utilities] * **Client Only** — Render components only on the client * **Format** — Date, number, and relative time formatting * **Show** — Conditional rendering with animation support * **Download Trigger** — Programmatic file downloads * **Swap** — Toggle between two states with animation * **Presence** — Mount/unmount with enter/exit animations * **JSON Tree View** — Expandable JSON display * **Highlight** — Syntax highlighting for code blocks ## Component Updates [#component-updates] Registry examples and thumbs were standardized across components: * **Button** — Variants, sizes, and icon support * **Card** — Composition and theming * **Combobox** — Multi-select and controlled state * **Dialog** — Sizes and compositions * **Field** — Required fields and validation * **Floating Panel** — Positions and resize behavior * **Input Group** — Button integration and addons * **Menu** — Nested menus and keyboard navigation * **Number Input** — Stepper and format options * **Pagination** — Sizes and variants * **Select** — Multi-select and custom items * **Textarea** — Autoresize and validation * **Toast** — Placement, types, and promises * **Toggle** — Sizes, outline, and icon variants * **Tooltip** — Positioning and keyboard support * **Tour** — Step types, progress, and async steps ## Theme Editor [#theme-editor] * Updated color variable system and theme presets * Support for success, warning, info, and destructive states * Prose typography styles for content blocks ## Home Page [#home-page] * Redesigned hero with Announcement component * Component examples (Input OTP, forms, calendar, charts, and more) * Framework support badges (React, Solid, Vue, Svelte) * Theme cards for activity, chat, and sharing examples ## Documentation [#documentation] * **Forms** — New forms section with React Hook Form and TanStack Form guides * **RTL** — Right-to-left layout support * Component docs updated with API references and examples * New installation guides for various frameworks ## Infrastructure [#infrastructure] * Open Graph image generation for docs and changelog * RSS feed and sitemap generation * LLMs.txt route for AI crawlers ## Dependencies [#dependencies] * Package updates for Next.js, React, Ark UI, and dev tooling # May 2026 - Post-RC updates (/docs/changelog/26-05-post-rc) This update follows the March release candidate with ecosystem listing, a new Hitbox utility, expanded hooks and agent documentation, site improvements, and many fixes across theming and components. ## Registry & ecosystem [#registry--ecosystem] * **shadcn registry** — Shark UI is wired into the broader shadcn registry configuration via `components.json` * **Registry build** — Manifest and `public/r/*.json` metadata refreshed; registry build script updated for maintainers ## New utility [#new-utility] * **Hitbox** — Enlarge tap and click targets without changing layout; includes docs, registry examples, and dedicated styles ## Hooks & CLI-facing docs [#hooks--cli-facing-docs] * **use-is-mobile** — Documented hook for responsive behavior * **style**, **ui**, **utils** — Registry items exposed for CLI installs alongside other meta updates ## Site & product [#site--product] * **Blocks** — Early `/blocks` route scaffold for the blocks experience * **Analytics** — Site analytics integration * **Funding** — Ko-fi support link in project metadata * **Agent skill** — Shark UI skill for Cursor and expanded primitive references for contributors and coding agents ## Documentation & layout [#documentation--layout] * **Installation & components** — Dedicated overview pages for installation and the component index (`ComponentsList`), with framework guides remaining under Installation * **Docs shell** — Fixes for table of contents when headings are sparse, component doc routing, CLI copy snippets, and content replacement behavior * **Layout** — Global scrollbar and overflow refinements on the docs body ## Components & theming [#components--theming] * **Theme** — Switcher reliability and reduced first-paint flicker; border and input CSS variables; background token alignment * **Dialog** — RTL layout fix * **Table** — Spacing and header text treatment * **CodeBlock** / **Highlight** — Standardized prop for line numbers * **Badge** — Improved touch behavior for coarse pointers * **Combobox** — Follow-up fixes and examples after the combobox workstream * **Announcement** — Updates from community PRs * **Drawer**, **Toast**, **Sidebar**, **Timer**, **Prose** — Props, examples, and styling tweaks * **data-slot** — Consistency fix for slot-based styling hooks ## Dependencies & infrastructure [#dependencies--infrastructure] * Dependency updates and small component refactors * CI workflow adjustments for contributor runs # Changelog (/docs/changelog) Releases are listed by date, newest first. Each entry describes what changed—components added or updated, breaking changes, and fixes. For release tags and diffs, check the [Shark UI repository](https://github.com/sharkui-inc/shark-ui) on GitHub. # Accordion (/docs/components/accordion) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/accordion ``` Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Add the following animations to your `globals.css` . ```css title="globals.css" showLineNumbers @theme inline { --animate-slide-up: slideUp 0.2s ease-out; --animate-slide-down: slideDown 0.2s ease-out; @keyframes slideUp { from { height: var(--height); } to { height: 0; } } @keyframes slideDown { from { height: 0; } to { height: var(--height); } } } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Accordion └── AccordionItem ├── AccordionTrigger └── AccordionContent ``` ## Usage [#usage] ```tsx import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@/components/ui/accordion"; ``` ```tsx Is it accessible? Yes. It adheres to the WAI-ARIA design pattern. ``` ## Controlled [#controlled] Use the `value` and `onValueChange` props to control the accordion state programmatically. ## States [#states] ### Disabled [#disabled] ## Examples [#examples] ### Non-collapsible [#non-collapsible] Set the `collapsible` prop to `false` to disable the collapsible behavior. ### Multiple [#multiple] Use the `multiple` prop to allow multiple items to be open simultaneously. ### Card [#card] Wrap the `Accordion` in a `Card` component. ## API Reference [#api-reference] ### Accordion [#accordion] Root component. | Prop | Type | Default | | --------------- | -------------------- | ------- | | `value` | `string[]` | `-` | | `defaultValue` | `string[]` | `-` | | `collapsible` | `boolean` | `true` | | `multiple` | `boolean` | `false` | | `onValueChange` | `ValueChangeDetails` | `-` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AccordionItem [#accordionitem] Single accordion item. | Prop | Type | Default | | ----------- | --------- | ------------ | | `value` | `string` | **required** | | `disabled` | `boolean` | `false` | | `className` | `string` | `-` | ### AccordionTrigger [#accordiontrigger] Toggles the item open/closed on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `disabled` | `boolean` | `false` | | `className` | `string` | `-` | ### AccordionContent [#accordioncontent] Holds the collapsible content for the item. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/accordion#api-reference). # Action Bar (/docs/components/action-bar) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/action-bar ``` This component depends on [Badge](/docs/components/badge) , and [Separator](/docs/components/separator) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text ActionBar ├── ActionBarTrigger └── ActionBarContent ├── ActionBarValue ├── ActionBarSeparator ├── ActionBarBody │ ├── Button ├── ActionBarSeparator └── ActionBarClose ``` ## Usage [#usage] ```tsx import { ArchiveIcon, DownloadIcon, PencilIcon, Trash2Icon, XIcon, } from "lucide-react"; import { ActionBar, ActionBarBody, ActionBarClose, ActionBarContent, ActionBarSeparator, ActionBarTrigger, ActionBarValue, } from "@/components/ui/action-bar"; import { Button } from "@/components/ui/button"; ``` ```tsx ``` ## Controlled [#controlled] ## Examples [#examples] ### Positioning [#positioning] Use the `positioning.placement` prop to position the action bar. ### Gutter [#gutter] Use `positioning.gutter` to control the distance from the bottom edge. ### Close Trigger [#close-trigger] ### With Dialog [#with-dialog] ### With Menu [#with-menu] ### Table [#table] ### Custom Spacing [#custom-spacing] The `[--space:--spacing("value")]` on `ActionBarContent` controls the internal spacing. Default spacing is `--spacing(2)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### ActionBar [#actionbar] Root component. Provides open state and positioning to descendants. | Prop | Type | Default | | --------------- | ------------------------- | ----------------------------------------- | | `open` | `boolean` | - | | `defaultOpen` | `boolean` | `false` | | `positioning` | `ActionBarPositioning` | `{ placement: "bottom", gutter: "16px" }` | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `closeOnEscape` | `boolean` | `true` | | `onOpenChange` | `(open: boolean) => void` | - | ### ActionBarContent [#actionbarcontent] Root component. | Prop | Type | Default | | ------------ | --------- | ------- | | `className` | `string` | - | | `aria-label` | `string` | - | | `asChild` | `boolean` | - | | CSS variable | Default | | ------------ | -------------- | | `--space` | `--spacing(2)` | ### ActionBarTrigger [#actionbartrigger] Button that opens the action bar. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ActionBarValue [#actionbarvalue] Displays the selection count. | Prop | Type | Default | | ----------- | --------- | ------- | | `count` | `number` | - | | `label` | `string` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ActionBarSeparator [#actionbarseparator] Vertical rule. Renders a [Separator](/docs/components/separator). | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ActionBarBody [#actionbarbody] Flex row for primary actions. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ActionBarClose [#actionbarclose] Closes the action bar. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | # Alert Dialog (/docs/components/alert-dialog) Alert Dialog is built on top of the [Dialog](/docs/components/dialog) component. Check it out for more examples. ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/alert-dialog ``` This component depends on [Button](/docs/components/button) and [Dialog](/docs/components/dialog) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text AlertDialog ├── AlertDialogTrigger └── AlertDialogContent ├── AlertDialogHeader │ ├── AlertDialogTitle │ └── AlertDialogDescription ├── AlertDialogBody ├── AlertDialogFooter │ ├── AlertDialogCancel │ └── AlertDialogAction └── AlertDialogClose ``` ## Usage [#usage] ```tsx import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogBody, AlertDialogFooter, AlertDialogAction, AlertDialogCancel, } from "@/components/ui/alert-dialog"; ``` ```tsx Allow accessory to connect? Do you want to allow the USB accessory to connect to this device? Don't allow Allow ``` ## Title & Description [#title--description] `AlertDialogHeader` supports two usage patterns: ### Using props [#using-props] Pass `title` and `description` props directly to `AlertDialogHeader`. ```tsx showLineNumbers ``` > This approach does not require `AlertDialogTitle` or `AlertDialogDescription` components. ### Using components [#using-components] Use `AlertDialogTitle` and `AlertDialogDescription` as children for more control. ```tsx showLineNumbers Allow accessory to connect? Do you want to allow the USB accessory to connect to this device? ``` ## Examples [#examples] ### Destructive [#destructive] ## API Reference [#api-reference] ### AlertDialogAction [#alertdialogaction] Primary action. | Prop | Type | Default | | ----------- | ---------------------------- | ----------- | | `variant` | `"default" \| "destructive"` | `"default"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AlertDialogCancel [#alertdialogcancel] Cancel action. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Dialog API Reference](/docs/components/dialog#api-reference). # Alert (/docs/components/alert) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/alert ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --destructive-foreground: var(--color-red-700); --info: var(--color-blue-500); --info-foreground: var(--color-blue-700); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-700); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-700); } .dark { --destructive-foreground: var(--color-red-400); --info: var(--color-blue-500); --info-foreground: var(--color-blue-400); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-400); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-400); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Alert ├── Icon ├── AlertTitle ├── AlertDescription └── AlertAction ``` ## Usage [#usage] ```tsx import { Alert, AlertTitle, AlertDescription, AlertAction, } from "@/components/ui/alert"; ``` ```tsx Heads up! You can add icons to alerts. ``` ## Variants [#variants] ### Default [#default] ### Info [#info] ### Warning [#warning] ### Success [#success] ### Destructive [#destructive] ## Examples [#examples] ### With icon [#with-icon] ### With action [#with-action] ### Custom color [#custom-color] ## API Reference [#api-reference] ### Alert [#alert] Root component. | Prop | Type | Default | | ----------- | ---------------------------------------------------------------- | ----------- | | `variant` | `"default" \| "info" \| "warning" \| "success" \| "destructive"` | `"default"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AlertTitle [#alerttitle] Title text. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AlertDescription [#alertdescription] Description text. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AlertAction [#alertaction] Container for action buttons. Automatically positioned to the right on larger screens. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Announcement (/docs/components/announcement) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/announcement ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Announcement ├── Badge └── AnnouncementTitle ``` ## Usage [#usage] ```tsx import { Announcement, AnnouncementTitle, } from "@/components/ui/announcement"; ``` ```tsx New feature added ``` ## Variants [#variants] ### Info [#info] ### Success [#success] ### Warning [#warning] ### Destructive [#destructive] ## Examples [#examples] ### With icon [#with-icon] ### With link [#with-link] The `asChild` prop renders a link with announcement styling. ### Without Badge [#without-badge] The announcement supports a title-only layout without the badge component. ## API Reference [#api-reference] ### Announcement [#announcement] Root wrapper for announcement banners or notices. | Prop | Type | Default | | ----------- | --------------------- | ---------- | | `role` | `"status" \| "alert"` | `"status"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AnnouncementTitle [#announcementtitle] Main title or message of the announcement. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Aspect Ratio (/docs/components/aspect-ratio) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/aspect-ratio ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { AspectRatio } from "@/components/ui/aspect-ratio"; ``` ```tsx Description ``` ## Examples [#examples] ### Square [#square] ### Portrait [#portrait] ### Video [#video] ### Responsive [#responsive] Use `[--ratio:*]` with breakpoints to change the ratio at different screen sizes. > You can use breakpoint utilities to change the aspect ratio at different screen sizes. ```css md:[--ratio:16/9] lg:[--ratio:16/9] ``` ## API Reference [#api-reference] ### AspectRatio [#aspectratio] Root component. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | | Attribute | Description | | --------- | ----------- | | `--ratio` | `1` | # Autocomplete (/docs/components/autocomplete) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/autocomplete ``` This component depends on [Combobox](/docs/components/combobox) , and [Separator](/docs/components/separator) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Autocomplete ├── AutocompleteInput └── AutocompleteContent ├── AutocompleteEmpty └── AutocompleteList └── AutocompleteGroup ├── AutocompleteGroupLabel └── AutocompleteItem ``` ## Usage [#usage] ```tsx import { useFilter, useListCollection } from "@ark-ui/react"; import { Autocomplete, AutocompleteContent, AutocompleteEmpty, AutocompleteGroup, AutocompleteInput, AutocompleteItem, AutocompleteList, } from "@/components/ui/autocomplete"; ``` ```tsx const { contains } = useFilter({ sensitivity: "base" }); const { collection, filter } = useListCollection({ initialItems: [ { label: "Apple", value: "apple" }, { label: "Banana", value: "banana" }, ], filter: contains, }); filter(inputValue)} > {items.map((item) => ( {item.label} ))} ``` ## Controlled [#controlled] Control the selected value with `value` and `onValueChange` props. ## States [#states] ### Invalid [#invalid] ### Disabled [#disabled] ## Sizes [#sizes] ### Small [#small] ### Medium [#medium] ### Large [#large] ## Examples [#examples] ### Group [#group] ### With Field [#with-field] Use [Field](/docs/components/field) components to style with the field components. ### With clear button [#with-clear-button] Pass `showClear` to `AutocompleteInput` to show a clear button. ### With trigger [#with-trigger] Pass `showTrigger` to `AutocompleteInput` to show the dropdown trigger button. ### With start icon [#with-start-icon] Use `InputGroupAddon` to add a start icon to the input. ## API Reference [#api-reference] ### Autocomplete [#autocomplete] Root component. | Prop | Type | Default | | -------------------- | -------------------------------------------- | ------------ | | `collection` | `ListCollection` | **required** | | `value` | `string[]` | - | | `defaultValue` | `string[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `onInputValueChange` | `(details: InputValueChangeDetails) => void` | - | | `disabled` | `boolean` | - | | `openOnClick` | `boolean` | `true` | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `className` | `string` | - | ### AutocompleteInput [#autocompleteinput] Input with dropdown trigger and clear button. | Prop | Type | Default | | ------------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `showTrigger` | `boolean` | `false` | | `showClear` | `boolean` | `false` | | `disabled` | `boolean` | - | | `className` | `string` | - | ### AutocompleteContent [#autocompletecontent] Holds the dropdown options. Displayed in a portal. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### AutocompleteGroup [#autocompletegroup] Groups related items. Use with `groupBy` on the collection. | Prop | Type | Default | | ----------- | --------------------- | ------- | | `heading` | `string \| ReactNode` | - | | `className` | `string` | - | ### AutocompleteGroupLabel [#autocompletegrouplabel] Label for a group of options. Use inside `AutocompleteGroup`. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### AutocompleteItem [#autocompleteitem] Single selectable option in the dropdown list. | Prop | Type | Default | | ----------- | --------- | ------------ | | `item` | `T` | **required** | | `className` | `string` | - | | `asChild` | `boolean` | - | ### AutocompleteEmpty [#autocompleteempty] Shown when no options match the current filter. Use for empty state. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/combobox#api-reference). # Avatar (/docs/components/avatar) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/avatar ``` This component depends on [Status](/docs/components/status) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Avatar ├── AvatarImage └── AvatarFallback AvatarGroup ├── AvatarGroupCount └── Avatar ├── AvatarImage ├── AvatarFallback └── AvatarBadge ``` ## Usage [#usage] ```tsx import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar"; ``` ```tsx VV ``` ## Sizes [#sizes] ### Small [#small] ### Medium [#medium] ### Large [#large] ## Examples [#examples] ### Avatar Group [#avatar-group] ### Badge [#badge] ### Badge with Icon [#badge-with-icon] ### Fallback with Icon [#fallback-with-icon] ### Avatar Group Count [#avatar-group-count] ### Avatar Group Count Icon [#avatar-group-count-icon] ### Avatar with Popover [#avatar-with-popover] ### Avatar with Hover Card [#avatar-with-hover-card] ### Custom Size [#custom-size] Use `size-*` to set the size of the avatar. > You can use breakpoint utilities to change the size at different screen sizes. ```css md:size-4 lg:size-8 ``` ### Custom Radius [#custom-radius] Use `rounded-*` to set the radius of the avatar. > You can use breakpoint utilities to change the radius at different screen sizes. ```css md:rounded-full lg:rounded-lg ``` ## API Reference [#api-reference] ### Avatar [#avatar] Container for user or entity profile image. Supports sizes and fallback. | Prop | Type | Default | | ----------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AvatarImage [#avatarimage] Profile image. Shown when URL loads; fallback used on error. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AvatarFallback [#avatarfallback] Shown when the image fails to load or is loading. Often initials or icon. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AvatarGroup [#avatargroup] Groups avatars with overlap and optional count badge. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AvatarGroupCount [#avatargroupcount] Shows "+N" when more avatars exist than displayed. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### AvatarBadge [#avatarbadge] Status or indicator badge overlaid on the avatar corner. | Prop | Type | Default | | ----------- | ---------------------------------------------------------------- | ----------- | | `variant` | `"default" \| "success" \| "info" \| "warning" \| "destructive"` | `"default"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/avatar#api-reference). # Badge (/docs/components/badge) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/badge ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --destructive-foreground: var(--color-red-700); --info: var(--color-blue-500); --info-foreground: var(--color-blue-700); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-700); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-700); } .dark { --destructive-foreground: var(--color-red-400); --info: var(--color-blue-500); --info-foreground: var(--color-blue-400); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-400); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-400); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Badge } from "@/components/ui/badge"; ``` ```tsx Favorite ``` ## Variants [#variants] ### Default [#default] ### Secondary [#secondary] ### Outline [#outline] ### Success [#success] ### Info [#info] ### Warning [#warning] ### Destructive [#destructive] ## Sizes [#sizes] The `size` prop controls the badge dimensions. ### Small [#small] ### Medium [#medium] ### Large [#large] ## Pill [#pill] The `pill` prop creates fully rounded badges. ## Examples [#examples] ### With link [#with-link] The `asChild` prop renders another element with badge styling. ### With icon [#with-icon] ### With spinner [#with-spinner] ### Custom color [#custom-color] ## API Reference [#api-reference] ### Badge [#badge] Label, count, or status badge. Supports variants. | Prop | Type | Default | | ----------- | -------------------------------------------------------------------------------------------- | ----------- | | `variant` | `"default" \| "secondary" \| "outline" \| "success" \| "info" \| "warning" \| "destructive"` | `"default"` | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Bottom Navigation (/docs/components/bottom-navigation) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/bottom-navigation ``` This component depends on [Tabs](/docs/components/tabs) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text BottomNavigation └── BottomNavigationList └── BottomNavigationItem ├── BottomNavigationItemIcon └── BottomNavigationItemLabel ``` ## Usage [#usage] ```tsx import { BottomNavigation, BottomNavigationList, BottomNavigationItem, BottomNavigationItemIcon, BottomNavigationItemLabel, } from "@/components/ui/bottom-navigation"; ``` ```tsx Home Notifications ``` ## Disclaimer [#disclaimer] > Don't include `position: absolute` on the `BottomNavigationList`. It's just for the examples. ## Examples [#examples] ### Icon only [#icon-only] Use `aria-label` on the `BottomNavigationItem` to give the item a label for screen readers. ### With links [#with-links] Use the `asChild` prop on `BottomNavigationItem` with `Link`. ## API Reference [#api-reference] ### BottomNavigation [#bottomnavigation] Root wrapper for the bottom navigation bar. | Prop | Type | Default | | --------------- | --------------------------------------- | ------- | | `value` | `string` | `-` | | `defaultValue` | `string` | `-` | | `onValueChange` | `(details: ValueChangeDetails) => void` | `-` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BottomNavigationList [#bottomnavigationlist] Fixed bar at the bottom. Typically holds nav items. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BottomNavigationItem [#bottomnavigationitem] Single navigation link or button. | Prop | Type | Default | | ----------- | --------- | ------------ | | `value` | `string` | **required** | | `disabled` | `boolean` | `false` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BottomNavigationItemIcon [#bottomnavigationitemicon] Holds the item icon. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BottomNavigationItemLabel [#bottomnavigationitemlabel] Holds the item label text. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/tabs#api-reference). # Breadcrumb (/docs/components/breadcrumb) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/breadcrumb ``` Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Breadcrumb └── BreadcrumbList └── BreadcrumbItem ├── BreadcrumbLink ├── BreadcrumbPage ├── BreadcrumbSeparator └── BreadcrumbEllipsis ``` ## Usage [#usage] ```tsx import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; ``` ```tsx Home Components Breadcrumb ``` ## Examples [#examples] ### With custom separator [#with-custom-separator] ### With links [#with-links] ### Collapsed [#collapsed] ### With menu [#with-menu] ## API Reference [#api-reference] ### Breadcrumb [#breadcrumb] Navigation landmark for the breadcrumb trail. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BreadcrumbList [#breadcrumblist] Ordered list of breadcrumb segments. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BreadcrumbItem [#breadcrumbitem] Wraps a single breadcrumb link or page. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BreadcrumbLink [#breadcrumblink] Link to a parent page in the hierarchy. | Prop | Type | Default | | ----------- | --------- | ------- | | `href` | `string` | `-` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BreadcrumbPage [#breadcrumbpage] Current page. Not a link; marked with `aria-current="page"` for accessibility. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BreadcrumbSeparator [#breadcrumbseparator] Visual separator between segments. | Prop | Type | Default | | ----------- | ----------------- | -------------- | | `children` | `React.ReactNode` | `ChevronRight` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### BreadcrumbEllipsis [#breadcrumbellipsis] Shows when middle segments are collapsed. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Button Group (/docs/components/button-group) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/button-group ``` This component depends on [Separator](/docs/components/separator) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text ButtonGroup └── Button or Input ├── ButtonGroupText └── ButtonGroupSeparator ``` ## Usage [#usage] ```tsx import { ButtonGroup, ButtonGroupSeparator, } from "@/components/ui/button-group"; ``` ```tsx ``` ## Accessibility [#accessibility] * Use `aria-label` or `aria-labelledby` to label the group. ```tsx showLineNumbers ``` ## Orientation [#orientation] ### Horizontal [#horizontal] ### Vertical [#vertical] ## Examples [#examples] ### Nested [#nested] ### Separator [#separator] Buttons with variant `outline` do not need a separator since they have a border. ### With Input [#with-input] ### With Menu [#with-menu] ### With Popover [#with-popover] A popover trigger button can be added to a button group for contextual information or actions. ## API Reference [#api-reference] ### ButtonGroup [#buttongroup] Groups buttons together. Uses fieldset for accessibility when applicable. | Prop | Type | Default | | ------------- | ---------------------------- | -------------- | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### ButtonGroupSeparator [#buttongroupseparator] Visual divider between buttons. Uses [Separator](/docs/components/separator) internally. | Prop | Type | Default | | ------------- | ---------------------------- | ------------ | | `orientation` | `"horizontal" \| "vertical"` | `"vertical"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Button (/docs/components/button) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/button ``` This component depends on [Spinner](/docs/components/spinner) . Install it first if you haven't already. Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --destructive-foreground: var(--color-red-700); --info: var(--color-blue-500); --info-foreground: var(--color-blue-700); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-700); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-700); } .dark { --destructive-foreground: var(--color-red-400); --info: var(--color-blue-500); --info-foreground: var(--color-blue-400); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-400); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-400); } ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Button } from "@/components/ui/button"; ``` ```tsx ``` ## Link [#link] The `asChild` prop renders another element with button styling. ## States [#states] ### Disabled [#disabled] ### Loading [#loading] ## Variants [#variants] ### Default [#default] ### Outline [#outline] ### Secondary [#secondary] ### Ghost [#ghost] ### Link [#link-1] ### Destructive [#destructive] ## Sizes [#sizes] ### Extra Small [#extra-small] ### Small [#small] ### Large [#large] ### Extra Large [#extra-large] ## Pill [#pill] ## Disabling click effect [#disabling-click-effect] ## Examples [#examples] ### Icon only [#icon-only] Add `aria-label` prop to the button so screen readers can identify the button. ### With icon [#with-icon] ### Touch hitbox [#touch-hitbox] For increasing the tap target area, use [Hitbox](/docs/utilities/hitbox). ### Custom color [#custom-color] ## API Reference [#api-reference] | Prop | Type | Default | | ------------- | ------------------------------------------------------------------------------------------------------- | ----------- | | `variant` | `"default" \| "outline" \| "secondary" \| "ghost" \| "link" \| "destructive"` | `"default"` | | `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "icon-xs" \| "icon-sm" \| "icon-md" \| "icon-lg" \| "icon-xl"` | `"md"` | | `clickEffect` | `boolean` | `true` | | `isLoading` | `boolean` | `false` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Calendar (/docs/components/calendar) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/calendar ``` This component depends on [Button](/docs/components/button) and [Native Select](/docs/components/native-select) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Calendar ├── CalendarViewControl │ ├── CalendarPrevTrigger │ ├── CalendarMonthSelect │ ├── CalendarYearSelect │ ├── CalendarViewDate │ └── CalendarNextTrigger └── CalendarTable ├── CalendarWeekDays └── CalendarTableDays ``` ## Usage [#usage] ```tsx import { Calendar, CalendarNextTrigger, CalendarPrevTrigger, CalendarTable, CalendarTableDays, CalendarViewControl, CalendarViewDate, CalendarWeekDays, } from "@/components/ui/calendar"; ``` ```tsx showLineNumbers ``` ## Controlled [#controlled] ## Examples [#examples] ### Date Range [#date-range] ### Month and Year Selector [#month-and-year-selector] ### With Presets [#with-presets] ### Multiple Months [#multiple-months] ### Min and Max [#min-and-max] ### Select Today [#select-today] ### Fixed Weeks [#fixed-weeks] ### Booked Dates [#booked-dates] ### Custom Cell Size [#custom-cell-size] Use `[--cell-size:--spacing("value")]` to set the size of the calendar cells. Default value is `--spacing(9)`. > You can use breakpoint utilities to change the cell size at different screen sizes. ```css md:[--cell-size:--spacing(10)] lg:[--cell-size:--spacing(12)] ``` ## API Reference [#api-reference] ### Calendar [#calendar] Root component. Manages date view, selection, and navigation. | Prop | Type | Default | | ---------------------- | --------------------------------------- | ---------- | | `value` | `DateValue[]` | - | | `defaultValue` | `DateValue[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `selectionMode` | `"single" \| "range" \| "multiple"` | `"single"` | | `min` | `DateValue` | - | | `max` | `DateValue` | - | | `isDateUnavailable` | `(date: DateValue) => boolean` | - | | `fixedWeeks` | `boolean` | `false` | | `outsideDaySelectable` | `boolean` | `false` | | `numOfMonths` | `number` | `1` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | | CSS Variable | Default | | ------------- | -------------- | | `--cell-size` | `--spacing(9)` | ### CalendarViewControl [#calendarviewcontrol] Holds prev/next buttons and month/year selects. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### CalendarMonthSelect [#calendarmonthselect] Month selector dropdown. Uses NativeSelect internally. | Prop | Type | Default | | ----------- | ------------------- | --------- | | `format` | `"short" \| "long"` | `"short"` | | `className` | `string` | - | ### CalendarYearSelect [#calendaryearselect] Year selector dropdown. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### CalendarTable [#calendartable] Table layout for the calendar day grid. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### CalendarWeekDays [#calendarweekdays] Header row with week day names (Sun–Sat). | Prop | Type | Default | | ----------- | ------------------------------- | ---------- | | `format` | `"narrow" \| "short" \| "long"` | `"narrow"` | | `className` | `string` | - | ### CalendarTableDays [#calendartabledays] Body with day cells for the current month. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### CalendarTableNextMonth [#calendartablenextmonth] Body for additional month(s). | Prop | Type | Default | | ----------- | -------- | ------- | | `months` | `number` | `1` | | `className` | `string` | - | ### CalendarTableCell [#calendartablecell] Single day cell. Clickable for selection. Shows disabled/outside styling. | Prop | Type | Default | | ----------- | ----------- | ------- | | `value` | `DateValue` | - | | `className` | `string` | - | ### parseDate [#parsedate] Utility for parsing dates. ```tsx import { parseDate } from "@/components/ui/calendar"; parseDate(new Date()); parseDate("2024-01-15"); parseDate(Date.now()); ``` *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/date-picker#api-reference). # Card (/docs/components/card) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/card ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Card ├── CardMedia ├── CardHeader │ ├── CardTitle │ ├── CardDescription │ └── CardAction ├── CardContent └── CardFooter ``` ## Usage [#usage] ```tsx import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardAction, CardMedia, } from "@/components/ui/card"; ``` ```tsx ``` ## Title & Description [#title--description] `CardHeader` supports two usage patterns: ### Using props [#using-props] Pass `title` and `description` props directly to `CardHeader`. ```tsx showLineNumbers ``` > This approach does not require `CardTitle` or `CardDescription` components. ### Using components [#using-components] Use `CardTitle` and `CardDescription` as children for more control. ```tsx showLineNumbers Card Title Card description ``` ## Examples [#examples] ### Product card [#product-card] ### Icon card [#icon-card] ### Custom spacing [#custom-spacing] The `[--space:--spacing("value")]` on `Card` controls the internal spacing. Default spacing is `--spacing(6)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### Card [#card] Root wrapper for card layout. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | | CSS Variable | Default | | ------------ | -------------- | | `--space` | `--spacing(6)` | ### CardMedia [#cardmedia] Image, video, or media area. Often full-width at top. | Prop | Type | Default | | ----------- | -------------------------------- | ----------- | | `variant` | `"default" \| "icon" \| "image"` | `"default"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CardHeader [#cardheader] Header area. Typically holds title and optional actions. | Prop | Type | Default | | ------------- | --------- | ------- | | `title` | `string` | `-` | | `description` | `string` | `-` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CardTitle [#cardtitle] Card title or heading. Bold by default. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CardDescription [#carddescription] Card description or body text. Muted foreground for hierarchy. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CardAction [#cardaction] Action button or link in the card header. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CardContent [#cardcontent] Main body content of the card. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CardFooter [#cardfooter] Footer area. Typically holds secondary actions or metadata. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Carousel (/docs/components/carousel) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/carousel ``` This component depends on [Button](/docs/components/button) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Carousel ├── CarouselContent │ └── CarouselItem ├── CarouselControl │ ├── CarouselPrevious │ └── CarouselNext └── CarouselIndicatorGroup └── CarouselIndicator ``` ## Usage [#usage] ```tsx import { Carousel, CarouselControl, CarouselItem, CarouselContent, CarouselIndicator, CarouselIndicatorGroup, CarouselNext, CarouselPrevious, } from "@/components/ui/carousel"; ``` ```tsx Previous Next ``` ## Orientation [#orientation] ### Horizontal [#horizontal] ### Vertical [#vertical] ## Thumbnail Indicators [#thumbnail-indicators] Render each thumbnail inside `CarouselIndicator` to create a visual preview of each slide. ### Horizontal [#horizontal-1] ### Vertical [#vertical-1] ## Examples [#examples] ### Autoplay [#autoplay] Use `autoplay` props on `Carousel` to make the carousel play automatically. ### Loop [#loop] Use `loop` prop to make the carousel loop. ### Controlled [#controlled] Use `page` and `onPageChange` props to control the carousel state programmatically. ### Slides Per Page [#slides-per-page] Display multiple slides simultaneously by setting the `slidesPerPage` prop on `Carousel`. ### Spacing [#spacing] Control the gap between slides using the `spacing` prop on `Carousel`. ### Mouse Drag [#mouse-drag] To allow mouse drag, set the `allowMouseDrag` prop on `Carousel`. ## API Reference [#api-reference] ### Carousel [#carousel] Root component. Manages slide state and navigation. | Prop | Type | Default | | ---------------- | ------------------------------ | -------------- | | `slideCount` | `number` | **required** | | `allowMouseDrag` | `boolean` | `false` | | `autoplay` | `boolean \| { delay: number }` | `false` | | `defaultPage` | `number` | `0` | | `loop` | `boolean` | `false` | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `page` | `number` | `-` | | `slidesPerPage` | `number` | `1` | | `slidesPerMove` | `number \| 'auto'` | `'auto'` | | `spacing` | `string` | `"16px"` | | `padding` | `number` | `0` | | `className` | `string` | `-` | ### CarouselContent [#carouselcontent] Wraps all slides. Handles layout and transitions. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CarouselItem [#carouselitem] Wraps a single slide. | Prop | Type | Default | | ----------- | ------------------------------ | ------------ | | `index` | `number` | **required** | | `snapAlign` | `"start" \| "center" \| "end"` | `"start"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CarouselControl [#carouselcontrol] Holds prev/next navigation buttons. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CarouselPrevious [#carouselprevious] Goes to the previous slide. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### CarouselNext [#carouselnext] Goes to the next slide. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### CarouselIndicatorGroup [#carouselindicatorgroup] Holds slide indicator dots or pills. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CarouselIndicator [#carouselindicator] Indicator for a slide. Click to jump to that slide. | Prop | Type | Default | | ----------- | --------- | ------------ | | `index` | `number` | **required** | | `readOnly` | `boolean` | `false` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/carousel#api-reference). # Chart (/docs/components/chart) For more complete, copy-ready setups: Browse the Charts Examples (soon). ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/chart ``` Install the following dependencies: ```bash npm install recharts ``` Import the following chart color variables into your CSS file (if they are not already in your theme) ```css @theme inline { --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); } :root { --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); } .dark { --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); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text ChartContainer ├── ChartStyle ├── Recharts surface (BarChart, LineChart, …) ├── ChartTooltip │ └── ChartTooltipContent └── ChartLegend └── ChartLegendContent ``` ## Component [#component] These pieces follow the familiar [shadcn/ui](https://ui.shadcn.com/docs/components/base/chart) chart pattern—container, tooltips, and legend helpers around standard Recharts charts—restyled and wired to Shark UI tokens and imports so the result feels native to this kit. ```tsx import { Bar, BarChart } from "recharts" import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart" export const MyChart = () => { return ( } /> ) } ``` ## Usage [#usage] Walk through a small bar chart: sample data, a shared config object, then layers for grid, axis, tooltip, and legend. ### Start with data [#start-with-data] Shape the rows however you like; `dataKey` maps columns to bars, lines, or areas. This set tracks desktop versus mobile counts per month: ```tsx const chartData = [ { month: "January", desktop: 186, mobile: 80 }, { month: "February", desktop: 305, mobile: 200 }, { month: "March", desktop: 237, mobile: 120 }, { month: "April", desktop: 73, mobile: 190 }, { month: "May", desktop: 209, mobile: 130 }, { month: "June", desktop: 214, mobile: 140 }, ] ``` ### Add a chart config [#add-a-chart-config] `ChartConfig` is metadata: human-readable labels, optional icons, and color tokens. It stays separate from the data array so several charts can reuse the same palette and copy. ```tsx import { type ChartConfig } from "@/components/ui/chart" const chartConfig = { desktop: { label: "Desktop", color: "#2563eb", }, mobile: { label: "Mobile", color: "#60a5fa", }, } satisfies ChartConfig ``` ### Render the chart [#render-the-chart] Pass `config` into `ChartContainer`. Give the container a **minimum height** (for example `min-h-[200px]`) or a fixed height so Recharts can measure the SVG responsively. ```tsx "use client" import { Bar, BarChart } from "recharts" import { ChartContainer, type ChartConfig } from "@/components/ui/chart" ``` ### Add a grid [#add-a-grid] Import `CartesianGrid` from Recharts and nest it inside the chart. Horizontal stripes alone often read cleaner than a full mesh: ```tsx import { Bar, BarChart, CartesianGrid } from "recharts" ``` ### Add an axis [#add-an-axis] Use `XAxis` (and `YAxis` when you need one) for categories and ticks. Here ticks are shortened and decorative lines are hidden for a lighter look: ```tsx import { Bar, BarChart, CartesianGrid, XAxis } from "recharts" value.slice(0, 3)} /> ``` ### Add a tooltip [#add-a-tooltip] Shark’s tooltip pair reads names, swatches, and values from `chartConfig` automatically: ```tsx import { ChartTooltip, ChartTooltipContent } from "@/components/ui/chart" value.slice(0, 3)} /> } /> ``` ### Add a legend [#add-a-legend] `ChartLegend` with `ChartLegendContent` mirrors the same config entries: ```tsx import { ChartLegend, ChartLegendContent } from "@/components/ui/chart" value.slice(0, 3)} /> } /> } /> ``` ## Chart config [#chart-config] Treat `ChartConfig` as the **presentation contract** for your series keys: labels for tooltips and legends, optional Lucide (or other) icons, and either a single `color` string or a `theme` map for light and dark. Data arrays stay focused on numbers and categories. Because config is independent of rows, you can fetch remote data in one shape while keeping stable color tokens in code, share one config across a dashboard, or swap palettes without touching API responses. ```tsx import { Monitor } from "lucide-react" import { type ChartConfig } from "@/components/ui/chart" const chartConfig = { desktop: { label: "Desktop", icon: Monitor, color: "#2563eb", theme: { light: "#2563eb", dark: "#dc2626", }, }, } satisfies ChartConfig ``` Use `color` for a single value that works in both themes, or `theme` with `light` / `dark` keys when the swatch should diverge. ## Theming [#theming] You can theme series with CSS variables (ideal alongside Shark’s tokens), raw color strings in any supported format, or a mix. ### CSS variables [#css-variables] Shark’s default theme already defines `--chart-1` through `--chart-5` in `globals.css`; see [Styling](/docs/styling) for how those slots fit the rest of the design system. Point config entries at those variables so charts track global palette tweaks: ```tsx const chartConfig = { desktop: { label: "Desktop", color: "var(--chart-1)", }, mobile: { label: "Mobile", color: "var(--chart-2)", }, } satisfies ChartConfig ``` ### Hex, HSL, or OKLCH [#hex-hsl-or-oklch] Inline literals work when you do not need shared tokens: ```tsx const chartConfig = { desktop: { label: "Desktop", color: "#2563eb" }, mobile: { label: "Mobile", color: "hsl(220, 98%, 61%)" }, tablet: { label: "Tablet", color: "oklch(0.5 0.2 240)" }, laptop: { label: "Laptop", color: "var(--chart-2)" }, } satisfies ChartConfig ``` ### Applying colors in markup and data [#applying-colors-in-markup-and-data] The container exposes `var(--color-)` for each config key. Use that placeholder anywhere Recharts or Tailwind can read a color: * **Series elements:** `` * **Data-driven fills:** `{ browser: "chrome", visitors: 275, fill: "var(--color-chrome)" }` with matching config keys * **Tailwind utilities:** `` ## Tooltip [#tooltip] Pair `ChartTooltip` with `ChartTooltipContent` to get a styled surface that pulls series colors and labels from `chartConfig`. Pass tooltip state from Recharts by using a render function for `content` and spreading those props into `ChartTooltipContent`. Toggle the label row or the color chip with props, and switch the indicator shape between dot, line, and dashed styles. ```tsx import { ChartTooltip, ChartTooltipContent } from "@/components/ui/chart" } /> ``` ### Tooltip props [#tooltip-props] | Prop | Type | | --------------- | ----------------------------- | | `labelKey` | string | | `nameKey` | string | | `indicator` | `"dot" \| "line" \| "dashed"` | | `hideLabel` | boolean | | `hideIndicator` | boolean | ### Custom label and name keys [#custom-label-and-name-keys] When the tooltip should read from different fields than the default mapping, pass `labelKey` and `nameKey` so the header and each row title resolve correctly: ```tsx const chartData = [ { browser: "chrome", visitors: 187, fill: "var(--color-chrome)" }, { browser: "safari", visitors: 200, fill: "var(--color-safari)" }, ] const chartConfig = { visitors: { label: "Total Visitors", }, chrome: { label: "Chrome", color: "var(--chart-1)", }, safari: { label: "Safari", color: "var(--chart-2)", }, } satisfies ChartConfig ( )} /> ``` ## Legend [#legend] `ChartLegend` delegates rendering to `ChartLegendContent`, which builds items from the same config metadata as the tooltip. ```tsx import { ChartLegend, ChartLegendContent } from "@/components/ui/chart" } /> ``` ### Custom name key [#custom-name-key] When legend entries should track a field on each datum (for example `browser`), set `nameKey`: ```tsx const chartData = [ { browser: "chrome", visitors: 187, fill: "var(--color-chrome)" }, { browser: "safari", visitors: 200, fill: "var(--color-safari)" }, ] const chartConfig = { chrome: { label: "Chrome", color: "var(--chart-1)", }, safari: { label: "Safari", color: "var(--chart-2)", }, } satisfies ChartConfig } /> ``` ## Accessibility [#accessibility] Recharts’ `accessibilityLayer` opt-in wires keyboard traversal and screen-reader semantics into the chart canvas. Turn it on for interactive or data-critical views; leave it off for purely decorative thumbnails if you need to avoid extra focus targets. ```tsx {/* children */} ``` ```tsx {/* children */} ``` *** For every prop on primitives such as `Bar`, `Line`, or `XAxis`, refer to the [Recharts API reference](https://recharts.github.io/en-US/api). # Checkbox (/docs/components/checkbox) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/checkbox ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Checkbox } from "@/components/ui/checkbox"; ``` ```tsx showLineNumbers ``` ## Controlled [#controlled] Use the `checked` and `onCheckedChange` props to control the checkbox state programmatically. ## States [#states] ### Invalid [#invalid] Use the `invalid` prop to indicate an invalid state. ### Disabled [#disabled] Use the `disabled` prop to disable the checkbox. ## Examples [#examples] ### With Description [#with-description] ### Indeterminate [#indeterminate] ### Group [#group] ### Card Style [#card-style] ## API Reference [#api-reference] ### Checkbox [#checkbox] Checkbox control for boolean or multi-select state. | Prop | Type | Default | | ----------------- | --------------------------------------------- | ------- | | `checked` | `boolean \| 'indeterminate'` | `-` | | `defaultChecked` | `boolean` | `false` | | `disabled` | `boolean` | `false` | | `checked` | `boolean \| 'indeterminate'` | `-` | | `onCheckedChange` | `({ checked }: CheckedChangeDetails) => void` | `-` | | `className` | `string` | `-` | ### CheckboxGroup [#checkboxgroup] Groups related checkboxes with consistent layout. | Prop | Type | Default | | --------------- | --------------------------------------- | ------- | | `value` | `string[]` | `-` | | `defaultValue` | `string[]` | `[]` | | `onValueChange` | `(details: ValueChangeDetails) => void` | `-` | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/checkbox#api-reference). # Circular Progress (/docs/components/circular-progress) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/circular-progress ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { CircularProgress } from "@/components/ui/circular-progress"; ``` ```tsx ``` ## Controlled [#controlled] ## Examples [#examples] ### With value [#with-value] ### Indeterminate [#indeterminate] ### Custom Size [#custom-size] Use the `size` prop to change the circular progress indicator size. ### Custom Thickness [#custom-thickness] Use the `thickness` prop to control the ring stroke width. ## API Reference [#api-reference] ### CircularProgress [#circularprogress] Root element of the circular progress indicator. | Prop | Type | Default | | --------------- | --------------------------------------- | ------- | | `value` | `number \| null` | - | | `defaultValue` | `number` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `indeterminate` | `boolean` | `false` | | `size` | `number` | `32` | | `thickness` | `number` | `4` | | `className` | `string` | - | ### CircularProgressValue [#circularprogressvalue] Displays the current progress value text. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/react/docs/components/progress-circular#api-reference). # Circular Slider (/docs/components/circular-slider) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/circular-slider ``` This component depends on [Field](/docs/components/field) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { CircularSlider } from "@/components/ui/circular-slider"; ``` ```tsx ``` ## Controlled [#controlled] ## States [#states] ### Disabled [#disabled] ## Examples [#examples] ### Size [#size] Use the `size` prop to change the slider dimensions. ### Thickness [#thickness] Use the `thickness` prop to change the progress ring thickness. ### With markers [#with-markers] Use `markers` to display clock-style tick marks. ### With step [#with-step] Use `markersAtSteps` with `step` to align markers with step positions. ### Show value [#show-value] Use `CircularSliderValue` to show the current value. The `prefix` and `suffix` props customize the display. ### Custom markers [#custom-markers] Pass a `number[]` to `markers` for custom angles. ## API Reference [#api-reference] ### CircularSlider [#circularslider] Root component. Manages angle selection and value. | Prop | Type | Default | | ---------------- | --------------------------------------- | ------- | | `value` | `number` | - | | `defaultValue` | `number` | `0` | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `step` | `number` | `1` | | `disabled` | `boolean` | - | | `size` | `number` | `120` | | `thickness` | `number` | `6` | | `markers` | `boolean \| number[]` | - | | `markersAtSteps` | `boolean` | `false` | | `className` | `string` | - | ### CircularSliderValue [#circularslidervalue] Shows the current angle value (degrees or custom format). | Prop | Type | Default | | ----------- | --------------------------- | ------- | | `prefix` | `React.ReactNode \| string` | - | | `suffix` | `React.ReactNode \| string` | - | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/react/docs/components/angle-slider). # Clipboard (/docs/components/clipboard) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/clipboard ``` This component depends on [Input](/docs/components/input) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Clipboard ├── ClipboardTrigger │ └── ClipboardIndicator ├── ClipboardInput └── ClipboardValue ``` ## Usage [#usage] ```tsx import { Clipboard, ClipboardTrigger, ClipboardIndicator } from "@/components/ui/clipboard"; ``` ```tsx ``` ## Controlled [#controlled] ## Examples [#examples] ### Icon Only [#icon-only] ### Different Icons [#different-icons] ### Value Text [#value-text] Use `ClipboardValue` component to display the value as text instead of an input field. ### Custom Timeout [#custom-timeout] Use the `timeout` prop on `Clipboard` to customize how long the copied state is shown. ## API Reference [#api-reference] ### Clipboard [#clipboard] Root wrapper. Manages copy state and value. | Prop | Type | Default | | ----------- | -------- | ------------ | | `value` | `string` | **required** | | `timeout` | `number` | `2000` | | `className` | `string` | `-` | ### ClipboardTrigger [#clipboardtrigger] Triggers copy to clipboard on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### ClipboardInput [#clipboardinput] Input showing the value to copy. Often hidden or read-only. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### ClipboardIndicator [#clipboardindicator] Icon that changes based on copy state. | Prop | Type | Default | | ----------- | ----------- | ----------- | | `copied` | `ReactNode` | `CheckIcon` | | `className` | `string` | `-` | ### ClipboardValue [#clipboardvalue] Text display of the value. Use when input is not needed. | Prop | Type | Default | | ----------- | -------------------------------------- | ------- | | `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"md"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/clipboard#api-reference). # Collapsible (/docs/components/collapsible) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/collapsible ``` Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Add the following animations to your `globals.css` . ```css title="globals.css" showLineNumbers @theme inline { --animate-expand: expand 0.2s ease-out; --animate-collapse: collapse 0.2s ease-out; @keyframes expand { from { height: var(--collapsed-height, 0); } to { height: var(--height); } } @keyframes collapse { from { height: var(--height); } to { height: var(--collapsed-height, 0); } } } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Collapsible ├── CollapsibleTrigger └── CollapsibleContent ``` ## Usage [#usage] ```tsx import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@/components/ui/collapsible"; ``` ```tsx Can I use this in my project? Yes. Free to use for personal and commercial projects. No attribution required. ``` ## Controlled [#controlled] Use the `open` and `onOpenChange` props to control the collapsible state programmatically. ## States [#states] ### Disabled [#disabled] ## Examples [#examples] ### Nested [#nested] Collapsibles can be nested to create hierarchical structures. ### Partial Collapse [#partial-collapse] Use the `collapsedHeight` prop to show a portion of the content when collapsed. Accessibility Notice Interactive elements (links, buttons, inputs) within the collapsed area automatically become inaccesible to prevent keyboard navigation to hidden content. ## API Reference [#api-reference] ### Collapsible [#collapsible] Root component. Controls expand/collapse state and animation. | Prop | Type | Default | | ----------------- | --------------------------------------- | ------- | | `open` | `boolean` | `-` | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `({ open }: OpenChangeDetails) => void` | `-` | | `collapsedHeight` | `string` | `-` | | `className` | `string` | `-` | ### CollapsibleTrigger [#collapsibletrigger] Toggles expand/collapse on click. Use `asChild` for custom trigger elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CollapsibleContent [#collapsiblecontent] Holds the content that expands and collapses. Animated by default. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### CollapsibleIndicator [#collapsibleindicator] Chevron or icon that rotates to indicate open/closed state. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/collapsible#api-reference). # Color Picker (/docs/components/color-picker) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/color-picker ``` This component depends on [Button](/docs/components/button) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Modes [#modes] You can use multiple modes to build the color picker that fits your needs: * [Input](#input) for hex or channel editing * [Popover](#popover) for area and slider selection * [Swatch](#swatch-picker) picker for preset colors * [Area](#area) standalone component for color selection * [Slider](#slider) for color adjustment ## Input [#input] ### Anatomy [#anatomy] ```text ColorPicker ├── ColorPickerControl │ └── InputGroup │ ├── ColorPickerTrigger │ │ └── ColorPickerSwatchPreview │ └── ColorPickerInput └── ColorPickerContent ├── ColorPickerArea │ └── ColorPickerAreaThumb └── ColorPickerView └── ColorPickerSlider ``` ### Usage [#usage] ```tsx import { ColorPicker, ColorPickerInput, } from "@/components/ui/color-picker"; ``` ```tsx ``` ### Controlled [#controlled] Use the `value` and `onValueChange` props to programmatically control the color picker's state. ### States [#states] #### Invalid [#invalid] #### Disabled [#disabled] ### Examples [#examples] #### With Field [#with-field] #### Channel Editing [#channel-editing] #### With Swatch [#with-swatch] Input with `ColorPickerSwatchPreview` showing the current color alongside the hex input. #### With Popover [#with-popover] An input with trigger and popover content for area, hue, and alpha selection. #### Compact [#compact] Inspired by Figma's color input. ## Popover [#popover] Color picker with trigger and popover content. ### Anatomy [#anatomy-1] ```text ColorPicker ├── ColorPickerControl │ └── ColorPickerTrigger └── ColorPickerContent ├── ColorPickerArea │ └── ColorPickerAreaThumb ├── ColorPickerView │ ├── ColorPickerEyeDropperTrigger │ └── ColorPickerSlider │ └── ColorPickerTransparencyGrid └── ColorPickerSwatchGroup └── ColorPickerSwatchTrigger └── ColorPickerSwatch ``` ### Usage [#usage-1] ```tsx import { ColorPicker, ColorPickerArea, ColorPickerAreaThumb, ColorPickerContent, ColorPickerEyeDropperTrigger, ColorPickerSlider, ColorPickerTrigger, ColorPickerTransparencyGrid, ColorPickerView, } from "@/components/ui/color-picker"; ``` ```tsx ``` ### States [#states-1] #### Disabled [#disabled-1] Set `disabled` to prevent user interaction. ### Examples [#examples-1] #### With Eye Dropper [#with-eye-dropper] #### With Channel Editing [#with-channel-editing] Popover with area, sliders, and input fields for editing red, green, and blue values. #### With Only Sliders [#with-only-sliders] Popover with hue, saturation, lightness, and alpha sliders only, no color area. #### With Swatch Picker [#with-swatch-picker] Popover with preset color swatches for quick selection. ## Color Swatch Picker [#color-swatch-picker] Set `inline` on `ColorPicker` so swatches render without a popover. ### Anatomy [#anatomy-2] ```text ColorPicker └── ColorPickerSwatchGroup └── ColorPickerSwatchTrigger └── ColorPickerSwatch └── ColorPickerSwatchIndicator ``` ### Usage [#usage-2] ```tsx import { ColorPicker, ColorPickerSwatchTrigger, ColorPickerSwatchGroup, ColorPickerSwatch, ColorPickerSwatchIndicator, } from "@/components/ui/color-picker"; ``` ```tsx ``` ### Controlled [#controlled-1] Use the `value` and `onValueChange` props to programmatically control the swatch picker's state. ### States [#states-2] #### Disabled [#disabled-2] Set `disabled` to prevent user interaction. ### Examples [#examples-2] #### Custom Size [#custom-size] Customize swatch size using the `size-*` on `ColorPickerSwatchTrigger`. #### Custom Radius [#custom-radius] Override the default rounded style on `ColorPickerSwatchTrigger` using the `rounded-*` utility class. #### Custom Indicator [#custom-indicator] Replace the default check icon with a custom indicator via the children of `ColorPickerSwatchIndicator`. ## Area [#area] Set `inline` on `ColorPicker` for a standalone color area. ### Anatomy [#anatomy-3] ```text ColorPicker └── ColorPickerArea └── ColorPickerAreaThumb ``` ### Usage [#usage-3] ```tsx import { ColorPicker, ColorPickerArea, ColorPickerAreaThumb, } from "@/components/ui/color-picker"; ``` ```tsx ``` ### Examples [#examples-3] #### Color Channels [#color-channels] #### With Dots [#with-dots] ## Slider [#slider] Set `inline` on `ColorPicker` for standalone sliders. Wrap multiple sliders in `ColorPickerView`. ### Anatomy [#anatomy-4] ```text ColorPicker └── ColorPickerView └── ColorPickerSlider └── ColorPickerTransparencyGrid ``` ### Usage [#usage-4] ```tsx import { ColorPicker, ColorPickerSlider, } from "@/components/ui/color-picker"; ``` ```tsx ``` ### Controlled [#controlled-2] ### States [#states-3] #### Disabled [#disabled-3] ### Examples [#examples-4] #### Alpha Channel [#alpha-channel] #### HSL Channels [#hsl-channels] #### HSBA Channels [#hsba-channels] #### RGB Channels [#rgb-channels] #### Vertical [#vertical] ### Custom spacing [#custom-spacing] Use `[--space:--spacing("value")]` on `ColorPickerContent` to adjust internal spacing. Default spacing is `--spacing(3)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### ColorPicker [#colorpicker] Root element of the color picker. | Prop | Type | Default | | --------------- | ------------------------------------------------------------------------------------- | ---------------------------- | | `value` | `string` | - | | `defaultValue` | `string` | - | | `onValueChange` | `(details: ColorPickerValueChangeDetails) => void` | - | | `disabled` | `boolean` | `false` | | `format` | `"hex" \| "hexa" \| "rgb" \| "rgba" \| "hsl" \| "hsla" \| "hsb" \| "hsba" \| "oklch"` | - | | `inline` | `boolean` | `false` | | `positioning` | `PositioningOptions` | `{ placement: "top-start" }` | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `className` | `string` | - | ### ColorPickerTrigger [#colorpickertrigger] Button or element that opens the color picker popover. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ColorPickerContent [#colorpickercontent] Holds the color picker popover. Displayed in a portal. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | | Attribute | Default | | --------- | -------------- | | `--space` | `--spacing(3)` | ### ColorPickerControl [#colorpickercontrol] Container for grouping control elements such as area, sliders, and inputs. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### ColorPickerView [#colorpickerview] Container for sliders and inputs. Can specify `format` for child value display. | Prop | Type | Default | | ----------- | ------------------------------------------------------------------------------------- | ------- | | `format` | `"hex" \| "hexa" \| "rgb" \| "rgba" \| "hsl" \| "hsla" \| "hsb" \| "hsba" \| "oklch"` | - | | `className` | `string` | - | ### ColorPickerArea [#colorpickerarea] Two-dimensional color selection area. | Prop | Type | Default | | ----------- | ----------------------------------------------------------------------------------------------- | ------- | | `showDots` | `boolean` | `false` | | `xChannel` | `"hue" \| "saturation" \| "brightness" \| "lightness" \| "red" \| "green" \| "blue" \| "alpha"` | - | | `yChannel` | `"hue" \| "saturation" \| "brightness" \| "lightness" \| "red" \| "green" \| "blue" \| "alpha"` | - | | `className` | `string` | - | ### ColorPickerAreaThumb [#colorpickerareathumb] Draggable thumb within the color area. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### ColorPickerSlider [#colorpickerslider] Slider for adjusting a color channel. | Prop | Type | Default | | ------------- | ------------------------------------------------------------------------------------------------------------------ | -------------- | | `channel` | `"hex" \| "hexa" \| "red" \| "green" \| "blue" \| "hue" \| "saturation" \| "brightness" \| "lightness" \| "alpha"` | - | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `className` | `string` | - | ### ColorPickerTransparencyGrid [#colorpickertransparencygrid] Checkerboard pattern for transparency. Shown as child of `ColorPickerSlider` when editing alpha. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### ColorPickerEyeDropperTrigger [#colorpickereyedroppertrigger] Button that activates the native Eye Dropper API to sample colors from the screen. | Prop | Type | Default | | ----------- | ------------------------ | ----------- | | `variant` | `ButtonProps["variant"]` | `"outline"` | | `size` | `ButtonProps["size"]` | `"icon-md"` | | `children` | `ReactNode` | `Pipette` | | `className` | `string` | - | ### ColorPickerInput [#colorpickerinput] Input for displaying and editing a color channel value. Use `asChild` with a custom input. | Prop | Type | Default | | --------- | ------------------------------------------------------------------------------------------------------------------ | ------- | | `channel` | `"hex" \| "hexa" \| "red" \| "green" \| "blue" \| "hue" \| "saturation" \| "brightness" \| "lightness" \| "alpha"` | `"hex"` | | `asChild` | `boolean` | `false` | ### ColorPickerSwatchPreview [#colorpickerswatchpreview] Compact swatch that displays the current color. Use inside an input group for input mode. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### ColorPickerSwatchGroup [#colorpickerswatchgroup] Container for swatch triggers in swatch picker mode. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### ColorPickerSwatchTrigger [#colorpickerswatchtrigger] Button that selects a color when clicked. Wraps `ColorPickerSwatch` and optionally `ColorPickerSwatchIndicator`. | Prop | Type | Default | | ----------- | -------- | ------- | | `value` | `string` | - | | `className` | `string` | - | ### ColorPickerSwatch [#colorpickerswatch] Color swatch display. Use as a child of `ColorPickerSwatchTrigger`. | Prop | Type | Default | | ----------- | -------- | ------- | | `value` | `string` | - | | `className` | `string` | - | ### ColorPickerSwatchIndicator [#colorpickerswatchindicator] Check mark or custom icon shown when a swatch is selected. Pass children to customize. | Prop | Type | Default | | ----------- | ----------- | ----------- | | `children` | `ReactNode` | `CheckIcon` | | `className` | `string` | - | ### ColorPickerValue [#colorpickervalue] Displays the current color as formatted text. | Prop | Type | Default | | ----------- | ------------------------------------------------------------------------------------- | ------- | | `format` | `"hex" \| "hexa" \| "rgb" \| "rgba" \| "hsl" \| "hsla" \| "hsb" \| "hsba" \| "oklch"` | - | | `className` | `string` | - | ### ColorPickerValueSwatch [#colorpickervalueswatch] Displays the current color as a swatch. Use for standalone value preview. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### parseColor [#parsecolor] Exported utility to parse color strings. Use for programmatic color handling. *** For the complete list of props and additional subcomponents, see the [Ark UI Color Picker documentation](https://ark-ui.com/docs/components/color-picker#api-reference). # Combobox (/docs/components/combobox) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/combobox ``` This component depends on [Button](/docs/components/button) , [Input](/docs/components/input) , and [Input Group](/docs/components/input-group) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Combobox ├── ComboboxInput └── ComboboxContent ├── ComboboxEmpty └── ComboboxList └── ComboboxGroup ├── ComboboxGroupLabel └── ComboboxItem ``` ## Usage [#usage] ```tsx import { useFilter, useListCollection } from "@ark-ui/react"; import { Combobox, ComboboxContent, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, } from "@/components/ui/combobox"; ``` ```tsx const { contains } = useFilter({ sensitivity: "base" }); const { collection, filter } = useListCollection({ initialItems: [ { label: "Apple", value: "apple" }, { label: "Banana", value: "banana" }, ], filter: contains, }); filter(inputValue)} > {items.map((item) => ( {item.label} ))} ``` ## Controlled [#controlled] Control the selected value with `inputValue` and `onValueChange` props. ## Size [#size] ### Small [#small] ### Medium [#medium] ### Large [#large] ## States [#states] ### Invalid [#invalid] ### Disabled [#disabled] ## Examples [#examples] ### Auto highlight [#auto-highlight] Automatically highlight the first matching item as the user types. ### Group [#group] ### With Field [#with-field] Use Combobox with `Field` components to style the combobox with the field components. ### With scroll [#with-scroll] ### Multiple [#multiple] Enable multiple selection by setting the `multiple` prop to `Combobox`. ### With clear button [#with-clear-button] Pass `showClear` to `ComboboxInput` to show a clear button. ### With start icon [#with-start-icon] ## API Reference [#api-reference] ### Combobox [#combobox] Root component. | Prop | Type | Default | | -------------------- | -------------------------------------------- | ------------ | | `collection` | `ListCollection` | **required** | | `value` | `string \| string[]` | - | | `defaultValue` | `string \| string[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `onInputValueChange` | `(details: InputValueChangeDetails) => void` | - | | `multiple` | `boolean` | `false` | | `disabled` | `boolean` | - | | `openOnClick` | `boolean` | `true` | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `className` | `string` | - | ### ComboboxControl [#comboboxcontrol] Optional wrapper for custom layouts. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxInput [#comboboxinput] Input with dropdown trigger and optional clear button. Combines search and selection. | Prop | Type | Default | | ------------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `showTrigger` | `boolean` | `true` | | `showClear` | `boolean` | `false` | | `disabled` | `boolean` | - | | `className` | `string` | - | ### ComboboxTrigger [#comboboxtrigger] Opens the dropdown on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxClear [#comboboxclear] Button to clear the input value. | Prop | Type | Default | | --------- | --------- | ------- | | `asChild` | `boolean` | - | ### ComboboxContent [#comboboxcontent] Holds the dropdown options. Displayed in a portal. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxList [#comboboxlist] Wraps the list of options. Use with collection. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxItem [#comboboxitem] A single selectable option. | Prop | Type | Default | | ----------- | --------- | ------------ | | `item` | `T` | **required** | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxGroup [#comboboxgroup] Groups related options under an optional heading. | Prop | Type | Default | | ----------- | --------------------- | ------- | | `heading` | `string \| ReactNode` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxGroupLabel [#comboboxgrouplabel] Label for an option group. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### ComboboxEmpty [#comboboxempty] Shown when no options match the current filter. Use for empty state. | Prop | Type | Default | | ----------- | ----------- | ------------------- | | `className` | `string` | - | | `children` | `ReactNode` | `No results found.` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/combobox#api-reference). # Command (/docs/components/command) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/command ``` This component depends on [Combobox](/docs/components/combobox) , [Dialog](/docs/components/dialog) , [Input](/docs/components/input) , [Input Group](/docs/components/input-group) , [Menu](/docs/components/menu) , and [Separator](/docs/components/separator) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Command ├── CommandInput ├── CommandList │ ├── CommandEmpty │ └── CommandGroup │ ├── CommandGroupLabel │ └── CommandItem ├── CommandSeparator ├── CommandShortcut └── CommandFooter ``` ## Usage [#usage] ```tsx import { useFilter, useListCollection } from "@ark-ui/react"; import { Command, CommandContent, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@/components/ui/command"; ``` ```tsx const { contains } = useFilter({ sensitivity: "base" }); const { collection, filter } = useListCollection({ initialItems: [ { label: "Search", value: "search", group: "Actions" }, { label: "Settings", value: "settings", group: "Actions" }, ], filter: contains, groupBy: (item) => item.group, // optional }); filter(inputValue)} > {collection.group().map(([group, items]) => ( {items.map((item) => ( {item.label} ))} ))} ``` ## Examples [#examples] ### With Dialog [#with-dialog] ### Groups [#groups] Group related items with `CommandGroup` and the `heading` prop. ### Shortcuts [#shortcuts] Display keyboard shortcuts next to items with `CommandShortcut`. ### With Footer [#with-footer] Add hints or actions in the footer with `CommandFooter`. ### Scrollable [#scrollable] Scrollable command menu with multiple items. ## API Reference [#api-reference] ### Command [#command] Root component. | Prop | Type | Default | | -------------------- | -------------------------------------------- | ------------ | | `collection` | `ListCollection` | **required** | | `value` | `string \| string[]` | - | | `defaultValue` | `string \| string[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `onInputValueChange` | `(details: InputValueChangeDetails) => void` | - | | `disabled` | `boolean` | - | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `className` | `string` | - | ### CommandDialog [#commanddialog] Dialog root for the command palette. Same as `Dialog`. | Prop | Type | Default | | -------------- | --------------------------------------- | ------- | | `open` | `boolean` | - | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `({ open }: OpenChangeDetails) => void` | - | | `className` | `string` | - | ### CommandDialogTrigger [#commanddialogtrigger] Opens the command palette on click. Same as `DialogTrigger`. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | - | ### CommandDialogContent [#commanddialogcontent] Container for the command palette inside the dialog. | Prop | Type | Default | | ------------- | ---------------------------------------------- | ---------------------------------- | | `size` | `"sm" \| "md" \| "lg" \| "xl" \| "fullscreen"` | `"lg"` | | `title` | `string` | `"Command Palette"` | | `description` | `string` | `"Search for a command to run..."` | | `className` | `string` | - | ### CommandInput [#commandinput] Search input with icon. Uses InputGroup for layout. | Prop | Type | Default | | ------------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `placeholder` | `string` | - | | `disabled` | `boolean` | - | | `className` | `string` | - | ### CommandContent [#commandcontent] Scrollable content container for the command list. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### CommandList [#commandlist] List container for command items. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### CommandEmpty [#commandempty] Content when no items match the filter. | Prop | Type | Default | | ----------- | ----------- | ------------------- | | `className` | `string` | - | | `children` | `ReactNode` | `No results found.` | | `asChild` | `boolean` | - | ### CommandGroup [#commandgroup] Groups related items. | Prop | Type | Default | | ----------- | --------------------- | ------- | | `heading` | `string \| ReactNode` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### CommandGroupLabel [#commandgrouplabel] Label for a group. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### CommandItem [#commanditem] A single command or action in the palette. | Prop | Type | Default | | ----------- | -------- | ------------ | | `item` | `T` | **required** | | `className` | `string` | - | ### CommandSeparator [#commandseparator] Visual divider between groups or items. Uses `Separator`. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### CommandShortcut [#commandshortcut] Keyboard shortcut hint shown next to a command. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### CommandFooter [#commandfooter] Footer area for hints, tips, or extra actions. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/command#api-reference). # Context Menu (/docs/components/context-menu) Context Menu is built on top of the [Menu](/docs/components/menu) component. Check it out for more examples. ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/context-menu ``` This component depends on [Menu](/docs/components/menu) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text ContextMenu ├── ContextMenuTrigger └── ContextMenuContent ├── ContextMenuGroup ├── ContextMenuItem ├── ContextMenuCheckboxItem ├── ContextMenuRadioGroup │ └── ContextMenuRadioItem ├── ContextMenuSub │ ├── ContextMenuSubTrigger │ └── ContextMenuSubContent ├── ContextMenuSeparator └── ContextMenuShortcut ``` ## Usage [#usage] ```tsx import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItemGroup, ContextMenuItemGroupLabel, ContextMenuItem, } from "@/components/ui/context-menu"; ``` ```tsx Right click here Action 1 Action 2 Action 3 ``` ## API Reference [#api-reference] ### ContextTrigger [#contexttrigger] Trigger component for the context menu. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Menu API Reference](/docs/components/menu#api-reference). # Data List (/docs/components/data-list) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/data-list ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text DataList └── DataListItem ├── DataListItemLabel └── DataListItemValue ``` ## Usage [#usage] ```tsx import { DataList, DataListItem, DataListItemLabel, DataListItemValue, } from "@/components/ui/data-list"; ``` ```tsx Name John Doe Email john@example.com ``` ## Orientation [#orientation] Use the `orientation` prop to change the orientation of the datalist component. ### Horizontal [#horizontal] ### Vertical [#vertical] ## Examples [#examples] ### Info Tip [#info-tip] ### Separator [#separator] Use the `divide-y` utility class on `DataList` to add a separator between items. ## API Reference [#api-reference] ### DataList [#datalist] Root wrapper for label-value list layout. | Prop | Type | Default | | ------------- | ---------------------------- | -------------- | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### DataListItem [#datalistitem] Single label-value row. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### DataListItemLabel [#datalistitemlabel] Label or key for the row. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### DataListItemValue [#datalistitemvalue] Value or content for the row. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | # Date Picker (/docs/components/date-picker) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/date-picker ``` This component depends on [Button](/docs/components/button) , [Calendar](/docs/components/calendar) , [Input](/docs/components/input) , and [Input Group](/docs/components/input-group) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text DatePicker ├── DatePickerTrigger └── DatePickerContent ── (Calendar components) ``` ## Usage [#usage] ```tsx import { DatePicker, DatePickerCalendar, DatePickerClearTrigger, DatePickerContent, DatePickerControl, DatePickerInput, DatePickerLabel, DatePickerPositioner, DatePickerTrigger, } from "@/components/ui/date-picker"; ``` ```tsx Pick a date ``` ## Examples [#examples] ### Input [#input] Use `DatePickerInput` for a text input with calendar icon that opens the date picker. ### Range [#range] Select a date range with `selectionMode="range"`. ### Time [#time] Use `DatePickerTimer` for time selection. ### With Presets [#with-presets] Add quick single-date presets in a side panel. ### Custom format [#custom-format] Customize the format of the presets using external date formatting library like `date-fns`. ## API Reference [#api-reference] ### DatePicker [#datepicker] Root element. Extends [Calendar](/docs/components/calendar#api-reference). | Prop | Type | Default | | --------------- | --------------------------------------- | ---------------------- | | `value` | `DateValue[]` | - | | `defaultValue` | `DateValue[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `selectionMode` | `"single" \| "range" \| "multiple"` | `"single"` | | `positioning` | `PositioningOptions` | `{ placement: "top" }` | | `lazyMount` | `boolean` | - | | `unmountOnExit` | `boolean` | - | ### DatePickerTrigger [#datepickertrigger] Button that opens the date picker. `button` | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | - | ### DatePickerInput [#datepickerinput] Input with calendar icon that opens the date picker on click. `input` | Prop | Type | Default | | ------------- | ---------------------- | ------- | | `placeholder` | `string` | - | | `index` | `number` | - | | `size` | `"sm" \| "md" \| "lg"` | - | | `className` | `string` | - | ### DatePickerContent [#datepickercontent] Wraps the calendar. Inherits `--cell-size` from calendar for date cell sizing. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | | Attribute | Default | | ------------- | -------------- | | `--cell-size` | `--spacing(8)` | ### DatePickerValue [#datepickervalue] Displays the selected date(s) as text. Use inside `DatePickerTrigger`. `span` | Prop | Type | Default | | ------------- | --------- | ------- | | `placeholder` | `string` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### DatePickerTimer [#datepickertimer] Time input for selecting hour and minute. Use alongside the calendar for date-time selection. `input` | Prop | Type | Default | | --------------- | --------------------------------------- | ------- | | `value` | `string` | - | | `defaultValue` | `string` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `className` | `string` | - | ### DatePickerPresetTrigger [#datepickerpresettrigger] Quick preset button for dates. `button` | Prop | Type | Default | | ----------- | ------------- | ------- | | `className` | `string` | - | | `value` | `DateValue[]` | - | | `asChild` | `boolean` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/date-picker#api-reference). # Dialog (/docs/components/dialog) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/dialog ``` This component depends on [Button](/docs/components/button) and [Scroll Area](/docs/components/scroll-area) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Dialog ├── DialogTrigger └── DialogContent ├── DialogHeader │ ├── DialogTitle │ └── DialogDescription ├── DialogBody └── DialogFooter └── DialogClose ``` ## Usage [#usage] ```tsx import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose, } from "@/components/ui/dialog"; ``` ```tsx {/** your content here */} ``` ## Title & Description [#title--description] `DialogHeader` supports two usage patterns: ### Using props [#using-props] Pass `title` and `description` props directly to `DialogHeader`. ```tsx showLineNumbers ``` > This approach does not require `DialogTitle` or `DialogDescription` components. ### Using components [#using-components] Use `DialogTitle` and `DialogDescription` as children for more control. ```tsx showLineNumbers Dialog Title Dialog description ``` ## Examples [#examples] ### With Scroll [#with-scroll] Use `DialogBody` to make the content area scrollable while keeping header and footer fixed. ### No Close Button [#no-close-button] Use the `showCloseButton` prop to hide the close button in the top right corner. ### Close behavior [#close-behavior] Use `closeOnInteractOutside` and `closeOnEscape` props to prevent closing on outside click and escape. ### Open from Menu [#open-from-menu] Open a dialog imperatively from a menu item using the `onSelect` handler. ### Non-Modal [#non-modal] Use `modal={false}` to allow interaction with elements outside the dialog. Disables focus trapping and scroll prevention. ### Initial Focus [#initial-focus] Use `initialFocusEl` to control which element receives focus when the dialog opens. ### Nested [#nested] Nest dialogs within one another. ### Custom spacing [#custom-spacing] Use `[--space:--spacing("value")]` on `DialogContent` to adjust internal padding. Default spacing is `--spacing(6)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### Dialog [#dialog] Root context provider. Controls open state and modal behavior. | Prop | Type | Default | | ------------------------ | --------------------------------------- | ------- | | `open` | `boolean` | `-` | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `({ open }: OpenChangeDetails) => void` | `-` | | `modal` | `boolean` | `true` | | `closeOnEscape` | `boolean` | `true` | | `closeOnInteractOutside` | `boolean` | `true` | | `initialFocusEl` | `() => MaybeElement` | `-` | | `finalFocusEl` | `() => MaybeElement` | `-` | | `onEscapeKeyDown` | `(event: KeyboardEvent) => void` | `-` | | `onInteractOutside` | `(event: InteractOutsideEvent) => void` | `-` | | `className` | `string` | `-` | ### DialogTrigger [#dialogtrigger] Opens the dialog on click. Use `asChild` for custom trigger elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DialogContent [#dialogcontent] Holds the dialog panel. Supports size variants from sm to fullscreen. | Prop | Type | Default | | ----------------- | ---------------------------------------------- | ------- | | `size` | `"sm" \| "md" \| "lg" \| "xl" \| "fullscreen"` | `"md"` | | `showCloseButton` | `boolean` | `true` | | `className` | `string` | `-` | | Attribute | Default | | --------- | -------------- | | `--space` | `--spacing(6)` | ### DialogHeader [#dialogheader] Header area for title and description. Accepts props or children. | Prop | Type | Default | | ------------- | -------- | ------- | | `title` | `string` | `-` | | `description` | `string` | `-` | | `className` | `string` | `-` | ### DialogBody [#dialogbody] Scrollable body content. Uses [ScrollArea](/docs/components/scroll-area) for overflow. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### DialogFooter [#dialogfooter] Footer area for action buttons. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### DialogTitle [#dialogtitle] Accessible title for the dialog. Announced to screen readers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DialogDescription [#dialogdescription] Accessible description for the dialog. Announced to screen readers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DialogClose [#dialogclose] Closes the dialog on click. Use `asChild` for custom close elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DialogOverlay [#dialogoverlay] Dimmed overlay behind the dialog panel. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/dialog#api-reference). # Drawer (/docs/components/drawer) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/drawer ``` This component depends on [Scroll Area](/docs/components/scroll-area) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Drawer ├── DrawerTrigger └── DrawerContent ├── DrawerGrabber ├── DrawerContentInner │ ├── DrawerHeader │ └── DrawerBody └── DrawerFooter └── DrawerClose ``` ## Usage [#usage] ```tsx import { Drawer, DrawerTrigger, DrawerContent, DrawerContentInner, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerClose, } from "@/components/ui/drawer"; ``` ```tsx {/** your content here */} ``` ## Examples [#examples] ### Container [#container] Use `DrawerContentInner` to constrain drawer content width to `max-w-sm`. ### Inset Variant [#inset-variant] Use `variant="inset"` on `DrawerContent` so the drawer appears as a floating card rather than edge-to-edge. ### Swipe Directions [#swipe-directions] Control which direction the drawer slides and swipes using `swipeDirection` on the root. ### Snap Points [#snap-points] Use `snapPoints` to allow the drawer to snap to multiple heights. ### Custom spacing [#custom-spacing] Use `[--space:--spacing("value")]` on `DrawerContent` to adjust internal spacing. Default spacing is `--spacing(6)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### Drawer [#drawer] Root element of the drawer. | Prop | Type | Default | | ------------------------ | --------------------------------------- | -------- | | `open` | `boolean` | `-` | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `({ open }: OpenChangeDetails) => void` | `-` | | `swipeDirection` | `"up" \| "down" \| "left" \| "right"` | `"down"` | | `snapPoints` | `(number \| string)[]` | `[1]` | | `defaultSnapPoint` | `number \| string \| null` | `1` | | `snapToSequentialPoints` | `boolean` | `false` | | `closeThreshold` | `number` | `0.25` | | `swipeVelocityThreshold` | `number` | `700` | | `preventDragOnScroll` | `boolean` | `true` | | `modal` | `boolean` | `true` | | `closeOnEscape` | `boolean` | `true` | | `closeOnInteractOutside` | `boolean` | `true` | | `className` | `string` | `-` | ### DrawerTrigger [#drawertrigger] Opens the drawer on click. Use `asChild` for custom trigger elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DrawerContent [#drawercontent] Holds the drawer panel. Supports swipe-to-close; direction inherited from root `swipeDirection`. | Prop | Type | Default | | ----------- | ---------------------- | ----------- | | `variant` | `"default" \| "inset"` | `"default"` | | `className` | `string` | `-` | | Attribute | Default | | --------- | -------------- | | `--bleed` | `3rem` | | `--space` | `--spacing(4)` | ### DrawerContentInner [#drawercontentinner] Wrapper that constrains content to `max-w-sm` and centers it. Use to wrap the main body (header + body) or footer actions. When used inside `DrawerFooter`, inherits `flex-col-reverse` and `gap-2` for button layout. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### DrawerHeader [#drawerheader] Header area for title and description. Accepts props or children. | Prop | Type | Default | | ------------- | -------- | ------- | | `title` | `string` | `-` | | `description` | `string` | `-` | | `className` | `string` | `-` | ### DrawerTitle [#drawertitle] Accessible title for the drawer. Announced to screen readers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DrawerDescription [#drawerdescription] Accessible description for the drawer. Announced to screen readers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### DrawerBody [#drawerbody] Scrollable body content. Uses [ScrollArea](/docs/components/scroll-area) for overflow. Supports `scrollFade` for gradient edges. | Prop | Type | Default | | ------------ | --------- | ------- | | `scrollFade` | `boolean` | `false` | | `className` | `string` | `-` | ### DrawerFooter [#drawerfooter] Footer area for action buttons. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### DrawerClose [#drawerclose] Closes the drawer on click. Use `asChild` for custom close elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/dialog#api-reference). # Editable (/docs/components/editable) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/editable ``` This component depends on [Button](/docs/components/button) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Editable ├── EditableArea │ ├── EditablePreview │ └── EditableInput └── EditableControl ├── EditableEditTrigger ├── EditableCancelTrigger └── EditableSubmitTrigger ``` ## Usage [#usage] ```tsx import { Editable, EditableArea, EditableInput, EditablePreview, EditableControl, EditableCancelTrigger, EditableSubmitTrigger, EditableEditTrigger, } from "@/components/ui/editable"; ``` ```tsx ``` ## Controlled [#controlled] Make the entire form editable at once by using the `edit` prop. The `value` and `onValueChange` props control the editable component programmatically. ## Modes [#modes] The `activationMode` prop controls how editing is triggered. #### Focus [#focus] Editing starts when the field receives focus. #### Click [#click] Editing starts with a single click on the preview. #### Double-Click [#double-click] Editing starts with a double-click on the preview. #### None [#none] No automatic activation. Use `EditableEditTrigger` to manually start editing. ## Sizes [#sizes] The `size` prop on `EditablePreview` controls the preview dimensions. ### Small [#small] ### Large [#large] ## Orientation [#orientation] The `orientation` prop controls the layout of the editable component and its controls. #### Horizontal [#horizontal] #### Vertical [#vertical] ## Examples [#examples] ### With Textarea [#with-textarea] ### Without Controls [#without-controls] Edit without control buttons. Press Enter to save, Escape to cancel. ## API Reference [#api-reference] ### Editable [#editable] Root component. Manages edit mode and value. | Prop | Type | Default | | ---------------- | ------------------------------------ | -------------- | | `activationMode` | `focus \| dblclick \| click \| none` | `'focus'` | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `submitMode` | `both \| enter \| blur \| none` | `'both'` | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### EditableArea [#editablearea] Wraps the input and preview views. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### EditableInput [#editableinput] Input shown when editing. Use `asChild` for custom input elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### EditablePreview [#editablepreview] Shows the value when not editing. Click to enter edit mode. | Prop | Type | Default | | ----------- | -------------------------------------- | ------- | | `asChild` | `boolean` | `-` | | `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"md"` | | `className` | `string` | `-` | ### EditableControl [#editablecontrol] Holds edit/cancel/submit control buttons. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### EditableEditTrigger [#editableedittrigger] Enters edit mode on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### EditableCancelTrigger [#editablecanceltrigger] Cancels editing and reverts to previous value. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | `-` | ### EditableSubmitTrigger [#editablesubmittrigger] Submits the edited value and exits edit mode. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/editable#api-reference). # Field (/docs/components/field) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/field ``` This component depends on [Separator](/docs/components/separator) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text FieldSet ├── FieldLegend └── FieldGroup ├── Field ├── FieldLabel │ └── FieldRequiredIndicator ├── FieldTitle ├── FieldDescription ├── FieldSeparator ├── FieldHelper └── FieldError ``` ## Usage [#usage] ```tsx import { Field, FieldLabel, FieldInput, FieldHelper, FieldError } from "@/components/ui/field"; ``` ```tsx Email Enter your email address Email is required ``` ## Examples [#examples] ### Input [#input] ### Autocomplete [#autocomplete] ### Combobox [#combobox] ### Combobox Multiple [#combobox-multiple] ### Textarea [#textarea] ### Select [#select] ### Checkbox [#checkbox] ### Checkbox Group [#checkbox-group] ### Radio Group [#radio-group] ### Switch [#switch] ### Slider [#slider] Use `SliderLabel` inside the `Slider` to label the slider. ### Number Input [#number-input] ### Field Group [#field-group] ## API Reference [#api-reference] ### Field [#field] Root layout for label, control, and helper/error text. | Prop | Type | Default | | ------------- | -------------------------------------------- | ------------ | | `orientation` | `"vertical" \| "horizontal" \| "responsive"` | `"vertical"` | | `reverse` | `boolean` | `false` | | `invalid` | `boolean` | `-` | | `disabled` | `boolean` | `-` | | `required` | `boolean` | `-` | | `readOnly` | `boolean` | `-` | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FieldSet [#fieldset] Groups related form controls semantically. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FieldLegend [#fieldlegend] Legend or label for a FieldSet group. | Prop | Type | Default | | ----------- | --------------------- | ---------- | | `variant` | `"legend" \| "label"` | `"legend"` | | `className` | `string` | `-` | ### FieldGroup [#fieldgroup] Groups multiple fields with consistent spacing. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FieldContent [#fieldcontent] Wraps label, description, and error. Use with horizontal orientation. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FieldLabel [#fieldlabel] Label associated with the control. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FieldRequiredIndicator [#fieldrequiredindicator] | Prop | Type | Default | | ----------- | ----------- | ------- | | `children` | `ReactNode` | `"*"` | | `className` | `string` | `-` | | `asChild` | `boolean` | `-` | ### FieldTitle [#fieldtitle] Title wrapper for grouped field content. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FieldDescription [#fielddescription] Helper text or description. Shown in muted foreground. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FieldSeparator [#fieldseparator] Horizontal divider between field groups. Optional center label. | Prop | Type | Default | | ----------- | ----------- | ------- | | `children` | `ReactNode` | `-` | | `className` | `string` | `-` | ### FieldHelper [#fieldhelper] Alias for FieldDescription. Use for consistency with other form libraries. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FieldError [#fielderror] Error message shown when the field is invalid. Shown in destructive color. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/field#api-reference). # File Upload (/docs/components/file-upload) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/file-upload ``` This component depends on [Button](/docs/components/button) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text FileUpload ├── FileUploadTrigger ├── FileUploadDropzone │ ├── FileUploadDropzoneIcon │ ├── FileUploadTitle │ ├── FileUploadDescription │ └── FileUploadHelper ├── FileUploadItemGroup │ └── FileUploadList │ └── FileUploadItem │ ├── FileUploadItemPreview │ │ └── FileUploadItemPreviewImage │ ├── FileUploadItemName │ ├── FileUploadItemSize │ └── FileUploadItemDeleteTrigger └── FileUploadClearTrigger ``` ## Usage [#usage] ```tsx import { FileUpload, FileUploadDropzone, FileUploadDropzoneIcon, FileUploadTitle, FileUploadDescription, FileUploadHelper, FileUploadTrigger, FileUploadList, } from "@/components/ui/file-upload"; ``` ```tsx Drop files here or You can upload up to 2 files at a time. ``` ## Examples [#examples] ### Multiple Files [#multiple-files] Use the `maxFiles` prop to allow uploading multiple files at once. ### Trigger only [#trigger-only] ### Dropzone only [#dropzone-only] Use `FileUploadDropzone` to enable drag-and-drop. It exposes a `data-dragging` attribute for styling the drag state. ### Accepted Files [#accepted-files] Use the `accept` prop to restrict file types. ### With Field [#with-field] Use `Field` to add helper text and error handling. ### Custom Preview [#custom-preview] ```tsx const { acceptedFiles } = useFileUploadContext(); return (
{acceptedFiles.map((file) => (
{file.name}
))}
); ``` ### Media Capture [#media-capture] Use the `capture` prop to capture and upload media directly from the device camera. The capture prop is only supported on mobile devices. ### Directory Upload [#directory-upload] Use the `directory` prop to upload entire folders. Attention: Directory Upload When uploading directories with many files, set `maxFiles` to a higher value or remove it entirely to prevent rejections. ### Clear Trigger [#clear-trigger] Use `FileUploadClearTrigger` to remove all uploaded files at once. ### Custom spacing [#custom-spacing] Use `[--space:--spacing("value")]` on `FileUploadDropzone` to adjust internal spacing. Default spacing is `--spacing(6)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### FileUpload [#fileupload] Root component. Manages file state and wraps the upload UI. | Prop | Type | Default | | ---------------------- | ------------------------------------------------------------------- | ---------- | | `accept` | `string \| Record \| FileMimeType[]` | `-` | | `acceptedFiles` | `File[]` | `-` | | `allowDrop` | `boolean` | `true` | | `capture` | `"user" \| "environment"` | `-` | | `defaultAcceptedFiles` | `File[]` | `-` | | `directory` | `boolean` | `false` | | `disabled` | `boolean` | `-` | | `invalid` | `boolean` | `-` | | `maxFiles` | `number` | `1` | | `maxFileSize` | `number` | `Infinity` | | `minFileSize` | `number` | `0` | | `name` | `string` | `-` | | `onFileAccept` | `(details: FileAcceptDetails) => void` | `-` | | `onFileChange` | `(details: FileChangeDetails) => void` | `-` | | `onFileReject` | `(details: FileRejectDetails) => void` | `-` | | `readOnly` | `boolean` | `-` | | `required` | `boolean` | `-` | | `transformFiles` | `(files: File[]) => Promise` | `-` | | `validate` | `(file: File, details: FileValidateDetails) => FileError[] \| null` | `-` | | `className` | `string` | `-` | ### FileUploadTrigger [#fileuploadtrigger] Opens the native file picker on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FileUploadDropzone [#fileuploaddropzone] Drop zone for drag-and-drop. Exposes `data-dragging` when files are dragged over. | Prop | Type | Default | | -------------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `disableClick` | `boolean` | `-` | | `className` | `string` | `-` | | Attribute | Default | | --------- | -------------- | | `--space` | `--spacing(8)` | ### FileUploadDropzoneIcon [#fileuploaddropzoneicon] Icon shown in the dropzone. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FileUploadTitle [#fileuploadtitle] Title text for the dropzone. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FileUploadDescription [#fileuploaddescription] Description or hint for the dropzone. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FileUploadHelper [#fileuploadhelper] Small text that provides additional information about the dropzone. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FileUploadList [#fileuploadlist] List of uploaded files. Hidden when empty. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FileUploadItemGroup [#fileuploaditemgroup] List of uploaded files. | Prop | Type | Default | | ----------- | -------------------------- | ------- | | `asChild` | `boolean` | `-` | | `type` | `"accepted" \| "rejected"` | `-` | | `className` | `string` | `-` | ### FileUploadItem [#fileuploaditem] Single uploaded file with preview and remove button. | Prop | Type | Default | | ----------- | --------- | -------- | | `file` | `File` | required | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FileUploadItemPreview [#fileuploaditempreview] Preview container for a file. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `type` | `string` | `'.*'` | | `className` | `string` | `-` | ### FileUploadItemPreviewImage [#fileuploaditempreviewimage] Image thumbnail for image files. Use inside `FileUploadItemPreview` with `type="image/*"`. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FileUploadItemName [#fileuploaditemname] Shows the file name. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FileUploadItemSize [#fileuploaditemsize] Shows the formatted file size. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FileUploadItemDeleteTrigger [#fileuploaditemdeletetrigger] Removes a single file from the list. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### FileUploadClearTrigger [#fileuploadcleartrigger] Removes all files from the list. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `-` | | `className` | `string` | `-` | ### useFileUploadContext [#usefileuploadcontext] Hook to access file upload state and methods. Use inside `FileUpload` or `FileUploadRootProvider`. | Property | Type | | -------------------- | ------------------------------------------------------- | | `acceptedFiles` | `File[]` | | `rejectedFiles` | `FileRejection[]` | | `openFilePicker` | `() => void` | | `deleteFile` | `(file: File, type?: ItemType) => void` | | `clearFiles` | `() => void` | | `clearRejectedFiles` | `() => void` | | `getFileSize` | `(file: File) => string` | | `createFileUrl` | `(file: File, cb: (url: string) => void) => () => void` | | `setClipboardFiles` | `(dt: DataTransfer) => boolean` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/file-upload#api-reference). # Float (/docs/components/float) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/float ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Float } from "@/components/ui/float"; ``` ```tsx
{/** floated content **/}
``` ## Placement [#placement] ## API Reference [#api-reference] ### Float [#float] | Prop | Type | Default | | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | | `placement` | `"top-start" \| "top-center" \| "top-end" \| "middle-start" \| "middle-center" \| "middle-end" \| "bottom-start" \| "bottom-center" \| "bottom-end"` | `"top-end"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | # Floating Panel (/docs/components/floating-panel) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/floating-panel ``` This component depends on [Button](/docs/components/button) and [Scroll Area](/docs/components/scroll-area) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text FloatingPanel ├── FloatingPanelTrigger └── FloatingPanelContent ├── FloatingPanelDragTrigger ├── FloatingPanelHeader │ ├── FloatingPanelControl │ │ ├── FloatingPanelMinimize │ │ ├── FloatingPanelMaximize │ │ └── FloatingPanelRestore │ ├── FloatingPanelTitle │ ├── FloatingPanelResizeTrigger │ ├── FloatingPanelStageTrigger │ └── FloatingPanelCloseTrigger ├── FloatingPanelBody └── FloatingPanelFooter ``` ## Usage [#usage] ```tsx import { FloatingPanel, FloatingPanelTrigger, FloatingPanelContent, FloatingPanelHeader, FloatingPanelTitle, FloatingPanelBody, } from "@/components/ui/floating-panel"; ``` ```tsx ``` ## Examples [#examples] ### Controlled Size [#controlled-size] Control the panel size programmatically using the `size` and `onSizeChange` props. ### Controlled Position [#controlled-position] Control the panel position programmatically using the `position` and `onPositionChange` props. ### Custom spacing [#custom-spacing] Use `[--space:--spacing("value")]` on `FloatingPanelContent` to adjust internal padding. Default spacing is `--spacing(4)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### FloatingPanel [#floatingpanel] Root component. Manages panel position and drag state. | Prop | Type | Default | | ------------------ | ------------------------------------------ | ------- | | `open` | `boolean` | `-` | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `(details: OpenChangeDetails) => void` | `-` | | `position` | `Point` | `-` | | `defaultPosition` | `Point` | `-` | | `onPositionChange` | `(details: PositionChangeDetails) => void` | `-` | | `size` | `Size` | `-` | | `defaultSize` | `Size` | `-` | | `onSizeChange` | `(details: SizeChangeDetails) => void` | `-` | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `closeOnEscape` | `boolean` | `true` | | `draggable` | `boolean` | `true` | | `resizable` | `boolean` | `true` | | `className` | `string` | `-` | ### FloatingPanelTrigger [#floatingpaneltrigger] Opens the floating panel on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FloatingPanelContent [#floatingpanelcontent] Holds the panel content. | Prop | Type | Default | | ----------- | --------- | ------- | | `resizable` | `boolean` | `true` | | `className` | `string` | `-` | | Attribute | Default | | --------- | -------------- | | `--space` | `--spacing(4)` | ### FloatingPanelHeader [#floatingpanelheader] Header area. Acts as drag handle for repositioning. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### FloatingPanelTitle [#floatingpaneltitle] Title for the panel. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FloatingPanelBody [#floatingpanelbody] Scrollable body content. Uses [ScrollArea](/docs/components/scroll-area) for overflow. | Prop | Type | Default | | ------------ | --------- | ------- | | `scrollFade` | `boolean` | `false` | | `className` | `string` | `-` | ### FloatingPanelCloseTrigger [#floatingpanelclosetrigger] Closes the panel on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/floating-panel#api-reference). # Frame (/docs/components/frame) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/frame ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Frame ├── FramePanel └── FrameHeader ├── FrameTitle ├── FrameDescription └── FrameFooter ``` ## Usage [#usage] ```tsx import { Frame, FrameHeader, FrameTitle, FrameDescription, FramePanel, FrameFooter, } from "@/components/ui/frame"; ``` ```tsx Title Description Content Footer ``` ## Title & Description [#title--description] `FrameHeader` supports two usage patterns: ### Using props [#using-props] Pass `title` and `description` props directly to `FrameHeader`. ```tsx showLineNumbers ``` > This approach does not require `FrameTitle` or `FrameDescription` components. ### Using components [#using-components] Use `FrameTitle` and `FrameDescription` as children for more control. ```tsx showLineNumbers Frame Title Frame description ``` ## Examples [#examples] ### Separated Panels [#separated-panels] By default, multiple panels are separated with spacing between them. ## API Reference [#api-reference] ### Frame [#frame] Main container for grouping related content into panels. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FramePanel [#framepanel] A single panel with optional header and footer. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FrameHeader [#frameheader] Header area for the panel. Often contains title and description. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FrameTitle [#frametitle] Panel title or heading. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FrameDescription [#framedescription] Panel description or subtitle. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### FrameFooter [#framefooter] Footer area for the panel. Often contains actions. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Hint (/docs/components/hint) For the full Tooltip component, check out the [Tooltip](/docs/components/tooltip) component. ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/hint ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Hint ├── HintTrigger └── HintContent ``` ## Usage [#usage] ```tsx import { Hint, HintTrigger, HintContent } from "@/components/ui/hint"; ``` ```tsx ``` ## Hint vs Tooltip [#hint-vs-tooltip] * **Hint**: A lightweight, minimal tooltip that shows information, no external dependencies. * **Tooltip**: A more complex component that provides a more full-featured tooltip with a variety of options. ## Controlled [#controlled] Pass `open` and `onOpenChange` to controlled hint. ## Examples [#examples] ### Positions [#positions] ## API Reference [#api-reference] ### Hint [#hint] Root wrapper. Provides hint context to trigger and content. | Prop | Type | Default | | -------------- | ------------------------- | ---------------------------------------- | | `open` | `boolean` | - | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `(open: boolean) => void` | - | | `positioning` | `Positioning` | `"{ placement: 'top', gutter: '10px' }"` | | `className` | `string` | - | | Attribute | Type | Default | | ---------- | -------- | ------- | | `--gutter` | `string` | `10px` | ### HintTrigger [#hinttrigger] Shows the hint on hover or focus. Button by default; use `asChild` for custom elements. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### HintContent [#hintcontent] Hint content shown in a popover on hover or focus. | Prop | Type | Default | | --------------- | --------- | ------- | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `className` | `string` | - | | `asChild` | `boolean` | - | ### HintArrow [#hintarrow] Arrow pointing to the trigger. Rendered inside `HintContent` by default. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | # Hover Card (/docs/components/hover-card) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/hover-card ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text HoverCard ├── HoverCardTrigger └── HoverCardContent ``` ## Usage [#usage] ```tsx import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@/components/ui/hover-card"; ``` ```tsx {/* Content */} ``` ## Triggers Delays [#triggers-delays] The `openDelay` and `closeDelay` props control the delay before the hover card opens and closes respectively. Default values are `100ms` for `closeDelay` and `10ms` for `openDelay`. ## Positioning [#positioning] Control the position of the hover card relative to the trigger using the `positioning` prop. ## Controlled [#controlled] Control the open state programmatically using the `open` and `onOpenChange` props. ## Disabled [#disabled] Use the `disabled` prop to prevent the hover card from opening on hover. ## API Reference [#api-reference] ### HoverCard [#hovercard] Root component. Manages hover state and content visibility. | Prop | Type | Default | | -------------- | -------------------------------------- | ---------------------- | | `closeDelay` | `number` | `100` | | `defaultOpen` | `boolean` | - | | `disabled` | `boolean` | - | | `immediate` | `boolean` | - | | `onOpenChange` | `(details: OpenChangeDetails) => void` | - | | `open` | `boolean` | - | | `openDelay` | `number` | `10` | | `positioning` | `PositioningOptions` | `{ placement: "top" }` | | `className` | `string` | `-` | ### HoverCardTrigger [#hovercardtrigger] Shows the hover card on hover or focus. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | - | ### HoverCardContent [#hovercardcontent] Content shown in a popover when hover card is open. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | - | ### HoverCardArrow [#hovercardarrow] Optional arrow pointing toward the trigger. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | - | | Attribute | Default | | -------------------- | ---------------------------- | | `--arrow-background` | `var(--popover)` | | `--arrow-size` | `calc(1.5 * var(--spacing))` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/hover-card#api-reference). # Image Cropper (/docs/components/image-cropper) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/image-cropper ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text ImageCropper ├── ImageCropperImage ├── ImageCropperSelection ├── ImageCropperHandle └── ImageCropperGrid ``` ## Usage [#usage] ```tsx import { ImageCropper, ImageCropperImage, ImageCropperSelection, } from "@/components/ui/image-cropper"; ``` ```tsx ``` ## Examples [#examples] ### Aspect ratio [#aspect-ratio] Use the `aspectRatio` to lock the crop area to a specific aspect ratio. ### Circle crop [#circle-crop] Use `cropShape="circle"` for profile pictures or avatars. ### Initial crop [#initial-crop] Start with a pre-defined crop area using the `initialCrop` prop. ### Controlled zoom [#controlled-zoom] Control zoom programmatically with the `zoom` and `onZoomChange` props. ### Zoom limits [#zoom-limits] Set `minZoom` and `maxZoom` to constrain how far users can zoom. ### Min and max size [#min-and-max-size] Constrain the crop area size with `minWidth`, `minHeight`, `maxWidth`, and `maxHeight`. ### Fixed crop area [#fixed-crop-area] Set `fixedCropArea` to `true` when the crop area should stay fixed while the image moves underneath. ## API Reference [#api-reference] ### ImageCropper [#imagecropper] Root wrapper. Manages crop state and handles. | Prop | Type | Default | | --------------- | --------------------------------------------------------- | ------------- | | `aspectRatio` | `number` | - | | `cropShape` | `"circle" \| "rectangle"` | `"rectangle"` | | `fixedCropArea` | `boolean` | `false` | | `initialCrop` | `{ x: number; y: number; width: number; height: number }` | - | | `maxHeight` | `number` | `Infinity` | | `maxWidth` | `number` | `Infinity` | | `maxZoom` | `number` | `5` | | `minHeight` | `number` | `40` | | `minWidth` | `number` | `40` | | `minZoom` | `number` | `1` | | `onCropChange` | `(details: CropChangeDetails) => void` | - | | `onZoomChange` | `(details: ZoomChangeDetails) => void` | - | | `rotation` | `number` | - | | `zoom` | `number` | - | | `className` | `string` | - | | Attribute | Default | | ------------------------- | -------------------- | | `--cropper-accent` | `var(--color-white)` | | `--cropper-handler-size` | `--spacing(2)` | | `--cropper-handler-width` | `--spacing(1)` | ### ImageCropperImage [#imagecropperimage] Image to crop. Pass `src` and alt. | Prop | Type | Default | | ----------- | -------- | ------- | | `alt` | `string` | - | | `src` | `string` | - | | `className` | `string` | - | ### ImageCropperSelection [#imagecropperselection] Crop selection overlay with resize handles and optional grid. | Prop | Type | Default | | ----------- | -------------------------------------- | -------- | | `axis` | `"horizontal" \| "vertical" \| "both"` | `"both"` | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/image-cropper#api-reference). # Input Group (/docs/components/input-group) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/input-group ``` This component depends on [Input](/docs/components/input) , [Button](/docs/components/button) , and [Textarea](/docs/components/textarea) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text InputGroup ├── InputGroupAddon ├── InputGroupButton ├── InputGroupText ├── InputGroupInput └── InputGroupTextarea ``` ## Usage [#usage] ```tsx import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, } from "@/components/ui/input-group"; ``` ```tsx https:// ``` ## Align [#align] Use the `align` prop to change the alignment of the input group. ### inline-start [#inline-start] ### inline-end [#inline-end] ### block-start [#block-start] ### block-end [#block-end] ## Size [#size] Use the `size` prop to change the size of the input group. ### Small [#small] ### Medium [#medium] ### Large [#large] ## States [#states] ### Disabled [#disabled] ### Invalid [#invalid] ## Examples [#examples] ### With Tooltip [#with-tooltip] ### With Button [#with-button] ### With Menu [#with-menu] ### With Badge [#with-badge] ### With Keyboard Shortcut [#with-keyboard-shortcut] ### With Inner Label [#with-inner-label] ### With Spinner [#with-spinner] ### With Number Field [#with-number-field] ### With Input Group [#with-input-group] Use `FieldGroup` with textarea to build forms. Combine subject input, message textarea, and action buttons. ### Password Strength Checker [#password-strength-checker] A complete password checker with show/hide toggle, clear button, and real-time strength indicator. A strong password requires at least 8 characters with uppercase, lowercase, number, and special character. ## API Reference [#api-reference] ### InputGroup [#inputgroup] Wraps input with optional addons (labels, buttons, icons) on any side. | Prop | Type | Default | | ----------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `className` | `string` | - | ### InputGroupAddon [#inputgroupaddon] Holds addon content (labels, buttons, icons) beside the input. | Prop | Type | Default | | ----------- | ---------------------------------------------------------------- | ---------------- | | `align` | `"inline-start" \| "inline-end" \| "block-start" \| "block-end"` | `"inline-start"` | | `className` | `string` | - | ### InputGroupButton [#inputgroupbutton] Button inside an addon. Typically used for reveal/hide, clear, or search. | Prop | Type | Default | | ----------- | ------------------------------------------------- | ---------- | | `size` | [ButtonSize](/docs/components/button#sizes) | `"xs"` | | `variant` | [ButtonVariant](/docs/components/button#variants) | `"ghost"` | | `type` | `"button" \| "submit" \| "reset"` | `"button"` | | `className` | `string` | - | ### InputGroupText [#inputgrouptext] Static text label inside an addon. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### InputGroupInput [#inputgroupinput] Text input. Accepts all native input props. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### InputGroupTextarea [#inputgrouptextarea] Multi-line text input. Accepts all native textarea props. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | # Input OTP (/docs/components/input-otp) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/input-otp ``` This component depends on [Input](/docs/components/input) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text InputOTP ├── InputOTPSlot └── InputOTPSeparator ``` ## Usage [#usage] ```tsx import { InputOTP, InputOTPSeparator, InputOTPSlot, } from "@/components/ui/input-otp"; ``` ```tsx ``` ## Controlled [#controlled] Use `value` and `onValueChange` to control the input. ## States [#states] ### Disabled [#disabled] Use the `disabled` prop to disable the input. ### Invalid [#invalid] Use the `invalid` prop to mark the input as invalid and show error styling. ## Examples [#examples] ### Four Digits [#four-digits] Use four `InputOTPSlot` elements for a 4-digit OTP. ### Separator [#separator] Add `InputOTPSeparator` between groups of slots. ### With Placeholder [#with-placeholder] Use the `placeholder` prop to show a placeholder in each slot. ### Blur on Complete [#blur-on-complete] Use the `blurOnComplete` prop to blur the input when all slots are filled. ### Mask [#mask] Use the `mask` prop to mask the input value. ### Custom Size [#custom-size] Pass `*:data-[slot=input-otp-input]:size-*` and `*:data-[slot=input-otp-input]:text-*` to `InputOTP` to override slot dimensions and text size. ## API Reference [#api-reference] ### InputOTP [#inputotp] | Prop | Type | Default | | ---------------- | ------------------------------------ | ------- | | `withFakeCaret` | `boolean` | `false` | | `value` | `string` | - | | `defaultValue` | `string` | - | | `onValueChange` | `({ value, valueAsString }) => void` | - | | `disabled` | `boolean` | - | | `invalid` | `boolean` | - | | `otp` | `boolean` | `true` | | `blurOnComplete` | `boolean` | - | | `mask` | `boolean` | - | ### InputOTPSlot [#inputotpslot] Single OTP slot. Use `index` to specify position, 0 is the first slot. | Prop | Type | Default | | ------- | -------- | ------------ | | `index` | `number` | **required** | ### InputOTPSeparator [#inputotpseparator] Visual separator between slots. *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/pin-input#api-reference). # Input (/docs/components/input) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/input ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Input } from "@/components/ui/input"; ``` ```tsx ``` ## Controlled [#controlled] Control the value with `value` and `onChange`. ## States [#states] ### Disabled [#disabled] Use the `disabled` prop to disable the input. ### Invalid [#invalid] Use the `invalid` prop to mark the input as invalid. ## Sizes [#sizes] Use the `size` prop to change the input height. ### Small [#small] ### Medium [#medium] ### Large [#large] ## Examples [#examples] ### With Field [#with-field] Use [Field](/docs/components/field) components to create an input with a label and a description. ### Field Group [#field-group] Use `FieldGroup` to show multiple `Field` blocks and to build forms. ### File [#file] Use the `type="file"` prop to create a file input. Dedicated File Upload component For more advanced file upload functionality, use the [FileUpload](/docs/components/file-upload) component instead. ### Inline [#inline] Use the `orientation="horizontal"` prop to create an inline input. ### Grid [#grid] ### Badge [#badge] Use `Badge` in the label to highlight a recommended field. ### Input Group [#input-group] Use `InputGroup` to create an input group. ### Button Group [#button-group] Use `ButtonGroup` to create a button group. ## API Reference [#api-reference] ### Input [#input] Text input. Accepts all native input attributes. | Prop | Type | Default | | ----------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `type` | `string` | `text` | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/field#api-reference). # Item (/docs/components/item) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/item ``` This component depends on [Separator](/docs/components/separator) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text ItemGroup ├── ItemSeparator └── Item ├── ItemMedia ├── ItemHeader ├── ItemContent │ ├── ItemTitle │ └── ItemDescription ├── ItemActions └── ItemFooter ``` ## Usage [#usage] ```tsx import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle, } from "@/components/ui/item"; ``` ```tsx ``` ## Variant [#variant] ### Default [#default] ### Outline [#outline] ### Muted [#muted] ## Custom spacing [#custom-spacing] The `[--space:--spacing("value")]` on `ItemContent` controls the internal spacing. Default spacing is `--spacing(3)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## Examples [#examples] ### Icon [#icon] ### Avatar [#avatar] ### Image [#image] ### Group [#group] Use `ItemGroup` to group related items together. ### Header [#header] Use `ItemHeader` to add a header above the item content. ### Link [#link] Use the `asChild` prop to render the item as a link. The hover and focus states will be applied to the anchor element. ### Dropdown [#dropdown] Use `Item` inside a menu or dropdown to display rich content in menu items. ## API Reference [#api-reference] ### Item [#item] Layout for list items with media, title, description, and actions. Use `[--space:--spacing("value")]` via `className` to control padding and gap. Supports `asChild`. | Prop | Type | Default | | ----------- | ----------------------------------- | ----------- | | `variant` | `"default" \| "outline" \| "muted"` | `"default"` | | `asChild` | `boolean` | `false` | | `className` | `string` | - | | Attribute | Default | | --------- | -------------- | | `--space` | `--spacing(3)` | ### ItemGroup [#itemgroup] Groups related items with consistent spacing. Uses a fixed gap; adjust layout with `className` if needed. Has `role="list"` for accessibility. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemSeparator [#itemseparator] Horizontal divider between items in a group. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemMedia [#itemmedia] Avatar, icon, or image for the item. Supports icon and image variants. | Prop | Type | Default | | ----------- | -------------------------------- | ----------- | | `variant` | `"default" \| "icon" \| "image"` | `"default"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemContent [#itemcontent] Wraps the item title and description text. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemTitle [#itemtitle] Primary title or heading for the item. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemDescription [#itemdescription] Secondary description or subtitle for the item. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemActions [#itemactions] Holds action buttons or controls. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemHeader [#itemheader] Full-width header row above the item content. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### ItemFooter [#itemfooter] Full-width footer row below the item content. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | # Kbd (/docs/components/kbd) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/kbd ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Kbd KbdGroup ├── Kbd └── Kbd ``` ## Usage [#usage] ```tsx import { Kbd, KbdGroup } from "@/components/ui"; ``` ```tsx K ``` ## Variant [#variant] ### Outline [#outline] ## Examples [#examples] ### Group [#group] Use `KbdGroup` to group keys into a single shortcut. ### Input Group [#input-group] Use `Kbd` inside `InputGroup` addons to show shortcut hints next to inputs. ### Button [#button] Add shortcut hints to buttons with `Kbd` or `KbdGroup`. ### Tooltip [#tooltip] Show keyboard shortcuts in `Tooltip` content. ## API Reference [#api-reference] ### Kbd [#kbd] Styled representation of a single key. | Prop | Type | Default | | ----------- | ------------------------ | ----------- | | `variant` | `"default" \| "outline"` | `"default"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### KbdGroup [#kbdgroup] Groups multiple keys into one shortcut. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | `false` | # Link Overlay (/docs/components/link-overlay) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/link-overlay ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text LinkBox └── LinkOverlay ``` ## Usage [#usage] ```tsx import { LinkBox, LinkOverlay } from "@/components/ui/link-overlay"; ``` ```tsx

Blog Post Title

``` ## Accessibility [#accessibility] * **Wrapping a whole card in ``** — Screen readers announce all card content as link text (verbose, confusing). * **`LinkOverlay`** — Keeps the link on the heading only. Announcements stay short. * **Full area clickable** — The overlay makes the whole card clickable without extra markup. * **Inner links** — Stay above the overlay and remain focusable. Users can tab between multiple links instead of one. ## Link [#link] The `asChild` prop renders another element with link overlay styling. ## Examples [#examples] ### Article [#article] A blog-style article with metadata, heading, description, and an inner link that stays clickable above the overlay. ### Always use Link [#always-use-link] By default the `LinkOverlay` component will render an `a` tag. To use the Next.js (or any other) `Link` component, make the following updates to `link-overlay.tsx`. ```diff tsx title="components/ui/link-overlay.tsx" showLineNumbers + import Link from "next/link" - import { ark } from "@ark-ui/react/factory" - export const LinkOverlay = (props: React.ComponentProps) => { + export const LinkOverlay = (props: React.ComponentProps) => { const { className, ...rest } = props; return ( - ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/listbox ``` This component depends on [Menu](/docs/components/menu) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Listbox ├── ListboxValueText └── ListboxContent ├── ListboxEmpty └── ListboxItemGroup ├── ListboxItemGroupLabel └── ListboxItem ├── ListboxItemText ├── ListboxItemIndicator └── ListboxShortcut ``` ## Usage [#usage] ```tsx import { createListCollection } from "@ark-ui/react"; import { Listbox, ListboxContent, ListboxItem, ListboxLabel, } from "@/components/ui/listbox"; ``` ```tsx const collection = createListCollection({ items: [ { label: "Brazil", value: "br" }, { label: "Mexico", value: "mx" }, { label: "Ireland", value: "ie" }, ], }); {collection.items.map((item) => ( {item.label} ))} ``` ## Controlled [#controlled] Use `value` and `onValueChange` to control the listbox externally. ## States [#states] ### Disabled [#disabled] Disable the entire listbox with the `disabled` prop. ## Orientation [#orientation] Use `orientation` prop to change the orientation of the listbox. ### Horizontal [#horizontal] ## Selection Mode [#selection-mode] ### Multiple [#multiple] Set `selectionMode="multiple"` to allow selecting multiple items. ### Extended [#extended] Set `selectionMode="extended"` to select multiple items with Cmd/Ctrl modifier. ### None [#none] Set `selectionMode="none"` to disable selection. ## Examples [#examples] ### With Icon [#with-icon] ### With Description [#with-description] ### Image Explorer [#image-explorer] ### Transfer List [#transfer-list] ### Grouping [#grouping] Use `groupBy` in `createListCollection` and `` with `` to group items. ### With Filter [#with-filter] Filter items using `useListCollection` with `useFilter` from `@ark-ui/react`. Call `filter` when the search input changes to filter items by label. ### With Popover [#with-popover] Use the listbox within a popover to create dropdown-like selection menus that overlay other content without taking up permanent screen space. ### Grid Layout [#grid-layout] Use `createGridCollection` with `columnCount` and grid CSS for a grid layout. ## API Reference [#api-reference] ### Listbox [#listbox] Root component. Manages selection state and keyboard navigation. | Prop | Type | Default | | --------------- | ------------------------------------------ | ------------ | | `collection` | `ListCollection` | **required** | | `value` | `string[]` | - | | `defaultValue` | `string[]` | `[]` | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `selectionMode` | `"single" \| "multiple" \| "extended"` | `"single"` | | `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | | `disabled` | `boolean` | - | | `deselectable` | `boolean` | - | | `loopFocus` | `boolean` | `false` | ### ListboxContent [#listboxcontent] Holds the list of options. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxItem [#listboxitem] A single selectable list option. | Prop | Type | Default | | ------------------ | ---------------------------- | ------------ | | `item` | `T` | **required** | | `variant` | `"default" \| "destructive"` | `"default"` | | `asChild` | `boolean` | - | | `highlightOnHover` | `boolean` | - | ### ListboxItemText [#listboxitemtext] Text content for a list item. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxItemIndicator [#listboxitemindicator] Checkmark or icon shown when the item is selected. | Prop | Type | Default | | ----------- | ----------- | ----------- | | `children` | `ReactNode` | `CheckIcon` | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxItemGroup [#listboxitemgroup] Groups related options. Use `heading` or `ListboxItemGroupLabel` for a label. | Prop | Type | Default | | ----------- | --------- | ------- | | `heading` | `string` | - | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxItemGroupLabel [#listboxitemgrouplabel] Label for a group. Must be used inside `ListboxItemGroup`. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxValueText [#listboxvaluetext] Shows the selected value(s) as text. Use for custom trigger or display. | Prop | Type | Default | | ------------- | --------- | ------- | | `placeholder` | `string` | - | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxEmpty [#listboxempty] Shown when the list has no items. Use for empty states. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | - | ### ListboxShortcut [#listboxshortcut] Optional keyboard shortcut hint shown next to an item. *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/listbox#api-reference). # Marquee (/docs/components/marquee) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/marquee ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Add the following animations to your `globals.css` . ```css title="globals.css" showLineNumbers @theme inline { --animate-marquee-x: marqueeX var(--marquee-duration) linear infinite var(--marquee-delay); --animate-marquee-y: marqueeY var(--marquee-duration) linear infinite var(--marquee-delay); @keyframes marqueeX { from { transform: translateX(0); } to { transform: translateX(var(--marquee-translate)); } } @keyframes marqueeY { from { transform: translateY(0); } to { transform: translateY(var(--marquee-translate)); } } } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Marquee ├── MarqueeContent └── MarqueeItem ``` ## Usage [#usage] ```tsx import { Marquee, MarqueeContent, MarqueeItem, } from "@/components/ui/marquee"; ``` ```tsx ``` ## Orientation [#orientation] Use the `orientation` prop to control the orientation of the marquee. ### Horizontal [#horizontal] ### Vertical [#vertical] ## Examples [#examples] ### Pause on hover [#pause-on-hover] Use the `pauseOnInteraction` prop to pause the marquee on hover or focus. ### Reverse [#reverse] Use the `reverse` prop to scroll in the opposite direction. ### Auto fill [#auto-fill] Use the `autoFill` prop to automatically duplicate content to fill the container. ### Spacing [#spacing] Use the `spacing` prop to control the gap between items. ### Fade [#fade] Use the `showEdges` prop to show or hide the gradient fade at the start and end of the marquee. ### Custom speed [#custom-speed] Use the `speed` prop (pixels per second) to control scroll speed. ## API Reference [#api-reference] ### Marquee [#marquee] Root component. Manages the scrolling viewport and animation. | Prop | Type | Default | | -------------------- | ---------------------------- | -------------- | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `speed` | `number` | `50` | | `spacing` | `string` | `"16px"` | | `showEdges` | `boolean` | `true` | | `autoFill` | `boolean` | `false` | | `pauseOnInteraction` | `boolean` | `false` | | `reverse` | `boolean` | `false` | | `className` | `string` | - | ### MarqueeContent [#marqueecontent] Viewport wrapper. Wrap `MarqueeItem` children with this. Animates content horizontally. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### MarqueeItem [#marqueeitem] Single item in the scrolling marquee. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/marquee#api-reference). # Menu (/docs/components/menu) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/menu ``` Install the following dependencies: ```bash npm install @ark-ui/react lucide-react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Menu ├── MenuTrigger └── MenuPositioner └── MenuContent ├── MenuGroup │ └── MenuGroupLabel ├── MenuItem ├── MenuQuickItem ├── MenuCheckboxItem ├── MenuRadioGroup │ └── MenuRadioItem ├── MenuSub │ ├── MenuSubTrigger │ └── MenuSubContent ├── MenuSeparator ├── MenuShortcut └── MenuArrow ``` ## Usage [#usage] ```tsx import { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, MenuQuickItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, } from "@/components/ui/menu"; ``` ```tsx ``` ## Positioning [#positioning] Control the position of the menu relative to the trigger using the `positioning` prop. ## Examples [#examples] ### Nested Menu [#nested-menu] Use `MenuSub`, `MenuSubTrigger`, and `MenuSubContent` for nested submenus. ### Icons [#icons] Combine icons with labels for quick scanning. ### Shortcuts [#shortcuts] Use `MenuShortcut` to show keyboard hints next to menu items. ### Checkboxes [#checkboxes] Use `MenuCheckboxItem` for toggles. ### Radio Group [#radio-group] Use `MenuRadioGroup` and `MenuRadioItem` for a single selection from a set of options. ### With Link [#with-link] Use the `asChild` prop on `MenuItem` with a `anchor` element to render a link. ### With Group Label [#with-group-label] Use `MenuGroup` with `MenuGroupLabel` or the `heading` prop to group related items under a label. ### With Separator [#with-separator] Use `MenuSeparator` to add visual dividers between related groups of menu items. ### Quick Items [#quick-items] Use `MenuQuickItem` for actions with icon-above-text layout, ideal for quick actions like Copy and Share displayed horizontally. ### With Scroll [#with-scroll] Add `max-h-*` and `overflow-y-auto` to `MenuContent` to constrain height and enable native scrolling when there are many items. ### Open a Dialog [#open-a-dialog] Open a dialog from a `MenuItem` with the `onSelect` prop and controlled state. ### Destructive [#destructive] Use `variant="destructive"` on `MenuItem` for irreversible actions like delete. ## API Reference [#api-reference] ### Menu [#menu] Root element of the menu component. | Prop | Type | Default | | --------------- | -------------------------------------- | ------- | | `positioning` | `PositioningOptions` | - | | `open` | `boolean` | - | | `defaultOpen` | `boolean` | - | | `onOpenChange` | `(details: OpenChangeDetails) => void` | - | | `onSelect` | `(details: SelectionDetails) => void` | - | | `closeOnSelect` | `boolean` | `true` | ### MenuTrigger [#menutrigger] Opens the menu on click. Use `asChild` to delegate to a child element. | Prop | Type | Default | | --------- | --------- | ------- | | `asChild` | `boolean` | - | ### MenuContent [#menucontent] Holds menu options. Displayed in a portal, positioned relative to the trigger. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | - | | `className` | `string` | - | ### MenuItem [#menuitem] A single selectable menu option. Supports `asChild` for custom elements. | Prop | Type | Default | | --------------- | ---------------------------- | ------------ | | `value` | `string` | **required** | | `variant` | `"default" \| "destructive"` | `"default"` | | `asChild` | `boolean` | - | | `disabled` | `boolean` | - | | `closeOnSelect` | `boolean` | - | | `onSelect` | `VoidFunction` | - | ### MenuCheckboxItem [#menucheckboxitem] A menu option with a checkbox. Use `checked` and `onCheckedChange` for controlled state. | Prop | Type | Default | | ----------------- | ---------------------------- | ------------ | | `value` | `string` | **required** | | `checked` | `boolean` | - | | `onCheckedChange` | `(checked: boolean) => void` | - | | `disabled` | `boolean` | - | ### MenuRadioGroup [#menuradiogroup] Group of mutually exclusive options. Use `value` and `onValueChange` for controlled state. | Prop | Type | Default | | --------------- | --------------------------------------- | ------- | | `value` | `string` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `heading` | `string` | - | ### MenuRadioItem [#menuradioitem] A single option in a radio group. | Prop | Type | Default | | ---------- | --------- | ------------ | | `value` | `string` | **required** | | `disabled` | `boolean` | - | ### MenuGroup [#menugroup] Groups related items. Use `heading` or `MenuGroupLabel` for a label. | Prop | Type | Default | | --------- | -------- | ------- | | `heading` | `string` | - | ### MenuGroupLabel [#menugrouplabel] Label for a group. Must be used inside `MenuGroup`. ### MenuSeparator [#menuseparator] Visual divider between groups of menu items. ### MenuQuickItem [#menuquickitem] A menu option with icon-above-text layout for quick actions. Use with `flex` to display multiple items horizontally. | Prop | Type | Default | | --------------- | -------------- | ------------ | | `value` | `string` | **required** | | `asChild` | `boolean` | - | | `disabled` | `boolean` | - | | `closeOnSelect` | `boolean` | - | | `onSelect` | `VoidFunction` | - | ### MenuSub / MenuSubTrigger / MenuSubContent [#menusub--menusubtrigger--menusubcontent] Submenu: wrap a nested `Menu`-like structure. `MenuSubTrigger` opens the submenu; `MenuSubContent` holds the nested items. ### MenuShortcut [#menushortcut] Optional keyboard shortcut hint displayed next to a menu item. ### MenuArrow [#menuarrow] Optional arrow pointing toward the trigger. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | | Attribute | Default | | -------------------- | ---------------------------- | | `--arrow-background` | `var(--popover)` | | `--arrow-size` | `calc(1.5 * var(--spacing))` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/menu#api-reference). # Native Select (/docs/components/native-select) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/native-select ``` This component depends on [Field](/docs/components/field) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text NativeSelect ├── NativeSelectOption └── NativeSelectOptGroup └── NativeSelectOption ``` ## Usage [#usage] ```tsx import { NativeSelect, NativeSelectOptGroup, NativeSelectOption, } from "@/components/ui/native-select"; ``` ```tsx Option 1 Option 2 Option 3 ``` ## Native Select vs Select [#native-select-vs-select] * **NativeSelect** — Use for native browser behavior, better performance, or mobile-optimized dropdowns. * **Select** — Use for custom styling, animations, or complex interactions. ## Sizes [#sizes] Use the `size` prop to change the select height. ### Small [#small] ### Medium [#medium] ### Large [#large] ## States [#states] ### Controlled [#controlled] Use `value` and `onChange` to control the select externally. ### Disabled [#disabled] Use the `disabled` prop to disable the select. ### Invalid [#invalid] Use the `invalid` prop to mark the select as invalid. ## Examples [#examples] ### Groups [#groups] Use `NativeSelectOptGroup` to group options with a label. ### With Field [#with-field] Wrap in `Field` with `FieldLabel` and `FieldDescription` for proper labeling and accessibility. ## API Reference [#api-reference] ### NativeSelect [#nativeselect] Extends native ` {collection.items.map((item) => ( {item} ))} ``` ## Controlled [#controlled] Use `value` and `onValueChange` to control the selected items. ## Size [#size] Control trigger size with the `size` prop on SelectTrigger. ### Small [#small] ### Medium [#medium] ### Large [#large] ## States [#states] ### Disabled [#disabled] ### Invalid [#invalid] ## Examples [#examples] ### Multiple [#multiple] Enable multiple selection with the `multiple` prop. ### Grouping [#grouping] Organize options into groups using `groupBy` and `SelectGroup`. ### With Field [#with-field] Use `Field` for labels, helper text, and error handling. ### Max Selection [#max-selection] ### With Scroll [#with-scroll] ### Empty [#empty] Use `SelectEmpty` to display a message when the collection has no items. ## API Reference [#api-reference] ### Select [#select] Root component. | Prop | Type | Default | | --------------- | ------------------------------------------ | ------- | | `collection` | `ListCollection` | - | | `value` | `string[]` | - | | `defaultValue` | `string[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `multiple` | `boolean` | `false` | | `disabled` | `boolean` | - | | `invalid` | `boolean` | - | | `name` | `string` | - | | `required` | `boolean` | - | | `positioning` | `PositioningOptions` | - | | `lazyMount` | `boolean` | `true` | | `unmountOnExit` | `boolean` | `true` | | `className` | `string` | - | ### SelectTrigger [#selecttrigger] Opens the dropdown on click. Displays the selected value or placeholder. | Prop | Type | Default | | ----------- | ---------------------- | ------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `showClear` | `boolean` | `false` | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectValue [#selectvalue] Shows the selected value or placeholder. Use `SelectContext` as children for custom display. | Prop | Type | Default | | ------------- | --------- | ------- | | `placeholder` | `string` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectContent [#selectcontent] Holds the dropdown options. Displayed in a portal. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectClearTrigger [#selectcleartrigger] Button to clear the selected value. Shown when `showClear` is true on `SelectTrigger`. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectGroup [#selectgroup] Groups related options under an optional heading. | Prop | Type | Default | | ----------- | ----------------------- | ------- | | `heading` | `string` \| `ReactNode` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectGroupLabel [#selectgrouplabel] Label for an option group. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectItem [#selectitem] A single selectable option in the dropdown. | Prop | Type | Default | | ----------- | --------- | ------- | | `item` | `T` | - | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SelectEmpty [#selectempty] Shown when the collection has no items (`collection.size === 0`). Place inside `SelectContent`. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/select#api-reference). # Separator (/docs/components/separator) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/separator ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Separator } from "@/components/ui/separator"; ``` ```tsx ``` ## Examples [#examples] ### Vertical [#vertical] Use `orientation` prop to control the orientation of the separator. ### Menu [#menu] ### List [#list] ## API Reference [#api-reference] ### Separator [#separator] Horizontal or vertical divider between content. | Prop | Type | Default | | ------------- | ---------------------------- | -------------- | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `className` | `string` | `-` | *** For complete list of props, see [Ark UI documentation](https://ark-ui.com/docs/components/separator#api-reference). # Sheet (/docs/components/sheet) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/sheet ``` This component depends on [Button](/docs/components/button) and [Dialog](/docs/components/dialog) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Sheet ├── SheetTrigger └── SheetContent ├── SheetHeader │ ├── SheetTitle │ └── SheetDescription ├── SheetBody └── SheetFooter └── SheetClose ``` ## Usage [#usage] ```tsx import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"; ``` ```tsx Open Sheet Title Sheet Description ``` ## Sides [#sides] Control which side the sheet slides in from using the `side` prop. ## Examples [#examples] ### Inset Variant [#inset-variant] Use the `variant="inset"` prop to add padding. The sheet appears as a floating card rather than edge-to-edge. ### With Scroll [#with-scroll] Use `SheetBody` to make the content area scrollable while keeping header and footer fixed. ### No Close Button [#no-close-button] Use the `showCloseButton` prop to hide the close button in the top right corner. ### Close behavior [#close-behavior] Use `closeOnInteractOutside` and `closeOnEscape` props to prevent closing on outside click and escape. ### Non-Modal [#non-modal] Use `modal={false}` to allow interaction with elements outside the sheet. Disables focus trapping and scroll prevention. ### Custom spacing [#custom-spacing] Use `[--space:--spacing("value")]` on `SheetContent` to adjust internal padding. Default spacing is `--spacing(6)`. > You can use breakpoint utilities to change the internal spacing at different screen sizes. ```css md:[--space:--spacing(6)] lg:[--space:--spacing(8)] ``` ## API Reference [#api-reference] ### Sheet [#sheet] Root component. Uses Ark UI Dialog. Controls open state and slide direction. | Prop | Type | Default | | ------------------------ | --------------------------------------- | ------- | | `open` | `boolean` | `-` | | `defaultOpen` | `boolean` | `false` | | `onOpenChange` | `({ open }: OpenChangeDetails) => void` | `-` | | `modal` | `boolean` | `true` | | `closeOnEscape` | `boolean` | `true` | | `closeOnInteractOutside` | `boolean` | `true` | | `initialFocusEl` | `() => MaybeElement` | `-` | | `finalFocusEl` | `() => MaybeElement` | `-` | | `onEscapeKeyDown` | `(event: KeyboardEvent) => void` | `-` | | `onInteractOutside` | `(event: InteractOutsideEvent) => void` | `-` | | `className` | `string` | `-` | ### SheetTrigger [#sheettrigger] Opens the sheet on click. Use `asChild` for custom triggers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### SheetContent [#sheetcontent] Holds the sheet panel. Slides in from the configured edge. | Prop | Type | Default | | ----------------- | ---------------------------------------- | ----------- | | `side` | `"right" \| "left" \| "top" \| "bottom"` | `"right"` | | `variant` | `"default" \| "inset"` | `"default"` | | `showCloseButton` | `boolean` | `true` | | `className` | `string` | `-` | | Attribute | Default | | --------- | -------------- | | `--space` | `--spacing(6)` | ### SheetHeader [#sheetheader] Header area for title and description. | Prop | Type | Default | | ------------- | -------- | ------- | | `title` | `string` | `-` | | `description` | `string` | `-` | | `className` | `string` | `-` | ### SheetBody [#sheetbody] Scrollable body content. Uses [ScrollArea](/docs/components/scroll-area) for overflow. | Prop | Type | Default | | ------------ | --------- | ------- | | `scrollFade` | `boolean` | `false` | | `className` | `string` | `-` | ### SheetFooter [#sheetfooter] Footer area for action buttons. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### SheetTitle [#sheettitle] Accessible title. Announced to screen readers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### SheetDescription [#sheetdescription] Accessible description. Announced to screen readers. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### SheetClose [#sheetclose] Closes the sheet on click. | Prop | Type | Default | | ----------- | --------- | ------- | | `asChild` | `boolean` | `false` | | `className` | `string` | `-` | ### SheetOverlay [#sheetoverlay] Dimmed overlay behind the sheet. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | `-` | ### SheetPositioner [#sheetpositioner] Positioning wrapper for sheet content. Used internally; expose for custom layouts. | Prop | Type | Default | | ----------- | ---------------------------------------- | ----------- | | `side` | `"right" \| "left" \| "top" \| "bottom"` | `-` | | `variant` | `"default" \| "inset"` | `"default"` | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/dialog#api-reference). # Sidebar (/docs/components/sidebar) For full-page examples that wire the sidebar: Browse the Sidebar Components (soon). ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/sidebar ``` This component depends on [Button](/docs/components/button) , [Input](/docs/components/input) , [Scroll Area](/docs/components/scroll-area) , [Separator](/docs/components/separator) , [Sheet](/docs/components/sheet) , [Skeleton](/docs/components/skeleton) , [Tooltip](/docs/components/tooltip) , and [useIsMobile](/docs/components/use-is-mobile) . Install them first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text SidebarProvider ├── Sidebar │ ├── SidebarHeader │ ├── SidebarContent │ │ └── SidebarGroup │ │ ├── SidebarGroupLabel │ │ ├── SidebarGroupAction │ │ ├── SidebarGroupContent │ │ └── SidebarMenu │ │ ├── SidebarMenuItem │ │ │ ├── SidebarMenuButton │ │ │ ├── SidebarMenuAction │ │ │ └── SidebarMenuBadge │ │ └── SidebarMenuSub │ │ ├── SidebarMenuSubButton │ │ └── SidebarMenuSubItem │ ├── SidebarFooter │ ├── SidebarSeparator │ └── SidebarInput ├── SidebarTrigger ├── SidebarRail └── SidebarInset ``` ## Structure [#structure] Piecing a `Sidebar` together usually means: * `` — Owns open/collapsed state, mobile sheet state, and keyboard shortcut handling. * `` — Fixed (or sheet) column: `placement`, `variant`, and `collapsible` behavior. * `` / `` — Pin content to the top or bottom of the column. * `` — Scrollable middle; optional `scrollFade` on the inner scroll area. * `` — Labeled section inside the scroll region. * `` — Icon/control wired to `useSidebar().toggleSidebar`. * `` — Main document column beside the sidebar (required for `variant="inset"`). Optional helpers: `` (edge hit target), the `` building blocks (submenus, badges, skeletons, actions)—same roles as in the upstream doc. ## Usage [#usage] `app/layout.tsx` keeps the provider at the top level: ```tsx title="app/layout.tsx" import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; import { AppSidebar } from "@/components/app-sidebar"; export default function Layout({ children }: React.PropsWithChildren) { return (
{children}
); } ``` The sidebar column itself is usually a dedicated module: ```tsx title="components/app-sidebar.tsx" import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, } from "@/components/ui/sidebar"; export function AppSidebar() { return ( ); } ``` ## Controlled [#controlled] Use the `onOpenChange` prop to control the sidebar open state. ```tsx "use client"; import React from "react"; import { Sidebar, SidebarProvider } from "@/components/ui/sidebar"; export const ControlledLayout = () => { const [open, setOpen] = React.useState(false); return ( ); } ``` ## Theming [#theming] Sidebar uses CSS variables to style the sidebar. See the full palette in [Colors](/docs/colors). ### Variable Reference [#variable-reference] *
`--sidebar` — Sidebar background *
`--sidebar-foreground` — Sidebar text *
`--sidebar-primary` — Active item background *
`--sidebar-accent` — Hover and active states *
`--sidebar-border` — Sidebar borders *
`--sidebar-ring` — Focus rings Learn more about styling in the [Styling](/docs/styling) section. ## Styling [#styling] React to collapse mode and peer state with utilities. ```tsx ``` ```tsx ``` ## Keyboard shortcut [#keyboard-shortcut] The toggle listens for **`⌘B`** on macOS and **`Ctrl+B`** elsewhere (`SIDEBAR_KEYBOARD_SHORTCUT` in source). Match that expectation in shortcuts or help copy. ## API Reference [#api-reference] ### SidebarProvider [#sidebarprovider] `SidebarProvider` must wrap any tree that calls `useSidebar` or renders `Sidebar` / `SidebarTrigger`. It forwards standard `div` props (including `className` and `style`). | Name | Type | Description | | -------------- | ------------------------- | -------------------------------------------------- | | `defaultOpen` | `boolean` | Initial open state on desktop (`true` by default). | | `open` | `boolean` | Controlled open flag. | | `onOpenChange` | `(open: boolean) => void` | Fires when the open flag changes. | #### Width [#width] Defaults live beside `SIDEBAR_WIDTH` and `SIDEBAR_WIDTH_MOBILE` inside the registry file. Override per layout with CSS variables on the provider: ```tsx ``` | Attribute | Default | | ------------------------ | ------- | | `--sidebar-width` | `16rem` | | `--sidebar-width-mobile` | `18rem` | | `--sidebar-width-icon` | `3rem` | ### Sidebar [#sidebar] Primary column component: desktop fixed strip + mobile sheet (via [Sheet](/docs/components/sheet)). | Property | Type | Description | | ------------- | ------------------------------------ | ---------------------------------------------------------------------- | | `placement` | `"left" \| "right"` | Which horizontal edge the column hugs (same idea as “side” in shadcn). | | `variant` | `"sidebar" \| "floating" \| "inset"` | Visual treatment: flush rail, floating panel, or inset shell. | | `collapsible` | `"offcanvas" \| "icon" \| "none"` | How width collapses. | ### Collapsible modes [#collapsible-modes] | Mode | Behavior | | ----------- | ----------------------------------------- | | `offcanvas` | Collapses off-screen; rail can recall it. | | `icon` | Shrinks to an icon rail. | | `none` | Fixed width; no collapse animation. | With **`variant="inset"`**, park page content in **`SidebarInset`** so padding, radius, and background line up with the inset shell: ```tsx
{children}
``` ### useSidebar [#usesidebar] ```tsx import { useSidebar } from "@/components/ui/sidebar"; export function Example() { const { state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar, } = useSidebar(); } ``` | Property | Type | Description | | --------------- | --------------------------- | ----------------------------------------- | | `state` | `"expanded" \| "collapsed"` | Desktop collapse mode. | | `open` | `boolean` | Desktop drawer expanded. | | `setOpen` | `(open: boolean) => void` | Set desktop open. | | `openMobile` | `boolean` | Mobile sheet visibility. | | `setOpenMobile` | `(open: boolean) => void` | Control the sheet. | | `isMobile` | `boolean` | Breakpoint-derived mobile flag. | | `toggleSidebar` | `() => void` | Toggles desktop or mobile as appropriate. | ### SidebarHeader [#sidebarheader] Sticky top region—common pattern: workspace switcher or brand row inside a `SidebarMenu`. ```tsx Select workspace ``` Wire menus or [Menu](/docs/components/menu) triggers to `SidebarMenuButton` as needed. ### SidebarFooter [#sidebarfooter] Sticky bottom slot—profile, settings entry, sign-out, etc. ```tsx Username ``` ### SidebarContent [#sidebarcontent] Wraps scrollable groups. Pass **`scrollFade`** when you want a fade on vertical overflow (see component props in source). ```tsx ``` | Attribute | Default | | ------------- | ------- | | `--fade-size` | `3rem` | ### SidebarGroup [#sidebargroup] A titled block with optional `SidebarGroupAction` and `SidebarGroupContent`. ```tsx Application Add project ``` Collapsible groups pair with [Collapsible](/docs/components/collapsible). `SidebarGroupLabel` is a plain label slot—keep the trigger beside it (or fold the pattern into `SidebarMenu` like the preview at the top of this page): ```tsx
Help
``` ### SidebarMenu [#sidebarmenu] Row list inside a group—map data to `SidebarMenuItem` / `SidebarMenuButton`. ```tsx {projects.map((project) => (
{project.name} ))} ``` ### SidebarMenuButton [#sidebarmenubutton] Default renders a **Button**; use **`asChild`** for links. **`isActive`** highlights the active route; **`tooltip`** surfaces collapsed labels. ```tsx Home ``` ### SidebarMenuAction [#sidebarmenuaction] Icon-only or compact action aligned to a row. Use **`showOnHover`** to reveal on row hover. ```tsx Home Add project ``` ### SidebarMenuSub [#sidebarmenusub] Nested list hanging off a parent item. ```tsx Child ``` ### SidebarMenuBadge [#sidebarmenubadge] Small count or pill beside a row. ```tsx 24 ``` ### SidebarMenuSkeleton [#sidebarmenuskeleton] Placeholder rows while async routes or prefs load. ```tsx {Array.from({ length: 5 }).map((_, index) => ( ))} ``` ### SidebarTrigger [#sidebartrigger] Prebuilt toggle wired to context—drop next to your page title or in a toolbar. ```tsx import { useSidebar } from "@/components/ui/sidebar"; export function CustomTrigger() { const { toggleSidebar } = useSidebar(); return ; } ``` Prefer `SidebarTrigger` when you want the default styling and accessibility bundle. ### SidebarRail [#sidebarrail] Draggable edge control that expands or collapses the desktop rail—place after header/content/footer inside `Sidebar`. ```tsx ``` # Signature Pad (/docs/components/signature-pad) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/signature-pad ``` This component depends on [Button](/docs/components/button) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { SignaturePad } from "@/components/ui/signature-pad"; ``` ```tsx ``` ## Examples [#examples] ### Image preview [#image-preview] Use the `onDrawEnd` callback to capture the signature as an image. The callback receives the `getDataUrl(type)` method that returns a promise that resolves to a data URL. ### With field [#with-field] Wrap the signature pad in a `Field` with `FieldLabel` and `FieldHelper` for accessible form integration. ## API Reference [#api-reference] ### SignaturePad [#signaturepad] Root component. Canvas for drawing signatures. Manages strokes and export. | Prop | Type | Default | | ----------- | ----------------------------------- | ------- | | `disabled` | `boolean` | `false` | | `required` | `boolean` | `false` | | `readOnly` | `boolean` | `false` | | `name` | `string` | - | | `onDraw` | `(details: DrawDetails) => void` | - | | `onDrawEnd` | `(details: DrawEndDetails) => void` | - | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/signature-pad#api-reference). # Skeleton (/docs/components/skeleton) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/skeleton ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Skeleton, SkeletonCircle, SkeletonText, } from "@/components/ui/skeleton"; ``` ```tsx ``` ## Examples [#examples] ### Skeleton [#skeleton] Rectangular skeleton placeholder. ### Circle [#circle] Circular skeleton placeholder. ### Text [#text] Use the `lines` prop to control the number of placeholder lines; the last line is shorter by default. ### Loading cards [#loading-cards] ## API Reference [#api-reference] ### Skeleton [#skeleton-1] Rectangular loading placeholder. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SkeletonCircle [#skeletoncircle] Circular loading placeholder. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | ### SkeletonText [#skeletontext] Multi-line text placeholder. Last line is shorter by default to mimic text. | Prop | Type | Default | | ----------- | --------- | ------- | | `lines` | `number` | `2` | | `className` | `string` | - | | `asChild` | `boolean` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/skeleton#api-reference). # Skip Nav (/docs/components/skip-nav) > Click on the "Preview" tab and use the tab key to see the skip to content link. ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/skip-nav ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] * Place `SkipNavLink` as one of the first focusable elements on the page. * Use `SkipNavContent` to wrap your main content. It renders a div with an id that the link targets. ```tsx import { SkipNavContent, SkipNavLink } from "@/components/ui/skip-nav"; ``` ```tsx
Your main content
``` ## API Reference [#api-reference] ### SkipNavLink [#skipnavlink] | Prop | Type | Default | | ----------- | --------- | -------------------- | | `id` | `string` | `"skip-nav-content"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | ### SkipNavContent [#skipnavcontent] | Prop | Type | Default | | ----------- | --------- | -------------------- | | `id` | `string` | `"skip-nav-content"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | # Slider (/docs/components/slider) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/slider ``` This component depends on [Field](/docs/components/field) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Slider } from "@/components/ui/slider"; ``` ```tsx ``` ## Controlled [#controlled] Control the value with `value` and `onValueChange` for a controlled slider. ## Examples [#examples] ### With label and value [#with-label-and-value] Use ``, ``, and `` for accessible labelling and to show the current value. ### Range [#range] Use an array with two values for a range slider. ### Vertical [#vertical] Use `orientation="vertical"` for a vertical slider. ### Disabled [#disabled] Use the `disabled` prop to disable the slider. ### Min and max [#min-and-max] Set `min` and `max` to constrain the slider's value range. ### Marks [#marks] The `showMarkers` and `markerInterval` props display markers and control the interval between them. ### Step [#step] Set `step` to control the slider's granularity. Use with `showMarkers` and `markerLabels` to show custom labels on the markers. Marks are only supported for `horizontal` sliders. ## API Reference [#api-reference] ### Slider [#slider] Root component. Manages value, track, range, and thumb(s). | Prop | Type | Default | | ---------------- | --------------------------------------- | -------------- | | `value` | `number[]` | - | | `defaultValue` | `number[]` | - | | `onValueChange` | `(details: ValueChangeDetails) => void` | - | | `min` | `number` | `0` | | `max` | `number` | `100` | | `step` | `number` | `1` | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `disabled` | `boolean` | `false` | | `showMarkers` | `boolean` | `false` | | `markerInterval` | `number` | `1` | | `markerLabels` | `string[]` | `[]` | | `className` | `string` | - | ### SliderLabel [#sliderlabel] Label for the slider. Required for accessibility. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | ### SliderValue [#slidervalue] Shows the current value. Useful for numeric display or formatting. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | - | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/slider#api-reference). # Spinner (/docs/components/spinner) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/spinner ``` Install the following dependencies: ```bash npm install lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Spinner } from "@/components/ui/spinner"; ``` ```tsx ``` ## Customization [#customization] ## Examples [#examples] ### Size [#size] Use the `size-*` utility class to change the size of the spinner. ### Badge [#badge] Add a spinner to a badge to indicate a loading state. ### Input Group [#input-group] Use a spinner in an input group addon to indicate a loading or validating state. ## API Reference [#api-reference] ### Spinner [#spinner] Use the `Spinner` component to display a loading indicator. It forwards SVG props and supports `className` for sizing and styling. | Prop | Type | Default | | ------------ | -------- | ----------- | | `className` | `string` | - | | `aria-label` | `string` | `"Loading"` | # Status (/docs/components/status) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/status ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --destructive-foreground: var(--color-red-700); --info: var(--color-blue-500); --info-foreground: var(--color-blue-700); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-700); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-700); } .dark { --destructive-foreground: var(--color-red-400); --info: var(--color-blue-500); --info-foreground: var(--color-blue-400); --success: var(--color-emerald-500); --success-foreground: var(--color-emerald-400); --warning: var(--color-amber-500); --warning-foreground: var(--color-amber-400); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Status } from "@/components/ui/status"; ``` ```tsx ``` ## Variants [#variants] ### Default [#default] ### Info [#info] ### Success [#success] ### Warning [#warning] ### Destructive [#destructive] ## Sizes [#sizes] ### Small [#small] ### Medium [#medium] ### Large [#large] ## With Badge [#with-badge] ## With Icon [#with-icon] Place an icon inside the `Status`. ## Custom Size [#custom-size] Use `size-*` on `Status` to customize the size. ## Custom Color [#custom-color] Use `bg-*` and `text-*` utility classes to customize the color. ## API Reference [#api-reference] ### Status [#status] Status badge or indicator. | Prop | Type | Default | | ----------- | --------------------------------------------------- | ----------- | | `variant` | `"success" \| "info" \| "warning" \| "destructive"` | `"success"` | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `className` | `string` | - | | `asChild` | `boolean` | `false` | # Steps (/docs/components/steps) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/steps ``` Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Steps ├── StepsList │ └── StepsItem │ ├── StepsTrigger │ ├── StepsIndicator │ ├── StepsSeparator │ ├── StepsTitle │ └── StepsDescription ├── StepsContent ├── StepsCompletedContent ├── StepsPrevious └── StepsNext ``` ## Usage [#usage] ```tsx import { Steps, StepsList, StepsItem, StepsTrigger, StepsSeparator, StepsIndicator, StepsTitle, StepsDescription, StepsContent, StepsCompletedContent, StepsNext, StepsPrevious } from "@/components/ui/steps"; ``` ```tsx ``` ## Examples [#examples] ### Title [#title] Use `StepsTitle` to display a description for each step. ### Description [#description] Use `StepsDescription` to display a description for each step. ### Vertical [#vertical] Use `orientation="vertical"` for a vertical layout. ### Loading [#loading] ### Controlled [#controlled] Use the `step` and `onStepChange` props to control the active step programmatically. ### Custom Icon [#custom-icon] ## API Reference [#api-reference] ### Steps [#steps] Root component. Manages step state and connectors. | Prop | Type | Default | | ---------------- | -------------------------------------- | -------------- | | `count` | `number` | `-` | | `step` | `number` | `-` | | `defaultStep` | `number` | `-` | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `linear` | `boolean` | `false` | | `onStepChange` | `(details: StepChangeDetails) => void` | `-` | | `onStepComplete` | `() => void` | `-` | ### StepsList [#stepslist] Wraps the list of steps. Handles connector layout. | Attribute | Default | | ------------------- | -------------- | | `--steps-gutter` | `--spacing(2)` | | `--steps-icon-size` | `--spacing(4)` | | `--steps-size` | `--spacing(8)` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/steps#api-reference). # Switch (/docs/components/switch) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/switch ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Switch } from "@/components/ui/switch"; ``` ```tsx ``` ## Controlled [#controlled] Use the `checked` and `onCheckedChange` props to control the switch state programmatically. ## States [#states] ### Invalid [#invalid] Use the `invalid` prop on the `Field` or in the `Switch` component to mark the switch as invalid. ## Examples [#examples] ### Disabled [#disabled] Use the `disabled` prop to disable the switch. ### With Description [#with-description] Use `FieldDescription` to add a description to the switch. ### Card Style [#card-style] Use a card-style layout with the switch for a more prominent display. ### Form Integration [#form-integration] Integrate the switch into a form with proper validation and error handling. ### Customizing Size [#customizing-size] The switch size is controlled by the `[--size-*]` CSS variable. ## API Reference [#api-reference] ### Switch [#switch] Toggle switch for on/off state. Use with a form control. | Prop | Type | Default | | ----------------- | ----------------------------------------- | ------- | | `checked` | `boolean` | `-` | | `defaultChecked` | `boolean` | `false` | | `disabled` | `boolean` | `false` | | `invalid` | `boolean` | `false` | | `name` | `string` | `-` | | `value` | `string \| number` | `"on"` | | `onCheckedChange` | `(details: CheckedChangeDetails) => void` | `-` | | `className` | `string` | `-` | | Attribute | Default | | --------- | -------------- | | `--size` | `--spacing(4)` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/switch#api-reference). # Table (/docs/components/table) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/table ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Table ├── TableCaption ├── TableHeader │ └── TableRow │ └── TableHead ├── TableBody │ └── TableRow │ └── TableCell └── TableFooter └── TableRow └── TableCell ``` ## Usage [#usage] ```tsx import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, TableFooter, } from "@/components/ui/table"; ``` ```tsx
``` ## Accessibility [#accessibility] Always use a `TableCaption` to help assistive technologies announce what the table represents. Use with the `sr-only` class to make the caption screen-reader only if you don't want to show it. ```tsx showLineNumbers Monthly revenue by product. {/* ... */}
``` ## Examples [#examples] ### Striped [#striped] Use `variant="striped"` on `Table` for alternating row backgrounds. ### With footer [#with-footer] Use `TableFooter` for summary rows, totals, or notes. ### With actions [#with-actions] Add an actions column with buttons per row. ### With action bar [#with-action-bar] Use checkboxes for row selection and an action bar that appears when one or more rows are selected. See the [action bar](/docs/components/action-bar) component. ### With context menu [#with-context-menu] Wrap each row with `ContextMenuTrigger` so right-clicking shows a context menu with row actions. ### Disable row hover [#disable-row-hover] Set `isHoverable={false}` on `Table` to disable the hover background on body rows. ## API Reference [#api-reference] ### Table [#table] Scrollable wrapper around a native table. Supports striped and hover variants. | Prop | Type | Default | | ------------- | ---------------------- | --------- | | `variant` | `"plain" \| "striped"` | `"plain"` | | `isHoverable` | `boolean` | `true` | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableHeader [#tableheader] Table header row group. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableBody [#tablebody] Table body row group. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableFooter [#tablefooter] Table footer row group for totals or summary rows. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableRow [#tablerow] A single table row. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableHead [#tablehead] Header cell for column titles. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableCell [#tablecell] Data cell for body or footer rows. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | ### TableCaption [#tablecaption] Accessible caption describing the table. Use `sr-only` for screen-reader only. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | `-` | | `asChild` | `boolean` | `false` | # Tabs (/docs/components/tabs) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/tabs ``` Install the following dependencies: ```bash npm install @ark-ui/react tailwind-variants ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text Tabs ├── TabsList │ └── TabsTrigger └── TabsContent ``` ## Usage [#usage] ```tsx import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; ``` ```tsx Tab 1 Tab 2 Tab 1 content Tab 2 content ``` ## Controlled [#controlled] Use `value` and `onValueChange` to control the active tab programmatically. ## Variant [#variant] ### Default [#default] ### Underline [#underline] ## Orientation [#orientation] Use the `orientation` prop on `Tabs` to lay out tabs horizontally or vertically. ### Horizontal [#horizontal] ### Vertical [#vertical] ## States [#states] ### Disabled [#disabled] Disable individual tabs with the `disabled` prop on `TabsTrigger`. Disabled tabs are not focusable or selectable. ## Examples [#examples] ### Vertical with underline [#vertical-with-underline] Combine `orientation="vertical"` on `Tabs` with `variant="underline"` on `TabsList`. ### With icons [#with-icons] ## API Reference [#api-reference] ### Tabs [#tabs] Root element. Manages tab state and layout. | Prop | Type | Default | | --------------- | --------------------------------------- | -------------- | | `value` | `string` | `-` | | `defaultValue` | `string` | `-` | | `onValueChange` | `(details: ValueChangeDetails) => void` | `-` | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | | `className` | `string` | `-` | ### TabsList [#tabslist] Container for tab triggers and the selection indicator. | Prop | Type | Default | | ----------- | -------------------------- | ----------- | | `variant` | `"default" \| "underline"` | `"default"` | | `className` | `string` | `-` | ### TabsTrigger [#tabstrigger] Button that selects a tab. Must have a `value` matching a `TabsContent` panel. | Prop | Type | Default | | ----------- | --------- | ------------ | | `value` | `string` | **required** | | `disabled` | `boolean` | `false` | | `className` | `string` | `-` | ### TabsContent [#tabscontent] Panel shown when its tab is selected. Must have a `value` matching a `TabsTrigger`. | Prop | Type | Default | | ----------- | -------- | ------------ | | `value` | `string` | **required** | | `className` | `string` | `-` | *** For a complete list of props, see the [Ark UI documentation](https://ark-ui.com/docs/components/tabs#api-reference). # Tags Input (/docs/components/tags-input) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/tags-input ``` This component depends on [Input Group](/docs/components/input-group) . Install it first if you haven't already. Install the following dependencies: ```bash npm install @ark-ui/react lucide-react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Anatomy [#anatomy] ```text TagsInput └── TagsInputContext └── TagsInputItem ``` ## Usage [#usage] ```tsx import { TagsInput, TagsInputContext, TagsInputItem, } from "@/components/ui/tags-input"; ``` ```tsx {({ value }) => value.map((value, index) => ( {value} )) } ``` ## Controlled [#controlled] Use `value` and `onValueChange` to control the tags array. ## States [#states] ### Disabled [#disabled] Use the `disabled` prop to disable the tags input. Users cannot add, remove, or edit tags. ### Invalid [#invalid] Use the `invalid` prop to mark the tags input as invalid for form validation. ## Sizes [#sizes] Use the `size` prop on `TagsInput` to change the control and input height. ### Small [#small] ### Medium [#medium] ### Large [#large] ## Examples [#examples] ### Blur Behavior [#blur-behavior] Use `blurBehavior="add"` to add the current input value as a tag when the field loses focus. ### Controlled Input Value [#controlled-input-value] Use `inputValue` and `onInputValueChange` to control the text field independently. ### Delimiter [#delimiter] Use `delimiter` with a regex to split tags when typing or pasting separators. ### Disabled Editing [#disabled-editing] Pass `editable={false}` to prevent editing existing tags after creation. ### Max Tag Length [#max-tag-length] Use `maxLength` to cap characters per tag. ### Max With Overflow [#max-with-overflow] Use `max` with `allowOverflow` to allow exceeding the limit while marking the root as invalid. ### Paste Behavior [#paste-behavior] Use `addOnPaste` with `delimiter` to create multiple tags from pasted text. ### Sanitize [#sanitize] Use `sanitizeValue` to normalize tag text before tags are added. ### Validation [#validation] Use `validate` to accept or reject tags before they are added. ### With Combobox [#with-combobox] ### With Field [#with-field] Wrap with [Field](/docs/components/field) for labels, descriptions, and validation messaging. ## API Reference [#api-reference] ### TagsInput [#tagsinput] Root component. Composes the control, input, and hidden field for form submission. | Prop | Type | Default | | -------------------- | --------------------------- | ------------------------- | | `size` | `"sm" \| "md" \| "lg"` | `"md"` | | `showClear` | `boolean` | `true` | | `defaultValue` | `string[]` | - | | `value` | `string[]` | - | | `inputValue` | `string` | - | | `defaultInputValue` | `string` | - | | `max` | `number` | `Infinity` | | `maxLength` | `number` | - | | `delimiter` | `string \| RegExp` | `","` | | `allowDuplicates` | `boolean` | `false` | | `allowOverflow` | `boolean` | - | | `disabled` | `boolean` | - | | `invalid` | `boolean` | - | | `required` | `boolean` | - | | `editable` | `boolean` | `false` | | `addOnPaste` | `boolean` | `false` | | `blurBehavior` | `"add" \| "clear"` | - | | `validate` | `(details) => boolean` | - | | `sanitizeValue` | `(value: string) => string` | `(value) => value.trim()` | | `onValueChange` | `(details) => void` | - | | `onInputValueChange` | `(details) => void` | - | | `onHighlightChange` | `(details) => void` | - | | `onValueInvalid` | `(details) => void` | - | | `className` | `string` | - | ### TagsInputInput [#tagsinputinput] Borderless text field for adding new tags. Rendered inside `TagsInput` by default. | Prop | Type | Default | | ------------- | -------- | ------- | | `placeholder` | `string` | - | | `className` | `string` | - | ### TagsInputItem [#tagsinputitem] Represents a single tag. Requires `index` and `value`. Pass the label as children. Renders the delete trigger and edit input. Chip height follows the root `size` (`sm`, `md`, `lg`). Supports `data-highlighted` when navigated by keyboard. | Prop | Type | Default | | ------------ | --------- | ------------ | | `index` | `number` | **required** | | `value` | `string` | **required** | | `showDelete` | `boolean` | `true` | | `disabled` | `boolean` | - | | `className` | `string` | - | ### TagsInputClearTrigger [#tagsinputcleartrigger] Clears all tags. | Prop | Type | Default | | ----------- | --------- | ------- | | `className` | `string` | - | | `asChild` | `boolean` | - | *** For the full list of props and context methods, see the [Ark UI documentation](https://ark-ui.com/docs/components/tags-input#api-reference). # Textarea (/docs/components/textarea) ## Installation [#installation] CLI Manual ```bash npx shadcn@latest add @shark/textarea ``` Install the following dependencies: ```bash npm install @ark-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Textarea } from "@/components/ui/textarea"; ``` ```tsx