Command
Overview
Command is a design-system component intended for reusable, product-agnostic UI composition.
Import
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, CommandDialog } from "@tesseract-nexus/tesserix-ui"Exports
export {
Command,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
CommandItem,
CommandShortcut,
CommandSeparator,
CommandDialog,
} from "./command"
export type { CommandProps, CommandItemProps } from "./command"Props
export interface CommandProps extends React.HTMLAttributes<HTMLDivElement> {
value?: string
defaultValue?: string
onValueChange?: (value: string) => void
}
export interface CommandItemProps extends React.ComponentProps<"button"> {
value: string
keywords?: string[]
}Variations
No explicit cva variant map found. Variations are primarily structural/compositional for this component.Usage Patterns
Basic
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, CommandDialog } from "@tesseract-nexus/tesserix-ui"
export function Example() {
return <Command />
}Do / Don’t
Do
// Compose with domain wrappers in product code
<Command className="w-full" />Don’t
// Avoid one-off hardcoded values that bypass tokens
<Command className="bg-[#123456] text-[#fafafa] px-[13px]" />Token / Theming Mapping
- Color tokens: —primary, —secondary, —muted, —destructive, —foreground, —background
- Shape tokens: —radius
- Border/input tokens: —border, —input, —ring
- Spacing and typography: Tailwind scale via design-system preset
Interaction Test Checklist
- Interaction: click/keyboard activation for primary paths.
- Focus: visible focus styles and logical tab order.
- Variants: core variants and sizes render correctly.
- Disabled/error states: behavior and ARIA attributes are correct.
- Regression: Storybook visual check for primary states.
Accessibility
- Verify keyboard behavior for all interactive states.
- Ensure labels and semantic roles are present in consuming screens.
- Validate focus treatment and screen-reader output during QA.