Forms | SegmentedControl
SegmentedControl#
Description#
- A few single-choice options side by side: list or grid, light or dark, indent width.
segmentedvariant: a rail with a thin border and the options inside; the selected one carries the accent veil and weight 600.chipsvariant: loose pills that wrap across several lines, for a filter with many options.- With
hrefon the options the control becomes a navigation (<nav>) with links andaria-current="page"on the current one.
Props#
options(SegmentedOption<T>[]) — The options of the control. Required.label(string) — The name of the group, already translated. Required.variant('segmented' | 'chips') — Visual style. Defaults to:'segmented'.disabled(boolean) — Disables every option. Defaults to:false.
Emits#
change— Emits the chosen value when the user selects a different option.navigate— Emits the value and theMouseEventwhen a link is chosen;event.preventDefault()lets the application navigate with its router.
Usage#
| |
Notes#
SegmentedOptionacceptsicon,iconOnly,badge,badgeTone,disabledandhrefbesidesvalueandlabel.- Keyboard works like
OptionGroup: a single Tab to enter and leave, and the arrows choose. - Options wrap onto two lines before overflowing; each one has a minimum height of 32 px.