uimaxxer

Tabs

An ink block slides under the labels and swaps their colour exactly at its edge, stretching the way it travels. Grab the block and drag it, and the labels turn under your finger.

npx shadcn@latest add https://uimaxxer.com/r/tabs.json
PasskeysSettings · Changes

Changes

  • app/api/webhooks/stripe/route.ts+28−11
  • lib/billing/idempotency.ts+9−2
  • tests/webhooks.test.ts+5−4

Usage

import { Tabs } from "@/components/ui/tabs"

<Tabs
  aria-label="Pull request"
  items={[
    { value: "overview", label: "Overview", content: <Overview /> },
    { value: "changes", label: "Changes", content: <Changes /> },
  ]}
/>

Props

PropTypeDefaultWhat it does
items{ value: string; label: ReactNode; content: ReactNode; disabled?: boolean }[]The tabs and their panels.
valuestringControlled value.
defaultValuestringitems[0].valueInitial tab when uncontrolled.
onValueChange(value: string) => voidCalled on click or arrow key.
aria-labelstringNames the tab list.
size"md" | "lg""md"lg sets 48px tabs that share the width, in a recessed tray.
panelClassNamestringClasses for the panel area.

Keyboard

← →
Previous / next tab
Home / End
First / last tab
Tab
Into the panel

Accessibility

  • role=tablist, tab and tabpanel, with aria-selected, aria-controls and aria-labelledby.
  • Roving tabindex with automatic activation, as the WAI-ARIA tabs pattern describes.
  • The ink copy of the labels is aria-hidden, so each label is read once.