SegmentedControl
Compact segmented switch for mutually exclusive options
Accessibility
- Pair the control with a visible label or aria-label and keep helper or error text programmatically associated.
- Provide native name, autocomplete, and value wiring when the component participates in form submission.
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 { SegmentedControl } from '@dryui/ui';
</script>
<SegmentedControl.Root bind:value={tripType}>
<SegmentedControl.Item value="one-way">One way</SegmentedControl.Item>
<SegmentedControl.Item value="round-trip">Round trip</SegmentedControl.Item>
<SegmentedControl.Item value="multi-city">Multi-city</SegmentedControl.Item>
</SegmentedControl.Root> Import options
Root package
ts
import { SegmentedControl } from '@dryui/ui' Per-component subpath
ts
import { SegmentedControl } from '@dryui/ui/segmented-control' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
SegmentedControl.Root | |||||
| value | string | Current controlled or bindable value. | '' | — | ✓ |
| disabled | boolean | Prevents interaction and applies disabled styling. | false | — | — |
| orientation | horizontalvertical | Horizontal or vertical layout direction. | 'horizontal' | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
SegmentedControl.Item | |||||
| value | string | Current controlled or bindable value. | — | ✓ | — |
| disabled | boolean | Prevents interaction and applies disabled styling. | — | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |