Description

A sidebar navigation component

A fully featured Sidebar with Search, Navigation, Buttons, and Separators.

API reference

class

SidebarButton

public class SidebarButton : ISearchableSidebarItem

A Button component for use within a Sidebar, supporting both open and closed states.

Namespace
Tesserae
Implements
ISearchableSidebarItem

Properties

NameDescription
IsSelectedGets or sets whether the button is currently selected.
CurrentRenderedGets the component that is currently rendered.
IdentifierGets the full identifier of the button.
OwnIdentifierGets the own identifier of the button.
Property
SidebarButton.IsSelected
public bool IsSelected { get ; set ; }

Gets or sets whether the button is currently selected.

Property
SidebarButton.CurrentRendered
public IComponent CurrentRendered

Gets the component that is currently rendered.

Property
SidebarButton.Identifier
public string Identifier { get; private set; }

Gets the full identifier of the button.

Property
SidebarButton.OwnIdentifier
public string OwnIdentifier

Gets the own identifier of the button.

Methods

NameDescription
AddGroupIdentifierAdds a group identifier prefix to the button's identifier.
ShowShows the button.
CollapseCollapses the button.
NotSortableMarks the button as not sortable.
ClearProgressClears the progress indication background.
ProgressSets a progress indication background.
SetTextSets the text of the button.
CommandsAlwaysVisibleEnsures that commands associated with the button are always visible when the sidebar is open.
LightSets the button to use a light style.
DangerSets the button to use a danger style.
DefaultSets the button to use the default style.
SuccessSets the button to use a success style.
PrimarySets the button to use the primary style.
SelectedSets whether the button is selected.
TooltipSets a tooltip for the closed state button.
OpenedTooltipSets a tooltip for the open state button.
OnClickAdds a click event handler to the button.
OnOpenIconClickAdds a click event handler to the icon when the button is open.
IdSets the ID of the button.
OnContextMenuAdds a context menu event handler to the button.
SetIconSets the icon for the button.
OnRenderedAdds a rendered event handler.
RenderClosedRenders the button for the closed state of the sidebar.
RenderOpenRenders the button for the open state of the sidebar.
Method
SidebarButton.AddGroupIdentifier
public void AddGroupIdentifier(string groupIdentifier)

Adds a group identifier prefix to the button's identifier.

Method
SidebarButton.Show
public void Show()

Shows the button.

Method
SidebarButton.Collapse
public void Collapse()

Collapses the button.

Method
SidebarButton.NotSortable
public SidebarButton NotSortable()

Marks the button as not sortable.

Returns

The current instance of the type.

Method
SidebarButton.ClearProgress
public SidebarButton ClearProgress()

Clears the progress indication background.

Returns

The current instance of the type.

Method
SidebarButton.Progress
public SidebarButton Progress(float progress)

Sets a progress indication background.

Parameters

progress
The progress value (0 to 1).

Returns

The current instance of the type.

Method
SidebarButton.SetText
public SidebarButton SetText(string text)

Sets the text of the button.

Parameters

text
The text.

Returns

The current instance of the type.

Method
SidebarButton.CommandsAlwaysVisible
public SidebarButton CommandsAlwaysVisible(bool alwaysVisible = true)

Ensures that commands associated with the button are always visible when the sidebar is open.

Returns

The current instance of the type.

Method
SidebarButton.Light
public SidebarButton Light()

Sets the button to use a light style.

Returns

The current instance of the type.

Method
SidebarButton.Danger
public SidebarButton Danger()

Sets the button to use a danger style.

Returns

The current instance of the type.

Method
SidebarButton.Default
public SidebarButton Default()

Sets the button to use the default style.

Returns

The current instance of the type.

Method
SidebarButton.Success
public SidebarButton Success()

Sets the button to use a success style.

Returns

The current instance of the type.

Method
SidebarButton.Primary
public SidebarButton Primary()

Sets the button to use the primary style.

Returns

The current instance of the type.

Method
SidebarButton.Selected
public SidebarButton Selected(bool isSelected = true)

Sets whether the button is selected.

Parameters

isSelected
Whether the button is selected.

Returns

The current instance of the type.

Method
SidebarButton.Tooltip
Overload
Tooltip(string)Sets a tooltip for the closed state button.
Tooltip(IComponent)Sets a tooltip component for the closed state button.
Tooltip(Func<IComponent>)Sets a tooltip generator function for the closed state button.
Tooltip(string)
public SidebarButton Tooltip(string text)

