# <img src="site/icon.svg" width="48" height="48" alt=""> Dockspace
Docking layouts for Rust editor UIs, independent of the UI framework.
Dockspace manages tabs, split layouts, floating groups, docking interactions and
close decisions. Your application owns pane content; your host owns rendering,
input and OS windows. Use the renderer-neutral core with a custom engine, or
start with the egui adapter.
**Pre-release:** the crates are not published yet, and the API may change.
Rust 1.95 or later is required. The egui adapter targets egui 0.37.
## Try it
Open the [browser workbench](https://frankorz.com/dockspace/demo/egui/) to try
docking and configurable motion in one canvas. The
[project homepage](https://frankorz.com/dockspace/) and
[local build instructions](integration/egui-web-demo) are also available.
Run the interactive editor using official egui, winit and WGPU:
```sh
cargo run -p egui_dockspace --example workbench --features wgpu --locked
```
Drag tabs to merge or split panes, resize splitters, and move the floating
Inspector. Edit a document, close it, then use **Restore layout** to reopen it
with its application data intact. This example uses one OS window and needs no
engine or dependency fork.

The recording uses the experimental [native multiview editor](docs/EXAMPLES.md#experimental-native-windows)
with motion enabled. Tabs dock in both directions, and the empty child window
retires after its final tab returns.
For a small terminal-only introduction to the core:
```sh
cargo run -p dockspace --example layout_commands --locked
```
[All examples and run commands](docs/EXAMPLES.md)
## Choose an integration
| You want to… | Start here | Host requirements |
| --- | --- | --- |
| Add docking to a custom engine or UI framework | [`dockspace`](crates/dockspace) | Supply measurements, drawing, input and presentation results |
| Connect a winit-based UI framework | [`dockspace_winit`](crates/dockspace_winit) | Shared input/repaint helpers and optional native window integration; keep your UI and renderer |
| Reuse your own native platform backend | [`dockspace::runtime`](crates/dockspace/docs/guide.md) | Native protocol and resource registry using your framework's IDs; no winit or UI dependency |
| Use egui in one OS window or browser canvas | [`egui_dockspace`](crates/egui_dockspace) | Own the complete egui run and final output for drag docking |
| Experiment with multiple native windows | [`egui_dockspace_native`](crates/egui_dockspace_native) | Use the pinned eframe/winit forks; platform support varies |
An ordinary `eframe::App::ui` callback supports rendering, selection, close,
menus and keyboard resizing. Drag docking and pane-focus confirmation need the
complete-output host shown above. [Host choices](crates/egui_dockspace#host-choices)
explain the difference before you integrate.
## What you can build
- Editor layouts with tabs, nested splits, splitter junctions and central panes.
- Drag docking with center/edge guides, tab reordering and overflow menus.
- Floating groups within a surface, with move, resize and Dock Back actions.
- Application-controlled close decisions, including background saving.
- Hide and restore panes without losing their tab positions or split proportions.
- Saved layouts with stable pane keys, restored independently of pane data.
- Custom pane drawing, minimum sizes, styling, focus and docking policies.
The experimental native adapter adds OS-window creation, recovery and shared
Root-window layouts. Physical cross-window docking has finite Linux X11 and macOS
coverage. Physical drag-out to create a window, Windows cross-window input and
arbitrary mixed-monitor DPI need further validation. See
[platform support](docs/PLATFORM_SUPPORT.md) before choosing a native integration.
## Use from source
Clone this repository and use path dependencies until the first release. Adjust
the paths to your checkout:
```toml
[dependencies]
dockspace = { path = "../dockspace/crates/dockspace" }
# For egui applications:
egui_dockspace = { path = "../dockspace/crates/egui_dockspace" }
```
Motion is enabled by default in the egui adapter. Use `MotionMode::Off` at
runtime or `default-features = false` to omit it;
[configuration examples](crates/egui_dockspace/README.md#configure-motion) cover
per-effect duration, curves and reduced motion. Enable `serde` for layout
persistence. Pane data and file storage stay in your application.
## Learn more
- [Examples](docs/EXAMPLES.md): choose a runnable starting point.
- [Core overview](crates/dockspace/README.md) and [engine host guide](crates/dockspace/docs/guide.md).
- [egui overview](crates/egui_dockspace/README.md) and [integration guide](crates/egui_dockspace/docs/guide.md).
- [GPUI adapter and workbench](integration/gpui-harness/README.md): embed retained application views and run the native demo.
- [Documentation index](docs/README.md): platform limits, adapter testing and architecture decisions.
- [AI integration skill](skills/dockspace-integration/SKILL.md): guidance for docking, custom hosts and native multiview. Copy its folder into your agent's skills directory (`~/.codex/skills/` for Codex) and invoke `$dockspace-integration`.
- [Contributing](CONTRIBUTING.md): repository layout and development checks.
## License
`dockspace` uses Apache-2.0. `dockspace_winit`, `egui_dockspace` and the experimental
native adapter use MIT OR Apache-2.0. [Third-party sources](THIRD_PARTY.md) records
prior art and fixture provenance.