Dock Panel

Collapsible edge-docked inspector with a kit scrollbar body.

Installation

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

Add dock-panel (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main 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.

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. Panel content is unrestricted.

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.
…div attributesHTMLAttributes-Native div attributes on the rail root.

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 collapse and expand controls when title or subtitle is not a string.
collapseIconReactNode-Icon for the collapse control. Defaults to PanelLeft.
expandIconReactNode-Icon for the collapsed expand control. Defaults to collapseIcon, then PanelLeft.
collapseLabelstring-Accessible name for the collapse control. Defaults to 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.
…aside attributesHTMLAttributes-Native aside attributes on the panel root.

DockPanelHeader

Header row for compound composition.

PropTypeDefaultNotes
childrenReactNode-Typically heading text and DockPanelCollapseTrigger.
classNamestring-Additional classes on the header.
…div attributesHTMLAttributes-Native div attributes on the header.

DockPanelTitle

Eyebrow label in the header.

PropTypeDefaultNotes
childrenReactNode-Eyebrow text.
classNamestring-Additional classes on the title.
…p attributesHTMLAttributes-Native paragraph attributes.

DockPanelSubtitle

Primary heading in the header.

PropTypeDefaultNotes
childrenReactNode-Heading text.
classNamestring-Additional classes on the subtitle.
…p attributesHTMLAttributes-Native paragraph attributes.

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.
…button attributesButtonHTMLAttributes-Native button attributes (onClick, aria-label, title, and others).

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.
…button attributesButtonHTMLAttributes-Native button attributes (onClick, aria-label, title, and others).

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.
…div attributesHTMLAttributes-Native div attributes 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.