` (`React.ComponentProps<"div">`), spread onto the root element.
| Prop | Type | Default | Description |
| --------------- | --------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options` | `readonly PxChoiceOption[]` | — | The cards: `{ value?: string; label: string; description?: string; price?: string }`. `value` defaults to `label`; `price` is shown in monospace. |
| `value` | `string` | — | Controlled selected value. Use with `onValueChange`. |
| `defaultValue` | `string` | `first option` | Initially selected value when uncontrolled. A form reset restores it. |
| `label` | `React.ReactNode` | — | Label above the cards; names the radio group. |
| `name` | `string` | — | Form field name; the selected value submits under it. |
| `disabled` | `boolean` | `false` | Dims the group and disables the cards. |
| `onValueChange` | `(value: string) => void` | — | Called when a different card is selected. |
### Ref
`ref` points at the root `HTMLDivElement`.
## Keyboard
| Keys | Action |
| ---------------------- | ---------------------------------------------------------- |
| ArrowRight / ArrowDown | Select and focus the next card, wrapping at the end. |
| ArrowLeft / ArrowUp | Select and focus the previous card, wrapping at the start. |
## Accessibility
* Cards are native buttons with `role="radio"` and `aria-checked` inside a `role="radiogroup"` labelled by `label`.
* Roving tabindex: only the selected card is in the tab order.
* The pixel outline and check are drawn on an `aria-hidden` canvas; the selection is exposed through `aria-checked`.
* With `name`, a hidden input submits the selected card's value. There is no validation. Form reset restores `defaultValue` (or the first option) and calls `onValueChange` when that changes the value.
* Reduced motion: the outline jumps to the selected card and stops circling.
## Theming
Styled with Tailwind classes on your shadcn theme tokens, so light and dark follow your theme. The accent comes from `--lumesec`. See [Theming](/docs/theming).
This component reads `--foreground`, `--muted-foreground`, `--card`, `--border`, `--lumesec` and `--lumesec-shine`.
## Notes
* Without reduced motion the outline animates continuously while the component is on screen.
* Cards are laid out in an auto-fit grid with a 120 px minimum width.
---
# Command menu
> ⌘K / Ctrl+K command palette with grouped commands, fuzzy search and a springing pixel highlight; focus stays in it while open.
- React: `import { PxCommand } from "@/components/lumesec/px-command"`
- Collection: Pixel UI (https://elements.lumesec.ai/components/pixel-ui)
- Registry item: https://elements.lumesec.ai/r/px-command.json
- Page: https://elements.lumesec.ai/components/pixel-ui/command
Live preview: https://elements.lumesec.ai/view/px-command
Demo source:
```tsx
import { PxCommand, type PxCommandItem } from "@/components/lumesec/px-command";
const COMMANDS: PxCommandItem[] = [
{ group: "Actions", label: "New chat", shortcut: "N" },
{ group: "Actions", label: "New project", shortcut: "P" },
{ group: "Actions", label: "Upload a file", shortcut: "U" },
{ group: "Actions", label: "Invite a teammate", shortcut: "I" },
{ group: "Go to", label: "Projects", shortcut: "G P" },
{ group: "Go to", label: "Usage and billing", shortcut: "G B" },
{ group: "Go to", label: "Settings", shortcut: "G S" },
{ group: "Go to", label: "Connectors", shortcut: "G C" },
{ group: "Preferences", label: "Toggle dark mode", shortcut: "⇧ D" },
{ group: "Preferences", label: "Keyboard shortcuts", shortcut: "?" },
];
export default function PxCommandDemo() {
return (