Skip to content
Back

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-field
Context windowSonnet 5.582%
System prompt6K
Tools14K
31K
Conversation112K
37K left
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

  • 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.

Terminal
oxyn add context-field

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

Default

Hover a part to light its cells; open Files to remove one; Compact the conversation.

Context windowSonnet 5.582%
System prompt6K
Tools14K
31K
Conversation112K
37K left
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

Warn

Past 80 %: amber and the tray says what's left.

Context windowSonnet 5.5101%
System prompt6K
Tools17.5K
38.8K
Conversation140K
Full · compact or start a new chat
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

Light

Early in a chat.

Context windowSonnet 5.527%
System prompt6K
Tools4.2K
9.3K
Conversation33.6K
53.1K of 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

API reference

ContextField

PropTypeDefaultDescription
titleString"Context window"Heading.
modelOption<String>Default::default()Small tag in the head (the model).
partsrequiredVec<Part>—Parts in fill order.
limitrequiredu64—Window size in tokens.
warn_atf640.8Warning share.
cellsusize216Number of cells.
columnsusize36Cells per row.
actionOption<String>Default::default()Button on the tray ("New chat").
on_removeEventHandler<(String, String)>—Part and item removed.
on_compactEventHandler<String>—Part compacted.
on_actionEventHandler<()>—Tray action.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabParts 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 ContextField from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: ContextFieldEl in oxyn_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.

Guides

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