Context barPro
The context window as one stacked bar or a field of dots, with a legend that lights each kind and a Compact / Undo button.
oxyn add context-barThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Say in one glance how full the window is and which kind fills it, with one action that gives room back.
When not to use
- What fills the window as a list of kinds with their share: use Context breakdown instead.
- An Oxyn original: use Context stack instead.
- An Oxyn original: use Context tide instead.
Installation
Context bar is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add context-barUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Bar
One stacked bar: point at a kind in the legend to light it and read its own count; Compact squeezes the chat.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Field
The same window as a field of 200 dots, one per half percent, in load order.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Mono
Monochrome: the kinds become steps of grey, for a quiet toolbar.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Big window
A 1M window after a compaction: the same parts read as a thin sliver.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ContextBar
| Prop | Type | Default | Description |
|---|---|---|---|
parts | Option<Vec<CtxPart>> | Default::default() | The parts (the demo window when `None`). |
limit | u32 | 200_000 | Window size in tokens. |
look | String | "bar" | `bar` (one stacked bar) or `field` (a field of dots). |
mono | bool | Default::default() | Greys instead of kind colours. |
compact | bool | true | Show the Compact / Undo button. |
default_compacted | bool | Default::default() | Starts compacted. |
title | String | "Context" | Heading. |
on_compact | EventHandler<bool> | — | Compacted (true) or undone (false). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Compact / Undo, then each kind in the legend |
| Focus on a kind | Lights it and shows its count |
| EnterorSpace | Compact or Undo |
Accessibility
- The bar (or field) is an image whose label reads the used tokens, the limit and the percent.
- Each legend chip names its kind and token count; Compact is a toggle button (aria-pressed) and the result is said in a status line.
Responsive behaviour
- 320 px card that shrinks with its container; the field keeps 20 columns and the legend wraps.
Edge cases (spec)
Card shrinks with its container; the field keeps 20 columns; the legend wraps.
Notes for AI
- Import
ContextBarfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
ContextBarElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.