Sets a tooltip for the closed state button.

Parameters

text string
The tooltip text.

Returns

The current instance of the type.

Tooltip(IComponent)
public SidebarButton Tooltip(IComponent tooltip)

Sets a tooltip component for the closed state button.

Parameters

tooltip IComponent
The tooltip component.

Returns

The current instance of the type.

Tooltip(Func<IComponent>)
public SidebarButton Tooltip(Func<IComponent> tooltip)

Sets a tooltip generator function for the closed state button.

Parameters

tooltip Func<IComponent>
The tooltip generator function.

Returns

The current instance of the type.

Method
SidebarButton.OpenedTooltip
Overload
OpenedTooltip(string)Sets a tooltip for the open state button.
OpenedTooltip(IComponent)Sets a tooltip component for the open state button.
OpenedTooltip(Func<IComponent>)Sets a tooltip generator function for the open state button.
OpenedTooltip(string)
public SidebarButton OpenedTooltip(string text)

Sets a tooltip for the open state button.

Parameters

text string
The tooltip text.

Returns

The current instance of the type.

OpenedTooltip(IComponent)
public SidebarButton OpenedTooltip(IComponent tooltip)

Sets a tooltip component for the open state button.

Parameters

tooltip IComponent
The tooltip component.

Returns

The current instance of the type.

OpenedTooltip(Func<IComponent>)
public SidebarButton OpenedTooltip(Func<IComponent> tooltip)

Sets a tooltip generator function for the open state button.

Parameters

tooltip Func<IComponent>
The tooltip generator function.

Returns

The current instance of the type.

Method
SidebarButton.OnClick
Overload
OnClick(Action)Adds a click event handler to the button.
OnClick(Action<Button, MouseEvent>)Adds a click event handler with button and mouse event arguments.
OnClick(Action)
public SidebarButton OnClick(Action action)

Adds a click event handler to the button.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

OnClick(Action<Button, MouseEvent>)
public SidebarButton OnClick(Action<Button, MouseEvent> action)

Adds a click event handler with button and mouse event arguments.

Parameters

action Action<Button, MouseEvent>
The event handler action.

Returns

The current instance of the type.

Method
SidebarButton.OnOpenIconClick
Overload
OnOpenIconClick(Action<HTMLElement, MouseEvent>)Adds a click event handler to the icon when the button is open.
OnOpenIconClick(Action)Adds a click event handler to the icon when the button is open.
OnOpenIconClick(Action<HTMLElement, MouseEvent>)
public SidebarButton OnOpenIconClick(Action<HTMLElement, MouseEvent> action)

Adds a click event handler to the icon when the button is open.

Parameters

action Action<HTMLElement, MouseEvent>
The event handler action.

Returns

The current instance of the type.

OnOpenIconClick(Action)
public SidebarButton OnOpenIconClick(Action action)

Adds a click event handler to the icon when the button is open.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

Method
SidebarButton.Id
public SidebarButton Id(string id)

Sets the ID of the button.

Parameters

id
The ID.

Returns

The current instance of the type.

Method
SidebarButton.OnContextMenu
Overload
OnContextMenu(Action)Adds a context menu event handler to the button.
OnContextMenu(Action<Button, MouseEvent>)Adds a context menu event handler with button and mouse event arguments.
OnContextMenu(Action)
public SidebarButton OnContextMenu(Action action)

Adds a context menu event handler to the button.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

OnContextMenu(Action<Button, MouseEvent>)
public SidebarButton OnContextMenu(Action<Button, MouseEvent> action)

Adds a context menu event handler with button and mouse event arguments.

Parameters

action Action<Button, MouseEvent>
The event handler action.

Returns

The current instance of the type.

Method
SidebarButton.SetIcon
Overload
SetIcon(UIcons, string, UIconsWeight)Sets the icon for the button.
SetIcon(Emoji)Sets an emoji icon for the button.
SetIcon(UIcons, string, UIconsWeight)
public SidebarButton SetIcon(UIcons icon, string color = "", UIconsWeight weight = UIconsWeight.Regular)

Sets the icon for the button.

Parameters

icon UIcons
The icon.
color string
The color of the icon.
weight UIconsWeight
The weight of the icon.

Returns

The current instance of the type.

SetIcon(Emoji)
public SidebarButton SetIcon(Emoji icon)

Sets an emoji icon for the button.

