Skip to content

Split barPro

One 100 % bar split into shares: rest on a segment to widen it and read its figures, switch segments from the legend and the rest reflow, with labels inside or on leader lines.

oxyn add split-bar
Sessions by sourceLast 30 days
Total · 10,000 sessions
Search48.2%Direct23.1%Social14.9%
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

  • A single 100 % bar split into shares.
  • Each segment is a full-width layer cut to its share with an animated clip-path, so reflow never touches layout and a new target retargets mid-flight.
  • Resting on or arrowing onto a segment widens it by 4.5 % of the bar (or to 16 % when smaller, enough to fit its name and share) while the others give way proportionally and dim (split).
  • The readout shows the highlighted segment's value and share (one decimal) or the total.

When not to use

  • A launch countdown with digits that roll per unit, a compact one-line variant, hours absorbing days when days are hidden, and a live state with a pulsing dot at zero: use Countdown instead.
  • A total that moves clearly: use Animated counter instead.
  • A collapsible JSON tree with search, paging for long arrays, copy value or path, the current path under the tree and full keyboard moves: use JSON viewer instead.

Installation

Split 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 split-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

Traffic

Six sources: small ones label below on leader lines.

Sessions by sourceLast 30 days
Total · 10,000 sessions
Search48.2%Direct23.1%Social14.9%
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

Budget

Currency values.

Budget by teamThis quarter
Total · $720,000
Engineering58.3%Marketing25.0%Operations13.3%
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

Hidden

One segment switched off; the rest reflow.

Sessions by sourceLast 30 days
Total · 7,690 sessions
Search62.7%Social19.4%
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

SplitBar

PropTypeDefaultDescription
titlerequiredString—Heading (and accessible name).
descriptionOption<String>Default::default()One line under the title.
sharesrequiredVec<Share>—Shares in display order.
unitStringDefault::default()Word after values in the readout ("sessions").
prefixStringDefault::default()Prefix on values ("$").
total_labelString"Total"Readout label with nothing highlighted.
default_hiddenVec<String>Default::default()Segments switched off at first.
legendbooltrueShow the legend.
on_hidden_changeEventHandler<Vec<String>>—Called with the hidden ids when a segment is switched.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabThe bar, then each legend item
→or↓ and ←or↑Highlight the next / previous segment
HomeorEndFirst / last
EnterorSpaceSwitch the highlighted segment off
EscapeClear the highlight

Accessibility

  • The readout is aria-live=polite; legend items are toggle buttons with aria-pressed.
  • Reduced motion swaps widths without the clip-path glide.
From the spec
  • The readout is aria-live=polite; legend buttons expose aria-pressed.

Motion & interaction

Timing
  • Clip-path edges 450 ms (cubic-bezier .25,1,.4,1); names open 350 ms.
  • Reduced motion swaps widths without the glide.

Responsive behaviour

  • Labels move outside segments narrower than about 13 % of the bar.
Edge cases (spec)
  • Outside labels below segments narrower than 13 %.

Notes for AI

  • Import SplitBar from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: SplitBarEl in oxyn_gpui.
  • Props to set first: title, shares.
  • 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