Skip to content
GitHub11 stars

A component for toggling between related panels on the same page.

Workspace stats and activity.

<TabsRoot class="tabs-root" Value="overview">
    <TabsList class="tabs-list">
        <TabsTab class="tabs-tab" Value="overview">

Anatomy

Import the primitives and assemble the parts:

@using Blazix.Primitives

<TabsRoot>
    <TabsList>
        <TabsTab />
        <TabsIndicator />
    </TabsList>
    <TabsPanel />
</TabsRoot>

API Reference

TabsRoot

Renders a <div> element.

ParameterTypeDefault
Value string? -
ValueChanged

Called with the new value when Value changes, for @bind-Value.

EventCallback<string?> -
OnValueChange

Runs before the value changes, with the reason; call Cancel() to keep it.

EventCallback<ValueChangeEventArgs<string?>> -
Orientation

Which way the parts are laid out, and which arrow keys move between them.

Orientation Orientation.Horizontal
Render RenderFragment<TabsRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the tabs.

'horizontal' | 'vertical'
data-activation-direction

Indicates the direction of the activation (based on the previous active tab).

'left' | 'right' | 'up' | 'down' | 'none'

TabsList

Renders a <div> element.

ParameterTypeDefault
ActivateOnFocus bool false
LoopFocus bool true
Render RenderFragment<TabsRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the tabs.

'horizontal' | 'vertical'
data-activation-direction

Indicates the direction of the activation (based on the previous active tab).

'left' | 'right' | 'up' | 'down' | 'none'

TabsPanel

Renders a <div> element.

ParameterTypeDefault
Value string? -
KeepMounted bool false
Render RenderFragment<TabsPanelRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the tabs.

'horizontal' | 'vertical'
data-activation-direction

Indicates the direction of the activation (based on the previous active tab).

'left' | 'right' | 'up' | 'down' | 'none'
data-hidden

Present when the panel is hidden.

-
data-index

Indicates the index of the tab panel.

-
data-starting-style

Present when the panel begins animating in.

-
data-ending-style

Present when the panel is animating out.

-

TabsIndicator

Renders a <span> element.

ParameterTypeDefault
Render RenderFragment<TabsRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the tabs.

'horizontal' | 'vertical'
data-activation-direction

Indicates the direction of the activation (based on the previous active tab).

'left' | 'right' | 'up' | 'down' | 'none'
CSS variableType
--active-tab-bottom

Indicates the distance on the bottom side from the parent's container if the tab is active.

number
--active-tab-height

Indicates the height of the tab if it is active.

number
--active-tab-left

Indicates the distance on the left side from the parent's container if the tab is active.

number
--active-tab-right

Indicates the distance on the right side from the parent's container if the tab is active.

number
--active-tab-top

Indicates the distance on the top side from the parent's container if the tab is active.

number
--active-tab-width

Indicates the width of the tab if it is active.

number

TabsTab

Renders a <button> element.

ParameterTypeDefault
Value string? -
Disabled

Whether the component should ignore user interaction.

bool false
NativeButton bool? -
Render RenderFragment<TabsTabRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Indicates the orientation of the tabs.

'horizontal' | 'vertical'
data-disabled

Present when the tab is disabled.

-
data-activation-direction

Indicates the direction of the activation (based on the previous active tab).

'left' | 'right' | 'up' | 'down' | 'none'
data-active

Present when the tab is active.

-