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

Installation

npx shadcn@latest add @ark-cn/toggle

Usage

import * as Toggle from "@/components/ui/toggle"

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

Examples

Basic

Controlled

Pressed: false

Disabled

Indicator

Context

API reference

This component mirrors the upstream Ark UI primitive.

See the ARK UI documentation for the full API.