Tab

Tabs make it easy to explore and switch between different views.

Overview

size
medium · small · tiny
Toggles
isSelected

All options

Size and selection

Outside a TabsContainer a selected tab draws its own background.

size \ isSelectedunselectedselected
medium
small
tiny

Icons

decoIcon adds a leading icon; actionIcon adds a trailing icon with its own click handler.

icon \ sizemediumsmalltiny
decoIcon
actionIcon
both

Second label

size \ isSelectedunselectedselected
medium
small
tiny

Examples

Basic tabs

Sizes in a container

Tabs come in medium (default), small and tiny. Inside a TabsContainer the selected pill slides to the new tab.

medium

small

tiny

With second label

Add a secondary text below the tab label for additional context (center aligned).

Accessibility

Keyboard

Focus a tab and use the arrow keys, Home or End to move between tabs. Enter or Space selects the focused tab. Inside a TabsContainer only the selected tab is in the Tab order.

Roles

Each tab has role="tab" and aria-selected reflecting isSelected. TabsContainer has role="tablist".

Props

RouterLike

PropTypeRequiredDescription
push(url: string) => voidYes—

TabProps

PropTypeRequiredDescription
labelstringYes—
secondLabelstringNo—
hrefstringNo—
isSelectedbooleanYes—
onClickTab() => voidYes—
onClickActionIconanyNo—
decoIconstringNo—
actionIconstringNo—
routerRouterLikeNo—
size'medium' | 'small' | 'tiny'No—