Nine ways to lay out a workspace, and what gives way first.
This page lays out one workspace nine ways: a toolbar, five tool panels (Files, Outline, Notes, Inspector, History) and a few open documents. Four layouts (labeled A, A2, C and F3) are docked windows, laid out live by solve from @n-uf/docking. The other five are page sketches this page draws by its own rules, for comparison. Drag the sliders to see what gives way when width or height runs out; every box settles to its new place from wherever it is drawn.
Built with @n-uf/motion (opens in a new tab) createLayoutMotion (every box glides) · @n-uf/docking (opens in a new tab) solve (the four docked layouts; the page's other five layouts are sketches drawn by the page itself) · @n-uf/placement (opens in a new tab) masterStack, layoutSplit and splitFromOrder from /tiling (the tiles inside the documents' area)
Everything fits at its natural size.
Laid out live by solve from A's dock state with panels allowed to float (floatKinds): A's columns and bottom dock, and any panel can be torn off to float over the documents, then docked back on a column or a rail. Inspector starts torn off here. Docked is the default; floating is the exception you choose, and a float always stays in view.
toolbarpanelrail / tabsdocumentfloating panels over the documentsbottom dock
Drag panels in the lab's Document window, a dock state of the same kind, and step through their drop targets from the keyboard.
Looking for a ready React component? @n-uf/docking has no React binding and draws nothing; your app draws the panels. For tiled panes users drag beside each other and into tabs, see hypr-tiling's React dockable panels (opens in a new tab) guide (it has no floating windows).
Docks, a tiling tree, scrolling columns, drawers and floating panels
A · Edge docksdocked
Laid out live by solve from a dock state with two side columns and a bottom dock. Each side has one column of stacked sections; each section is as tall as it wants, and the last one takes the rest. When height runs out, the least recently used section collapses to its header. When width runs out, the columns narrow, then the least recently used collapses to its rail. The bottom dock (outlined) sits between the columns and shortens the documents; on a short stage it shrinks, then collapses to a header bar.
A2 · Full-width bottom dockdocked
Laid out live by solve, from A's dock state with the dock's span set to "full". The same as A except for one thing: the bottom dock (outlined) runs the full width, and the columns and their rails stand on it. History gets the whole workspace's width, which suits a log or a timeline; the columns are shorter.
B · One tiling treesketch
A page sketch, drawn by this page's own rules, not by the library. Panels and documents are tiles of one tree, so a panel can sit beside a document. One rule for all: the newest tile that breaks a minimum floats.
C · Navigator + inspectordocked
Laid out live by solve from a dock state with two side columns and no dock. The left column shows one panel at a time under a row of tabs (the page draws the tabs in the column's top padding); the right column is a stack of sections. There is no bottom dock and nothing floats. When width runs out, the columns narrow, then collapse to their rails.
D · Scrolling columnssketch
A page sketch, drawn by this page's own rules, not by the library. Panels and documents are columns of a row wider than the screen; nothing shrinks below its minimum, and the view scrolls to the focus instead. Short on height, a column splits in two.
E · Drawerssketch
A page sketch, drawn by this page's own rules, not by the library. Documents take the screen; each side is a drawer with tabs. Wide, the drawers dock and push the documents aside. Narrow, they overlay the documents.
F1 · Floating panels oversketch
A page sketch, drawn by this page's own rules, not by the library. Documents take the whole workspace; panels are floating panels over them at their natural size, anchored to the top corners and draggable anywhere. The toolbar floats too (top or bottom). Short on height, the least recently used collapse to their headers; the documents never move.
F2 · Floating panels, documents aroundsketch
A page sketch, drawn by this page's own rules, not by the library. Floating panels sit at their natural size, but they keep their footprint free: the documents tile in the space between them. Nothing is covered, and the space under a short stack stays empty.
F3 · Docks + tear-offour pick
Laid out live by solve from A's dock state with panels allowed to float (floatKinds): A's columns and bottom dock, and any panel can be torn off to float over the documents, then docked back on a column or a rail. Inspector starts torn off here. Docked is the default; floating is the exception you choose, and a float always stays in view.
Nine questions, nine layouts
| Layout | Laid out by | Toolbar | Panels on one side | When height runs out | When width runs out | Covers documents | Reflows on its own | Drop targets while dragging | Known from |
|---|---|---|---|---|---|---|---|---|---|
| A · Edge docks | a dock state, laid out by solve | toolbar, top or bottom; space reserved for it, or floating over the documents | stacked sections at their natural heights; a bottom dock between the columns | the least recently used section collapses to its header; the bottom dock shrinks, then collapses to a header bar | columns narrow, then the least recently used collapses to its rail | never, unless you lay the bottom dock over them | rarely: sections, columns and the bottom dock collapse | a new column, into a column, a rail, the bottom dock | IDE tool windows (VS Code's bottom panel, alignment "center") |
| A2 · Full-width bottom dock | a dock state, laid out by solve | as A | as A; the bottom dock runs under the columns | as A; the columns are shorter | as A; the bottom dock keeps the full width | as A | rarely | as A | IDE tool windows (VS Code's bottom panel, alignment "justify") |
| B · One tiling tree | a page sketch | bar across the top | tiles in the same tree as documents | newest tile floats | newest tile floats | only floated tiles | often: opening a document reshapes panels | any tile edge | tiling window managers |
| C · Navigator + inspector | a dock state, laid out by solve | toolbar, top or bottom; space reserved for it, or floating over the documents | left: tabs, one panel shows; right: stacked sections | sections on the right collapse to headers; the tabs never change | columns narrow, then collapse to their rails | never | rarely: columns collapse | a new column, into a column (a tab on the left), a rail | design tools |
| D · Scrolling columns | a page sketch | bar across the top | stacked in the columns of a scrolling row | a column splits in two | the row scrolls | never | the view scrolls to the focus | between columns, inside a column | scrollable tiling window managers |
| E · Drawers | a page sketch | bar across the top | tabs: one panel per drawer | nothing happens | drawers overlay the documents instead of pushing | narrow only | drawers switch at a width | left / right tab rows | tablet apps |
| F1 · Floating panels over | a page sketch | floating toolbar, top or bottom; reserved space or overlay | floating panels stacked in a corner, or anywhere | the least recently used floating panels collapse to headers | floating panels cover more; narrow, stacks merge in one corner | always (shown under the stage) | never | anywhere (snap to corners, edges, other panels) | creative tools' floating panels |
| F2 · Floating panels, documents around | a page sketch | floating toolbar, top or bottom; reserved space or overlay | floating panels stacked in a corner, or anywhere | the least recently used floating panels collapse to headers | documents get narrower | never; leaves empty space under short stacks | documents re-tile when a panel moves | anywhere (snap to corners, edges) | window managers' "struts" |
| F3 · Docks + tear-off | a dock state, laid out by solve | toolbar, top or bottom; space reserved for it, or floating over the documents | as A; any panel can float | as A; a float stays in view | as A | what floats (Inspector starts torn off), or the bottom dock if you lay it over them | rarely | as A, or anywhere to float | IDE tool windows (floating mode) |
F3 · Docks + tear-off
A, A2, C and F3 are each a DockState from @n-uf/docking: a column edge on each side, a bottom dock edge, the panels as items with their forms, and any floats. solve lays one out. The letters are this page's labels. Our pick is F3, A's dock state with floatKinds set so panels may float, and one rule: a panel lives in a column, and a column collapses to its rail. Short on height, sections collapse to their headers and the bottom dock shrinks, then collapses to a header bar. Short on width, columns narrow, then collapse to their rails (contentMin). Nothing covers the documents unless you choose it: tear a panel off and it floats, and drop it on a column or a rail to dock it back. Space for the toolbar is a bar edge holding a fixed item, and the app draws the toolbar there. Every glide is a column, a section or a float opening, closing or moving, which settle already does.
A is the same without floating; C is the simplest if one panel at a time on the left is enough.
Questions
How do I drag a panel from one dock to another?
Take drop targets from targets(state, id) in @n-uf/docking and feed them to createDragIntent from @n-uf/motion/drag, or take lanes(state, id) for createLandingModel. Each DockDrop carries what a release there makes: target.after(point, grab) returns the new dock state and its layout, so the preview is the result. Your app draws the rects.
Which docking layouts can I build?
Any you can describe as a DockState from @n-uf/docking: edges along the window's sides (columns, docks, toolbars), the panels in them, and floats. This page lays out four: side docks with a bottom dock, the same with a full-width dock, the same with floating panels, and a navigator. Panes that share an area come from ./tiling in @n-uf/placement.
What gives way when a docked window runs out of room?
The least recently used section collapses to its header when a column runs short of height. Short of width (contentMin), columns narrow, then the least recently used collapses to its rail. A dock with giveWay shrinks, then collapses to a header bar. solve returns coded notes such as column-folded; your app supplies the wording.
Can I use these docking layouts in React?
Yes, with your own rendering. @n-uf/docking has no React components and draws nothing: you keep a DockState in your state, draw the rects solve returns, and feed pointer samples to a drag. For a ready-made React component with tabs and splits but no floating windows, n-uf has a separate library, linked in the note under the demo.