Parameters

icon Emoji
The emoji icon.

Returns

The current instance of the type.

Method
SidebarButton.OnRendered
public ISidebarItem OnRendered(Action<HTMLElement> onRendered)

Adds a rendered event handler.

Parameters

onRendered
The rendered event handler.

Returns

The current instance of the type.

Method
SidebarButton.RenderClosed
public IComponent RenderClosed()

Renders the button for the closed state of the sidebar.

Method
SidebarButton.RenderOpen
public IComponent RenderOpen()

Renders the button for the open state of the sidebar.

class

SidebarPivot

public sealed class SidebarPivot : ISearchableSidebarItem
Namespace
Tesserae
Implements
ISearchableSidebarItem
class

SidebarNav

public class SidebarNav : ISearchableSidebarItem

A hierarchical navigation component for use within a Sidebar, allowing for nested ISidebarItem elements.

Namespace
Tesserae
Implements
ISearchableSidebarItem

Properties

NameDescription
IsCollapsedGets or sets whether the navigation is collapsed.
IsSelectedGets or sets whether the navigation is currently selected.
CollapsedStatusGets an observable for the collapsed status.
CurrentRenderedGets the component that is currently rendered.
IdentifierGets the full identifier of the navigation component.
OwnIdentifierGets the own identifier of the navigation component.
Property
SidebarNav.IsCollapsed
public bool IsCollapsed { get ; set ; }

Gets or sets whether the navigation is collapsed.

Property
SidebarNav.IsSelected
public bool IsSelected { get ; set ; }

Gets or sets whether the navigation is currently selected.

Property
SidebarNav.CollapsedStatus
public IObservable<bool> CollapsedStatus

Gets an observable for the collapsed status.

Property
SidebarNav.CurrentRendered
public IComponent CurrentRendered

Gets the component that is currently rendered.

Property
SidebarNav.Identifier
public string Identifier { get; private set; }

Gets the full identifier of the navigation component.

Property
SidebarNav.OwnIdentifier
public string OwnIdentifier

Gets the own identifier of the navigation component.

Methods

NameDescription
ShowShows the navigation component.
CollapseCollapses the navigation component.
NotSortableMarks the navigation component as not sortable.
SetTextSets the header text of the navigation.
CollapsedSets whether the navigation is collapsed.
SelectedSets whether the navigation is selected.
ToggleToggles the collapsed state.
OnOpenIconClickAdds a click event handler to the open header icon.
OnClickAdds a click event handler to the navigation header.
OnContextMenuAdds a context menu event handler.
ClearClears all items from the navigation.
AddAdds an item to the navigation.
RemoveRemoves an item from the navigation.
AddRangeAdds a range of items to the navigation.
RenderClosedRenders the navigation for the closed state of the sidebar.
RenderOpenRenders the navigation for the open state of the sidebar.
OnRenderedAdds a rendered event handler.
AddGroupIdentifierAdds a group identifier prefix to the navigation component's identifier.
LoadSortingLoads the sorting order for navigation items.
GetCurrentSortingGets the current sorting order of all items within this navigation.
SortableSets whether items within this navigation are sortable.
OnSortingChangedAdds a sorting change event handler.
OnParentChangedAdds a parent changed event handler, for cross-nav sorting.
Method
SidebarNav.Show
public void Show()

Shows the navigation component.

Method
SidebarNav.Collapse
public void Collapse()

Collapses the navigation component.

Method
SidebarNav.NotSortable
public SidebarNav NotSortable()

Marks the navigation component as not sortable.

Returns

The current instance of the type.

Method
SidebarNav.SetText
public SidebarNav SetText(string text)

Sets the header text of the navigation.

Parameters

text
The text.

Returns

The current instance of the type.

Method
SidebarNav.Collapsed
public SidebarNav Collapsed(bool isCollapsed = true)

Sets whether the navigation is collapsed.

Parameters

isCollapsed
Whether it is collapsed.

Returns

The current instance of the type.

Method
SidebarNav.Selected
public SidebarNav Selected(bool isSelected = true)

Sets whether the navigation is selected.

Parameters

isSelected
Whether it is selected.

Returns

The current instance of the type.

Method
SidebarNav.Toggle
public SidebarNav Toggle()

Toggles the collapsed state.

Returns

The current instance of the type.

