Component
Vue Dock Layout Component
<DomDockLayout>A bounded app workspace with resizable left, right, and bottom docks. Panels can float, stack by focus, and return to any dock without losing their mounted content.
Dock layout
Use DomDockLayout for an app workspace with supporting panels that can be resized, floated, moved, and docked. Import it from @getdom/studio/vue and give it a bounded height. The default slot is the central workspace. Each #left, #right, or #bottom slot identifies one panel; that panel may later occupy any of the three docks.
npm install @getdom/studio<script setup>
import '@getdom/studio/style.css';
import { ref } from 'vue';
import { DomDockLayout } from '@getdom/studio';
const layout = ref(null);
</script>
<template>
<DomDockLayout
v-model:layout="layout"
class="h-[36rem]"
:panels="{ left: { title: 'AI chat', size: 320, floatResizable: true } }"
>
<template #left><ChatPanel /></template>
<LivePreview />
</DomDockLayout>
</template>AI chat and live preview
Resize the left divider to give chat or preview more room. Pop out the chat, move it by its title bar, then drop it over the highlighted left, right, or bottom zone to dock it there. The Move panel menu provides the same positions without dragging. The demo saves its layout in browser storage and has a Reset layout action. Its conversation is local and makes no AI request.
I can help shape this preview. Resize this dock, float the chat, or move it to another edge while we talk.
Local demo reply · No AI request
Live preview
Workspace overview
A clear view of what matters next.
Your projects, activity, and decisions in one calm place. The preview grows as the chat dock gets narrower.
Open projects
12
In review
4
Completed
28
Multiple floating panels
This example uses icon-controls for compact panel headers. The outward arrow floats a panel, and the split window icon returns it to its dock. The three dots open the position menu. The corner grip resizes floating panels that allow it.
The review workspace has three independently movable panels. Float two or more, then click or drag one: it rises above its siblings. The back-to-front order is part of the layout value. A panel dropped onto an occupied dock takes that dock, and its previous occupant moves into the vacant dock. Panel content stays mounted across these moves.
Design review
Check that the workspace stays usable while you keep supporting panels open.
Design review · Awaiting review
Sizing and state
panels sets each source panel's title, initial size, expanded minSize, and floatResizable. Floating resize is enabled by default; set floatResizable: false for a fixed-size floating tool. Docked panels snap closed when their divider is dragged 32 pixels past the minimum and can be restored with Enter. On narrow containers, the workspace may scroll horizontally when dock and preview minimums exceed the available width.
Bind v-model:layout if the host should persist the arrangement. It emits a serializable DockLayoutState with panels keyed by their source slot, physical dock sizes, and floatingOrder from back to front. Each panel records its current or return dock, floating state, and bounds (x and y are fractions of the available floating area; width and height are pixels or null). Save this value in the application and pass it back on the next mount. Passing null resets the default arrangement. Dock and floating moves preserve the mounted Vue panel instance; host applications retain responsibility for conversation data, permissions, and remote persistence.
This first version has one panel per dock and floating windows inside the app. Dropping onto an occupied dock swaps its occupant into the available edge. Tab groups, arbitrary nested splits, and separate browser windows are outside this component's current layout model.
Reference
Props
Control props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
panels | object | Record<string, unknown> | {} | Settings keyed by the original left, right, or bottom slot. Each accepts title, size, minSize, and floatResizable. |
layout | object | Record<string, unknown> | — | Optional controlled layout with panel locations, floating bounds, dock sizes, and back-to-front order. |
iconControls | boolean | boolean | false | Use compact icons for the panel position menu and pop out or dock action. |
minWorkspaceWidth | number | number | 280 | Minimum workspace width in pixels. |
minWorkspaceHeight | number | number | 180 | Minimum workspace height in pixels. |
Auto-generated from Dock layout.props and inline _edit hints.
Slots
| Name | Scope | Description |
|---|---|---|
| #default | — | Central workspace content. |
| #left | — | Panel content identified as left; it can later move to any dock. |
| #right | — | Panel content identified as right; it can later move to any dock. |
| #bottom | — | Panel content identified as bottom; it can later move to any dock. |
Keyboard
- Arrow keysResize from a focused dock divider or floating resize control. Hold Shift for larger steps.
- EnterCollapse or restore a dock from its focused divider.
- Move menuChoose a dock position or float the panel without dragging.
- EscapeReturn a floating panel to its last dock when focus is inside the panel.