Skip to content

Busy

An overlay while a slow action runs.

Example

Show code
use crate::data::slow_count;
use zeyn::prelude::*;

pub fn overview(_ctx: &Ctx) -> Node {
    Busy::new()
        .add(ActionButton::new("Count slowly", slow_count, ()).on_success(|n, ui| {
            if let Ok(n) = n {
                ui.toast(format!("{n} products"));
            }
        }))
        .into()
}