Dock Panel

Collapsible edge-docked inspector with a kit scrollbar body. Prefer this for persistent side chrome; prefer Options Panel for anchored temporary controls.

Also known as: side panel, side drawer, edge drawer, inspector, inspector panel, edge panel, docked inspector, collapsible inspector

Installation

Install with the CLI, or copy the component source into your project.

Add dock-panel (npm)

npx --yes -p @default-file/ui df-ui add dock-panel

Single dock

One edge-docked panel with custom collapse and expand icons. Body content is unrestricted.

Multiple docks

Two panels in a rail. Each panel collapses independently.

Dismissible

Temporary tune panel. Closing removes it from the rail instead of collapsing to an expand chip. The header control defaults to a close icon.

Header visibility

Hide the eyebrow with titleVisible, or the heading with subtitleVisible. The remaining line centers with the collapse control.

Properties

Collapsible edge-docked inspector. Compose a rail of panels with optional header text, custom icons, and a body that owns the kit ScrollArea. Prefer this for persistent side chrome; prefer Options Panel for anchored temporary controls. Use dismissible for temporary tune panels that leave the rail when closed.

DockPanelRail

Layout container for one or more DockPanel instances. Stacks vertically below xl and sits in a row at xl and up.

PropTypeDefaultNotes
childrenReactNode-One or more DockPanel children.
classNamestring-Additional classes on the rail.

DockPanel

Root panel. Pass title and subtitle for a convenience header, or compose Header, Body, and Footer manually.

PropTypeDefaultNotes
openboolean-Controlled open state.
defaultOpenbooleantrueInitial open state when uncontrolled.
onOpenChange(open: boolean) => void-Called when the open state changes.
size"sm" | "md" | "lg" | "xl""md"Expanded width at xl and up. Maps to --df-dock-width-* tokens.
mobileMaxHeight"sm" | "md" | "lg""lg"Open max-height below xl. Maps to --df-dock-mobile-max-height-* tokens.
titleReactNode-Eyebrow label in the convenience header. When title or subtitle is set, children render inside DockPanelBody.
subtitleReactNode-Primary heading in the convenience header.
titleVisiblebooleantrueShow the eyebrow title. When false, the subtitle centers with the collapse control.
subtitleVisiblebooleantrueShow the primary heading. When false, the title centers with the collapse control.
labelstring-Accessible name for the aside landmark (aria-label) and for collapse or dismiss controls. Falls back to a string title or subtitle, then a catalogue default.
dismissiblebooleanfalseWhen true, closing removes the panel from the rail instead of showing the collapsed expand chip. Defaults the header control to a close icon and Close {label}. Use for temporary tune panels opened from another surface.
collapseIconReactNode-Icon for the collapse or dismiss control. Defaults to X when dismissible, otherwise PanelLeft.
expandIconReactNode-Icon for the collapsed expand control. Defaults to collapseIcon, then PanelLeft. Ignored when dismissible, because closed panels leave the rail.
collapseLabelstring-Accessible name for the collapse or dismiss control. Defaults to Close {label} when dismissible, otherwise Collapse {label}.
expandLabelstring-Accessible name for the expand control. Defaults to Expand {label}.
collapsedLabelVisiblebooleantrueShow the text label on the collapsed rail. When false, only the icon chip is shown.
collapsedAlign"start" | "center""start"Placement of the expand control on the collapsed rail. start aligns to the top at xl, or the leading edge below xl. center places it in the middle.
variant"default" | "edge""default"ScrollArea thumb style on the convenience DockPanelBody. Use edge with side left for a thin thumb on the panel leading border.
side"left" | "right" | "top" | "bottom"-ScrollArea thumb placement on the convenience DockPanelBody.
thumbShape"rounded" | "flat""rounded"ScrollArea thumb shape on the convenience DockPanelBody.
visibility"hover" | "always""hover"ScrollArea thumb visibility on the convenience DockPanelBody.
space"auto" | "none""none"ScrollArea track inset on the convenience DockPanelBody. none overlays the thumb with no reserved gutter.
orientation"vertical" | "horizontal" | "both""vertical"ScrollArea axes on the convenience DockPanelBody.
widthnumber-ScrollArea scrollbar thickness in pixels on the convenience DockPanelBody.
viewportClassNamestring-Classes on the ScrollArea viewport inside the convenience DockPanelBody.
childrenReactNode-Panel content. With a convenience header, children fill DockPanelBody. Otherwise compose Header, Body, and Footer as needed.
classNamestring-Additional classes on the panel root.

DockPanelHeader

Header row for compound composition.

PropTypeDefaultNotes
childrenReactNode-Typically heading text and DockPanelCollapseTrigger.
classNamestring-Additional classes on the header.

DockPanelTitle

Eyebrow label in the header.

PropTypeDefaultNotes
childrenReactNode-Eyebrow text.
classNamestring-Additional classes on the title.

DockPanelSubtitle

Primary heading in the header.

PropTypeDefaultNotes
childrenReactNode-Heading text.
classNamestring-Additional classes on the subtitle.

DockPanelCollapseTrigger

Control that collapses an open panel.

PropTypeDefaultNotes
iconReactNode-Icon for this trigger. Overrides collapseIcon from the root.
childrenReactNode-Custom trigger content. Replaces the default icon when set.
classNamestring-Additional classes on the trigger.

DockPanelExpandTrigger

Control shown when the panel is collapsed.

PropTypeDefaultNotes
iconReactNode-Icon for the expand chip. Overrides expandIcon from the root.
labelReactNode-Visible label on the collapsed rail.
showLabelboolean-Show or hide the collapsed label for this trigger. Overrides collapsedLabelVisible from the root.
childrenReactNode-Custom trigger content. Replaces the default chip and label layout when set.
classNamestring-Additional classes on the trigger.

DockPanelBody

Expanded content region. Always wraps children in the kit ScrollArea. Do not nest another ScrollArea inside.

PropTypeDefaultNotes
childrenReactNode-Panel content.
space"auto" | "none""none"ScrollArea track inset. none overlays the thumb with no reserved gutter. auto reserves inset when that axis overflows.
variant"default" | "edge""default"Passed through to ScrollArea.
thumbShape"rounded" | "flat""rounded"Passed through to ScrollArea.
orientation"vertical" | "horizontal" | "both""vertical"Passed through to ScrollArea.
side"left" | "right" | "top" | "bottom"-Passed through to ScrollArea.
visibility"hover" | "always""hover"Passed through to ScrollArea.
widthnumber-Passed through to ScrollArea as scrollbar thickness in pixels.
viewportClassNamestring-Classes on the ScrollArea viewport.
classNamestring-Additional classes on the body shell.

Tokens

Theme defaults live on :root. Override these globally or on a local host.

TokenTypeDefaultNotes
--df-dock-width-smCSS length252pxExpanded width for size sm.
--df-dock-width-mdCSS length280pxExpanded width for size md.
--df-dock-width-lgCSS length300pxExpanded width for size lg.
--df-dock-width-xlCSS length420pxExpanded width for size xl.
--df-dock-collapsed-sizeCSS lengthcalc(12 * var(--spacing-unit))Collapsed rail width and mobile collapsed height.
--df-dock-mobile-max-height-smCSS length38vhOpen max-height below xl for mobileMaxHeight sm.
--df-dock-mobile-max-height-mdCSS length42vhOpen max-height below xl for mobileMaxHeight md.
--df-dock-mobile-max-height-lgCSS length46vhOpen max-height below xl for mobileMaxHeight lg.
--df-shadow-dock-chipCSS box-shadow0 1px 2px rgb(0 0 0 / 0.04)Shadow on the collapsed expand chip.