mirror of
https://github.com/huntabyte/shadcn-svelte.git
synced 2026-09-14 19:33:46 +08:00
7ff65b4892
Co-authored-by: Crush <crush@charm.land> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2.2 KiB
2.2 KiB
title, description, component, links
| title | description | component | links |
|---|---|---|---|
| Toggle Group | A set of two-state buttons that can be toggled on or off. | true |
Installation
{#snippet cli()} {/snippet} {#snippet manual()}Install bits-ui:
Copy and paste the following code into your project.
{#if viewerData} {/if} {/snippet}Usage
<script lang="ts">
import * as ToggleGroup from "$lib/components/ui/toggle-group/index.js";
</script>
<ToggleGroup.Root type="single">
<ToggleGroup.Item value="a">A</ToggleGroup.Item>
<ToggleGroup.Item value="b">B</ToggleGroup.Item>
<ToggleGroup.Item value="c">C</ToggleGroup.Item>
</ToggleGroup.Root>
Examples
Outline
Single
Small
Large
Disabled
Spacing
Use spacing={2} to add spacing between toggle group items.