Genesis
@stable

Command

Cmdk-style command palette.

packages/ui/src/components/ui/command.tsx

Import
Subpath export: @marktiderman/genesis-ui
import { Command } from "@marktiderman/genesis-ui";
Exports
Re-exported from @marktiderman/genesis-ui.
  • Command
  • CommandDialog
  • CommandInput
  • CommandList
  • CommandEmpty
  • CommandGroup
  • CommandItem
Components
Auto-generated from TypeScript source via react-docgen-typescript.

Command

PropTypeDefaultDescription
asChildboolean—
disablePointerSelectionboolean—Optionally set to `true` to disable selection via pointer events.
filterCommandFilter—Custom filter function for whether each command menu item should matches the given search query. It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely. By default, uses the `command-score` library.
labelstring—Accessible label for this command menu. Not shown visibly.
loopboolean—Optionally set to `true` to turn on looping around when using the arrow keys.
onValueChange((value: string) => void)—Event handler called when the selected item of the menu changes.
shouldFilterboolean—Optionally set to `false` to turn off the automatic filtering and sorting. If `false`, you must conditionally render valid items based on the search query yourself.
valuestring—Optional controlled state of the selected command menu item.
vimBindingsboolean—Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.

CommandDialog

No declared props.

CommandInput

PropTypeDefaultDescription
asChildboolean—
onValueChange((search: string) => void)—Event handler called when the search value changes.
valuestring—Optional controlled state for the value of the search input.

CommandList

PropTypeDefaultDescription
asChildboolean—
labelstring—Accessible label for this List of suggestions. Not shown visibly.

CommandEmpty

PropTypeDefaultDescription
asChildboolean—

CommandGroup

PropTypeDefaultDescription
asChildboolean—
forceMountboolean—Whether this group is forcibly rendered regardless of filtering.
headingReactNode—Optional heading to render for this group.
valuestring—If no heading is provided, you must provide a value that is unique for this group.

CommandItem

PropTypeDefaultDescription
asChildboolean—
disabledboolean—Whether this item is currently disabled.
forceMountboolean—Whether this item is forcibly rendered regardless of filtering.
keywordsstring[]—Optional keywords to match against when filtering.
onSelect((value: string) => void)—Event handler for when this item is selected, either via click or keyboard selection.
valuestring—A unique value for this item. If no value is provided, it will be inferred from `children` or the rendered `textContent`. If your `textContent` changes between renders, you _must_ provide a stable, unique `value`.

CommandShortcut

No declared props.

CommandSeparator

PropTypeDefaultDescription
alwaysRenderboolean—Whether this separator should always be rendered. Useful if you disable automatic filtering.
asChildboolean—