Components
SegmentedControl
Single selection from a few options.
Use SegmentedControl to choose one of a small set of options. Arrow keys move between options and skip disabled ones.
import { SegmentedControl } from '@soundor/components';
import { useState } from 'react';
export default function Demo() {
const [mode, setMode] = useState<'sync' | 'free'>('sync');
return (
<SegmentedControl
label="Mode"
options={[
{ value: 'sync', label: 'Sync' },
{ value: 'free', label: 'Free' },
]}
value={mode}
onChange={setMode}
/>
);
}segmented-control.tsx, running in the web runtime.SourceA parameter can supply the options through parameter.info.options.
Keyboard and accessibility
The group is one tab stop. ← ↑ select the previous option and → ↓ the next, wrapping at the ends; Home and End select the first and the last. It is announced as a radio group, with each option's state. Use label for the group's name and an option's hint for anything unclear. See Keyboard and accessibility.
Props
See Mixed values for editing multiple items.
Prop
Type
SegmentOption
Prop
Type