Method
SidebarNav.OnOpenIconClick
Overload
OnOpenIconClick(Action<HTMLElement, MouseEvent>)Adds a click event handler to the open header icon.
OnOpenIconClick(Action)Adds a click event handler to the open header icon.
OnOpenIconClick(Action<HTMLElement, MouseEvent>)
public SidebarNav OnOpenIconClick(Action<HTMLElement, MouseEvent> action)

Adds a click event handler to the open header icon.

Parameters

action Action<HTMLElement, MouseEvent>
The event handler action.

Returns

The current instance of the type.

OnOpenIconClick(Action)
public SidebarNav OnOpenIconClick(Action action)

Adds a click event handler to the open header icon.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

Method
SidebarNav.OnClick
Overload
OnClick(Action)Adds a click event handler to the navigation header.
OnClick(Action<SidebarNav>)Adds a click event handler with SidebarNav argument.
OnClick(Action<Button, MouseEvent>)Adds a click event handler with button and mouse event arguments.
OnClick(Action)
public SidebarNav OnClick(Action action)

Adds a click event handler to the navigation header.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

OnClick(Action<SidebarNav>)
public SidebarNav OnClick(Action<SidebarNav> action)

Adds a click event handler with SidebarNav argument.

Parameters

action Action<SidebarNav>
The event handler action.

Returns

The current instance of the type.

OnClick(Action<Button, MouseEvent>)
public SidebarNav OnClick(Action<Button, MouseEvent> action)

Adds a click event handler with button and mouse event arguments.

Parameters

action Action<Button, MouseEvent>
The event handler action.

Returns

The current instance of the type.

Method
SidebarNav.OnContextMenu
Overload
OnContextMenu(Action)Adds a context menu event handler.
OnContextMenu(Action<Button, MouseEvent>)Adds a context menu event handler with button and mouse event arguments.
OnContextMenu(Action)
public SidebarNav OnContextMenu(Action action)

Adds a context menu event handler.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

OnContextMenu(Action<Button, MouseEvent>)
public SidebarNav OnContextMenu(Action<Button, MouseEvent> action)

Adds a context menu event handler with button and mouse event arguments.

Parameters

action Action<Button, MouseEvent>
The event handler action.

Returns

The current instance of the type.

Method
SidebarNav.Clear
public void Clear()

Clears all items from the navigation.

Method
SidebarNav.Add
public void Add(ISidebarItem item)

Adds an item to the navigation.

Parameters

item
The item to add.
Method
SidebarNav.Remove
public void Remove(ISidebarItem item)

Removes an item from the navigation.

Parameters

item
The item to remove.
Method
SidebarNav.AddRange
public SidebarNav AddRange(IEnumerable<ISidebarItem> items)

Adds a range of items to the navigation.

Parameters

items
The items to add.

Returns

The current instance of the type.

Method
SidebarNav.RenderClosed
public IComponent RenderClosed()

Renders the navigation for the closed state of the sidebar.

Method
SidebarNav.RenderOpen
public IComponent RenderOpen()

Renders the navigation for the open state of the sidebar.

Method
SidebarNav.OnRendered
public ISidebarItem OnRendered(Action<HTMLElement> onRendered)

Adds a rendered event handler.

Parameters

onRendered
The rendered event handler.

Returns

The current instance of the type.

Method
SidebarNav.AddGroupIdentifier
public void AddGroupIdentifier(string groupIdentifier)

Adds a group identifier prefix to the navigation component's identifier.

Method
SidebarNav.LoadSorting
public void LoadSorting(Dictionary<string, string[]> itemOrder)

Loads the sorting order for navigation items.

Parameters

itemOrder
A dictionary mapping group identifiers to ordered item identifiers.
Method
SidebarNav.GetCurrentSorting
public Dictionary<string, string[]> GetCurrentSorting()

Gets the current sorting order of all items within this navigation.

Returns

A dictionary mapping group identifiers to ordered item identifiers.

Method
SidebarNav.Sortable
public SidebarNav Sortable(bool sortable = true, string sortableGroup = null)

Sets whether items within this navigation are sortable.

Parameters

sortable
Whether items are sortable.
sortableGroup
An optional group name for cross-nav sorting.

Returns

The current instance of the type.

Method
SidebarNav.OnSortingChanged
public SidebarNav OnSortingChanged(Action<Dictionary<string, string[]>> onSortingChanged)

Adds a sorting change event handler.

Parameters

onSortingChanged
The event handler action.

Returns

The current instance of the type.

