Tesserae

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.

Constructors

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 : the listener is attached when 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

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

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

Event
CommandPalette.ActionExecuted
public event Action<CommandPaletteAction> ActionExecuted

Raised when action executed occurs.

class

CommandPaletteAction

public sealed class CommandPaletteAction

Constructors

Constructor
CommandPaletteAction
public CommandPaletteAction(string id, string name)

Initializes a new instance of this class.

Properties

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 Tesserae. All rights reserved.