Fusuma

Components / Basics

slider

A slider.

Try it

This is the Shape page of the gallery, running in your browser: slider is on it, and it is the real widget. Press Run, then use it.

Live: Shape, where slider is usedOpen full size

Also on this pagesegmented

A slider.

permille is thousandths, 0 to 1000. A drag, the wheel and the arrow keys change it; .on_change(f) sends what f makes of the new value.

Signature

pub const fn slider<M>(permille: u16) -> Slider<M>

Methods

  • .on_change(f: fn(u16) -> M) -> Self — Sends a message made from the new position (thousandths) when it moves.

Example

use fusuma::{column, slider};
let view = column((slider(300).on_change(|permille| permille),));
let built = fusuma::doc::built::<u16, _>(&view);
assert_eq!(built.nodes(), 2);

All components · Source