Method
SidebarNav.OnParentChanged
public SidebarNav OnParentChanged(Action<ParentChangedEvent> onParentChanged)

Adds a parent changed event handler, for cross-nav sorting.

Parameters

onParentChanged
The event handler action.

Returns

The current instance of the type.

Events

NameDescription
_onSortingChangedEvent fired when sorting changes within the navigation.
Event
SidebarNav._onSortingChanged
public event Action<Dictionary<string, string[]>> _onSortingChanged

Event fired when sorting changes within the navigation.

class

SidebarSearchBox

public class SidebarSearchBox : ISidebarItem
Namespace
Tesserae
Implements
ISidebarItem
class

SidebarCommand

public class SidebarCommand : IComponent

A Command component for use within a Sidebar, typically appearing as a small action button.

Namespace
Tesserae
Implements
IComponent

Methods

NameDescription
ForegroundSets the foreground color of the command button.
HookToParentContextMenuConfigures the command to hook into the parent's context menu event.
BackgroundSets the background color of the command button.
DefaultSets the command to use the default style.
PrimarySets the command to use the primary style.
SuccessSets the command to use the success style.
DangerSets the command to use the danger style.
TooltipSets a tooltip for the command.
OnClickMenuConfigures the command to show a menu when clicked.
ShowMenuShows the associated menu for the command.
RaiseOnClickProgrammatically raises the click event.
RaiseOnContextMenuProgrammatically raises the context menu event.
OnClickAdds a click event handler.
OnContextMenuAdds a context menu event handler.
SetIconSets the icon for the command.
RenderRenders the sidebar command.
Method
SidebarCommand.Foreground
public SidebarCommand Foreground(string color)

Sets the foreground color of the command button.

Parameters

color
The color.

Returns

The current instance of the type.

Method
SidebarCommand.HookToParentContextMenu
public SidebarCommand HookToParentContextMenu()

Configures the command to hook into the parent's context menu event.

Returns

The current instance of the type.

Method
SidebarCommand.Background
public SidebarCommand Background(string color)

Sets the background color of the command button.

Parameters

color
The color.

Returns

The current instance of the type.

Method
SidebarCommand.Default
public SidebarCommand Default()

Sets the command to use the default style.

Returns

The current instance of the type.

Method
SidebarCommand.Primary
public SidebarCommand Primary()

Sets the command to use the primary style.

Returns

The current instance of the type.

Method
SidebarCommand.Success
public SidebarCommand Success()

Sets the command to use the success style.

Returns

The current instance of the type.

Method
SidebarCommand.Danger
public SidebarCommand Danger()

Sets the command to use the danger style.

Returns

The current instance of the type.

Method
SidebarCommand.Tooltip
Overload
Tooltip(string)Sets a tooltip for the command.
Tooltip(IComponent)Sets a tooltip component for the command.
Tooltip(Func<IComponent>)Sets a tooltip generator function for the command.
Tooltip(string)
public SidebarCommand Tooltip(string text)

Sets a tooltip for the command.

Parameters

text string
The tooltip text.

Returns

The current instance of the type.

Tooltip(IComponent)
public SidebarCommand Tooltip(IComponent tooltip)

Sets a tooltip component for the command.

Parameters

tooltip IComponent
The tooltip component.

Returns

The current instance of the type.

Tooltip(Func<IComponent>)
public SidebarCommand Tooltip(Func<IComponent> tooltip)

Sets a tooltip generator function for the command.

Parameters

tooltip Func<IComponent>
The tooltip generator function.

Returns

The current instance of the type.

Method
SidebarCommand.OnClickMenu
public SidebarCommand OnClickMenu(Func<ISidebarItem[]> generator)

Configures the command to show a menu when clicked.

Parameters

generator
A function that generates the sidebar items for the menu.

Returns

The current instance of the type.

Method
SidebarCommand.ShowMenu
public void ShowMenu()

Shows the associated menu for the command.

Method
SidebarCommand.RaiseOnClick
public SidebarCommand RaiseOnClick(MouseEvent mouseEvent)

Programmatically raises the click event.

Parameters

mouseEvent
The mouse event arguments.

Returns

The current instance of the type.

Method
SidebarCommand.RaiseOnContextMenu
public SidebarCommand RaiseOnContextMenu(MouseEvent mouseEvent)

Programmatically raises the context menu event.

Parameters

mouseEvent
The mouse event arguments.

Returns

