Actions
Segmented control
One choice out of a few, side by side: a view, a period, a theme.
Actions
One choice out of a few, side by side: a view, a period, a theme.
Change the props on the right. The control and its code follow.
import { Segmented, SegmentedItem } from 'omuk-ui/segmented';
<Segmented aria-label="Period" defaultValue="day">
<SegmentedItem value="day">Day</SegmentedItem>
<SegmentedItem value="week">Week</SegmentedItem>
<SegmentedItem value="month">Month</SegmentedItem>
</Segmented>The chosen segment is raised; the others sit on the track. Keep the value in the parent with value and onValueChange.
Showing the tasks as a list.
With defaultValue, the control keeps its value itself. A disabled segment is muted and the arrow keys pass it.
Segmented is the track; SegmentedItem is one segment in it. Each also takes the props of its element.