Skip to content
caliper ui pro docs

Stretch tabs

Tabs whose underline moves like an inchworm: the leading edge reaches the new tab first and the trailing edge catches up, so the line stretches across the gap and contracts onto its label.

Pro

Six sections, last edited by Mara Chen two hours ago.

When to use

  • Page-level tabs under a header.
  • Switching views where the direction of travel helps.

When not to use

  • Segmented choices inside a form; use the segmented control.
  • Many tabs on a phone, where an overflow menu is clearer.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/stretch-tabs

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

StretchTabs

6 props
PropTypeDefault
label *string—
tabs *readonly StretchTab[]—
valuestring—
defaultValuestring—
onValueChange((id: string) => void)—
classNamestring—

Keyboard

→
Moves to the next item or value.
←
Moves to the previous item or value.
Home
Jumps to the first item or the minimum.
End
Jumps to the last item or the maximum.

Accessibility

It exposes tablist, tab and tabpanel semantics, with aria-label, aria-selected, aria-controls, aria-hidden and aria-labelledby kept in step with state.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/stretch-tabs.md

The index of every part is at /llms.txt.

More in Morphing controls