Fusuma

Components / Basics

item

A list row.

Try it

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

Live: Climate, where item is usedOpen full size

Also on this pagetagtabtab_bar

A list row.

A row of a list: chosen or not, pressed to choose it. .icon(..) puts an icon before the text.

Signature

pub const fn item<M>(text: &str, selected: bool) -> Item<'_, M>

Methods

  • .on_select(message: M) -> Self — Sends message when it is chosen (or pressed, in a menu).
  • .icon(icon: fusuma_icons::Icon) -> Self — An icon before the text.

Example

use fusuma::{column, item};
let view = column((item("Inbox", true).on_select(0), item("Sent", false).on_select(1)));
let built = fusuma::doc::built::<i32, _>(&view);
assert_eq!(built.texts(), ["Inbox", "Sent"]);

All components · Source