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
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
| Name | Description |
|---|---|
| CommandBar | Initializes a new instance of this class. |
Methods
| Name | Description |
|---|---|
| AddItem | Adds the given item to the component. |
| AddItems | Adds the given items to the component. |
| AddFarItem | Adds the given far item to the component. |
| AddFarItems | Adds the given far items to the component. |
| Items | Adds the given items to the component. |
| FarItems | Configures the far items on the component. |
| Render | Renders the component's root HTML element. |
public CommandBar AddItem(IComponent item)Adds the given item to the component.
public CommandBar AddItems(params IComponent[] items)Adds the given items to the component.
public CommandBar AddFarItem(IComponent item)Adds the given far item to the component.
public CommandBar AddFarItems(params IComponent[] items)Adds the given far items to the component.
public CommandBar Items(params IComponent[] items)Adds the given items to the component.
public CommandBar FarItems(params IComponent[] items)Configures the far items on the component.
public sealed class CommandBarItem : ComponentBase<CommandBarItem, HTMLButtonElement>- Namespace
- Tesserae
- Inheritance
- ComponentBase<CommandBarItem, HTMLButtonElement> → CommandBarItem
Constructors
| Name | Description |
|---|---|
| CommandBarItem | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| Text | Gets or sets the text shown in the component. |
| Icon | Gets or sets the icon shown by the component. |
| IsEnabled | Gets or sets a value indicating whether the component is interactive (enabled). |
public string Text { get ; set ; }Gets or sets the text shown in the component.
public string Icon { get ; set ; }Gets or sets the icon shown by the component.
Methods
| Name | Description |
|---|---|
| SetText | Sets the text of the component. |
| SetIcon | Sets the icon of the component. |
| Disabled | Disables the component. |
| Primary | Styles the component using the primary tone. |
| OnClick | Registers a callback invoked when the click event fires. |
| Render | Renders the component's root HTML element. |
public CommandBarItem SetText(string text)Sets the text of the component.
public CommandBarItem SetIcon(UIcons icon)Sets the icon of the component.
public CommandBarItem Disabled(bool value = true)Disables the component.
public CommandBarItem Primary(bool value = true)Styles the component using the primary tone.
public CommandBarItem OnClick(Action action)Registers a callback invoked when the click event fires.