"use client"
import {
ToggleGroup,
ToggleGroupItem,
} from "@/components/ui/preskok-ui/toggle-group"
export function ToggleGroupDemo() {
return (
<ToggleGroup aria-label="Car body types">
<ToggleGroupItem id="sedan">Sedan</ToggleGroupItem>
<ToggleGroupItem id="suv">SUV</ToggleGroupItem>
<ToggleGroupItem id="coupe">Coupe</ToggleGroupItem>
<ToggleGroupItem id="truck">Truck</ToggleGroupItem>
</ToggleGroup>
)
}
Installation
CLI
Manual
pnpmnpmyarnbunpnpm dlx @preskok-org/ui@latest add toggle-group
Usage
import { ToggleGroup } from "@/registry/preskok/ui/preskok-ui/toggle-group"
export function ToggleGroupDemo() {
return (
<ToggleGroup selectionMode="single" aria-label="Formatting">
<ToggleGroup.Item id="bold">Bold</ToggleGroup.Item>
<ToggleGroup.Item id="italic">Italic</ToggleGroup.Item>
<ToggleGroup.Item id="underline">Underline</ToggleGroup.Item>
</ToggleGroup>
)
}