Skip to content

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-bar
Context
166.4Kof 200K
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

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

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.

Terminal
oxyn add context-bar

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Bar

One stacked bar: point at a kind in the legend to light it and read its own count; Compact squeezes the chat.

Context
166.4Kof 200K
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Field

The same window as a field of 200 dots, one per half percent, in load order.

Context
166.4Kof 200K
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Mono

Monochrome: the kinds become steps of grey, for a quiet toolbar.

Context
166.4Kof 200K
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Big window

A 1M window after a compaction: the same parts read as a thin sliver.

Context
87.4Kof 1M
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

ContextBar

PropTypeDefaultDescription
partsOption<Vec<CtxPart>>Default::default()The parts (the demo window when `None`).
limitu32200_000Window size in tokens.
lookString"bar"`bar` (one stacked bar) or `field` (a field of dots).
monoboolDefault::default()Greys instead of kind colours.
compactbooltrueShow the Compact / Undo button.
default_compactedboolDefault::default()Starts compacted.
titleString"Context"Heading.
on_compactEventHandler<bool>—Compacted (true) or undone (false).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabCompact / Undo, then each kind in the legend
Focus on a kindLights it and shows its count
EnterorSpaceCompact 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 ContextBar from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: ContextBarEl in oxyn_gpui.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI