CommandMenu API

API documentation for CommandMenu component

CommandMenu#

Props#

Defines valid properties in CommandMenu component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuInstance) => ReactNode)
null
The children to render.
jumpnumber
null
The number of items to jump by.
selectedstring
null
The selected value.
defaultSelectedstring
null
The default selected value.
onSelectedChange(value: string) => void
null
Callback function that is called when the selected value changes.
selectOnHoverboolean
null
Whether to select on hover.
filter(value: string, search: string, keywords?: string[]) => number
null
Callback function that is called to filter the items.
filterableboolean
null
Whether the items are filterable.
loopboolean
null
Whether to loop the items.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenu component.

nametypedefaultdescription
useCommandMenuStore(selector: (state: useCommandMenuStoreState) => T) => T
null
Selector function to access the store.
storeuseCommandMenuStore
null
The store of the useCommandMenu.
listRefRefObject<HTMLDivElement>
null
The ref to the list element.
handleItemPointerMove(e: PointerEvent<HTMLDivElement>) => void
null
Handles the pointer move event.
handleItemClick(e: MouseEvent<HTMLDivElement>, onSelect?: (value?: string) => void) => void
null
Handles the item click event.
handleKeyDown(e: KeyboardEvent) => void
null
Handles the key down event.

Interfaces#

Defines passthrough(pt) options of CommandMenu component.

nametypedefaultdescription
rootCommandMenuPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
listCommandMenuPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the list's DOM element.
groupCommandMenuPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the group's DOM element.
groupHeadingCommandMenuPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the group heading's DOM element.
itemCommandMenuPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the item's DOM element.
emptyCommandMenuPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the empty's DOM element.
inputCommandMenuPassThroughType<HTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the input's DOM element.

Types#

Instance of CommandMenu component.

values
ComponentInstance<CommandMenuProps, CommandMenuState, CommandMenuExposes>

CommandMenuInput#

Props#

Defines valid properties in CommandMenuInput component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuInputInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuInputInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuInputPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuInputInstance) => ReactNode)
null
The children to render.
valuestring
null
Value of the input.
onValueChange(value: string) => void
null
Callback function that is called when the value changes.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenuInput component.

nametypedefaultdescription
commandmenuCommandMenuInstance
null
The CommandMenu component instance.

Interfaces#

Defines passthrough(pt) options of CommandMenuInput component.

nametypedefaultdescription
rootCommandMenuInputPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of CommandMenuInput component.

values
ComponentInstance<CommandMenuInputProps, CommandMenuInputState, CommandMenuInputExposes>

CommandMenuEmpty#

Props#

Defines valid properties in CommandMenuEmpty component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuEmptyInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuEmptyInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuEmptyPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuEmptyInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenuEmpty component.

nametypedefaultdescription
commandmenuCommandMenuInstance
null
The CommandMenu component instance.

Interfaces#

Defines passthrough(pt) options of CommandMenuEmpty component.

nametypedefaultdescription
rootCommandMenuEmptyPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of CommandMenuEmpty component.

values
ComponentInstance<CommandMenuEmptyProps, CommandMenuEmptyState, CommandMenuEmptyExposes>

CommandMenuItem#

Props#

Defines valid properties in CommandMenuItem component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuItemInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuItemInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuItemPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuItemInstance) => ReactNode)
null
The children to render.
valuestring
null
Value of the item.
keywordsstring[]
null
Keywords of the item.
disabledboolean
false
When present, it specifies that the item is disabled.
onSelect(value?: string) => void
null
Callback function that is called when the item is selected.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenuItem component.

nametypedefaultdescription
commandmenuCommandMenuInstance
null
The CommandMenu component instance.

Interfaces#

Defines passthrough(pt) options of CommandPaletteItem component.

nametypedefaultdescription
rootCommandMenuItemPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of CommandMenuItem component.

values
ComponentInstance<CommandMenuItemProps, CommandMenuItemState, CommandMenuItemExposes>

CommandMenuGroup#

Props#

Defines valid properties in CommandMenuGroup component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuGroupInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuGroupInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuGroupPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuGroupInstance) => ReactNode)
null
The children to render.
valuestring
null
Value of the group.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenuGroup component.

nametypedefaultdescription
commandmenuCommandMenuInstance
null
The CommandMenu component instance.

Interfaces#

Defines passthrough(pt) options of CommandMenuGroup component.

nametypedefaultdescription
rootCommandMenuGroupPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of CommandMenuGroup component.

values
ComponentInstance<CommandMenuGroupProps, CommandMenuGroupState, CommandMenuGroupExposes>

CommandMenuGroupHeading#

Props#

Defines valid properties in CommandMenuGroupHeading component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuGroupHeadingInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuGroupHeadingInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuGroupHeadingPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuGroupHeadingInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenuGroupHeading component.

nametypedefaultdescription
commandmenuCommandMenuInstance
null
The CommandMenu component instance.

Interfaces#

Defines passthrough(pt) options of CommandMenuGroupHeading component.

nametypedefaultdescription
rootCommandMenuGroupHeadingPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of CommandMenuGroupHeading component.

values
ComponentInstance<CommandMenuGroupHeadingProps, CommandMenuGroupHeadingState, CommandMenuGroupHeadingExposes>

CommandMenuList#

Props#

Defines valid properties in CommandMenuList component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: CommandMenuListInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: CommandMenuListInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<CommandMenuListPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: CommandMenuListInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Exposes#

Defines the methods and properties exposed by CommandMenuList component.

nametypedefaultdescription
commandmenuCommandMenuInstance
null
The CommandMenu component instance.

Interfaces#

Defines passthrough(pt) options of CommandMenuList component.

nametypedefaultdescription
rootCommandMenuListPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of CommandMenuList component.

values
ComponentInstance<CommandMenuListProps, CommandMenuListState, CommandMenuListExposes>

useCommandMenu#

Props#

State#

Exposes#

Events#

Types#