Fusuma

Components / Small parts

badge

A badge: on the main colour when primary, else on the page colour.

Try it

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

Live: Account, where badge is usedOpen full size

Also on this pageavatarstepperstat_cardrow

A badge: on the main colour when primary, else on the page colour.

Signature

pub const fn badge(text: &str, primary: bool) -> Badge<'_>

Example

use fusuma::{badge, row, text};
let view = row((text("Messages"), badge("3", true)));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Messages", "3"]);

All components · Source