SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

commandKeys

Arrow-key and Enter navigation for a Command root already paired with commandFilter(model).

tsx
import { commandKeys } from "@sdxc/ui/mixins";

Usage

Adds ArrowDown/ArrowUp/Enter navigation to a Command root already paired with commandFilter(model), mirroring the active match onto aria-selected and aria-activedescendant, and activating it on Enter.

Signature

typescript
commandKeys(model: FilterModel): MixinDescriptor<HTMLElement>

Parameters

ParameterTypeDefaultRequiredDescription
modelFilterModel—YesThe same FilterModel instance passed to commandFilter().

Examples

tsx
let model = new FilterModel();
<Command mix={[commandFilter(model), commandKeys(model)]}>
	<Command.Input />
	<Command.Item id="home" value="Home">
		<a href="/">Home</a>
	</Command.Item>
	<Command.Item id="settings" value="Settings">
		<a href="/settings">Settings</a>
	</Command.Item>
	<Command.Empty>No matches</Command.Empty>
</Command>
@sdxc/ui

Can’t find it? Contact us