Skip to content

TabBarWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A horizontal tab bar widget that displays tabs with optional overflow navigation. Can be used standalone or as part of a TabPanel.

csharp
public sealed record TabBarWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<TabBarWidget>

Inheritance

ObjectHex1bWidgetTabBarWidget

Implements

Constructors

TabBarWidget(IReadOnlyList<TabItemWidget>)

A horizontal tab bar widget that displays tabs with optional overflow navigation. Can be used standalone or as part of a TabPanel.

Parameters:

csharp
public TabBarWidget(IReadOnlyList<TabItemWidget> Tabs)

Properties

Position

The position of tabs (top or bottom). Used for rendering style.

Returns: TabPosition

csharp
public TabPosition Position { get; init; }

RenderMode

The rendering mode for the tab bar.

Returns: TabBarRenderMode

csharp
public TabBarRenderMode RenderMode { get; init; }

ShowPaging

Whether to show paging arrows when tabs overflow.

Returns: Boolean

csharp
public bool ShowPaging { get; init; }

ShowSelector

Whether to show the dropdown selector for quick tab navigation.

Returns: Boolean

csharp
public bool ShowSelector { get; init; }

Tabs

The list of tabs to display.

Returns: IReadOnlyList<TabItemWidget>

csharp
public IReadOnlyList<TabItemWidget> Tabs { get; init; }

Methods

Compact()

Sets the rendering mode to compact (just the tab row).

Returns: TabBarWidget

csharp
public TabBarWidget Compact()

Full()

Sets the rendering mode to full (with visual separators).

Returns: TabBarWidget

csharp
public TabBarWidget Full()

OnSelectionChanged(Action<TabSelectionChangedEventArgs>)

Sets the handler for selection changes.

Parameters:

Returns: TabBarWidget

csharp
public TabBarWidget OnSelectionChanged(Action<TabSelectionChangedEventArgs> handler)

OnSelectionChanged(Func<TabSelectionChangedEventArgs, Task>)

Sets the async handler for selection changes.

Parameters:

Returns: TabBarWidget

csharp
public TabBarWidget OnSelectionChanged(Func<TabSelectionChangedEventArgs, Task> handler)

Paging(bool)

Enables or disables paging arrows for tab overflow navigation.

Parameters:

Returns: TabBarWidget

csharp
public TabBarWidget Paging(bool enabled = true)

Selector(bool)

Enables or disables the dropdown selector for quick tab navigation.

Parameters:

Returns: TabBarWidget

csharp
public TabBarWidget Selector(bool enabled = true)

TabsOnBottom()

Sets the tab position to bottom.

Returns: TabBarWidget

csharp
public TabBarWidget TabsOnBottom()

TabsOnTop()

Sets the tab position to top.

Returns: TabBarWidget

csharp
public TabBarWidget TabsOnTop()

Fields

Click

Rebindable action: Select tab or scroll via mouse click.

Returns: ActionId

csharp
public static readonly ActionId Click

ScrollLeft

Rebindable action: Scroll tabs left.

Returns: ActionId

csharp
public static readonly ActionId ScrollLeft

ScrollRight

Rebindable action: Scroll tabs right.

Returns: ActionId

csharp
public static readonly ActionId ScrollRight

Examples

csharp
ctx.TabBar(tb => [
    tb.Tab("Overview").Selected(),
    tb.Tab("Settings"),
    tb.Tab("Advanced")
])

Released under the MIT License.