Context window (cells)Pro
What fills the model's context as a field of cells: hover a part to light it, remove files, and compact the conversation while its cells shimmer and clear.
oxyn add context-fieldThe 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
- What fills the model's context as a field of cells (216 in 36 columns by default).
- Parts (Part { id, label, tokens, items, locked, compact }) fill the field in order with cumulative rounding so every non-empty part gets at least one cell.
- Pointing at a part lights its cells and quiets the rest.
- Parts with items open to list them with × to remove (locked parts cannot).
When not to use
- Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
- The model menu of an AI chat: use Model Picker instead.
- The prompt box for an agent, in six layouts: use Composer instead.
Installation
Context window (cells) 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-fieldUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Default
Hover a part to light its cells; open Files to remove one; Compact the conversation.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Warn
Past 80 %: amber and the tray says what's left.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Light
Early in a chat.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ContextField
| Prop | Type | Default | Description |
|---|---|---|---|
title | String | "Context window" | Heading. |
model | Option<String> | Default::default() | Small tag in the head (the model). |
partsrequired | Vec<Part> | — | Parts in fill order. |
limitrequired | u64 | — | Window size in tokens. |
warn_at | f64 | 0.8 | Warning share. |
cells | usize | 216 | Number of cells. |
columns | usize | 36 | Cells per row. |
action | Option<String> | Default::default() | Button on the tray ("New chat"). |
on_remove | EventHandler<(String, String)> | — | Part and item removed. |
on_compact | EventHandler<String> | — | Part compacted. |
on_action | EventHandler<()> | — | Tray action. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Parts with items, Compact and the tray action |
Accessibility
- The field is role=img with tokens in use; the tray line is role=status.
- Reduced motion clears compacted cells with a short fade.
From the spec
- The field is role=img with tokens in use; the tray line is role=status.
Motion & interaction
Timing
- Cell clear 900 ms with 8 ms per column; part rows fade 180 ms.
- Reduced motion clears cells with a 200 ms fade.
Responsive behaviour
- Cells keep their aspect; the field fills the card.
Edge cases (spec)
- Cells keep their aspect ratio.
Notes for AI
- Import
ContextFieldfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
ContextFieldElinoxyn_gpui. - Props to set first:
parts,limit. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.