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.

Namespace
Tesserae
Inheritance
ComponentBase<CommandBar, HTMLElement> → CommandBar

Constructors

NameDescription
CommandBarInitializes a new instance of this class.
Constructor
CommandBar
public CommandBar(params IComponent[] items)

Initializes a new instance of this class.

Methods

NameDescription
AddItemAdds the given item to the component.
AddItemsAdds the given items to the component.
AddFarItemAdds the given far item to the component.
AddFarItemsAdds the given far items to the component.
ItemsAdds the given items to the component.
FarItemsConfigures the far items on the component.
RenderRenders the component's root HTML element.
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>
Namespace
Tesserae
Inheritance
ComponentBase<CommandBarItem, HTMLButtonElement> → CommandBarItem

Constructors

NameDescription
CommandBarItemInitializes a new instance of this class.
Constructor
CommandBarItem
public CommandBarItem(string text = null, UIcons? icon = null)

Initializes a new instance of this class.

Properties

NameDescription
TextGets or sets the text shown in the component.
IconGets or sets the icon shown by the component.
IsEnabledGets or sets a value indicating whether the component is interactive (enabled).
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

NameDescription
SetTextSets the text of the component.
SetIconSets the icon of the component.
DisabledDisables the component.
PrimaryStyles the component using the primary tone.
OnClickRegisters a callback invoked when the click event fires.
RenderRenders the component's root HTML element.
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

© 2026 Curiosity. All rights reserved.