The current instance of the type.

Method
SidebarCommand.OnClick
Overload
OnClick(Action)Adds a click event handler.
OnClick(Action<Button, MouseEvent>)Adds a click event handler with button and mouse event arguments.
OnClick(Action)
public SidebarCommand OnClick(Action action)

Adds a click event handler.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

OnClick(Action<Button, MouseEvent>)
public SidebarCommand OnClick(Action<Button, MouseEvent> action)

Adds a click event handler with button and mouse event arguments.

Parameters

action Action<Button, MouseEvent>
The event handler action.

Returns

The current instance of the type.

Method
SidebarCommand.OnContextMenu
Overload
OnContextMenu(Action)Adds a context menu event handler.
OnContextMenu(Action<Button, MouseEvent>)Adds a context menu event handler with button and mouse event arguments.
OnContextMenu(Action)
public SidebarCommand OnContextMenu(Action action)

Adds a context menu event handler.

Parameters

action Action
The event handler action.

Returns

The current instance of the type.

OnContextMenu(Action<Button, MouseEvent>)
public SidebarCommand OnContextMenu(Action<Button, MouseEvent> action)

Adds a context menu event handler with button and mouse event arguments.

Parameters

action Action<Button, MouseEvent>
The event handler action.

Returns

The current instance of the type.

Method
SidebarCommand.SetIcon
Overload
SetIcon(UIcons, string, UIconsWeight)Sets the icon for the command.
SetIcon(Emoji)Sets an emoji icon for the command.
SetIcon(UIcons, string, UIconsWeight)
public SidebarCommand SetIcon(UIcons icon, string color = "", UIconsWeight weight = UIconsWeight.Regular)

Sets the icon for the command.

Parameters

icon UIcons
The icon.
color string
The color of the icon.
weight UIconsWeight
The weight of the icon.

Returns

The current instance of the type.

SetIcon(Emoji)
public SidebarCommand SetIcon(Emoji icon)

Sets an emoji icon for the command.

Parameters

icon Emoji
The emoji icon.

Returns

The current instance of the type.

Method
SidebarCommand.Render
public HTMLElement Render()

Renders the sidebar command.

Returns

The rendered HTMLElement.

class

SidebarCommands

public class SidebarCommands : ISidebarItem

A component for grouping multiple SidebarCommand items into a single line within a Sidebar.

Namespace
Tesserae
Implements
ISidebarItem

Properties

NameDescription
IsSelectedGets or sets whether the group is currently selected.
CurrentRenderedGets the component that is currently rendered.
IdentifierGets the full identifier of the command group.
OwnIdentifierGets the own identifier of the command group.
Property
SidebarCommands.IsSelected
public bool IsSelected { get; set; }

Gets or sets whether the group is currently selected.

Property
SidebarCommands.CurrentRendered
public IComponent CurrentRendered { get; private set; }

Gets the component that is currently rendered.

Property
SidebarCommands.Identifier
public string Identifier { get; private set; }

Gets the full identifier of the command group.

Property
SidebarCommands.OwnIdentifier
public string OwnIdentifier

Gets the own identifier of the command group.

Methods

NameDescription
RenderOpenRenders the commands for the open state of the sidebar.
ShowShows the commands.
CollapseCollapses the commands.
RenderOpenFullRenders all commands for the open state without truncation.
RenderClosedRenders the commands for the closed state of the sidebar.
AlignEndAligns the commands to the end of the line.
NotSortableMarks the commands as not sortable.
AddGroupIdentifierAdds a group identifier prefix to the command group's identifier.
Method
SidebarCommands.RenderOpen
public IComponent RenderOpen()

Renders the commands for the open state of the sidebar.

Method
SidebarCommands.Show
public void Show()

Shows the commands.

Method
SidebarCommands.Collapse
public void Collapse()

Collapses the commands.

Method
SidebarCommands.RenderOpenFull
public IComponent RenderOpenFull()

Renders all commands for the open state without truncation.

Method
SidebarCommands.RenderClosed
public IComponent RenderClosed()

Renders the commands for the closed state of the sidebar.

Method
SidebarCommands.AlignEnd
public SidebarCommands AlignEnd()

Aligns the commands to the end of the line.

Returns

The current instance of the type.

Method
SidebarCommands.NotSortable
public SidebarCommands NotSortable()

Marks the commands as not sortable.

Returns

The current instance of the type.

