Components / ToolRail

ToolRail

A narrow bar of tools with their names under their icons.

Example

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

Code

use ravenrs::prelude::*;

fn tool_rail() -> impl View {
    let open = State::new(0);
    ToolRail::new(
        open.binding(),
        [(IconName::Type, "Text"), (IconName::ZoomIn, "Zoom"), (IconName::Layers, "Fades")],
    )
    // Hold the button, right-click or press Right for the tools that share its place.
    .separator()
    .tool(ToolRailItem::new(IconName::Square, "Shape").variant(IconName::Circle, "Ellipse"))
}

Open in the playground, with every example →

Full API of ToolRail →