Tabs

Tabs are a set of layered sections of content that display one panel of content at a time. Each tab panel has an associated tab element, that when activated, displays the panel. The list of tab elements is arranged along one edge of the currently displayed panel.

<FluentTabs> wraps the <fluent-tabs> element, a web component implementation of a tabs composition leveraging the Fluent UI design system. It uses the <FluentTab> component to define the structure and content.

The default width for the active tab indicator is 20 pixels. If you would like to change this, you can add some rules to your CSS like this:


    ::deep fluent-tabs::part(activeIndicator) {
        width: 85%;
    }

Examples

Default

Example
SmallMediumLarge Use deferred loading

If checked, the contents of Tab two and three will be loaded after 1 second of processing (to simulate a long running process).

Tab one Tab one content. This is for testing. Tab two Tab two content. This is for testing. Tab three Tab three content. This is for testing.

Active tab changed to:

Vertical

Tab one Tab one content. This is for testing. Tab two Tab two content. This is for testing. Tab three Tab three content. This is for testing.
Download: 

Custom Header and Panel usage

A <FluentTab> exposes a Header parameter that can be used to provide custom content for the tab header. This can be used to add icons, badges, etc. The Panel parameter allows for custom content to be used for the tab panel. This can be used to add additional content to the panel, or to use a different component

Example
All Content 0 January Content 1 February Content 2
Download: 

Dynamic

Example
January Content #01 - JanuaryFebruary Content #02 - FebruaryMarch Content #03 - MarchApril Content #04 - AprilMay Content #05 - MayJune Content #06 - JuneJuly Content #07 - JulyAugust Content #08 - AugustSeptember Content #09 - SeptemberOctober Content #10 - OctoberNovember Content #11 - NovemberDecember Content #12 - December SelectedTab ID
01 January02 February03 March04 April05 May06 June07 July08 August09 September10 October11 November12 December Add and select
Download: 

Extra content

Example

Horizontal

1 2 3
1 2 3
Tab one Tab one content. This is for testing. Tab two Tab two content. This is for testing. Tab three Tab three content. This is for testing.

Vertical

1 2 3
1 2 3
Tab one Tab one content. This is for testing. Tab two Tab two content. This is for testing. Tab three Tab three content. This is for testing.
Download: 

No active tab indicator

Example

No active indicator

Tab one Tab one content. This is for testing. Tab two Tab two content. This is for testing. Tab three Tab three content. This is for testing.

No active indicator - Vertical

Tab one Tab one content. This is for testing. Tab two Tab two content. This is for testing. Tab three Tab three content. This is for testing. Tab four Tab four content. This is for testing.
Download: 

Documentation

FluentTabs Class

Parameters

Name
Type
Default
Description
ActiveTabFluentTab
Gets the active selected tab.
ActiveTabIdstring
ChildContentRenderFragment?
Gets or sets the content to be rendered inside the component.
Heightstring?
Gets or sets the height of the tabs component.
Needs to be a valid CSS value (e.g. 100px, 50%).
IdMoreButtonstring
f1733aff7-more
Gets the unique identifier associated to the more button ([Id]-more).
OrientationOrientation
Horizontal
Gets or sets the tab's orentation. See Orientation
ShowActiveIndicatorbool
True
Gets or sets a value indicating whether the active indicator is displayed.
ShowClosebool
False
Determines if a dismiss icon is shown.
When clicked the FluentTabs.OnTabClose event is raised to remove this tab from the list.
SizeTabSize?
Small
Gets or sets the width of the tab items.
TabsOverflowIEnumerable<FluentTab>
Gets all tabs with FluentTab.Overflow assigned to True.
Widthstring?
Gets or sets the width of the tabs component.
Needs to be a valid CSS value (e.g. 100px, 50%).

EventCallbacks

Name
Type
Description
ActiveTabIdChangedEventCallback<string>
Gets or sets a callback when the bound value is changed.
OnTabChangeEventCallback<FluentTab>
Gets or sets a callback when a tab is changed.
OnTabCloseEventCallback<FluentTab>
Raised when a tab is closed.
OnTabSelectEventCallback<FluentTab>
Raised when a tab is selected.

Methods

Name
Parameters
Type
Description
GoToTabAsyncstring TabId
Task
Go to a specific tab by specifying an id
OverflowRaisedAsyncstring value
Task

FluentTab Class

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Gets or sets the content to be rendered inside the component.
ContentRenderFragment?
Gets or sets the customized content of this tab panel.
DeferredLoadingbool
False
Render the tab content only when the tab is selected.
Disabledbool
False
When true, the control will be immutable by user interaction. See disabled HTML attribute for more information.
HeaderRenderFragment?
Gets or sets the customized content of the header.
IconIcon?
Gets or sets the icon to display in front of the tab
Indexint
0
Gets the index number of this tab.
Labelstring
Gets or sets the label of the tab.
LabelClassstring?
Gets or sets the class, applied to the Label Tab Item.
LabelEditablebool
False
True to let the user edit the FluentTab.Label property.
LabelStylestring?
Gets or sets the style, applied to the Label Tab Item.
LoadingContentRenderFragment?
Gets or sets the customized loading content message when using deferred loading.
Overflowbool?
If this tab is outside of visible tab panel area.
OwnerFluentTabs
Gets or sets the owning FluentTabs component.
Visiblebool
True
Gets or sets the visibility of a tab

EventCallbacks

Name
Type
Description
LabelChangedEventCallback<string>
Callback to invoke when the label changes.

Methods

Name
Parameters
Type
Description
UpdateTabLabelAsyncstring tabId
string label
Task
Horizontal
Vertical
Small
Medium
Large
An error has occurred. This application may no longer respond until reloaded. Reload 🗙