Preview Updated 2026-05-10

Detached panel

Draggable floating panel teleported to body. Use with TearOffTab / DockLayout's detach action.

Basic usage

Hold the header to drag it; resizable enables the browser-native resize handle. To turn it into a separate window in Tauri / Electron, just spawn a new BrowserWindow / WebView in the tear-off event.

Demo source
src/App.vue vue
<CfDetachedPanel v-model:open="open" title="Inspector" :width="320">
<div>Panel content…</div>
</CfDetachedPanel>
src/App.tsx tsx
<CfDetachedPanel open={open} onOpenChange={setOpen} title="Inspector" width={320}>
<div>Panel content…</div>
</CfDetachedPanel>

Multiple panels

Multiple DetachedPanels can be open simultaneously; layer them explicitly via zIndex. resizable=true enables the browser-native resize handle.

Demo source
src/App.vue vue
<CfDetachedPanel v-model:open="a" :width="280" />
<CfDetachedPanel v-model:open="b" resizable />
src/App.tsx tsx
<CfDetachedPanel open={a} onOpenChange={setA} width={280} />
<CfDetachedPanel open={b} onOpenChange={setB} resizable />

API

PropTypeDefaultDescription
open / v-model:openbooleanfalse
titlestringHeader title
x / ynumberautoInitial position
width / heightnumber | string360 / 240
resizablebooleanfalseEnable native resize handle
closablebooleantrue
tostring'body'Teleport target
zIndexnumber

Events: update:open / move(x, y).

反馈与讨论

Detached panel · Discussion

0
0 / 600
一键发送
正在加载评论...