Method
SidebarCommands.AddGroupIdentifier
public void AddGroupIdentifier(string groupIdentifier)

Adds a group identifier prefix to the command group's identifier.

class

SidebarText

public class SidebarText : ISidebarItem

A Text component for use within a Sidebar, supporting both open and closed states.

Namespace
Tesserae
Implements
ISidebarItem

Constructors

NameDescription
SidebarTextInitializes a new instance of the SidebarText class.
Constructor
SidebarText
public SidebarText(string identifier, string text, string closedText = null, TextSize textSize = TextSize.Small, TextWeight textWeight = TextWeight.Regular)

Initializes a new instance of the SidebarText class.

Parameters

identifier
The identifier for the text item.
text
The text to display when the sidebar is open.
closedText
The optional text to display when the sidebar is closed.
textSize
The size of the text.
textWeight
The weight of the text.

Properties

NameDescription
CurrentRenderedGets the component that is currently rendered.
IsSelectedGets or sets whether the item is currently selected.
IdentifierGets the full identifier of the text component.
OwnIdentifierGets the own identifier of the text component.
Property
SidebarText.CurrentRendered
public IComponent CurrentRendered

Gets the component that is currently rendered.

Property
SidebarText.IsSelected
public bool IsSelected { get; set; }

Gets or sets whether the item is currently selected.

Property
SidebarText.Identifier
public string Identifier { get; private set; }

Gets the full identifier of the text component.

Property
SidebarText.OwnIdentifier
public string OwnIdentifier

Gets the own identifier of the text component.

Methods

NameDescription
ShowShows the text component.
CollapseCollapses the text component.
NotSortableMarks the text component as not sortable.
AddGroupIdentifierAdds a group identifier prefix to the text component's identifier.
SetTextSets the text content for the open state.
ForegroundSets the foreground color of the text.
PTSets the top padding of the text.
PBSets the bottom padding of the text.
PLSets the left padding of the text.
RenderClosedRenders the text for the closed state of the sidebar.
RenderOpenRenders the text for the open state of the sidebar.
Method
SidebarText.Show
public void Show()

Shows the text component.

Method
SidebarText.Collapse
public void Collapse()

Collapses the text component.

Method
SidebarText.NotSortable
public SidebarText NotSortable()

Marks the text component as not sortable.

Returns

The current instance of the type.

Method
SidebarText.AddGroupIdentifier
public void AddGroupIdentifier(string groupIdentifier)

Adds a group identifier prefix to the text component's identifier.

Method
SidebarText.SetText
public SidebarText SetText(string text)

Sets the text content for the open state.

Parameters

text
The text.

Returns

The current instance of the type.

Method
SidebarText.Foreground
public SidebarText Foreground(string color)

Sets the foreground color of the text.

Parameters

color
The color.

Returns

The current instance of the type.

Method
SidebarText.PT
public SidebarText PT(int pixels)

Sets the top padding of the text.

Parameters

pixels
The padding in pixels.

Returns

The current instance of the type.

Method
SidebarText.PB
public SidebarText PB(int pixels)

Sets the bottom padding of the text.

Parameters

pixels
The padding in pixels.

Returns

The current instance of the type.

Method
SidebarText.PL
public SidebarText PL(int pixels)

Sets the left padding of the text.

Parameters

pixels
The padding in pixels.

Returns

The current instance of the type.

Method
SidebarText.RenderClosed
public IComponent RenderClosed()

Renders the text for the closed state of the sidebar.

Method
SidebarText.RenderOpen
public IComponent RenderOpen()

Renders the text for the open state of the sidebar.

class

SidebarBadge

public class SidebarBadge : IComponent

A Badge component for sidebar items, often used to display counts or status indicators.

Namespace
Tesserae
Implements
IComponent

Constructors

NameDescription
SidebarBadgeInitializes a new instance of the SidebarBadge class.
Constructor
SidebarBadge
Overload
SidebarBadge(string, UIcons, TextSize)Initializes a new instance of the SidebarBadge class.
SidebarBadge(string, UIcons)Initializes a new instance of the SidebarBadge class.
SidebarBadge(string)Initializes a new instance of the SidebarBadge class.
SidebarBadge(ISidebarIcon)Initializes a new instance of the SidebarBadge class with an image.
SidebarBadge(string, UIcons, TextSize)
public SidebarBadge(string badge, UIcons badgeIcon, TextSize iconSize = TextSize.Tiny)

