Skip to content
Overlays & Tooltips

Command

⌘K command palette (cmdk).

Import

tsx
import { Command } from "@cronus-ui/ui";
bash
npx cronus-ui add command

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component CommandDefault layout:inline style:command {
  label "Command menu"
  text "Type a command…"
  text "Calendar"
  text "Search"
}

page "/audit/command/default" type:custom {
  use CommandDefault
}

API Reference

Generated from the component's exported types.

CommandDialogProps

Extends ComponentProps<typeof Dialog>

Skip CommandDialogProps props table
PropTypeDefaultDescription
title
string"Command Menu"—
description
string"Search for a command to run..."—
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

CommandProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive>

Skip CommandProps props table
PropTypeDefaultDescription
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
loop
boolean——
label
string—Accessible name of the command list.

CommandInputProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive.Input>

Skip CommandInputProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
loop
boolean——
label
string—Accessible name of the command list.

CommandListProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive.List>

Skip CommandListProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
loop
boolean——
label
string—Accessible name of the command list.

CommandEmptyProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>

Skip CommandEmptyProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
loop
boolean——
label
string—Accessible name of the command list.

CommandGroupProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive.Group>

Skip CommandGroupProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
loop
boolean——
label
string—Accessible name of the command list.

CommandItemProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive.Item>

Skip CommandItemProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
loop
boolean——
label
string—Accessible name of the command list.

CommandShortcutProps

Extends ComponentProps<"span">

Skip CommandShortcutProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

CommandSeparatorProps

Extends ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>

Skip CommandSeparatorProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.
loop
boolean——
label
string—Accessible name of the command list.