A row of toggles with shared selection, for single or multiple choice.
Copy the command below and run it in your terminal.
bunx @sivir/ui add toggle-group
pnpm dlx @sivir/ui add toggle-group
npx @sivir/ui add toggle-group
yarn dlx @sivir/ui add toggle-group
Import Toggle Group and compose it with Item components:
import * as ToggleGroup from '$lib/sivir/components/toggle-group'; <ToggleGroup.Root type="single" bind:value={alignment}> <ToggleGroup.Item value="left">Left</ToggleGroup.Item> <ToggleGroup.Item value="center">Center</ToggleGroup.Item> <ToggleGroup.Item value="right">Right</ToggleGroup.Item> </ToggleGroup.Root>
Toggle Group in single and multiple modes.