Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Tabs

Panels of content, one shown at a time, picked by a row of tabs.

Built on the headless Tabs.See its API in Docs

Rendered by React 19.3.1

tabs.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/tabs.json

It also adds utils. The app needs its setup first: Installation.

Usage

Tabs holds TabsList with a TabsTrigger per tab, and a TabsContent per panel; a trigger and its panel share a value, and the root's defaultValue or value picks the one shown. variant="line" on the list draws an underline in place of the filled background, and orientation="vertical" stacks the tabs and turns the arrow keys. The keyboard and the tab roles come from the headless Tabs.

import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from '@/components/ui/tabs'

Examples

Default

Account and Password tabs, each a card.

Its preview and code are at the top of the page.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Tabs's API reference.