Installation

Prerequisites

  1. Rust toolchain

    Install Rust via rustup:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. WASM target

    Add the WebAssembly compilation target:

    rustup target add wasm32-unknown-unknown
  3. Trunk (Leptos users)

    Install Trunk for building and serving Leptos apps:

    cargo install trunk

Add rs-grid to your project

Leptos
Vanilla JS
Dioxus
Yew

Add the required crates to your Cargo.toml:

[dependencies]
rs-grid-core   = { path = "../crates/rs-grid-core" }
rs-grid-scene  = { path = "../crates/rs-grid-scene" }
rs-grid-web    = { path = "../crates/rs-grid-web" }
rs-grid-leptos = { path = "../crates/rs-grid-leptos" }
Note

rs-grid is not yet published on crates.io. Use local path dependencies or git dependencies for now.

Crate dependency graph

The dependency flows in one direction — never introduce reverse dependencies:

rs-grid-leptos → rs-grid-web → rs-grid-render-canvas → rs-grid-scene → rs-grid-core
rs-grid-dioxus → rs-grid-web → rs-grid-render-canvas → rs-grid-scene → rs-grid-core
rs-grid-yew    → rs-grid-web → rs-grid-render-canvas → rs-grid-scene → rs-grid-core
CrateRole
rs-grid-coreHeadless logic: model, viewport, selection, hit-testing. No WASM dependency.
rs-grid-sceneConverts GridState into renderer-agnostic ScenePrimitive values
rs-grid-render-canvasCanvas2D backend via wasm-bindgen
rs-grid-webBrowser integration: events, DPR, rAF loop, CSS theme
rs-grid-leptosLeptos CSR wrapper component (<GridCanvas>)
rs-grid-dioxusDioxus CSR wrapper component (GridCanvas)
rs-grid-yewYew CSR wrapper component (GridCanvas)

Verify your setup

# Check the entire workspace compiles
cargo check --workspace

# Run unit tests
cargo test --workspace

# Build and serve the demo app
cd examples/basic-leptos
trunk serve