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

Installation

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

Usage

import * as ToggleGroup from "@/components/ui/toggle-group"

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

Examples

Basic

Controlled

Value: left

Small

Large

Outline

Vertical

Disabled

With Disabled Item

Multiple

Root Provider

Current: left

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.

ToggleGroup

PropTypeDescription
size?"default" | "sm" | "lg"Default size for items via context.
variant?"default" | "outline"Default item chrome variant.

ToggleGroupItem

PropTypeDescription
size?"default" | "sm" | "lg"Per-item size override.
variant?"default" | "outline"Per-item variant override.

ToggleGroupSeparator

PropTypeDescription
orientation?"horizontal" | "vertical"Separator direction.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.