Initializes a new instance of the SidebarBadge class.

Parameters

badge string
The text content of the badge.
badgeIcon UIcons
An optional icon for the badge.
iconSize TextSize
The size of the icon.
SidebarBadge(string, UIcons)
public SidebarBadge(string badge, UIcons badgeIcon)

Initializes a new instance of the SidebarBadge class.

Parameters

badge string
The text content of the badge.
badgeIcon UIcons
An optional icon for the badge.
SidebarBadge(string)
public SidebarBadge(string badge)

Initializes a new instance of the SidebarBadge class.

Parameters

badge string
The text content of the badge.
SidebarBadge(ISidebarIcon)
public SidebarBadge(ISidebarIcon image)

Initializes a new instance of the SidebarBadge class with an image.

Parameters

image ISidebarIcon
The image icon.

Methods

NameDescription
SemiTransparentSets the badge icon to be semi-transparent.
ForegroundSets the foreground color of the badge.
BackgroundSets the background color of the badge.
DefaultSets the badge to use the default style.
PrimarySets the badge to use the primary style.
SuccessSets the badge to use the success style.
DangerSets the badge to use the danger style.
TooltipSets a tooltip for the badge.
SetIconSets the icon for the badge.
SetBadgeSets the text content of the badge.
RenderRenders the sidebar badge.
Method
SidebarBadge.SemiTransparent
public SidebarBadge SemiTransparent()

Sets the badge icon to be semi-transparent.

Returns

The current instance of the type.

Method
SidebarBadge.Foreground
public SidebarBadge Foreground(string color)

Sets the foreground color of the badge.

Parameters

color
The color.

Returns

The current instance of the type.

Method
SidebarBadge.Background
public SidebarBadge Background(string color)

Sets the background color of the badge.

Parameters

color
The color.

Returns

The current instance of the type.

Method
SidebarBadge.Default
public SidebarBadge Default()

Sets the badge to use the default style.

Returns

The current instance of the type.

Method
SidebarBadge.Primary
public SidebarBadge Primary()

Sets the badge to use the primary style.

Returns

The current instance of the type.

Method
SidebarBadge.Success
public SidebarBadge Success()

Sets the badge to use the success style.

Returns

The current instance of the type.

Method
SidebarBadge.Danger
public SidebarBadge Danger()

Sets the badge to use the danger style.

Returns

The current instance of the type.

Method
SidebarBadge.Tooltip
Overload
Tooltip(string)Sets a tooltip for the badge.
Tooltip(IComponent)Sets a tooltip component for the badge.
Tooltip(Func<IComponent>)Sets a tooltip generator function for the badge.
Tooltip(string)
public SidebarBadge Tooltip(string text)

Sets a tooltip for the badge.

Parameters

text string
The tooltip text.

Returns

The current instance of the type.

Tooltip(IComponent)
public SidebarBadge Tooltip(IComponent tooltip)

Sets a tooltip component for the badge.

Parameters

tooltip IComponent
The tooltip component.

Returns

The current instance of the type.

Tooltip(Func<IComponent>)
public SidebarBadge Tooltip(Func<IComponent> tooltip)

Sets a tooltip generator function for the badge.

Parameters

tooltip Func<IComponent>
The tooltip generator function.

Returns

The current instance of the type.

Method
SidebarBadge.SetIcon
Overload
SetIcon(UIcons, string, UIconsWeight)Sets the icon for the badge.
SetIcon(Emoji)Sets an emoji icon for the badge.
SetIcon(UIcons, string, UIconsWeight)
public SidebarBadge SetIcon(UIcons icon, string color = "", UIconsWeight weight = UIconsWeight.Regular)

Sets the icon for the badge.

Parameters

icon UIcons
The icon.
color string
The color of the icon.
weight UIconsWeight
The weight of the icon.

Returns

The current instance of the type.

SetIcon(Emoji)
public SidebarBadge SetIcon(Emoji icon)

Sets an emoji icon for the badge.

Parameters

icon Emoji
The emoji icon.

Returns

The current instance of the type.

Method
SidebarBadge.SetBadge
public SidebarBadge SetBadge(string badge)

Sets the text content of the badge.

Parameters

badge
The badge text.

Returns

The current instance of the type.

Method
SidebarBadge.Render
public HTMLElement Render()

Renders the sidebar badge.

Returns

The rendered HTMLElement.

Sample

See also

© 2026 Curiosity. All rights reserved.