A shadcn-style segment group component built with Ark UI primitives.

Installation

npx shadcn@latest add @ark-cn/segment-group

Usage

import * as SegmentGroup from "@/components/ui/segment-group"

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

Examples

Underline tabs

Underline vertical tabs

Default

Controlled

Value: react

Root provider

Disabled group

Disabled item

Orientation

Label

Form

Read-only

Invalid

With field

Pick how dates are shown in the calendar.

useSegmentGroupContext hook

useSegmentGroupContext: b

SegmentGroupContext render prop

SegmentGroupContext: react

Rich item text

Items shortcut

Anatomy

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.

SegmentGroupRoot

PropTypeDescription
variant?"default" | "underline"Chrome variant for items and indicator.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.