DwsTabGroup & DwsTab
DwsTabGroup shows a group of tabs with exactly one visible content area. Tabs come from markup (DwsTab), from a data source (DwsTabItems), from a template via the + button or at runtime through the API. The tab bar follows the WAI-ARIA tabs pattern (arrow keys, Home/End, roving tabindex) and can be reordered by mouse, pen and touch. It is built from the library's own parts: the search is a DwsInput, the header buttons are DwsButtons and DwsCloseButtons, the icons DwsIcons, and the context menu and the โ+Nโ list a DwsContextMenu. On a phone a tap on a tab plays a haptic tick when the app switches haptics on (Haptic, default Selection).
Obsolete: the former single parameters.
The group's settings are grouped into five option objects - AppearanceOptions, ScrollOptions, BehaviorOptions, AddCloseOptions and PersistenceOptions - and a tab's into four (HeaderOptions, ActionOptions, PanelOptions, ValidationOptions), as the examples below pass them. The former single parameters (Position, OverflowMode, PersistState, AllowClose, Badge ...) still work and give compiler warning CS0618; one that is set explicitly wins over the option object. TooltipPosition of a tab has no effect any more.
Basics
Tabs with icons, badge and tooltip, plus pinning, minimizing and closing. A disabled tab is visible but cannot be reached.
Show Code
Tab.razor
<DwsTabGroup Name="TabDemo_TabGroup01">
<DwsTab Name="TabDemo_TabGroup01_Tab01" Title="Overview" HeaderOptions="@(new() { StartIcon = Icons.BS.House, Tooltip = "Project start page" })">
Welcome to the project. Hover over the tab (or tap it) to see the tooltip.
</DwsTab>
<DwsTab Name="TabDemo_TabGroup01_Tab02" Title="Messages" HeaderOptions="@(new() { StartIcon = Icons.BS.Envelope, Badge = "3", BadgeColor = DwsColor.Error })" ActionOptions="@(new() { AllowPin = true, AllowClose = true })">
Three unread messages. Pinned tabs move to the front and cannot be closed.
</DwsTab>
<DwsTab Name="TabDemo_TabGroup01_Tab03" Title="Reports" HeaderOptions="@(new() { EndIcon = Icons.BS.BarChart })" ActionOptions="@(new() { AllowClose = true, AllowMinimize = true })">
The minimize button of the active tab collapses the content area.
</DwsTab>
<DwsTab Name="TabDemo_TabGroup01_Tab04" Title="Archive" HeaderOptions="@(new() { StartIcon = Icons.BS.Archive })" Disabled="true">
Not reachable.
</DwsTab>
</DwsTabGroup>Colour & sizes
Color sets the active tab's accent colour through the theme variables. The NavTab* parameters limit the headers, Width the group and Height/MinHeight/MaxHeight a tab's content (all in px).
Show Code
Tab.razor
<DwsNativeSelect Name="TabDemo_TabGroup21_ColorSelect" T="DwsColor" Label="Color" @bind-Value="_accentColor">
@foreach (DwsColor color in _accentColors)
{
<DwsSelectOption Name="@($"TabDemo_TabGroup21_Color_{color}")" Value="@color">@color</DwsSelectOption>
}
</DwsNativeSelect>
<DwsTabGroup Name="TabDemo_TabGroup21" AppearanceOptions="@(new DwsTabGroupAppearanceOptions { Color = _accentColor, Width = 600, MinNavTabWidth = 120, MaxNavTabWidth = 160 })">
<DwsTab Name="TabDemo_TabGroup21_Tab01" Title="Short" PanelOptions="@(new() { Height = 120 })">Height=120</DwsTab>
<DwsTab Name="TabDemo_TabGroup21_Tab02" Title="A rather long tab title" PanelOptions="@(new() { MaxHeight = 80 })">
MaxHeight=80 – longer content is cut off once it no longer fits.
</DwsTab>
<DwsTab Name="TabDemo_TabGroup21_Tab03" Title="Medium" PanelOptions="@(new() { MinHeight = 200 })">MinHeight=200</DwsTab>
</DwsTabGroup>Tab.razor.cs
private readonly DwsColor[] _accentColors = [DwsColor.Undefined, DwsColor.Primary, DwsColor.Secondary, DwsColor.Success, DwsColor.Info, DwsColor.Warning, DwsColor.Error];
private DwsColor _accentColor = DwsColor.Undefined;Option objects of a tab
A tab's settings are grouped into four option objects: HeaderOptions (tooltip, icons, badge), ActionOptions (pin, close, minimize), PanelOptions (heights, ContentMode) and ValidationOptions (EditContext, Validator). One instance can be shared by many tabs, and one that is changed in place is read again when the page renders. The former single parameters (AllowClose, StartIcon, Height ...) still work, are marked obsolete and win when set explicitly.
Show Code
Tab.razor
<DwsTabGroup Name="TabDemo_TabGroup22">
<DwsTab Name="TabDemo_TabGroup22_Tab01" Title="Inbox" HeaderOptions="_inboxHeader" ActionOptions="_closableAndPinnable">Inbox</DwsTab>
<DwsTab Name="TabDemo_TabGroup22_Tab02" Title="Drafts" ActionOptions="_closableAndPinnable" PanelOptions="@(new DwsTabPanelOptions { MinHeight = 120 })">Drafts (MinHeight = 120)</DwsTab>
<DwsTab Name="TabDemo_TabGroup22_Tab03" Title="Archive" HeaderOptions="@(new DwsTabHeaderOptions { EndIcon = Icons.BS.Archive, Tooltip = "Read only" })">Archive</DwsTab>
</DwsTabGroup>
<DwsButton Name="TabDemo_TabGroup22_Button01" Class="mt-2" OnClick="@(() => _inboxHeader.Badge = (++_unread).ToString())">One more unread message</DwsButton>Tab.razor.cs
// One instance can be shared by many tabs ...
private static readonly DwsTabActionOptions _closableAndPinnable = new() { AllowClose = true, AllowPin = true };
// ... and one that is changed in place is read again when the page renders.
private readonly DwsTabHeaderOptions _inboxHeader = new() { StartIcon = Icons.BS.Envelope, Badge = "3", BadgeColor = DwsColor.Error };
private int _unread = 3;Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Tabs | IReadOnlyList<DwsTab> | [] | The tabs in display order (pinned first), including hidden ones. |
| ActiveTab | DwsTab? | null | The active tab. |
| SelectedTabs | IReadOnlyList<DwsTab> | [] | The multi-selection in display order. |
| ParentGroup | DwsTabGroup? | null | The group this one is nested in. |
| ParentTab | DwsTab? | null | The tab this group sits in. |
| Depth | int | 0 | Nesting depth: 0 for a top-level group. |
| IsHorizontal | bool | true | True for Position Top/Bottom – also when Responsive stacks a side bar on top on narrow screens. |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| ActivateTabAsync | Task<bool> | Activates a tab (DwsTab, index or name) after validation and cancellable events. | |
| ActivateNextTabAsync | Task<bool> | Activates the next reachable tab (wrapping around). | |
| ActivatePreviousTabAsync | Task<bool> | Activates the previous reachable tab (wrapping around). | |
| FindTab | DwsTab? | Finds a tab by its name. | |
| IndexOfTab | int | Position of a tab in Tabs, or -1. | |
| AddTabAsync | Task<string?> | Creates a tab from DwsTabOptions at runtime. The task completes once the tab is registered – FindTab finds it afterwards. Returns its name, or null when the group is locked or the name is taken. | |
| CloseTabAsync | Task<bool> | Closes a tab (DwsTab, index or name) unless locked or cancelled. | |
| CloseOtherTabsAsync | Task<int> | Closes every other closable tab. | |
| CloseTabsAfterAsync | Task<int> | Closes every closable tab after a tab. | |
| CloseAllTabsAsync | Task<int> | Closes every closable tab. | |
| CloseSelectedTabsAsync | Task<int> | Closes the selected closable tabs. | |
| CloseGroupAsync | Task<bool> | Closes the whole group; when nested, also the parent tab if nothing stays open. | |
| SetTabPinnedAsync | Task<bool> | Pins or unpins a tab. | |
| SetSelectedTabsPinnedAsync | Task | Pins or unpins every selected tab. | |
| SetTabCollapsedAsync | Task<bool> | Minimizes or restores a tab. | |
| MoveTabAsync | Task<bool> | Moves a tab to a new index; pinned tabs stay in front. | |
| SetTabOrderAsync | Task<bool> | Orders the tabs by a list of names. | |
| SetTabSelectedAsync | Task | Adds a tab to or removes it from the multi-selection. | |
| SelectAllTabsAsync | Task | Selects every visible tab. | |
| ClearSelectionAsync | Task | Clears the multi-selection. | |
| ValidateActiveTabAsync | Task<bool> | Validates the active tab without leaving it. | |
| ValidateTabAsync | Task<bool> | Validates a tab. | |
| ScrollToActiveTabAsync | Task | Scrolls the bar until the active tab is visible. | |
| ClearPersistedStateAsync | Task | Deletes the group's saved state. |
| Name | Typ | Default | Description |
|---|---|---|---|
| ChildContent | RenderFragment? | null | The tabs (DwsTab, DwsTabItems) and any other content. Tabs and lists shown later (@if) also appear at their place in the markup; tabs inside custom wrapper components come after the rest. |
| HeaderStartContent | RenderFragment? | null | Custom content in the header before the tabs. |
| HeaderEndContent | RenderFragment? | null | Custom content in the header after the tabs, e.g. buttons or dropdowns. |
| FooterContent | RenderFragment? | null | A footer below the content area. |
| EmptyContent | RenderFragment? | null | Shown instead of the default message when no tab is open. |
| AppearanceOptions | DwsTabGroupAppearanceOptions? | null | Position, colour, sizes and animations in one object (the AppearanceOptions.* rows below). Null uses the defaults. Like every option object it is read on each render of the parent, so one instance can be changed in place or shared by several groups. |
| ScrollOptions | DwsTabGroupScrollOptions? | null | What happens when the headers do not fit (the ScrollOptions.* rows below). |
| BehaviorOptions | DwsTabGroupBehaviorOptions? | null | Content rendering, keyboard, reordering, locking, validation, multi-selection, context menu and search (the BehaviorOptions.* rows below). |
| AddCloseOptions | DwsTabGroupAddCloseOptions? | null | The add button, the title of new tabs and the close-all button (the AddCloseOptions.* rows below). |
| PersistenceOptions | DwsTabGroupPersistenceOptions? | null | Saving and restoring the group's state (the PersistenceOptions.* rows below). |
| Haptic | DwsHapticFeedback | DwsHapticFeedback.Selection | The haptic a tap on a tab header plays on phones (data-dws-haptic), while the app has haptics on (IDwsHapticService). None switches it off; a disabled group or tab plays nothing. |
| (obsolete parameters) | - | - | Until fix batch 32 every option was a parameter of its own: Position, Color, Width ... (now AppearanceOptions), OverflowMode ... (ScrollOptions), ContentMode ... (BehaviorOptions), NewTabTitle, ShowAddButton, AllowCloseGroup (AddCloseOptions), PersistState, PersistedState, PersistenceStorage, StorageKey (PersistenceOptions.Enabled / State / Storage / StorageKey). They still work and are marked [Obsolete]; one that is set explicitly wins over the option object. |
| AppearanceOptions.Position | DwsTabPosition | DwsTabPosition.Top | Position of the tab bar. Start/End follow the writing direction, Left/Right do not; the side positions stack vertically. |
| AppearanceOptions.Color | DwsColor | DwsColor.Undefined | Accent colour of the active tab through the theme variables. Undefined uses the primary colour. |
| AppearanceOptions.Width | int? | null | Width of the group in px. With Responsive (and no MaxWidth) never wider than the container. |
| AppearanceOptions.MinWidth | int? | null | Minimum width of the group in px. |
| AppearanceOptions.MaxWidth | int? | null | Maximum width of the group in px. |
| AppearanceOptions.NavTabWidth | int? | null | Width of the tab headers in px. |
| AppearanceOptions.NavTabHeight | int? | null | Height of the tab headers in px. |
| AppearanceOptions.MinNavTabWidth | int? | null | Minimum width of the tab headers in px. |
| AppearanceOptions.MinNavTabHeight | int? | null | Minimum height of the tab headers in px. |
| AppearanceOptions.MaxNavTabWidth | int? | null | Maximum width of the tab headers in px. |
| AppearanceOptions.MaxNavTabHeight | int? | null | Maximum height of the tab headers in px. |
| ScrollOptions.OverflowMode | DwsTabOverflowMode | DwsTabOverflowMode.Menu | Menu: what does not fit moves behind a “+N” button and the active tab stays visible. Scroll: one scrolling row. Wrap: breaks into several rows. Menu and Wrap only apply to horizontal bars; side bars always scroll. |
| ScrollOptions.ShowScrollButtons | bool | true | Shows back/forward buttons while the bar overflows (Scroll only). |
| ScrollOptions.ShowScrollbar | bool | true | Shows a thin scrollbar on an overflowing bar. |
| ScrollOptions.Responsive | bool | true | Moves side tab bars to the top on narrow screens, shrinks the headers and limits a fixed Width to the available width. Arrow keys, scroll arrows, the context menu and aria-orientation then follow the horizontal bar. |
| AriaLabel | string? | null | Accessible name of the tab bar. Default: the localized “Tabs”. |
| CurrentTabIndex | int | 0 | Index of the active tab in Tabs. Two-way bindable. |
| ActiveTabName | string? | null | Name of the active tab. Two-way bindable, stable across reordering, and takes precedence over CurrentTabIndex for the start tab. A start tab from data loaded later becomes active as soon as it exists, as long as nobody has switched. |
| LinkQueryParameter | string? | null | Link mode: every tab header is also a real link to ?{LinkQueryParameter}={tab Name}, and the tab named there is the start tab. Under static SSR the links switch tabs (bookmarkable, crawlable); interactive, the address follows the active tab (history replace). |
| BehaviorOptions.ContentMode | DwsTabContentMode | DwsTabContentMode.Lazy | ActiveOnly: only the active content exists. Lazy: rendered on first activation, then kept hidden. Eager: all at once. |
| AppearanceOptions.Transition | DwsTabTransition | DwsTabTransition.Fade | Animation when switching tabs. |
| AppearanceOptions.GroupTransition | DwsTabTransition | DwsTabTransition.None | Animation when the group is shown or hidden through Visible. |
| AppearanceOptions.TransitionDuration | int | 200 | Duration of both animations in ms. |
| BehaviorOptions.KeyboardNavigation | bool | true | Arrow keys, Home/End, Enter/Space, Delete and Ctrl+Shift+Arrow in the tab bar. |
| BehaviorOptions.KeyboardActivation | DwsTabKeyboardActivation | DwsTabKeyboardActivation.Automatic | Automatic: the focused tab becomes active. Manual: only Enter/Space activates. |
| BehaviorOptions.AllowReorder | bool | true | Reordering by drag & drop (mouse, pen, touch) and Ctrl+Shift+Arrow. A pen drags tabs like a mouse; it scrolls the bar via empty space, the scrollbar or the buttons. |
| BehaviorOptions.Locked | bool | false | Prevents adding, closing, pinning and reordering – by UI and API. Switching stays possible. |
| BehaviorOptions.ValidationMode | DwsTabValidationMode | DwsTabValidationMode.Always | Always: validate whenever a tab is left. ForwardOnly: only when moving to a later tab. |
| BehaviorOptions.MultiSelect | bool | false | Multi-selection with Ctrl/Cmd+click, Shift+click and Ctrl+Space. Screen readers hear selected tabs as “(selected)” and the count as an announcement; aria-selected stays reserved for the active tab. |
| BehaviorOptions.EnableContextMenu | bool | false | Context menu by right-click, long press or Shift+F10. |
| BehaviorOptions.ContextMenuItems | IReadOnlyList<DwsTabContextMenuItem>? | null | Custom entries after the built-in ones. |
| BehaviorOptions.ShowDefaultContextMenuItems | bool | true | Shows the built-in entries. |
| BehaviorOptions.ShowSearch | bool | false | Shows a search box that filters the tab headers by title. |
| SearchText | string? | null | The search text. Two-way bindable. |
| BehaviorOptions.SearchPlaceholder | string? | null | Placeholder of the search box. Default: localized. |
| NewTabTemplate | RenderFragment<DwsTabTemplateContext>? | null | Template for tabs the user creates with the + button. |
| AddCloseOptions.NewTabTitle | string? | null | Title of new template tabs; {0} is replaced by the running number. |
| AddCloseOptions.ShowAddButton | bool | true | Shows the + button once NewTabTemplate or OnAddTab is set. |
| AddCloseOptions.AllowCloseGroup | bool | false | Shows a button that closes every closable tab; a nested group then closes its parent tab. |
| PersistenceOptions.Enabled | bool | false | Saves the active tab, order, pinned and minimized tabs and restores them on load – also for tabs whose data only arrives after the first render. |
| PersistenceOptions.State | DwsTabPersistedState | DwsTabPersistedState.All | Which parts are saved (flags). |
| PersistenceOptions.Storage | DwsTabPersistenceStorage | DwsTabPersistenceStorage.Local | localStorage or sessionStorage. |
| PersistenceOptions.StorageKey | string? | null | Storage key. Default: derived from the page namespace and Name. |
| Name | Typ | Description |
|---|---|---|
| CurrentTabIndexChanged | EventCallback<int> | The active index changed (also through reordering or closing). |
| ActiveTabNameChanged | EventCallback<string?> | The name of the active tab changed. |
| OnActiveTabChanging | EventCallback<DwsTabChangingEventArgs> | Before switching, after validation passed. Cancellable. |
| OnActiveTabChanged | EventCallback<DwsTabChangedEventArgs> | After the active tab changed. |
| OnTabAdded | EventCallback<DwsTab> | A tab was added after the first render (API, template, data). |
| OnTabRemoved | EventCallback<DwsTab> | A tab was closed or removed from the markup. |
| OnTabOrderChanged | EventCallback<IReadOnlyList<DwsTab>> | The order changed. |
| OnTabCollapseStateChanged | EventCallback<(bool previousState, bool currentState)> | The minimized state of the active content changed. |
| OnTabClosing | EventCallback<DwsTabCancelEventArgs> | Before a tab closes. Cancellable. |
| OnAddTab | EventCallback<DwsTabAddEventArgs> | The + button was pressed. Cancellable, so that no template tab is created. |
| OnGroupClosing | EventCallback<DwsTabCancelEventArgs> | Before the group closes. Cancellable. |
| OnGroupClosed | EventCallback | After the group was closed. |
| OnValidationFailed | EventCallback<DwsTab> | Validation prevented leaving a tab. |
| OnSelectionChanged | EventCallback<IReadOnlyList<DwsTab>> | The multi-selection changed. |
| OnContextMenuOpened | EventCallback<DwsTab> | The context menu was opened for a tab. |
| SearchTextChanged | EventCallback<string> | The search text changed. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| TabParent | DwsTabGroup? | null | The enclosing group (cascaded). |
| Group | DwsTabGroup? | null | The tab's group. |
| IsActive | bool | false | The tab is active. |
| IsPinned | bool | false | The tab is pinned. |
| IsCollapsed | bool | false | The tab is minimized. |
| IsSelected | bool | false | The tab is part of the multi-selection. |
| IsInvalid | bool | false | The last validation failed. |
| IsClosed | bool | false | The tab was closed. |
| HasBeenActivated | bool | false | The tab was active at least once (content rendered under Lazy). |
| Index | int | -1 | Position in DwsTabGroup.Tabs. |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| ActivateAsync | Task<bool> | Activates the tab. | |
| CloseAsync | Task<bool> | Closes the tab. | |
| SetPinnedAsync | Task<bool> | Pins or unpins the tab. | |
| SetCollapsedAsync | Task<bool> | Minimizes or restores the tab. | |
| ValidateAsync | Task<bool> | Runs EditContext and Validator and updates IsInvalid. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Title | string | string.Empty | The header text; searched by ShowSearch. |
| ChildContent | RenderFragment? | null | The tab's content. |
| HeaderContent | RenderFragment? | null | Custom header content instead of the title. |
| Pinned | bool | false | Pinned: sits in front and cannot be closed. Two-way bindable. |
| Collapsed | bool | false | Minimizes the content area while the tab is active. Two-way bindable. |
| HeaderOptions | DwsTabHeaderOptions? | null | What the header shows besides the title (the HeaderOptions.* rows below). Null uses the defaults. Like every option object it is read on each render of the parent, so one instance can be changed in place or shared by several tabs. |
| ActionOptions | DwsTabActionOptions? | null | Which buttons the header offers (the ActionOptions.* rows below). |
| PanelOptions | DwsTabPanelOptions? | null | Size and rendering of the content (the PanelOptions.* rows below). |
| ValidationOptions | DwsTabValidationOptions? | null | What must hold before the tab may be left (the ValidationOptions.* rows below). |
| (obsolete parameters) | - | - | Until fix batch 34 every option was a parameter of its own: Tooltip, StartIcon, EndIcon, StartIconSize, EndIconSize, Badge, BadgeColor (now HeaderOptions), AllowPin, AllowClose, AllowMinimize (ActionOptions), Height, MaxHeight, MinHeight, ContentMode (PanelOptions), EditContext, Validator (ValidationOptions). They still work and are marked [Obsolete]; one that is set explicitly wins over the option object. Most examples on this page still use them. |
| TooltipPosition | DwsTooltipPosition | DwsTooltipPosition.Top | Obsolete and without effect: the browser positions the native tooltip. |
| HeaderOptions.Tooltip | string | string.Empty | Tooltip of the header (native title attribute). |
| HeaderOptions.StartIcon | string | string.Empty | Icon before the title. |
| HeaderOptions.EndIcon | string | string.Empty | Icon after the title. |
| HeaderOptions.StartIconSize | DwsSize | DwsSize.Medium | Size of the start icon. |
| HeaderOptions.EndIconSize | DwsSize | DwsSize.Medium | Size of the end icon. |
| HeaderOptions.Badge | string? | null | Badge text on the header, e.g. a count. Empty = hidden. |
| HeaderOptions.BadgeColor | DwsColor | DwsColor.Primary | Colour of the badge. |
| ActionOptions.AllowPin | bool | false | Shows the pin button. |
| ActionOptions.AllowClose | bool | false | Shows the close button and allows closing by keyboard and context menu. |
| ActionOptions.AllowMinimize | bool | false | Shows the minimize button while the tab is active. |
| PanelOptions.Height | int? | null | Height of the content in px. |
| PanelOptions.MaxHeight | int? | null | Maximum height of the content in px. |
| PanelOptions.MinHeight | int? | null | Minimum height of the content in px. |
| PanelOptions.ContentMode | DwsTabContentMode? | null | Overrides the group's ContentMode for this tab. |
| ValidationOptions.EditContext | EditContext? | null | Validated before the tab is left. |
| ValidationOptions.Validator | Func<Task<bool>>? | null | Custom validation that must return true before the tab is left. |
| Name | Typ | Description |
|---|---|---|
| PinnedChanged | EventCallback<bool> | The pinned state changed (for @bind-Pinned). |
| CollapsedChanged | EventCallback<bool> | The minimized state changed (for @bind-Collapsed). |
| OnClick | EventCallback | Click on the header, before activation. |
| OnBeforeShowTab | EventCallback<DwsTabCancelEventArgs> | Before the tab is shown. Cancellable. |
| OnBeforeHideTab | EventCallback<DwsTabCancelEventArgs> | Before the tab is left. Cancellable. |
| OnBeforeCloseTab | EventCallback<DwsTabCancelEventArgs> | Before the tab is closed. Cancellable. |
| OnShowTab | EventCallback | The tab was shown (also as the start tab). |
| OnHideTab | EventCallback | The tab was left. |
| OnCloseTab | EventCallback | The tab was closed. |
| OnPinTabStateChanged | EventCallback<(bool previousState, bool currentState)> | The pinned state changed. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Group | DwsTabGroup? | null | The enclosing group (cascaded). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| FindTab | DwsTab? | The tab currently created for an item. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Items | IEnumerable<TItem>? | null | The items tabs are created from. |
| KeySelector | Func<TItem, object> | default! | Stable identity of an item. |
| TitleSelector | Func<TItem, string>? | null | The header text. Default: ToString(). |
| NameSelector | Func<TItem, string>? | null | Name of the created tab (permissions, persistence). Default: Name + key. |
| ContentTemplate | RenderFragment<TItem>? | null | A tab's content. |
| HeaderTemplate | RenderFragment<TItem>? | null | Custom header content instead of the title. |
| IconSelector | Func<TItem, string?>? | null | Start icon of a tab. |
| TooltipSelector | Func<TItem, string?>? | null | Tooltip of a tab. |
| BadgeSelector | Func<TItem, string?>? | null | Badge text of a tab. |
| BadgeColorSelector | Func<TItem, DwsColor>? | null | Badge colour of a tab. |
| DisabledSelector | Func<TItem, bool>? | null | Disables individual tabs. |
| VisibleSelector | Func<TItem, bool>? | null | Hides individual tabs. |
| Validator | Func<TItem, Task<bool>>? | null | Validation before a tab is left. |
| AllowClose | bool | false | Every created tab can be closed. |
| AllowPin | bool | false | Every created tab can be pinned. |
| AllowMinimize | bool | false | Every created tab can be minimized. |
| ContentMode | DwsTabContentMode? | null | Overrides the group's ContentMode for the created tabs. |
| Name | Typ | Description |
|---|---|---|
| OnItemClosed | EventCallback<TItem> | An item's tab was closed – remove the item from Items here. |
| OnItemActivated | EventCallback<TItem> | An item's tab became active. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
