Fusuma

Components / Components

tile

A square card for one thing among many (a session, a device, a room): its picture, its name and a line of state under it, centred, width wide (the room the theme keeps for its elevation is in it).

Try it

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

Live: Components, where tile is usedOpen full size

Also on this pagealertbannersnackbarbreadcrumbsstepsgauge

A square card for one thing among many (a session, a device, a room): its picture, its name and a line of state under it, centred, width wide (the room the theme keeps for its elevation is in it). active fills it a step so the one that needs a look stands out.

A pixel-art picture with a title and a state under it; the active one stands out. A touch target for a home or a settings grid.

Signature

pub fn tile<'a, M: Clone + 'a>( art: &'static [&'static str], title: &'a str, state: &'a str, active: bool, width: Length, ) -> impl View<M> + 'a

Example

use fusuma::{Length, tile};
static LAMP: [&str; 2] = ["www", ".w."];
let view = tile(&LAMP, "Lamp", "On", true, Length::Fixed(120));
let built = fusuma::doc::built::<(), _>(&view);
assert!(built.texts().contains(&"Lamp"));

All components · Source