On this page
@addTagHelper *, Webority.Ui.RazorThe tab strip
Tabs switch between a few peer views of one page, with one view active at a time.
Emphasis and state
A tab can carry an icon, a count, a tone or a disabled state, beyond its plain name.
Link tabs (navigation)
Tabs that are routes render as real links, so right-click and open in new tab still work.
?section=overview. Right-click a tab to open it in a new tab; refresh and the server renders the right tab active.?section=members.Variant, size and fit
Pills change the chrome of the strip, not its behaviour, and size and fitted layout tune it to the space.
Vertical orientation
A vertical strip works as a settings rail, with the arrow keys moving up and down between tabs.
Overflow
Tabs that do not fit scroll with chevrons, or move into a More menu when the menu option is set.
Every option
Every value of every prop, one cell each.
tabs: label and key
title="Overview": the text of the tabkey (React only): identifies the tab, not showntabs: icon and image
icon="folder-open"image="/img/sample-logo.png": wins over iconimage-alt="Overview": the alt text, not showntabs: tooltip
tooltip="The high-level summary": a hint on hover and focustabs: count, countLabel and tone
count="12"tone="success": tints the count pilltone="warning": tints the count pilltone="danger": tints the count pilltone="info": tints the count pillcount-label="3 open": shown in place of counttabs: state
danger="true": draws the tab and its indicator in the danger colourdisabled="true": the tab cannot be selectedactive="true" on a disabled tab: falls back to the first enabled tabtabs: link
href="#every-option": a link tab, not a buttonto (React only): a router route, Razor uses hreftarget="_blank": opens the link in a new tabrel="nofollow": replaces the default rel of a _blank linkvalue
active="true" on Activity: the selected tabonChange
onChange (React only): the callback that receives the picked keylinkComponent
linkComponent (React only): Razor link tabs use hrefvariant
variant="underline" (default)variant="pills"orientation
orientation="horizontal" (default)orientation="vertical"size
size="sm"size="md" (default)size="lg"fitted
fitted="false" (default): tabs keep their widthfitted="true": tabs share the width equallyoverflow
overflow="scroll" (default): edges fade and chevrons appearoverflow="menu": the tabs that do not fit go in a More menumaxVisible
max-visible="3": the tabs past three go in a More menumoreLabel
more-label="All sections": the More button text, with overflow menuactivation
activation="automatic" (default): arrows also selectactivation="manual": arrows move focus, Enter or Space selectsariaLabel
aria-label="Project sections": the accessible name, not shownclassName and style
class and style: pass through to the outer div, not showntab content
content: the pane shown when the tab is activeGuidance
What to do, and what to avoid.
Use it when
- A record or page has a few peer sections (Overview, Activity, Settings) the user switches between.
- A list needs quick filters (All / Active / Archived) that swap the rows in place.
- The set of views is small and stable, so every one stays a single click away.
Reach for something else when
- The views are ordered steps that must be completed in sequence. → a wizard or stepper
- There are many options to choose from. → AppSelect
- Each view is a full destination with its own URL. → router navigation
- You are toggling a single on/off setting. → AppSwitch
Short labels for peer views
A few short, peer labels: the user sees every view at a glance.
Sentence-long labels break the scannable rhythm a tab strip depends on.
Tabs switch views, never steps
A count on a filter tab tells the user how much is behind it before they click.
Fitted pills read as a segmented control. Do not use them for sequential steps; that is a stepper.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
24 props. The 3 most used come first.
Used on most screens 3 props
| Prop | Type | Default | Description |
|---|---|---|---|
| variantdefault underline | Underline | Pills | underline | The look of the strip: an underline with a sliding bar, or pills. |
| orientationdefault horizontal | Horizontal | Vertical | horizontal | horizontal lays the tabs in a row. vertical renders a side rail. |
| sizedefault md | Sm | Md | Lg | md | The size of the tabs. |
Less common 21 props
| Prop | Type | Default | Description |
|---|---|---|---|
| fitteddefault false | bool | false | The tabs share the width equally instead of scrolling. |
| overflowdefault scroll | Scroll | Menu | scroll | What a horizontal strip does when the tabs do not fit. scroll scrolls it with chevrons and edge fades. menu moves the tabs that do not fit into a More menu and always keeps the selected tab visible. Ignored when orientation is vertical. |
| max-visibledefault - | int | - | Puts the tabs that do not fit the row in a More menu, as overflow menu does. The selected tab always stays visible. |
| more-labeldefault More | string | More | The text of the More button when overflow is menu. |
| activationdefault automatic | Automatic | Manual | automatic | Whether the arrow keys also select. automatic selects as focus moves. manual moves focus only and selects on Enter or Space. |
| (app-tab) titledefault - | string | - | The label of a tab. Each app-tab child is one tab. |
| (app-tab) disableddefault false | bool | false | Renders the tab as unavailable: it can't be selected. |
| (app-tab) icondefault - | string | - | Library icon name shown before the label. |
| (app-tab) imagedefault - | string | - | A picture URL shown before the label, such as a logo or avatar. Wins over icon. |
| (app-tab) image-altdefault - | string | - | The alt text of the image. |
| (app-tab) tooltipdefault - | string | - | A hover/focus hint on the tab, drawn as a CSS-only bubble rather than a native tooltip, which cannot attach to a tab button that already runs its own tab script. |
| (app-tab) countdefault - | int? | - | A count badge shown after the label. |
| (app-tab) tonedefault - | success | warning | danger | info | - | Tone tint for the count badge. |
| (app-tab) dangerdefault false | bool | false | Destructive styling for the tab. |
| (app-tab) hrefdefault - | string | - | Turns the tab into a real link (an anchor with href) instead of a panel-switching button: the browser gives right-click “Open in new tab”, Ctrl/⌘-click and middle-click for free. A link tab navigates and owns no pane. |
| (app-tab) targetdefault - | string | - | Anchor target for a link tab; _blank opens it on the next screen on a plain click. |
| (app-tab) reldefault - | string | - | Anchor rel for a link tab; defaults to noopener noreferrer when target="_blank". |
| (app-tab) activedefault false | bool | false | Marks this tab as current: use with link tabs to flag the one matching the route. Panel tabs may omit it (first enabled is active). React derives this from value. |
| (app-tab content)default - | markup | - | The pane shown when the tab is active (inner content). |
| style / class / other attrsdefault - | string | - | Unbound attributes on app-tabs pass through to the rendered outer div.app-tabs-group (lands on the wrapper, not the role="tablist" element). |
| aria-labeldefault - | string | - | The accessible name of the tab strip. |
Screen reader
5 notes- The strip is a tablist and each tab has role tab with aria-selected; a vertical strip sets aria-orientation, and ariaLabel names the strip.
- Only one tab is in the tab order at a time (a roving tabindex). Arrow keys, Home and End move between tabs and skip disabled ones; Up and Down replace Left and Right when vertical.
- Automatic activation selects a tab as focus moves; manual activation moves focus only and selects on Enter or Space.
- A tab with href or to is a real link, so open in new tab and middle click work; a link tab is not selected by arrow keys, and a new-window link gets rel noopener noreferrer.
- The scroll chevrons are left out of the tab order and carry accessible names, and the sliding indicator is hidden from assistive technology.
Do and avoid
2 pairsShort labels for peer views
A few short, peer labels: the user sees every view at a glance.
Sentence-long labels break the scannable rhythm a tab strip depends on.
Tabs switch views, never steps
A count on a filter tab tells the user how much is behind it before they click.
Fitted pills read as a segmented control. Do not use them for sequential steps; that is a stepper.