CommandPalette

Description

A command palette utility

CommandPalette provides a fast and efficient way for users to navigate an application and trigger commands using only their keyboard. Inspired by modern editors and tools, it allows users to search through a list of actions and execute them with a single keystroke.

API reference

class

CommandPalette

public sealed class CommandPalette : Layer<CommandPalette>

A keyboard-driven full-screen command launcher (Ctrl/Cmd-K style) that lets users search and invoke application commands.

Namespace
Tesserae
Inheritance
Layer<CommandPalette> → CommandPalette

Constructors

NameDescription
CommandPaletteCreates a CommandPalette whose global Ctrl/Cmd keyboard listener is bound to the lifetime of host: the listener is attached when host first mounts to the DOM and detached when it is removed. This prevents the palette from leaking listeners (and continuing to respond to its shortcut) after the owning view has been navigated away.
Constructor
CommandPalette
public CommandPalette(IComponent host, IEnumerable<CommandPaletteAction> actions = null)

Creates a CommandPalette whose global Ctrl/Cmd keyboard listener is bound to the lifetime of host: the listener is attached when host first mounts to the DOM and detached when it is removed. This prevents the palette from leaking listeners (and continuing to respond to its shortcut) after the owning view has been navigated away.

Properties

NameDescription
EnableGlobalShortcutEnables the global shortcut on the component.
EnableGlobalActionShortcutsEnables the global action shortcuts on the component.
HideOnActionHides the on action.
GlobalShortcutKeyKey (combined with Ctrl/Cmd) that toggles the palette globally. Case-insensitive. Defaults to "k".
PlaceholderGets or sets the placeholder text shown when the component is empty.
Property
CommandPalette.EnableGlobalShortcut
public bool EnableGlobalShortcut { get; set; }

Enables the global shortcut on the component.

Property
CommandPalette.EnableGlobalActionShortcuts
public bool EnableGlobalActionShortcuts { get; set; }

Enables the global action shortcuts on the component.

Property
CommandPalette.HideOnAction
public bool HideOnAction { get; set; }

Hides the on action.

Property
CommandPalette.GlobalShortcutKey
public string GlobalShortcutKey { get; set; }

Key (combined with Ctrl/Cmd) that toggles the palette globally. Case-insensitive. Defaults to "k".

Property
CommandPalette.Placeholder
public string Placeholder { get ; set ; }

Gets or sets the placeholder text shown when the component is empty.

Methods

NameDescription
SetActionsSets the actions of the component.
AddActionAdds the given action to the component.
OpenOpens the component.
CloseCloses the component.
ToggleToggles the component's state.
ShowShows the component.
HideHides the component.
Method
CommandPalette.SetActions
public CommandPalette SetActions(IEnumerable<CommandPaletteAction> actions)

Sets the actions of the component.

Method
CommandPalette.AddAction
public CommandPalette AddAction(CommandPaletteAction action)

Adds the given action to the component.

Method
CommandPalette.Open
public CommandPalette Open()

Opens the component.

Method
CommandPalette.Close
public CommandPalette Close()

Closes the component.

Method
CommandPalette.Toggle
public CommandPalette Toggle()

Toggles the component's state.

Method
CommandPalette.Show
public override CommandPalette Show()

Shows the component.

Method
CommandPalette.Hide
public override void Hide(Action onHidden = null)

Hides the component.

Events

NameDescription
ActionExecutedRaised when action executed occurs.
Event
CommandPalette.ActionExecuted
public event Action<CommandPaletteAction> ActionExecuted

Raised when action executed occurs.

class

CommandPaletteAction

public sealed class CommandPaletteAction
Namespace
Tesserae

Constructors

NameDescription
CommandPaletteActionInitializes a new instance of this class.
Constructor
CommandPaletteAction
public CommandPaletteAction(string id, string name)

Initializes a new instance of this class.

Properties

NameDescription
IdSets the DOM id of the component.
NameGets or sets the name of the component.
SubtitleGets or sets the subtitle.
KeywordsGets or sets the keywords.
SectionGets or sets the section.
ParentIdGets or sets the parent id.
IconGets or sets the icon shown by the component.
ShortcutGets or sets the shortcut.
IsEnabledGets or sets a value indicating whether the component is interactive (enabled).
IsVisibleGets a value indicating whether the component is currently visible.
PerformGets or sets the perform.
Property
CommandPaletteAction.Id
public string Id { get; }

Sets the DOM id of the component.

Property
CommandPaletteAction.Name
public string Name { get; set; }

Gets or sets the name of the component.

Property
CommandPaletteAction.Subtitle
public string Subtitle { get; set; }

Gets or sets the subtitle.

Property
CommandPaletteAction.Keywords
public string Keywords { get; set; }

Gets or sets the keywords.

Property
CommandPaletteAction.Section
public string Section { get; set; }

Gets or sets the section.

Property
CommandPaletteAction.ParentId
public string ParentId { get; set; }

Gets or sets the parent id.

Property
CommandPaletteAction.Icon
public UIcons? Icon { get; set; }

Gets or sets the icon shown by the component.

Property
CommandPaletteAction.Shortcut
public string[] Shortcut { get; set; }

Gets or sets the shortcut.

Property
CommandPaletteAction.IsEnabled
public bool IsEnabled { get; set; }

Gets or sets a value indicating whether the component is interactive (enabled).

Property
CommandPaletteAction.IsVisible
public bool IsVisible { get; set; }

Gets a value indicating whether the component is currently visible.

Property
CommandPaletteAction.Perform
public Action Perform { get; set; }

Gets or sets the perform.

Sample

See also

© 2026 Curiosity. All rights reserved.