Skip to content

TabPanelWidget ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A complete tabbed panel widget with a tab bar and content area. Supports composable tab content with automatic tab switching.

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

Inheritance ​

Object → Hex1bWidget → TabPanelWidget

Implements ​

Constructors ​

TabPanelWidget(IReadOnlyList<TabItemWidget>) ​

A complete tabbed panel widget with a tab bar and content area. Supports composable tab content with automatic tab switching.

Parameters:

csharp
public TabPanelWidget(IReadOnlyList<TabItemWidget> Tabs)

Properties ​

Position ​

The position of tabs (top or bottom).

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: TabPanelWidget

csharp
public TabPanelWidget Compact()

Full() ​

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

Returns: TabPanelWidget

csharp
public TabPanelWidget Full()

OnSelectionChanged(Action<TabSelectionChangedEventArgs>) ​

Sets the handler for selection changes.

Parameters:

Returns: TabPanelWidget

csharp
public TabPanelWidget OnSelectionChanged(Action<TabSelectionChangedEventArgs> handler)

OnSelectionChanged(Func<TabSelectionChangedEventArgs, Task>) ​

Sets the async handler for selection changes.

Parameters:

Returns: TabPanelWidget

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

Paging(bool) ​

Enables or disables paging arrows for tab overflow navigation.

Parameters:

Returns: TabPanelWidget

csharp
public TabPanelWidget Paging(bool enabled = true)

Selector(bool) ​

Enables or disables the dropdown selector for quick tab navigation.

Parameters:

Returns: TabPanelWidget

csharp
public TabPanelWidget Selector(bool enabled = true)

TabsOnBottom() ​

Sets the tab position to bottom.

Returns: TabPanelWidget

csharp
public TabPanelWidget TabsOnBottom()

TabsOnTop() ​

Sets the tab position to top.

Returns: TabPanelWidget

csharp
public TabPanelWidget TabsOnTop()

Fields ​

Click ​

Rebindable action: Select tab or scroll via mouse click.

Returns: ActionId

csharp
public static readonly ActionId Click

NextFocusable ​

Rebindable action: Focus next focusable element.

Returns: ActionId

csharp
public static readonly ActionId NextFocusable

NextTab ​

Rebindable action: Switch to next tab.

Returns: ActionId

csharp
public static readonly ActionId NextTab

PreviousFocusable ​

Rebindable action: Focus previous focusable element.

Returns: ActionId

csharp
public static readonly ActionId PreviousFocusable

PreviousTab ​

Rebindable action: Switch to previous tab.

Returns: ActionId

csharp
public static readonly ActionId PreviousTab

ScrollTabsLeft ​

Rebindable action: Scroll tabs left via mouse wheel.

Returns: ActionId

csharp
public static readonly ActionId ScrollTabsLeft

ScrollTabsRight ​

Rebindable action: Scroll tabs right via mouse wheel.

Returns: ActionId

csharp
public static readonly ActionId ScrollTabsRight

Examples ​

csharp
ctx.TabPanel(tp => [
    tp.Tab("Overview", t => [t.Text("Overview content")]),
    tp.Tab("Settings", t => [t.Text("Settings content")]).Selected(),
    tp.Tab("Advanced", t => [t.Text("Advanced content")])
])

Released under the MIT License.