Tabs Blazor API

Tabs Properties

NameTypeDefaultDescription
AddNewTabboolfalseSets or gets whether the "Add new tab" button (+) is displayed.
AllowToggleboolfalseAllows toggle. If set to true, **selectedIndex** can be set to null (no selected tab).
CloseButtonModeTabsCloseButtonModeTabsCloseButtonMode.DefaultSets or gets the close button mode.
CloseButtonsboolfalseSets or gets whether close buttons are displayed.
IsCollapsedboolfalseSets or gets whether the Tabs content section is collapsed.
CollapsibleboolfalseEnables or disables the collapsible feature.
DataSourceIEnumerable<object>N/ADetermines the data source that will be loaded to the Tabs.
DisabledboolfalseEnables or disables the element.
EnableMouseWheelActionboolfalseEnables or disables scrolling using the mouse wheel through overflowing tab labels in the tab strip.
Localestring"en"Sets or gets the locale. Used in conjunction with the property messages.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
Namestring""Sets or gets the widget's name.
OverflowOverflowOverflow.AutoSets or gets the Tabs scroll buttons behavior. Applicable only when tabLayout is 'scroll'.
ReadonlyboolfalseDisables user interaction with the element.
ReorderboolfalseEnables or disables the reorder feature. When this feature is enabled, the end-user can drag a tab and drop it over another tab. As a result the tabs will be reordered.
ResizeboolfalseSets or gets whether tab labels can be resized by dragging with the mouse.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
ScrollButtonsPositionLayoutPositionLayoutPosition.BothSets or gets the position of the scroll buttons.
ScrollModeTabsScrollModeTabsScrollMode.PagingSets or gets the behavior when scrolling the tab strip via the scroll buttons.
SelectedIndexint?N/ASets or gets which tab is selected.
SelectionModeTabSelectionModeTabSelectionMode.ClickDetermines the way the user can switch between tabs.
TabLayoutTabsTabLayoutTabsTabLayout.ScrollApplies one of four behaviors when the element is not wide enough to display all tab labels.
TabPositionTabPositionTabPosition.TopSets or gets where the tab strip is positioned.
TabTextOrientationOrientationOrientation.HorizontalSets or gets the orientation of the text in the tabs.
Themestring""Determines the theme. Theme defines the look of the element
UnfocusableboolfalseIf is set to true, the element cannot be focused.

Tabs Methods

NameTypeArgumentsDescription
CollapsevoidN/ACollapses the content section.
EnsureVisiblevoidint indexMakes sure a tab is visible by scrolling to it.Args: int index - The index of the tab to scroll to.
ExpandvoidN/AExpands the content section.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetIsCollapsedAsync()Task<bool>'N/A'Gets the &quot;IsCollapsed&quot; property as Task&lt;bool&gt;.
GetOffsetFromEdgeOfElementintint indexReturns the offset of the tab item container (smart-tab-item element) from the edge of the Tabs (smart-tabs element) where the tab strip is positioned.Args: int index - The index of the tab item.
GetSelectedIndexAsync()Task<int?>'N/A'Gets the &quot;SelectedIndex&quot; property as Task&lt;int?&gt;.
GetTabContentobjectint indexReturns the content of a Tab at given index.Args: int index - The index of the tab.
GetTabLabelstringint indexReturns the label of a Tab at given index.Args: int index - The index of the tab.
GetTabsTabItem[]N/AReturns an array of the TabItems inside the element.
Insertvoidint index, object detailsInserts a new tab and an associated content section.Args: int index - The index to insert a new tab at.,object details - An Object with the fields "label", "labelSize", "content" and "group".
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RefreshTabHeadervoidN/ARefreshes the Tabs header section. Useful when the header contains elements (such as images) loaded slower than the Tabs itself.
RemoveAtvoidint indexRemoves a tab and its associated content section.Args: int index - The index of the tab to remove.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
Selectvoidint indexSelects a tab.Args: int index - The index of the tab to select.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
Updatevoidint index, string label, string contentUpdates a tab and its associated content section.Args: int index - The index of the tab to update.,string label - The new label of the tab. The value can be the id of an HTMLTemplateElement,string content - The new content of the tab.

Tabs Events

NameTypeDescriptionEvent Detail
OnAddNewTabClickEventCallback<Event>This event is triggered when the addNewTab is enabled and is clicked.N/A
AddNewTabClickedevent TabsAddNewTabClickedEventHandlerThis event is triggered when the addNewTab is enabled and is clicked.TabsAddNewTabClickedEventArgs
OnChangeEventCallback<Event>This event is triggered when the tab selection is changed.int index- The tab's index., int oldIndex- The tab's old index.
Changedevent TabsChangedEventHandlerThis event is triggered when the tab selection is changed.TabsChangedEventArgs
OnCloseEventCallback<Event>This event is triggered when a tab is closed.int index- The tab's index.
Closedevent TabsClosedEventHandlerThis event is triggered when a tab is closed.TabsClosedEventArgs
OnClosingEventCallback<Event>This event is triggered when a tab is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.int index- The tab's index.
Closingevent TabsClosingEventHandlerThis event is triggered when a tab is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.TabsClosingEventArgs
OnDragEndEventCallback<Event>This event is triggered when a drag operation has ended.int left- The tab's left position., int top- The tab's top position., int index- The tab's index., string label- The tab's label.
DragEndedevent TabsDragEndedEventHandlerThis event is triggered when a drag operation has ended.TabsDragEndedEventArgs
OnDragStartEventCallback<Event>This event is triggered when a drag operation has started.int left- The tab's left position., int top- The tab's top position., int index- The tab's index., string label- The tab's label.
DragStartedevent TabsDragStartedEventHandlerThis event is triggered when a drag operation has started.TabsDragStartedEventArgs
OnReorderEventCallback<Event>This event is triggered when tabs have been reordered.int index- The tab's index., int oldIndex- The tab's old index.
Reorderedevent TabsReorderedEventHandlerThis event is triggered when tabs have been reordered.TabsReorderedEventArgs

Enums

TabsCloseButtonMode

TabsCloseButtonMode.Default
TabsCloseButtonMode.Selected

Overflow

Overflow.Auto
Overflow.Hidden
Overflow.Scroll

LayoutPosition

LayoutPosition.Near
LayoutPosition.Far
LayoutPosition.Both

TabsScrollMode

TabsScrollMode.Paging
TabsScrollMode.Continuous

TabSelectionMode

TabSelectionMode.Click
TabSelectionMode.Dblclick
TabSelectionMode.Mouseenter
TabSelectionMode.None

TabsTabLayout

TabsTabLayout.Scroll
TabsTabLayout.DropDown
TabsTabLayout.Wrap
TabsTabLayout.Shrink

TabPosition

TabPosition.Top
TabPosition.Bottom
TabPosition.Left
TabPosition.Right
TabPosition.Hidden

Orientation

Orientation.Horizontal
Orientation.Vertical