Segment-Schalter — component.segmented-control
Umschalter aus verbundenen Segmenten (genau eine Auswahl) — für Ansichts-/Modus-Wechsel; als Formularwert über das name-Feld, Tastatur mit Pfeiltasten. 1.1.0: Segmente optional mit Zaehler (count) und nur als Icon (iconOnly, Label fuer Screenreader). 1.2.0 opt-in: label/hint (Feld wie ui.input), fil
Beispiele
Ansichts-Wechsel
Als Formularfeld (hidden input), klein
In einer Werkzeugleiste: Beschriftung nur für Vorlesehilfen (labelHidden)
Eigenschaften
| Prop | Typ | Default |
|---|---|---|
options * | array | — |
value | string | "" |
name | string | "" |
size | string: sm | md | "md" |
label | string | "" |
hint | string | "" |
labelHidden | boolean | false |
fill | boolean | false |
padding | string: standard | none | sm | md | lg | xl | "standard" |
margin | string: standard | none | sm | md | lg | xl | "standard" |
border | string: standard | none | hairline | strong | "standard" |
radius | string: standard | none | control | surface | pill | "standard" |
textColor | string | "" |
backgroundColor | string | "" |
shadow | string: standard | none | sm | md | lg | "standard" |
width | string: standard | full | "standard" |
alignSelf | string: standard | start | center | end | "standard" |
anchor | string | "" |
Events & Slots
Events: change
Stellschrauben (Komponenten-Tokens)
| Token | Default |
|---|---|
--segmented-control-height | var(--control-height) |
--segmented-control-pad | var(--size-05) |
--segmented-control-radius | var(--radius-control, var(--shape-control)) |
--segmented-control-background | var(--color-surface-default) |
--segmented-control-border | var(--color-border-default) |
--segmented-control-color | var(--color-text-muted) |
--segmented-control-hover-background | color-mix(in srgb, var(--color-text-default) 6%, transparent) |
--segmented-control-hover-color | var(--color-text-default) |
--segmented-control-active-background | var(--color-text-default) |
--segmented-control-active-hover-background | color-mix(in srgb, var(--color-text-default) 88%, var(--color-surface-default)) |
--segmented-control-active-color | var(--color-surface-default) |
--segmented-control-count-background | color-mix(in srgb, var(--color-text-default) 8%, transparent) |
--segmented-control-count-color | var(--color-text-muted) |
--segmented-control-active-count-background | color-mix(in srgb, var(--color-surface-default) 20%, transparent) |
--segmented-control-active-count-color | var(--color-surface-default) |
Genutzte Design-Tokens
border.hairline color.border.default color.surface.default color.text.default color.text.muted control.height duration.fast easing.standard focus.ring-color focus.ring-offset focus.ring-width font.family.default leading.base radius.control radius.sm size.05 size.1 size.2 size.3 size.4 text.2xs text.sm text.xs weight.medium