Kanshō/Command input

Command / slash input

Operator surface for typing structured commands. Use CommandInput when the user is authoring text and suggestions are assistive; use Combobox when the primary goal is selecting one discrete option.

Included in the single kansho full pack. Components are not offered as separate installs.

With suggestions

Type / to discover commands. Use ↑/↓ to choose, ↵ to select or submit, Esc to close suggestions.

Component documentation

Command Input

components/inputs/command-input.tsx

Purpose

Captures a command and offers keyboard-navigable suggestions.

Appropriate use

Use for terminal-like prompts where a visible prefix and suggested commands support fast entry.

Example

components/inputs/command-input.tsx has a representative live example in the "With suggestions" section on /components/command-input.

States

Supports controlled or internal text, empty and filtered suggestions, active suggestion, open or closed list, invalid state, and custom prefix.

API and props

CommandInput accepts value, onValueChange, prefix, placeholder, suggestions, onSubmit, id, aria-describedby, aria-invalid, aria-label, and className.

Dependencies

React, Lucide icons, Kbd, and the Kansho cn utility.

Accessibility

Uses combobox, listbox, aria-expanded, aria-controls, and aria-activedescendant semantics with arrow and Escape handling.

Limitations

It does not execute commands itself; callers own parsing, history, side effects, and error feedback.

Source

Source: components/inputs/command-input.tsx.

Full pack

components/inputs/command-input.tsx is documented at /components/command-input and installs only through the single Kansho full pack; no individual component install is offered.