Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { ToggleGroup } from '@dryui/ui';
</script>

<ToggleGroup.Root>
  <ToggleGroup.Item>...</ToggleGroup.Item>
</ToggleGroup.Root>

Import options

Root package

ts
import { ToggleGroup } from '@dryui/ui'

Per-component subpath

ts
import { ToggleGroup } from '@dryui/ui/toggle-group'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Single Selection

svelte
<script lang="ts">
  let value = $state(['bold']);
</script>
<ToggleGroup.Root type="single" bind:value>
  <ToggleGroup.Item value="bold">Bold</ToggleGroup.Item>
  <ToggleGroup.Item value="italic">Italic</ToggleGroup.Item>
  <ToggleGroup.Item value="underline">Underline</ToggleGroup.Item>
</ToggleGroup.Root>

Multiple Selection

svelte
<script lang="ts">
  let value = $state(['bold', 'italic']);
</script>
<ToggleGroup.Root type="multiple" bind:value>
  <ToggleGroup.Item value="bold">Bold</ToggleGroup.Item>
  <ToggleGroup.Item value="italic">Italic</ToggleGroup.Item>
  <ToggleGroup.Item value="underline">Underline</ToggleGroup.Item>
</ToggleGroup.Root>

Structure

Compound components always start with ToggleGroup.Root. Use this structure block to understand required wrappers before you wire state or styling.

ToggleGroup.Root
  ToggleGroup.Item
ToggleGroup.Root ToggleGroup.Item

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with ToggleGroup.Root, then add only the parts you need.

ToggleGroup.Item

ToggleGroup.Root

Prop Type Default Required Bindable
type
singlemultiple
value
string[]
[]
disabled
boolean
orientation
horizontalvertical
'horizontal'
size
smmdlg
'md'
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

ToggleGroup.Item

Prop Type Default Required Bindable
value
string
disabled
boolean
children
Snippet

Forwards <button> attributes via rest props. Common examples: type, disabled, name.