Tabs
Primary and secondary tab rows with a sliding indicator, scrollable when they overflow.
import { Tabs, Tab } from '@windmorph/react';Purpose
Tabs organise content into peer sections on one screen and switch between them. Primary tabs sit at the top level with a content-width indicator; secondary tabs mark a nested level with a full-width indicator. Each Tab is a React Stately collection item identified by its key, with a title, an optional icon and its panel as children.
Leave the panel out for tabs that only navigate. When there are more tabs than fit, use scrollable so they keep their width and the row scrolls instead of letting them shrink. On wide windows, align="start" or "center" makes every fixed tab as wide as the widest and places the group at the leading edge or the centre. A badge marks news in a tab, and swipeable lets a horizontal swipe on the panel change tab; avoid it when the panel holds swipeable content such as a map.
Do and don't
When not to use
For top-level app destinations use a Navigation bar or rail, not tabs.
See also
- Tabs on m3.material.io: Material's own guidelines, with anatomy and specs.
- Navigation bar: 3–5 destinations along the bottom of compact and medium windows, stacked or inline.
- Top app bar: A header with the screen title and actions, in three sizes, with scroll behaviour.