# drift-ui: full usage docs > A shadcn-compatible component registry. Tags input, stepper, tree view, file dropzone and more, built on Radix or Base UI with Tailwind v4 and installed with the shadcn CLI. ## Setup Install components from the drift-ui registry into this project. drift-ui is a shadcn-compatible component registry built on Radix or Base UI with Tailwind v4. Read https://drift-ui.dev/llms.txt for the component list and https://drift-ui.dev/llms-full.txt for props and usage examples before writing code. 1. Make sure the project uses shadcn. If there is no components.json, run `npx shadcn@latest init` and accept the defaults that match the project. 2. Register the namespace: `npx shadcn@latest registry add @drift-ui=https://drift-ui.dev/r/{style}/{name}.json`. The CLI fills in {style} from components.json, so a `base-` style gets the Base UI build and any other style gets Radix. 3. Choose the components this task needs from llms.txt and install them, for example `npx shadcn@latest add @drift-ui/tags-input @drift-ui/stepper`. The CLI also installs their registry and npm dependencies. 4. Import them from the project's ui alias, usually @/components/ui/. Compose them in feature code rather than editing the installed files, and keep the project's existing theme tokens. 5. Run the project's typecheck and lint, then list the components you installed and where you used them. Optional: `npx shadcn@latest mcp init --client ` (claude, cursor, vscode, codex or opencode) lets you search and install from the registry over MCP. ## Conventions - Every component is a plain file in the project after install, with data-slot attributes on each part and className forwarded through cn(). - Inputs follow one state pattern: value + onValueChange for controlled use, defaultValue for uncontrolled use. - Colors, radius and focus rings come from the shadcn CSS variables (--primary, --border, --ring and so on), so the project's theme applies automatically. ## Avatar (@drift-ui/avatar) An image with a fallback for when it fails to load. Install: `npx shadcn@latest add @drift-ui/avatar` Source: https://drift-ui.dev/r/avatar.json Depends on: utils, radix-ui Identical API to the shadcn/ui component of the same name. Skip it if the project already has one. ## Avatar Group (@drift-ui/avatar-group) Stacked avatars with presence dots and a +N overflow that lists the rest. Install: `npx shadcn@latest add @drift-ui/avatar-group` Source: https://drift-ui.dev/r/avatar-group.json Depends on: utils, avatar, popover AvatarGroup stacks AvatarGroupItem children with overlap. max shows that many avatars and turns the rest into a +N button that opens a popover listing them by name. AvatarGroupItem takes name (required, used for initials, the title tooltip and the screen reader label), src and status (online, away, busy or offline) for a presence dot. Built on the shadcn avatar and popover primitives. Pass aria-label to the group. ```tsx import { AvatarGroup, AvatarGroupItem } from "@/components/ui/avatar-group" export function Assignees({ users }: { users: { id: string; name: string; image?: string }[] }) { return ( {users.map((user) => ( ))} ) } ``` ### AvatarGroup Stacks its AvatarGroupItem children with overlap. Avatars past max collapse into a +N button that opens a popover listing them. Pass aria-label. - `max` (`number`): Most avatars shown before the +N button. Other props go to the
. ### AvatarGroupItem One avatar built on the shadcn Avatar, with initials as the fallback and an optional presence dot. - `name` (`string`, required): Used for the initials, the tooltip and the screen reader label. - `src` (`string`): Image URL. - `status` (`"online" | "away" | "busy" | "offline"`): Adds a presence dot and reads the status aloud. Other props go to the . ## Bulk Action Bar (@drift-ui/bulk-action-bar) A floating toolbar for acting on selected rows. Escape clears the selection. Install: `npx shadcn@latest add @drift-ui/bulk-action-bar` Source: https://drift-ui.dev/r/bulk-action-bar.json Depends on: utils, button, radix-ui, lucide-react, motion, class-variance-authority Floating toolbar (Radix or Base UI) that animates in when selectedCount > 0. Props: selectedCount, onClear (also bound to Escape), placement: 'viewport' (portaled, default) or 'container' (absolute inside a relative parent). Put BulkActionBarButton children inside. Requires the motion package. ```tsx import { BulkActionBar, BulkActionBarButton } from "@/components/ui/bulk-action-bar" export function FileActions({ selected, onClear }: { selected: string[]; onClear: () => void }) { return ( Move Delete ) } ``` ### BulkActionBar A floating toolbar that springs in while something is selected. Put BulkActionBarButton children inside. Needs the motion package. - `selectedCount` (`number`, required): Number of selected items. The bar shows while it is above 0. - `onClear` (`() => void`, required): Called by the clear button and by Escape. - `placement` (`"viewport" | "container"`, default `"viewport"`): viewport portals the bar to the bottom of the screen, container positions it inside the nearest relative parent. - `aria-label` (`string`, default `"Bulk actions"`): Name of the toolbar. Other props go to the Toolbar root. ### BulkActionBarButton A Button that joins the toolbar's arrow key navigation. - `variant` (`Button variant`, default `"ghost"`): Button style. - `size` (`Button size`, default `"sm"`): Button size. Other props go to the Button. ## Color Picker (@drift-ui/color-picker) Saturation area, hue and alpha sliders, eyedropper, hex input and an oklch readout. Install: `npx shadcn@latest add @drift-ui/color-picker` Source: https://drift-ui.dev/r/color-picker.json Depends on: utils, button, input, popover, @drift-ui/use-controllable-state, radix-ui, lucide-react Popover picker with a saturation and brightness area, hue and alpha sliders, hex input, oklch readout and the native EyeDropper where supported. Value is a hex string (#rrggbb or #rrggbbaa). Props: value/defaultValue/onValueChange, showAlpha, swatches. ```tsx import { ColorPicker } from "@/components/ui/color-picker" export function BrandColorField() { return } ``` ### ColorPicker A trigger button that opens a saturation and brightness area, hue and alpha sliders, a hex field, an oklch readout and, where the browser has it, the EyeDropper. - `value` (`string`): Controlled hex color, "#rrggbb" or "#rrggbbaa". - `defaultValue` (`string`, default `"#000000"`): Initial value when uncontrolled. - `onValueChange` (`(hex: string) => void`): Called with the new hex color. - `showAlpha` (`boolean`, default `true`): Show the opacity slider. - `swatches` (`string[]`): Preset hex colors shown as buttons. - `variant` (`Button variant`, default `"outline"`): Style of the trigger button. - `size` (`Button size`): Size of the trigger button. Other props go to the trigger