Skip to content
Kits

Context

BetaBeta — the props contract is close to final, but small breaking changes can still land.

Compact context-window usage with an automatically derived token graph and anchored detail inspector.

Composition

Context inspector

Omitting children uses the built-in trigger and content. Add a header when composing a custom inspector.

  • <Context>
    • <ContextTrigger />
    • <ContextContent>
      • <ContextHeader>
        • <ContextTitle />
        • <ContextDescription />
        • <ContextClose />
        </ContextHeader>
      • <ContextSummary />
      • <ContextGraph />
      • <ContextLegend />
      </ContextContent>
    </Context>

Installation

Use this command to install the component.

Registry command
See registry manifest

Usage

Dependencies

Derivation modelsrc/registry/sources/control-ui/context-model.tsSupport
ButtonbuttonPrimitivePopoverpopoverPrimitiveScroll areascroll-areaPrimitive

Raw code

Installed component source and support files

src/registry/sources/control-ui/context.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-context-* · 11 knobsHow the cascade resolves
--cui-context-graph-radius<length-percentage>9999px
--cui-context-legend-indicator-radius<length-percentage>9999px
--cui-context-segment-system-fill<color>oklch(from var(--foreground) l c h / 0.75)
--cui-context-segment-cache-fill<color>oklch(from var(--muted-foreground) l c h / 0.55)
--cui-context-track-fill<color>var(--muted)
--cui-context-segment-tool-fill<color>var(--primary)
--cui-context-segment-message-fill<color>oklch(from var(--primary) l c h / 0.65)
--cui-context-segment-source-fill<color>oklch(from var(--accent-foreground) l c h / 0.65)
--cui-context-segment-reasoning-fill<color>oklch(from var(--foreground) l c h / 0.5)
--cui-context-overage-fill<color>oklch(from var(--destructive-text) l c h / 0.22)
--cui-context-limit-marker-color<color>var(--destructive-text)