RavenRS · Rust GUI

FloatingToolbar

Edit and run the FloatingToolbar RavenRS example in your browser. Explore its Rust code and download a Cargo project for desktop and WebAssembly.

One declarative Rust interface, GPU rendering, reactive state and semantic design tokens. Free and open source under MIT OR Apache-2.0.

Rust source

fn floating_toolbar() -> impl View {
    let (place, level) = (State::new(None::<Point>), State::new(100.0_f32));
    FloatingToolbar::new(
        Spacer::new().frame(None, Some(200.0)).background(Semantic::Control).corner_radius(8.0),
    )
    .label("Zoom")
    .movable(place.binding())
    .action(ToolbarAction::new("Fit"))
    .action(ToolbarAction::new("Fill"))
    .separator()
    .action(ToolbarAction::new("Zoom out").icon(IconName::Minus).icon_only())
    .view(ValueSlider::new(level.binding()).range(10.0, 400.0).step(10.0).unit("%").label("Zoom level"))
    .action(ToolbarAction::new("Zoom in").icon(IconName::Plus).icon_only())
}

The interactive preview loads when JavaScript and WebGPU or WebGL2 are available. You can read the guide and examples here at any time.

More examples