Command
A command menu component. From Cmdk.
No results found.
Calendar
Search Emoji
ProfileCtrl + P
SettingsCtrl + S
Installation
npx @rahimstack@latest add command
Dialog
Press Ctrl + K
API Reference
const CommandAnatomy = defineStyleAnatomy({
root: cva([
"UI-Command__root",
"flex h-full w-full flex-col overflow-hidden rounded-md bg-[--paper] text-[--foreground]",
]),
inputContainer: cva([
"UI-Command__input",
"flex items-center px-3 py-2",
"cmdk-input-wrapper",
]),
inputIcon: cva([
"UI-Command__inputIcon",
"mr-2 h-5 w-5 shrink-0 opacity-50",
]),
list: cva([
"UI-Command__list",
"max-h-64 overflow-y-auto overflow-x-hidden",
]),
empty: cva([
"UI-Command__empty",
"py-6 text-center text-base text-[--muted]",
]),
group: cva([
"UI-Command__group",
"overflow-hidden p-1 text-[--foreground]",
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-[--muted]",
]),
separator: cva([
"UI-Command__separator",
"-mx-1 h-px bg-[--border]",
]),
item: cva([
"UI-Command__item",
"relative flex cursor-default select-none items-center rounded-[--radius] px-2 py-1.5 text-base outline-none",
"aria-selected:bg-[--subtle] data-[disable=true]:pointer-events-none data-[disable=true]:opacity-50",
]),
itemIconContainer: cva([
"UI-Command__itemIconContainer",
"mr-2 text-base shrink-0 w-4",
]),
shortcut: cva([
"UI-Command__shortcut",
"ml-auto text-xs tracking-widest text-[--muted]",
]),
})
const CommandDialogAnatomy = defineStyleAnatomy({
content: cva([
"UI-CommandDialog__content",
"overflow-hidden p-0",
]),
command: cva([
"UI-CommandDialog__command",
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-[--muted]",
"[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pb-2 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5",
"[&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-5",
]),
})