-
Notifications
You must be signed in to change notification settings - Fork 9
Component Slider
MeowLynxSea edited this page Jun 18, 2026
·
5 revisions
A horizontal slider for selecting a value within a range. Drag is wired internally — no caller drag handler needed.
use yororen_ui::headless::slider::slider;
slider("volume", cx)
.value(self.volume)
.range(0.0, 100.0)
.step(1.0)
.on_change({
let entity = cx.entity();
move |new, _, cx| entity.update(cx, |s, _| s.volume = new);
})
.render(cx)| Method | Purpose |
|---|---|
value(v) |
Current value (clamped to [min, max]). |
range(min, max) |
Min and max of the track. |
step(s) |
Step size; the renderer snaps drag to multiples of s. |
disabled(v) |
Disable the drag handler. |
on_change(closure) |
Fn(f32, &mut Window, &mut App) + 'static + Send + Sync. Fires continuously during drag. |
Factory takes (id, _cx). .render(cx) returns Stateful<Div>. No state entity.
See also: NumberInput, ProgressBar.
Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.