Tabs

Tabs is a neobrutalist React component from Cruise UI. Three styles: Underline for page sections, Boxed for settings, Pill for filters. Install it with npx shadcn@latest add @cruiseui/tabs.

Install

Terminal

npx shadcn@latest add @cruiseui/tabs

First time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.

Example

Corners

Three layers of vanilla sponge. Serves 12.

Your name, photo and phone number.

Showing all 48 products.

When to use it

When to use

Switching between views of the same thing without leaving the page.

When not to

Tabs that are really pages (use links). More than ~6 tabs.

Props

CruiseTabs

PropTypeDefaultDescription
labelstring—Accessible name for the tab row, e.g. "Order details".
itemsCruiseTabItem<V>[]——
variant?CruiseTabsVariant"underline"—
value?V——
defaultValue?Vitems[0]?.value—
onValueChange?((value: V) => void)——
keepMounted?booleanfalseRender every panel's content in the HTML (hidden until chosen), so it can be found without JavaScript and by search engines.
className?string——

Accessibility

  • tablist / tab / tabpanel roles with aria-selected and aria-controls.
  • Left / Right, Home / End move between tabs; the row scrolls sideways on phones.