Main Content
Resize by dragging the edge between panel and center. Drag a panel header to re-dock it. Press the pin icon to toggle auto-hide.
A VS Code-style panel layout engine. Dock panels to left, right, or bottom edges. Toggle between pinned and auto-hide. Drag headers to re-dock. Float panels freely with full layout state persistence.
Left, right, and bottom panels. The "Filters" panel starts as auto-hide — click its icon to reveal it. Drag panel headers to re-dock. Click the pin button to toggle between pinned and auto-hide.
Left, right, and bottom panels with tabbed groups. 'Filters' starts as auto-hide. Drag panel headers to re-dock. Click the pin button to toggle pinned/auto-hide.
import { DockedLayout } from 'fluxo-ui';
import type { PanelConfig } from 'fluxo-ui';
const panels: PanelConfig[] = [
{
id: 'explorer',
title: 'Explorer',
icon: FolderIcon,
defaultPosition: 'left',
defaultState: 'pinned',
defaultSize: 220,
children: <ExplorerPanel />,
},
{
id: 'properties',
title: 'Properties',
icon: SettingsIcon,
defaultPosition: 'right',
defaultState: 'pinned',
defaultSize: 240,
children: <PropertiesPanel />,
},
{
id: 'output',
title: 'Output',
icon: BarChartIcon,
defaultPosition: 'bottom',
defaultState: 'pinned',
defaultSize: 150,
children: <OutputPanel />,
},
];
<DockedLayout panels={panels}>
<main style={{ padding: 24 }}>Main content here</main>
</DockedLayout>Switch between 'icon' (compact icon-only tabs) and 'icon-label' (icon with label text) via the tabMode prop.
Switch between 'icon' (compact icon-only) and 'icon-label' (icon with label text below) activity bar modes.
<DockedLayout panels={panels} tabMode="icon">
<Content />
</DockedLayout>Panels with defaultPosition='float' are freely positioned. Drag the header to move them. Resize from the bottom-right corner. Use dock buttons to attach to a side.
Panels with defaultPosition='float' are freely draggable and resizable. Drag the header to move. Resize from the bottom-right corner. Use the dock buttons to attach to a side.
const panels: PanelConfig[] = [
{
id: 'floating-panel',
title: 'Color Picker',
icon: PaletteIcon,
defaultPosition: 'float',
defaultFloatPos: { x: 240, y: 60, width: 280, height: 200 },
children: <ColorPickerContent />,
},
];
<DockedLayout panels={panels}>
<Content />
</DockedLayout>The onChange callback fires on every layout change. Pass the state back via layoutState to restore a saved layout.
The onChange callback fires on every layout change — resize, pin toggle, re-dock. Pass the state back via layoutState to restore it.
const [layoutState, setLayoutState] = useState<DockedLayoutState>();
<DockedLayout
panels={panels}
layoutState={layoutState}
onChange={(state) => {
setLayoutState(state);
localStorage.setItem('layout', JSON.stringify(state));
}}
>
<Content />
</DockedLayout>import { DockedLayout } from 'fluxo-ui';
import type { DockedLayoutState, PanelConfig, TabMode } from 'fluxo-ui';panelsreqPanelConfig[]Array of panel configuration objects.
panelsreqPanelConfig[]Array of panel configuration objects.
childrenReact.ReactNodeThe main center content area.
childrenReact.ReactNodeThe main center content area.
layoutStateDockedLayoutStateControlled layout state. Use onChange to keep in sync.
layoutStateDockedLayoutStateControlled layout state. Use onChange to keep in sync.
onChange(state: DockedLayoutState) => voidFired on every layout change for persistence.
onChange(state: DockedLayoutState) => voidFired on every layout change for persistence.
tabMode'icon' | 'icon-label'"'icon'"Activity bar display mode.
tabMode'icon' | 'icon-label'"'icon'"Activity bar display mode.
classNamestringAdditional CSS class names.
classNamestringAdditional CSS class names.
styleReact.CSSPropertiesInline styles for the outer container.
styleReact.CSSPropertiesInline styles for the outer container.
idreqstringUnique panel identifier.
idreqstringUnique panel identifier.
titlereqstringPanel display title and activity bar tooltip.
titlereqstringPanel display title and activity bar tooltip.
iconreqSVGIconIcon rendered in the activity bar. Must be from icons.ts.
iconreqSVGIconIcon rendered in the activity bar. Must be from icons.ts.
childrenReact.ReactNodePanel body content.
childrenReact.ReactNodePanel body content.
defaultPosition'left' | 'right' | 'bottom' | 'float'"'left'"Initial dock position.
defaultPosition'left' | 'right' | 'bottom' | 'float'"'left'"Initial dock position.
defaultState'pinned' | 'auto-hide'"'pinned'"Initial pin state.
defaultState'pinned' | 'auto-hide'"'pinned'"Initial pin state.
defaultSizenumber"260"Initial size in pixels.
defaultSizenumber"260"Initial size in pixels.
minSizenumber"100"Minimum size in pixels during resize.
minSizenumber"100"Minimum size in pixels during resize.
defaultVisibleboolean"true"Whether visible in activity bar on initial render.
defaultVisibleboolean"true"Whether visible in activity bar on initial render.
defaultFloatPosFloatPosInitial position/size for floating: { x, y, width, height }.
defaultFloatPosFloatPosInitial position/size for floating: { x, y, width, height }.
userCanMoveboolean"true"Whether end user can re-dock the panel.
userCanMoveboolean"true"Whether end user can re-dock the panel.
userCanResizeboolean"true"Whether end user can resize the panel.
userCanResizeboolean"true"Whether end user can resize the panel.
userCanCloseboolean"true"Whether end user can close the panel.
userCanCloseboolean"true"Whether end user can close the panel.
userCanTogglePinboolean"true"Whether end user can toggle pin/auto-hide.
userCanTogglePinboolean"true"Whether end user can toggle pin/auto-hide.
Dock panels to left, right, bottom, or let them float freely. Each panel is independently positioned.
Toggle between pinned (always visible, takes layout space) and auto-hide (expands on demand as an overlay).
Drag any panel header to re-dock it to a different edge or float it. Drop zones highlight during drag.
Multiple panels in the same dock position form a tabbed group. Click activity bar icons to switch.
Drag the splitter between any pinned panel and center content. Min/max size constraints are respected.
Detach any panel to float freely. Floating panels are draggable by header and resizable from the corner.
onChange fires on every layout change. Restore any saved state by passing it back via layoutState.
Choose between 'icon' (compact) and 'icon-label' modes for the activity bar.