Skip to content

Tabs

Each tab has a stable name and an optional display label.

<Tabs.Tab name="posts" label="Posts">

Each child of <Tabs.Container> is a <Tabs.Tab>. The name is the tab’s permanent identity — scroll memory and jumpToTab key off it — while label is what the user sees. Keeping name ASCII-simple avoids the sync bugs other libraries hit with localized tab text.

Wrapping Tabs.Tab in your own component

The container detects children by their name prop, not by element type. So you can wrap Tabs.Tab in your own component — just forward name (and children) to the element you return.

function MyTab({ name, label, children }) {
  return (
    <Tabs.Tab name={name} label={label}>
      {children}
    </Tabs.Tab>
  );
}

Reference

name string

Stable identity, used for scroll memory and jumpToTab. Keep it ASCII-simple; localized text goes in label.

label string?

Display text for the tab bar. Defaults to name.

lazy boolean?

Per-tab override of the container's lazy.

swipeEnabled boolean?

While this tab is focused, disables pager swiping — for a horizontal carousel inside the tab.