RavenRS · Rust GUI

CodeEditor

Edit and run the CodeEditor 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 code_editor() -> impl View {
    let code = State::new(
        "fn total(prices: &[f64]) -> f64 {\n    // Sum of every price\n    prices.iter().sum()\n}\n"
            .to_owned(),
    );
    CodeEditor::new(code.binding())
        .diagnostics(vec![
            CodeDiagnostic::warning(3, 5, 6, "`prices` could be empty").hint("Return 0.0 first"),
        ])
        .rows(10)
}

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