Tesserae

CommandBar

Description

A toolbar for housing commands

Command Bars provide a surface for common actions related to a specific context, such as a page or a selected item in a list.

They typically contain buttons with icons and labels, and can be split into 'near' items (left-aligned) and 'far' items (right-aligned).

API reference

class

CommandBar

public sealed class CommandBar : ComponentBase<CommandBar, HTMLElement>

A horizontal bar of commands (buttons, dropdowns) typically anchored to the top of an application surface.

Constructors

Constructor
CommandBar
public CommandBar(params IComponent[] items)

Initializes a new instance of this class.

Methods

Method
CommandBar.AddItem
public CommandBar AddItem(IComponent item)

Adds the given item to the component.

Method
CommandBar.AddItems
public CommandBar AddItems(params IComponent[] items)

Adds the given items to the component.

Method
CommandBar.AddFarItem
public CommandBar AddFarItem(IComponent item)

Adds the given far item to the component.

Method
CommandBar.AddFarItems
public CommandBar AddFarItems(params IComponent[] items)

Adds the given far items to the component.

Method
CommandBar.Items
public CommandBar Items(params IComponent[] items)

Adds the given items to the component.

Method
CommandBar.FarItems
public CommandBar FarItems(params IComponent[] items)

Configures the far items on the component.

Method
CommandBar.Render
public override HTMLElement Render()

Renders the component's root HTML element.

class

CommandBarItem

public sealed class CommandBarItem : ComponentBase<CommandBarItem, HTMLButtonElement>

Constructors

Constructor
CommandBarItem
public CommandBarItem(string text = null, UIcons? icon = null)

Initializes a new instance of this class.

Properties

Property
CommandBarItem.Text
public string Text { get ; set ; }

Gets or sets the text shown in the component.

Property
CommandBarItem.Icon
public string Icon { get ; set ; }

Gets or sets the icon shown by the component.

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

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

Methods

Method
CommandBarItem.SetText
public CommandBarItem SetText(string text)

Sets the text of the component.

Method
CommandBarItem.SetIcon
public CommandBarItem SetIcon(UIcons icon)

Sets the icon of the component.

Method
CommandBarItem.Disabled
public CommandBarItem Disabled(bool value = true)

Disables the component.

Method
CommandBarItem.Primary
public CommandBarItem Primary(bool value = true)

Styles the component using the primary tone.

Method
CommandBarItem.OnClick
public CommandBarItem OnClick(Action action)

Registers a callback invoked when the click event fires.

Method
CommandBarItem.Render
public override HTMLElement Render()

Renders the component's root HTML element.

Sample

See also

Referenced by

© 2026 Tesserae. All rights reserved.