RavenRS · Rust GUI

FloatingPanel

Edit and run the FloatingPanel 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_panel() -> impl View {
    /// Keeps whether it is open, here while the page rebuilds.
    struct Corner;

    impl View for Corner {
        fn build(&self, cx: &mut BuildCx<'_>) -> NodeId {
            let open = cx.use_state(|| false);
            // `.movable` and `.minimized` take bindings, for the app to remember them.
            cx.child(&FloatingPanel::new(open.binding(), "Assistant", || {
                Box::new(Text::new("The app stays usable behind this panel."))
            }))
        }
    }
    Corner
}

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