Browser Tabs
betaA miniature browser window whose tabs are a real tablist: a card-coloured leaf springs under the active tab, and tabs reorder by drag or keyboard.
- Navigation
- 2 files
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add browser-tabsnpm packages installed: class-variance-authority.
import { BrowserTabs } from "@/components/ui/browser-tabs";Default
Gallery
Controlled
Right To Left
<BrowserTabs>
| Prop | Type | Default |
|---|---|---|
tabs (required) | BrowserTab[] | — |
bounceSpring overshoot for the leaf and tabs, 0–30. | number | 15 |
cornerWindow corner radius in px; the tab's top radius derives from it. | number | 20 |
defaultOrderInitial order when uncontrolled. Defaults to the order of | string[] | — |
defaultValueThe initially active tab when uncontrolled. Defaults to the first tab. | string | — |
formatMoveThe live-region message after a move. | (tab: BrowserTab, position: number, total: number) => string | defaultFormatMove |
labels | Partial<BrowserTabsLabels> | — |
onBackMakes the back glyph a real button. Without a handler it is decoration. | () => void | — |
onForward | () => void | — |
onOrderChangeCalled with the new order after a drag swap or a keyboard move. | (order: string[]) => void | — |
onReload | () => void | — |
onValueChange | (value: string) => void | — |
orderTab values in visual order (controlled). Unknown values are dropped, missing ones appended. | string[] | — |
renderPanelRenders the page for the active tab. | (tab: BrowserTab) => ReactNode | — |
strokeAdds a 1px hairline to the window and the active tab. | boolean | false |
tabWidthTab width in px. | number | 100 |
tone | "default" | "inverted" | "default" |
valueThe active tab's value (controlled). | string | — |
childrenPage content for the active tab. Ignored when | ReactNode | — |
Plus every attribute of <div> except children, defaultValue, onChange.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes