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 { RadioGroup } from '@dryui/ui';
</script>

<RadioGroup.Root>
  <RadioGroup.Item>...</RadioGroup.Item>
</RadioGroup.Root>

Import options

Root package

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

Per-component subpath

ts
import { RadioGroup } from '@dryui/ui/radio-group'

Customize

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

Basic Group

svelte
<script lang="ts">
  let selected = $state('option1');
</script>
<RadioGroup.Root bind:value={selected}>
  <RadioGroup.Item value="option1">Option 1</RadioGroup.Item>
  <RadioGroup.Item value="option2">Option 2</RadioGroup.Item>
  <RadioGroup.Item value="option3">Option 3</RadioGroup.Item>
</RadioGroup.Root>

Horizontal

svelte
<RadioGroup.Root orientation="horizontal">
  <RadioGroup.Item value="xs">XS</RadioGroup.Item>
  <RadioGroup.Item value="sm">SM</RadioGroup.Item>
  <RadioGroup.Item value="md">MD</RadioGroup.Item>
  <RadioGroup.Item value="lg">LG</RadioGroup.Item>
</RadioGroup.Root>

Disabled

svelte
<RadioGroup.Root disabled>
  <RadioGroup.Item value="a">Option A</RadioGroup.Item>
  <RadioGroup.Item value="b">Option B</RadioGroup.Item>
</RadioGroup.Root>

Structure

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

RadioGroup.Root
  RadioGroup.Item
RadioGroup.Root RadioGroup.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 RadioGroup.Root, then add only the parts you need.

RadioGroup.Item

RadioGroup.Root

Prop Type Default Required Bindable
value
string
name
string
disabled
boolean
required
boolean
orientation
horizontalvertical
children
Snippet

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

RadioGroup.Item

Prop Type Default Required Bindable
value
string
disabled
boolean
children
Snippet

Forwards <input> attributes via rest props. Common examples: name, autocomplete, inputmode.