Varianten-Swatch
Farb-/Bild-Kachel für Produktvarianten. Die Produktfarbe ist ein CONTENT-Datum (Prop), kein Design-Token — Auswahl-Ring und Maße kommen aus Tokens. 1.1.0: Props size (xs|sm|md|fill), shape (circle|square) und interactive (false = statisches span ohne Event) ergaenzt
Beispiele
Farbe, ausgewählt
Farbe, nicht ausgewählt
Ohne Farbwert (Platzhalter-Fläche)
Eigenschaften
| Prop | Typ | Default | Builder-Label |
|---|---|---|---|
| label * | string | — | Bezeichnung (aria) |
| color | string | "" | Produktfarbe (CSS-Wert — Content-Datum) |
| imageUrl | string | "" | Bild-URL (vor Farbe) |
| active | boolean | false | Ausgewählt |
| size | string: xs | sm | md | fill | "md" | Groesse (md = Standard, fill = fuellt Elternteil) |
| shape | string: circle | square | "circle" | Form |
| interactive | boolean | true | Klickbar (aus = statische Anzeige ohne Event) |
| padding | string: standard | none | sm | md | lg | xl | "standard" | Innenabstand (standard = Baustein-Wert) |
| margin | string: standard | none | sm | md | lg | xl | "standard" | Aussenabstand |
| border | string: standard | none | hairline | strong | "standard" | Rahmen |
| radius | string: standard | none | control | surface | pill | "standard" | Ecken-Rundung |
| textColor | string | "" | Textfarbe (Token; leer = Standard) |
| backgroundColor | string | "" | Hintergrundfarbe (Token; leer = Standard) |
| shadow | string: standard | none | sm | md | lg | "standard" | Schatten |
| width | string: standard | full | "standard" | Breite |
| alignSelf | string: standard | start | center | end | "standard" | Ausrichtung im Elternteil |
| anchor | string | "" | Anker-ID (Sprungziel, z. B. fuer Nav-Links) |
* Pflicht-Prop
Stellschrauben (Komponenten-Tokens)
Ebene 3 — aus dem CSS generiert (Registry). Umverdrahtbar per Hüllen-Komposition, ohne Markup-Eingriff; künftige Regler-Quelle des Component Builders.
| Token | Default |
|---|---|
--swatch-border-strong | var(--color-border-strong) |
--swatch-focus-ring-color | var(--focus-ring-color) |
--swatch-focus-ring-offset | var(--focus-ring-offset) |
--swatch-focus-ring-width | var(--focus-ring-width) |
--swatch-radius-full | var(--radius-full) |
--swatch-surface-sunken | var(--color-surface-sunken) |
--swatch-text-default | var(--color-text-default) |
Genutzte Design-Tokens
border.hairlinecolor.border.strongcolor.surface.sunkencolor.text.defaultduration.fasteasing.standardfocus.ring-colorfocus.ring-offsetfocus.ring-widthradius.fullradius.smsize.10size.3size.6
LLM-Notizen
ui.swatch
Farb-/Bild-Kachel für die Auswahl einer Produktvariante.
Wann nutzen
- Für wählbare Produktvarianten mit visuellem Muster (Farbe oder Materialbild).
- Für abstrakte An/Aus- oder Text-Optionen stattdessen
ui.switchbzw.ui.radio-group.
Wichtige Props
label= Bezeichnung der Variante (aria), Pflicht.color= CSS-Farbwert der Variante — ein CONTENT-Datum, kein Token.imageUrl= Bild-URL; wird vor der Farbe angezeigt.active= als ausgewählt markiert.
Beispiel-Node
{ "definition": "ui.swatch", "props": { "label": "Nachtblau", "color": "#1b2a4a", "active": true } }
Hinweise
- Nur die Produktfarbe/-abbildung ist Content; Auswahl-Ring und Maße stammen aus Tokens.