Skip to content

Effort pillPro

A “Select effort” pill that opens a popover with the level, the model it applies to, a dotted step slider and reset.

oxyn add effort-pill
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

  • An effort control for a composer that starts unset: the pill reads "Select effort" until the user picks a level in a popover with a big, touch-friendly step slider.

When not to use

  • A card with the effort's name and what it does over a dense tick ruler: use Ruler card instead.
  • A model's details with a notched reasoning slider (R steps it: use Reasoning panel instead.
  • A chip with the current effort that opens a plain list of levels above it, the chosen one checked: use Effort list instead.

Installation

Effort pill 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 effort-pill

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

Open

The popover under the pill: the level, the model it applies to, and a fat slider with a dot per level.

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

Unset

Nothing chosen yet: the pill reads “Select effort” in grey and the slider rests on the default.

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

Max

The thumb at the far end.

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

EffortPill

PropTypeDefaultDescription
levelsOption<Vec<EffortLevel>>Default::default()The scale (Low … Max when `None`).
valueOption<Option<usize>>Default::default()Controlled level (`None` inside = nothing chosen yet).
default_valueOption<usize>Default::default()Starting level when uncontrolled.
resetusize2Where reset returns.
modelString"Atlas 6"The model the effort applies to (a link-styled line under the level).
default_openboolDefault::default()Starts open (for previews).
on_changeEventHandler<usize>—The level changed.
on_modelEventHandler<()>—The model line was pressed (to switch models).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpace on the pillOpens or closes the popover
←or→ · HomeorEndOn the slider: one level, or the ends
EscapeCloses the popover

Accessibility

  • The pill reports aria-expanded; the popover is a dialog named Thinking effort.
  • The slider's value text is the level's name; reset is named after the level it returns to.

Responsive behaviour

  • 380 px popover, capped at the viewport minus 32 px; the slider fills it.
Edge cases (spec)

380 px popover capped at the viewport minus 32 px.

Notes for AI

  • Import EffortPill from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: EffortPillEl 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