Skip to content

CommandPalette

widgetsinput

CommandPalette: a fuzzy-search overlay widget

Installation

$ bunx termuijs add command-palette

Copies the source into src/components/command-palette/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { CommandPalette } from '@termuijs/widgets'
ts
new CommandPalette(options: CommandPaletteOptions, style: Partial<Style> = {})

API Reference

CommandPalette

PropTypeRequiredDescription
commandsCommand[]required
onClose() => voidoptional
placeholderstringoptionalPlaceholder shown when query is empty
maxVisiblenumberoptionalMax number of commands shown at once
#input#command-palette