Invisible Docs
GalerieTokens

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

Componentv1.6.0Formulareweb.documentweb.applicationdesktop.shell

Beispiele

Ansichts-Wechsel

Als Formularfeld (hidden input), klein

In einer Werkzeugleiste: Beschriftung nur für Vorlesehilfen (labelHidden)

Eigenschaften

PropTypDefault
options *array—
valuestring""
namestring""
sizestring: sm | md"md"
labelstring""
hintstring""
labelHiddenbooleanfalse
fillbooleanfalse
paddingstring: standard | none | sm | md | lg | xl"standard"
marginstring: standard | none | sm | md | lg | xl"standard"
borderstring: standard | none | hairline | strong"standard"
radiusstring: standard | none | control | surface | pill"standard"
textColorstring""
backgroundColorstring""
shadowstring: standard | none | sm | md | lg"standard"
widthstring: standard | full"standard"
alignSelfstring: standard | start | center | end"standard"
anchorstring""

Events & Slots

Events: change

Stellschrauben (Komponenten-Tokens)

TokenDefault
--segmented-control-heightvar(--control-height)
--segmented-control-padvar(--size-05)
--segmented-control-radiusvar(--radius-control, var(--shape-control))
--segmented-control-backgroundvar(--color-surface-default)
--segmented-control-bordervar(--color-border-default)
--segmented-control-colorvar(--color-text-muted)
--segmented-control-hover-backgroundcolor-mix(in srgb, var(--color-text-default) 6%, transparent)
--segmented-control-hover-colorvar(--color-text-default)
--segmented-control-active-backgroundvar(--color-text-default)
--segmented-control-active-hover-backgroundcolor-mix(in srgb, var(--color-text-default) 88%, var(--color-surface-default))
--segmented-control-active-colorvar(--color-surface-default)
--segmented-control-count-backgroundcolor-mix(in srgb, var(--color-text-default) 8%, transparent)
--segmented-control-count-colorvar(--color-text-muted)
--segmented-control-active-count-backgroundcolor-mix(in srgb, var(--color-surface-default) 20%, transparent)
--segmented-control-active-count-colorvar(--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