dockviewers_dioxus
🌐 Live demo — no setup, runs in the browser.
A tiling/docking layout for Dioxus — the IDE/trading-terminal kind: panes split, resize, tab together, float, and maximize, with the arrangement saved to JSON and restored on reload. It's a Dioxus-idiomatic port of dockview-core: one pure DockModel in a Signal is the only source of truth, and the UI is declarative rsx! derived from it. User content lives in a stable, id-keyed overlay layer separate from the split-tree skeleton, so a panel keeps its component instance and inner state (a live chart, scroll, an unsaved textarea) while it's dragged across the grid.
TODO
Usage
Usage
Hand DockArea a list of DockPanels (id + title + the Element to render); the library owns layout, you own content.
use *;
use ;
Runnable demo: dx serve --example insilico --package dockviewers_dioxus --platform web — or open the hosted demo, no local setup needed.
Props: panels (order = stable overlay render order — don't reorder it, that remounts panels), storage_key (localStorage key for autosave/restore; None to disable), on_ready (Option<Callback<DockApi>>, fires once only on a fresh default layout — use it to script the initial split).
Scripting — grab DockApi via use_context::<DockApi>() or from on_ready; every method mutates the model:
api.add_panel; // Option<(Location, Position)>
api.move_panel; // Location = path of child indices; vec![] is root
api.remove_panel;
api.maximize; api.exit_maximized;
api.float;
let json = api.save; api.load; // load panics on corrupt JSON
Position: Top/Bottom/Left/Right split into a new branch, Center docks as a tab.
Persistence is wasm-only (no-op natively). With storage_key set: no data → default layout + on_ready; valid → restored, on_ready skipped; corrupt → error watermark, never a silent reset.
Theming — only structural CSS ships; set --dv-* custom properties on any ancestor for colors/sizes (e.g. --dv-group-bg, --dv-tab-active-bg, --dv-splitter-size, --dv-drop-bg).