A shadcn-style tabs component built with Ark UI primitives.

Make changes to your account here.

Installation

npx shadcn@latest add @ark-cn/tabs

Usage

import * as Tabs from "@/components/ui/tabs"

Read exported parts in src/components/ui/tabs.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Basic

Make changes to your account here.

Underline (vertical)

Underline variant uses a sliding indicator bar.

Controlled

current: account
Controlled: manage value + onValueChange.

Disabled

Disabled triggers get data-disabled.

Vertical

Vertical orientation changes arrow-key navigation (Up/Down).

Lazy mount

Lazy mounted content.

Manual activation

Manual activation: focus doesn't select until Enter/Space.
Triggers can render as links with asChild.

Root provider

selected: account
RootProvider: control from outside via useTabs.

Nested

Nested tabs inside tab content.
Inner content A

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

Tabs

PropTypeDescription
variant?"default" | "underline"Chrome variant for list and triggers.

TabsList

PropTypeDescription
withIndicator?booleanRenders the sliding indicator.
indicatorClassName?stringExtra class on the indicator.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.