- Accordion
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- ChatContainer
- ChatInput
- ChatMessage
- ChatMultiChoiceQuestion
- ChatMultiOptionQuestion
- ChatThinking
- Checkbox
- Combobox
- Container
- CurrencyInput
- DistributionSlider
- Drawer
- Dropdown
- FilePicker
- Grid
- Heading
- Image
- Input
- InputGroup
- Label
- Logo
- MapPin
- Markdown
- Modal
- NativeSelect
- NumberInput
- OptionSlider
- OtpInput
- PhoneInput
- Popover
- Progress
- PropertyCalendar
- RadioGroup
- RadioGroupCards
- ResponsiveModal
- ScrollArea
- SearchBar
- SearchBarFallback
- SearchInput
- Select
- Separator
- Spinner
- Switch
- Table
- Tabs
- Text
- Textarea
- TimePicker
- Toast
- Toggle
- ToggleCard
- ToggleGroup
- Toolbar
- Tooltip
OptionSlider
A compact control for choosing one option from a small set
pnpm add @wandercom/design-system-web
import { OptionSlider } from '@wandercom/design-system-web/ui/option-slider';
export function Example() {
return (
<OptionSlider
aria-label="Select slide"
defaultValue="slide-1"
options={[
{ label: 'Slide 1', value: 'slide-1' },
{ label: 'Slide 2', value: 'slide-2' },
{ label: 'Slide 3', value: 'slide-3' },
{ label: 'Slide 4', value: 'slide-4' },
]}
/>
);
}Use the option slider to choose one value from a short, ordered set, typically three or four options. Drag the thumb, select a stop, or use the keyboard. Each option needs a short accessible label. Use a toggle group when options need visible labels or are not meaningfully ordered.
Use value and onValueChange for controlled state.
const [value, setValue] = useState('slide-2');
<OptionSlider
aria-label="Select slide"
options={[
{ label: 'Slide 1', value: 'slide-1' },
{ label: 'Slide 2', value: 'slide-2' },
{ label: 'Slide 3', value: 'slide-3' },
]}
value={value}
onValueChange={setValue}
/>Disable the slider when selection is unavailable.
<OptionSlider
aria-label="Select layout"
defaultValue="layout-1"
disabled
options={[
{ label: 'Layout 1', value: 'layout-1' },
{ label: 'Layout 2', value: 'layout-2' },
{ label: 'Layout 3', value: 'layout-3' },
]}
/>options:
defaultValue?:
value?:
onValueChange?:
onValueCommitted?:
disabled?:
aria-label?:
aria-labelledby?:
aria-describedby?:
className?:
The option slider is built on Base UI Slider and follows the WAI-ARIA slider pattern. Provide an accessible name with aria-label or aria-labelledby. Each option label is announced through the thumb's aria-valuetext. Do not rely on dot position alone to communicate meaning.
Keyboard interaction:
ArrowRight/ArrowUp- Select the next optionArrowLeft/ArrowDown- Select the previous optionHome- Select the first optionEnd- Select the last optionPageUp/Shift + ArrowRight/Shift + ArrowUp- Select the next optionPageDown/Shift + ArrowLeft/Shift + ArrowDown- Select the previous option
Drag the thumb or press a stop to change the selected option with a pointer.
Option slider is currently available on web only.
Use three or four ordered options. Individual disabled stops are not supported. Disable the entire control or use a toggle group when specific options can be unavailable.
- Toggle group - Use when each option needs visible text or an icon