Expand description
§dioxus-mosaic
A React-Mosaic-style tiling window manager library for Dioxus applications.
§Features
- HashMap-based architecture - O(1) operations for smooth 60 FPS performance
- Binary splits - Simple, proven pattern (like VSCode, Sublime)
- Resizable dividers - Drag to resize panes
- Dynamic splitting - Split any tile horizontally or vertically
- Panel controls - Close tiles, collapse/expand
- LocalStorage persistence - Layout survives page reloads
- Clean builder API - Easy-to-use tree-like configuration
§Quick Start
ⓘ
use dioxus::prelude::*;
use dioxus_mosaic::{Mosaic, MosaicBuilder, tile};
#[component]
fn App() -> Element {
let mut layout = use_signal(|| {
MosaicBuilder::horizontal()
.left(tile("sidebar"))
.right(tile("editor"))
.split(25.0)
.build()
});
rsx! {
Mosaic {
layout: layout,
render_tile: move |tile_id| {
match tile_id.as_str() {
"sidebar" => rsx! { div { "Sidebar" } },
"editor" => rsx! { div { "Editor" } },
_ => None
}
},
}
}
}Re-exports§
pub use drag_drop::DragGhost;pub use drag_drop::DragGhost;pub use split_pane::SplitPane;pub use split_pane::SplitPane;pub use tile_pane::TilePane;pub use tile_pane::TilePane;
Structs§
- Drag
State - Global drag state
- Mosaic
Builder - Builder for creating mosaic layouts with a fluent API
- Mosaic
Layout - Main layout structure using HashMap for O(1) operations
Enums§
- Drop
Zone - Drop zone position when hovering over a tile
- Mosaic
Node - Tree representation for external API
- Split
Direction - Direction of a split
Functions§
- Drag
Ghost - Drag ghost component that follows the cursor
- Mosaic
- Main mosaic component
- Split
Pane - A resizable split pane component
- Tile
Pane - Wrapper for a tile with controls (split, close, drag-drop)
- tile
- Create a tile node (helper function)