Skip to content
Back

Rubber sliderPro

A slider that stretches like rubber past its ends and springs back, pushing its icons outward, with a value tag that sways with the thumb's speed and detents it clicks into.

oxyn add rubber-slider
Volume40%
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 slider that stretches like rubber past its ends: the track widens (and shifts for the start end) by rubber(over, 22) and the start / end icons are pushed outward by 60 % of that, then everything springs back on release.
  • The thumb swells to 1.28× while dragged; a value tag rides over it and tilts with its speed (tag_tilt, ±14°).
  • Detents (marks) catch a dragged thumb within 7 px and hold it there (detent); a detent's tick pops when the thumb clicks in.
  • Labelled marks print under the track and are clickable.

When not to use

  • On or off for things that apply right away: use Switch instead.
  • A real checkbox with a label and second line, an indeterminate state for Select all, an error, a card row and a check that draws itself: use Checkbox instead.
  • Pick one: use Radio group instead.

Installation

Rubber slider 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 rubber-slider

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

Detents

Detents the thumb clicks into; labels can be clicked.

Volume40%
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

Plain

No marks: just the rubber band and the swaying tag.

Volume40%
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

Bare

No icons or readout.

Brightness
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

RubberSlider

PropTypeDefaultDescription
labelrequiredString—Label.
valuef64Default::default()Starting value.
minf64Default::default()Lowest value.
maxf64100.0Highest value.
stepf641.0Step.
marksVec<(f64, String)>Default::default()Detents: value and label (empty for an unlabelled tick). Labelled ones can be clicked.
suffixStringDefault::default()Text after the value ("%").
show_valuebooltrueShow the value beside the label.
start_iconOption<String>Default::default()Icon before the track.
end_iconOption<String>Default::default()Icon after the track.
disabledboolDefault::default()Disabled.
on_changeEventHandler<f64>—Every change.
on_commitEventHandler<f64>—Once a drag ends, a key lands or a mark is clicked.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
←or→or↑or↓One step
ShiftarrowsorPage UporDownA tenth of the range
HomeorEndMin / max; at a limit the track stretches toward the press

Accessibility

  • The thumb is role=slider with a formatted aria-valuetext.
  • Reduced motion removes the stretch, sway and tick pop.
From the spec
  • The thumb is role=slider with aria-valuetext; disabled removes it from the tab order.

Motion & interaction

Timing
  • Spring back 450 ms (cubic-bezier .3,1.5,.5,1); thumb swell 180 ms; tag sway 350 ms.
  • Reduced motion removes the stretch, sway and tick pop; the thumb jumps and the tag fades.

Responsive behaviour

  • The track fills its container; icons stay at the ends.
Edge cases (spec)
  • The track fills its row between the icons.

Notes for AI

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