TabItemWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
Represents a single tab within a TabPanel or TabBar. Contains the tab title, optional icon, and content builder.
public sealed record TabItemWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<TabItemWidget>Inheritance
Object → Hex1bWidget → TabItemWidget
Implements
Constructors
TabItemWidget(string, Func<WidgetContext<VStackWidget>, IEnumerable<Hex1bWidget>>?)
Represents a single tab within a TabPanel or TabBar. Contains the tab title, optional icon, and content builder.
Parameters:
Title(String): The title displayed in the tab header.ContentBuilder(Func<VStackWidget>, Hex1bWidget>>): A function that builds the tab content widgets.
public TabItemWidget(string Title, Func<WidgetContext<VStackWidget>, IEnumerable<Hex1bWidget>>? ContentBuilder)Properties
ContentBuilder
A function that builds the tab content widgets.
Returns: Func<VStackWidget>, Hex1bWidget>>
public Func<WidgetContext<VStackWidget>, IEnumerable<Hex1bWidget>>? ContentBuilder { get; init; }Icon
Optional icon displayed before the tab title.
Returns: String
public string? Icon { get; init; }IsDisabled
Whether this tab is disabled (cannot be selected).
Returns: Boolean
public bool IsDisabled { get; init; }IsSelected
Whether this tab is selected. When multiple tabs have IsSelected=true, the first one wins.
Returns: Boolean
public bool IsSelected { get; init; }Title
The title displayed in the tab header.
Returns: String
public string Title { get; init; }Methods
Disabled(bool)
Sets whether this tab is disabled.
Parameters:
disabled(Boolean): True to disable the tab.
Returns: TabItemWidget
public TabItemWidget Disabled(bool disabled = true)LeftActions(Func<WidgetContext<TabItemWidget>, IEnumerable<IconWidget>>)
Adds action icons to the left side of the tab using a builder. Actions are displayed in the order they are added.
Parameters:
builder(Func<TabItemWidget>, IconWidget>>): A function that returns the icons to add.
Returns: TabItemWidget
public TabItemWidget LeftActions(Func<WidgetContext<TabItemWidget>, IEnumerable<IconWidget>> builder)RightActions(Func<WidgetContext<TabItemWidget>, IEnumerable<IconWidget>>)
Adds action icons to the right side of the tab using a builder. Actions are displayed in the order they are added.
Parameters:
builder(Func<TabItemWidget>, IconWidget>>): A function that returns the icons to add.
Returns: TabItemWidget
public TabItemWidget RightActions(Func<WidgetContext<TabItemWidget>, IEnumerable<IconWidget>> builder)Selected(bool)
Marks this tab as selected. When multiple tabs are marked as selected, the first one wins.
Parameters:
selected(Boolean): True to select this tab, false otherwise.
Returns: TabItemWidget
public TabItemWidget Selected(bool selected = true)WithIcon(string)
Sets the icon for this tab.
Parameters:
icon(String): The icon string (emoji or text).
Returns: TabItemWidget
public TabItemWidget WithIcon(string icon)