Kael’s workspace system gives you a composable, serializable multi-pane layout out of the box. You define panels that declare their preferred dock area, register them with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Augani/kael/llms.txt
Use this file to discover all available pages before exploring further.
Workspace, and Kael handles grouping, tab management, and bounds computation automatically. When the user rearranges panels or resizes a dock, you can serialize the entire layout to JSON in a single call and restore it on the next launch.
Core types
DockArea
DockArea is a Copy enum that identifies the four regions where panels can live:
rust
DockArea::Center is the default variant; panels placed there share the main content area.
TabGroup
A TabGroup owns the ordered list of panel IDs that occupy one DockArea. Exactly one panel is active at a time.
rust
TabGroup manually — Workspace creates and updates groups automatically as you add or move panels.
The Panel trait
Any type you want to dock must implement Panel:
rust
id must be unique across the workspace — it is the stable key used for serialization and tab management.
Pre-built panel implementations
Kael ships three concretePanel implementations in kael::panels so you can get started without writing boilerplate:
- InspectorPanel
- BottomPanel
Setting up a workspace
Register panels
Call After these four calls the workspace contains two
add_panel for each panel. Kael creates a TabGroup for each DockArea the first time a panel targets it, and subsequent panels sharing the same area are appended to that group.rust
TabGroups in Left (with explorer active), one in Right, and one in Bottom.Remove a panel
remove_panel returns the boxed panel if it existed. Empty groups are pruned automatically.rust
Computing dock bounds
compute_dock_layout converts the current panel configuration and a viewport size into pixel Bounds for each dock area. Pass the result to your rendering code to position panes:
rust
0.2 (20 %) for Left, Right, and Bottom. Override them via layout_mut().sizes:
rust
Persisting and restoring layout
save_layout serializes the current panel positions, tab groups, and dock sizes to a pretty-printed JSON string. restore_layout reads that string and reconciles it with whichever panels are currently registered — panels present in the saved layout but not registered are silently skipped.
rust
Always register your panels before calling
restore_layout. The method only repositions panels it can find in the current panels map; it cannot recreate panel objects from JSON alone.WorkspaceLayout type that backs the serialized format is itself Serialize + Deserialize, so you can embed it inside a larger application-level config struct if needed.
Writing a custom panel
If none of the pre-built panels fit, implementPanel directly:
rust