Command

The Command component is used to access items at ease.

1. Import

KUMUI exports 7 Command-related components:

import { CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator } from "@rohitgadekar/kimui";

2. Usage


3. API

3.1 CommandDialog

AttributeTypeDescriptionDefault
open

boolean

Determines whether the command dialog is open or notfalse
onOpenChange

(open: boolean) => void

Callback function when the open state changes-

3.2 CommandInput

AttributeTypeDescriptionDefault
placeholder

string

Text displayed when the input is empty"Search..."
value

string

The current value of the input field-
onChange

(value: string) => void

Callback triggered when the input value changes-

3.3 CommandList

AttributeTypeDescriptionDefault
children

React.ReactNode

Children that represent the list of command items-

3.4 CommandEmpty

AttributeTypeDescriptionDefault
children

React.ReactNode

Text or elements to display when no results are foundNo results found.

3.5 CommandGroup

AttributeTypeDescriptionDefault
heading

string

The heading label for the group of commands-
children

React.ReactNode

The list of command items within the group-

3.6 CommandItem

AttributeTypeDescriptionDefault
children

React.ReactNode

Content of the command item, typically an action label-
shortcut

string

The keyboard shortcut associated with the item (optional)-

3.7 CommandSeparator

AttributeTypeDescriptionDefault
children

React.ReactNode

Optional children or separator elements-