RavenRS · Rust GUI

DockArea

Edit and run the DockArea 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 dock_area() -> impl View {
    let layout = State::new(
        DockLayout::new()
            .center(DockNode::tabs(["photo", "grid"]))
            .left(DockNode::tabs(["folders", "search"]), 220.0)
            .right(DockNode::vertical([DockNode::tabs(["layers"]), DockNode::tabs(["history"])]), 200.0)
            .bottom(DockNode::tabs(["log"]), 110.0),
    );
    let panels = vec![
        DockPanel::new("photo", "Photo").icon(IconName::Camera).closable(false),
        DockPanel::new("grid", "Grid"),
        DockPanel::new("folders", "Folders").icon(IconName::Folder),
        DockPanel::new("search", "Search").icon(IconName::Search),
        DockPanel::new("layers", "Layers"),
        DockPanel::new("history", "History"),
        DockPanel::new("log", "Log"),
    ];
    DockArea::new(layout.binding(), panels, |id| -> AnyView {
        Box::new(VStack::new((Text::new(format!("What {id} shows")),)).padding(12.0))
    })
    // Keep this text, and give it to DockLayout::parse the next time.
    .on_end(|layout| println!("{}", layout.to_text()))
    .height(420.0)
}

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