Install
Pull Command from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Command } from "@brika/clay";import { Command } from "@brika/clay/components/command";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
'use client';
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '@brika/clay/components/command';
import {
Calculator,
Calendar,
FileText,
Settings,
User,
} from 'lucide-react';
/** Inline command palette with grouped items, icons, and keyboard shortcuts. */
export default function CommandDefaultDemo() {
return (
<Command className="rounded-lg border shadow-md w-72">
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>
<Calendar />
Calendar
</CommandItem>
<CommandItem>
<Calculator />
Calculator
</CommandItem>
<CommandItem>
<FileText />
New document
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>
<User />
Profile
<CommandShortcut>⌘P</CommandShortcut>
</CommandItem>
<CommandItem>
<Settings />
Settings
<CommandShortcut>⌘S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
);
}Command, every way
Dialog
Modal command palette triggered by Cmd+K, the standard power-user pattern.
Groups
Three groups, Suggestions, Recent, and Settings, with icons on every item.
Navbar Search
Navbar-style search bar: CommandInputControl embedded in an InputGroup for the focus halo, with CommandList rendered as an absolute dropdown below. The Command palette mode and this detached mode are fully independent parts of the same component tree.
Accessibility
- Arrow keys navigate list items; Enter activates the focused item.
- The input is always focused while the list is visible, Tab closes the command palette.
- Grouped items announce their group heading;
CommandEmptyis announced when no results match. - Wrap in
CommandDialogfor modal use, adds focus trapping and Escape-to-close.
Theme tokens
Every CSS variable Command reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Command
without touching component code.
Command tokens
17 tokens--command-surface-containercolorvar(--popover)components.command.surfaceContainerBackground of the command palette surface.
--command-surface-labelcolorvar(--popover-foreground)components.command.surfaceLabelDefault foreground color inside the command palette.
--command-separator-colorcolorvar(--border)components.command.separatorColorColor of the divider rule between command palette groups.
--command-input-border-colorcolorvar(--border)components.command.inputBorderColorColor of the bottom border under the command input row.
--command-shortcut-colorcolorvar(--muted-foreground)components.command.shortcutColorColor of the keyboard-shortcut hint inside command items.
--command-icon-colorcolorvar(--muted-foreground)components.command.iconColorDefault color of inline SVG icons inside command items.
--command-group-heading-colorcolorvar(--muted-foreground)components.command.groupHeadingColorForeground color of the group heading rendered above grouped items.
--command-placeholder-colorcolorvar(--muted-foreground)components.command.placeholderColorForeground color of the input placeholder in the command search field.
--command-empty-colorcolorvar(--muted-foreground)components.command.emptyColorForeground color of the empty-results message.
--command-radiusradiusvar(--radius-surface)components.command.radiusCommand palette container radius.
--command-padding-xsize0pxcomponents.command.paddingXInline padding inside the command.
--command-padding-ysize0pxcomponents.command.paddingYBlock padding inside the command.
--command-gapsize0pxcomponents.command.gapGap between adjacent children inside the command.
--command-border-widthborder-width1pxcomponents.command.borderWidthBorder width on the command. Set non-zero for outline-style variants.
--command-border-styleborder-stylesolidcomponents.command.borderStyleBorder style on the command (`solid`, `dashed`, `double`, `none`).
--command-shadowshadowvar(--shadow-overlay)components.command.shadowCommand palette elevation.
--command-backdrop-blurblur0pxcomponents.command.backdropBlurBackdrop blur on the command palette container. Set non-zero for a frosted-glass overlay.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.command, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"command": {
"paddingX": "0px"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-command-…) — see the
chips on each token row.
API reference
Props specific to Command. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
<Command />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandDialog />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandEmpty />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandGroup />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandInput />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandInputControl />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandItem />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandList />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandSeparator />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<CommandShortcut />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.