structyl

Command

stable

A command palette with fuzzy search, cmdk-style.

Basic usage

Suggestions
Search
Settings

Examples

With shortcuts and groups

A command palette with keyboard shortcuts, icons, and multiple sections.

Suggestions
SearchCtrl K
Favorites
Inbox
Settings
PreferencesCtrl ,

Command palette with groups

Command combines search input, grouped actions, shortcuts and empty states.

Navigation
Dashboard G D
Members G M
Actions
Create project
Open settings

Features

  • Fuzzy filtering.
  • Groups, items, shortcuts.

Installation

bash
pnpm dlx structyl add command

API Reference

Command.Root

A command palette with fuzzy search.

PropTypeDefault
valuestring

Controlled highlighted value.

onValueChange(value: string) => void

Called when the highlighted item changes.

filter(value, search, keywords?) => number

Custom scoring function.

shouldFilterboolean

Whether to filter items internally.

true
loopboolean

Whether arrow navigation wraps.

false

Command.Input

The search field.

PropTypeDefault

Command.List

The scrollable result list.

PropTypeDefault

Command.Item

A command entry.

PropTypeDefault
valuestring

Match value.

keywordsstring[]

Extra search terms.

onSelect(value: string) => void

Called on selection.

disabledboolean

Disable the item.

Command.Group

A labelled group of items.

PropTypeDefault
headingReactNode

Group heading.

Command.Empty

Shown when nothing matches.

PropTypeDefault

Command.Separator

A visual divider.

PropTypeDefault
Command | structyl