Mixins / foldkit-mixins-ui

CommandView

interface · packages/mixins-ui/src/command.ts:82

interface CommandView<Value extends string, Message> {
  readonly id: string
  readonly label: string
  readonly placeholder?: string | undefined
  readonly groups: ReadonlyArray<CommandGroup<Value>>
  readonly query: string
  readonly onQuery: (query: string) => NoInfer<Message>
  readonly active: Option.Option<Value>
  readonly onActive: (value: Value) => NoInfer<Message>
  readonly onRun: (value: Value) => NoInfer<Message>
  readonly loading?: boolean | undefined
  readonly words?: Partial<CommandWords> | undefined
  readonly page?: CommandPage<Message> | undefined
  readonly routes?:
    ReadonlyArray<CommandRoute<Value, NoInfer<Message>>> | undefined
  readonly hints?: ReadonlyArray<CommandHint> | undefined
  readonly style?: NamedStyle<typeof CommandSlots> | undefined
  readonly kbd?: NamedStyle<typeof KbdSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

Members

CommandView.id

property · packages/mixins-ui/src/command.ts:84

readonly id: string

Prefixes every id the menu draws, unique on the page.

CommandView.label

property · packages/mixins-ui/src/command.ts:86

readonly label: string

The field's accessible name.

CommandView.placeholder

property · packages/mixins-ui/src/command.ts:87

readonly placeholder?: string | undefined

CommandView.groups

property · packages/mixins-ui/src/command.ts:88

readonly groups: ReadonlyArray<CommandGroup<Value>>

CommandView.query

property · packages/mixins-ui/src/command.ts:89

readonly query: string

CommandView.onQuery

property · packages/mixins-ui/src/command.ts:90

readonly onQuery: (query: string) => NoInfer<Message>

CommandView.active

property · packages/mixins-ui/src/command.ts:92

readonly active: Option.Option<Value>

The highlighted row, as the application keeps it.

CommandView.onActive

property · packages/mixins-ui/src/command.ts:93

readonly onActive: (value: Value) => NoInfer<Message>

CommandView.onRun

property · packages/mixins-ui/src/command.ts:95

readonly onRun: (value: Value) => NoInfer<Message>

The Message that runs a row.

CommandView.loading

property · packages/mixins-ui/src/command.ts:100

readonly loading?: boolean | undefined

The list is loading what the query asks for: it says words.loading, and is aria-busy. The rows it holds still show, as cmdk's do.

CommandView.words

property · packages/mixins-ui/src/command.ts:102

readonly words?: Partial<CommandWords> | undefined

The fixed text: empty when nothing matches, loading while loading.

CommandView.page

property · packages/mixins-ui/src/command.ts:104

readonly page?: CommandPage<Message> | undefined

The page the menu is on, when the application has stepped into one.

CommandView.routes

property · packages/mixins-ui/src/command.ts:112

readonly routes?:
  ReadonlyArray<CommandRoute<Value, NoInfer<Message>>> | undefined

Keys the application answers in the field, such as Escape clearing the query. They share one keydown owner with the menu's own (↑ ↓ PageUp PageDown Enter and Backspace): a route on the same gesture as another is a diagnostic naming both. Typing and the caret keys stay the field's; Home and End stay the caret's, as in the Combobox; add them here to move the highlight.

CommandView.hints

property · packages/mixins-ui/src/command.ts:114

readonly hints?: ReadonlyArray<CommandHint> | undefined

The keys named in a footer under the list, such as ↑↓ to move and ↵ to run.

CommandView.style

property · packages/mixins-ui/src/command.ts:116

readonly style?: NamedStyle<typeof CommandSlots> | undefined

A style of CommandSlots, for the menu's look.

CommandView.kbd

property · packages/mixins-ui/src/command.ts:118

readonly kbd?: NamedStyle<typeof KbdSlots> | undefined

A style of KbdSlots for shortcuts and hints (Recipes.Kbd); without one they are the keys' words.

CommandView.mixins

property · packages/mixins-ui/src/command.ts:120

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.