Fusuma

Components / Small parts

stepper

A stepper showing value.

Try it

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

Live: Account, where stepper is usedOpen full size

Also on this pagebadgeavatarstat_cardrow

A stepper showing value.

Two buttons and the value between them; the app owns the number and shows it as text. .on_dec(m) and .on_inc(m) say what the buttons send.

Signature

pub fn stepper<M>(value: &str) -> Stepper<M>

Methods

  • .on_dec(message: M) -> Self — Sends message when the minus button is pressed.
  • .on_inc(message: M) -> Self — Sends message when the plus button is pressed.

Example

use fusuma::stepper;
let quantity = 3;
let view = stepper("3").on_dec(quantity - 1).on_inc(quantity + 1);
let built = fusuma::doc::built::<i32, _>(&view);
assert!(built.texts().contains(&"3"));

All components · Source