Skip to content

Command ​

Loading...

<flint-command-shortcut> ​

Displays a keyboard shortcut hint inside a command item. Slot the shortcut string (e.g. ⌘P) as default slot content.

  • Tag: <flint-command-shortcut>
  • Class: FlintCommandShortcut

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandShortcut } from 'flint-ui';

Usage ​

html
<flint-command-shortcut></flint-command-shortcut>

Slots ​

NameDescription
(default)Shortcut text, e.g. ⌘P or Ctrl+K.

CSS Custom Properties ​

PropertyDefault
--flint-border-radius-md—
--flint-text-color-muted—
--flint-font-family—
--flint-border-color—
--flint-text-color—
--flint-hover-color—
--flint-primary-color—

<flint-command-separator> ​

A hairline separator between command groups.

  • Tag: <flint-command-separator>
  • Class: FlintCommandSeparator

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandSeparator } from 'flint-ui';

Usage ​

html
<flint-command-separator></flint-command-separator>

<flint-command-item> ​

A single interactive option inside a command menu.

  • Tag: <flint-command-item>
  • Class: FlintCommandItem

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandItem } from 'flint-ui';

Usage ​

html
<flint-command-item></flint-command-item>

Properties ​

PropertyAttributeTypeDefaultDescription
valuevaluestring''Machine-readable value used for filter matching. Falls back to textContent.
disableddisabledbooleanfalseDisables the item — non-interactive and skipped in keyboard nav.
highlightedhighlightedbooleanfalseSet by parent flint-command to indicate keyboard focus.

Events ​

EventDetailDescription
flint-command-item-select—Fired when the item is activated.

Slots ​

NameDescription
(default)Item label text.
iconLeading icon (16×16).
shortcutTrailing shortcut hint; prefer &lt;flint-command-shortcut&gt;.

Methods ​

MethodDescription
scrollIntoViewIfNeeded()Scroll this item into view (nearest ancestor scroll container).

<flint-command-empty> ​

Empty state message shown when no command items match the current query. Managed automatically by the parent flint-command element.

  • Tag: <flint-command-empty>
  • Class: FlintCommandEmpty

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandEmpty } from 'flint-ui';

Usage ​

html
<flint-command-empty></flint-command-empty>

Slots ​

NameDescription
(default)Message text, e.g. "No results found."

<flint-command-group> ​

A labeled group of command items. The parent flint-command automatically hides the whole group when all its items are filtered out.

  • Tag: <flint-command-group>
  • Class: FlintCommandGroup

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandGroup } from 'flint-ui';

Usage ​

html
<flint-command-group></flint-command-group>

Properties ​

PropertyAttributeTypeDefaultDescription
headingheadingstring''Label rendered above the group items.

Slots ​

NameDescription
(default)flint-command-item elements.

<flint-command-list> ​

Scrollable list container for command items and groups.

  • Tag: <flint-command-list>
  • Class: FlintCommandList

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandList } from 'flint-ui';

Usage ​

html
<flint-command-list></flint-command-list>

Slots ​

NameDescription
(default)flint-command-group, flint-command-item, flint-command-empty, flint-command-separator.

CSS Custom Properties ​

PropertyDefault
--flint-command-list-max-height300px

<flint-command-input> ​

Search input for the command menu. Dispatches _cmd-filter events that the parent flint-command intercepts to apply filtering.

  • Tag: <flint-command-input>
  • Class: FlintCommandInput

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandInput } from 'flint-ui';

Usage ​

html
<flint-command-input></flint-command-input>

Properties ​

PropertyAttributeTypeDefaultDescription
placeholderplaceholderstring'Type a command or search...'Placeholder text shown when input is empty.
valuevaluestring''Current input value.

Events ​

EventDetailDescription
_cmd-filter{ query: input.value }

Methods ​

MethodDescription
focus()Focus the inner input element.
reset()Reset the input value and broadcast an empty filter.

<flint-command> ​

Root command menu component. Manages search filtering and keyboard navigation. Compose it with flint-command-input, flint-command-list, flint-command-group, flint-command-item, flint-command-separator, and flint-command-empty.

  • Tag: <flint-command>
  • Class: FlintCommand

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommand } from 'flint-ui';

Usage ​

html
<flint-command></flint-command>

Events ​

EventDetailDescription
flint-command-item-select—Bubbles up from activated items.

Slots ​

NameDescription
(default)Command menu content.

CSS Custom Properties ​

PropertyDefault
--flint-command-backdrop-bgrgba(0, 0, 0, 0.5
--flint-command-z-index1400
--flint-command-dialog-width512px
--flint-command-bgvar(--flint-surface-1
--flint-command-panel-border-colorvar(--flint-border-color
--flint-command-highlight-bgvar(--flint-hover-color
--flint-command-highlight-colorvar(--flint-text-color
--flint-command-list-max-height300px
--flint-command-border-colorvar(--flint-border-color

Methods ​

MethodDescription
reset()Reset search query and restore all items.

<flint-command-dialog> ​

Modal dialog wrapper for a command menu. Opens with a smooth backdrop + scale animation. Pressing Escape or clicking the backdrop fires flint-command-dialog-close.

  • Tag: <flint-command-dialog>
  • Class: FlintCommandDialog

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintCommandDialog } from 'flint-ui';

Usage ​

html
<flint-command-dialog></flint-command-dialog>

Properties ​

PropertyAttributeTypeDefaultDescription
openopenbooleanfalseControls the open/closed state of the dialog.

Events ​

EventDetailDescription
flint-command-dialog-close—Fired when the dialog should close.

Slots ​

NameDescription
(default)Place a flint-command element here.

CSS Custom Properties ​

PropertyDefault
--flint-command-dialog-width512px