Components / Toolbar

Toolbar

Commands that fold into a menu when out of room.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn toolbar() -> impl View {
    Toolbar::new()
        .label("Records")
        .action(
            ToolbarAction::new("New")
                .icon(IconName::Plus)
                .style(ButtonStyle::Primary)
                .hotkey(Hotkey::command("n"))
                .on_click(|| {}),
        )
        .action(ToolbarAction::new("Refresh").icon(IconName::RefreshCw).on_click(|| {}))
        .separator()
        .action(ToolbarAction::new("Export").icon(IconName::Download).on_click(|| {}))
        .action(ToolbarAction::new("Delete").icon(IconName::Trash2).style(ButtonStyle::Danger).disabled(true))
}

Open in the playground, with every example →

Full API of Toolbar →