Tab strip
Tabs a person opens and closes, like a browser's. Tabs shrink evenly as more open, a closed tab folds its width away before it leaves, the open tab scrolls into view, and arrows, Delete and the New tab button all work from the keyboard.
// page.tsx
export default function Page() {
return <main>…</main>;
}When to use
- Editors, terminals, consoles and record viewers with several things open at once.
- Workspaces where people choose what stays open.
When not to use
- A fixed set of views; use tabs.
- Navigation between pages; use the site's navigation.
Installation
pnpm dlx shadcn@latest add @caliper/tab-strip
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
TabStrip
6 props
Also accepts the native props of its root element and a ref.
Keyboard
- Delete
- Removes the next character or the selected item.
- Backspace
- Removes the previous character or item.
Accessibility
It exposes tablist and tab semantics, with aria-label, aria-selected and aria-hidden 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/tab-strip.mdThe index of every part is at /llms.txt.