Kontext-Anzeige
Auslastung des Kontextfensters: Balken mit belegten/freien Token, Warn-Ton ab Schwellwert, optional Kosten und Modell-Angabe 1.1: feste Texte mehrsprachig (invisible_i18n). 1.2.0 (28.10.2026, opt-in, nex, wingQ-Chat): href = die Anzeige ist ein Link, action=button = ein Knopf (data-context-action, E
Beispiele
Normal (unter 70 %)
Kontext21%
Warnung (ab 70 %)
Kontext78%
Kritisch (ab 90 %), kompakt
Kontext95%
Als Knopf (1.2.0, action=button) - z. B. Ausloeser der Sitzungs-Uebersicht
Eigenschaften
| Prop | Typ | Default | Builder-Label |
|---|---|---|---|
| used * | number | — | Belegte Token |
| total * | number | — | Kontextfenster gesamt |
| model | string | "" | Modell |
| cost | string | "" | Kosten (formatiert) |
| compact | boolean | false | Kompakt (nur Balken + Prozent) |
| href | string | "" | Link (leer = reine Anzeige) |
| action | string: | button | "" | Klick-Verhalten (leer = keins) |
| 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
Events & Slots
Events:
⚡ action — im Surface per on: {<event>: {action, params}} verdrahtbar.
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 |
|---|---|
--context-tone | var(--color-status-success) |
Genutzte Design-Tokens
color.status.dangercolor.status.successcolor.status.warningcolor.surface.sunkencolor.text.defaultcolor.text.mutedfocus.ring-colorfocus.ring-offsetfocus.ring-widthfont.family.defaultradius.fullradius.smsize.1size.24size.32text.xsweight.semibold
LLM-Notizen
# component.context
Auslastungs-Anzeige eines Kontextfensters: Balken mit belegten/freien Token, Warn-Ton ab Schwellwert.
## Wann nutzen
- Um die Token-Belegung eines LLM-Kontextfensters sichtbar zu machen (optional mit Kosten/Modell).
- Nicht als generischer Fortschrittsbalken — die Darstellung ist token-spezifisch.
## Wichtige Props
- `used`* = belegte Token (≥ 0)
- `total`* = Kontextfenster gesamt (≥ 1)
- `model` = Modell-Angabe
- `cost` = formatierte Kosten (String)
- `compact` = kompakt, nur Balken + Prozent (Boolean)
- 1.2.0 (28.10.2026, opt-in, nex, wingQ-Chat): `href` = die Anzeige wird ein Link (ganze Flaeche, <a>), `action: button` = ein Knopf
(<button type=button data-context-action>) - Tastaturzugang, z. B. als Slot-Ausloeser eines component.popover (Luecke 35).
href hat Vorrang; ohne beide reine Anzeige wie bisher.
## Beispiel-Node
{ "definition": "component.context", "props": { "used": 32000, "total": 128000, "model": "gpt-oss-120b", "cost": "0,12 €" } }
## Hinweise
- Ab einem Schwellwert wechselt der Balken in den Warn-Ton.
- Ohne href/action kein Client-Script und keine Events - reine Anzeige. Mit action=button meldet der Controller (context.js) `action`
(Lifecycle) und das DOM-Ereignis `invisible-context:action` (bubbles, detail.percent); mit href navigiert der Link (data-invisible-event navigate).