byronwade/ui
Application UI

Morph · Application UI

MorphDock

A config-driven morphing navigation dock. The item row morphs compact ↔ full, and the whole pill blooms in place into a consumer-provided panel via useChromeMorph, items, badges, core/pinned flags, a trailing cluster, and a contextual action. Pure --dock tokens, reduced-motion + Esc + click-away.

@byronwade/foundation@byronwade/utils@byronwade/use-chrome-morph@phosphor-icons/react

Feature showcase

Installation

Features

  • Config-driven navigation

    Items, pinned items, tools, breadcrumbs, badges, and actions are all driven from typed config.

  • Morphing panel surface

    Uses useChromeMorph to bloom the dock into a consumer-provided panel with controlled state support.

  • Advanced chrome states

    Supports status overlays, save actions, draggable panels, resizable panels, placements, and tones.

API

Props

PropTypeDefaultDescription
itemsMorphDockItem[]-Nav items: id, label, icon, optional onSelect/href, active, core, pinned, badge, group (a seam is drawn between adjacent items of differing groups).
expandablebooleantrueAllow compact ↔ full toggling via a chevron button.
clusterReact.ReactNode-Custom trailing slot (count + badge, env tag, search button…).
action{ label; icon; onSelect? }-Contextual action pill, blooms the panel when children are present, else runs onSelect.
toolsMorphDockAction[]-Trailing two-tone tool zone (bg-dock-tool), a combined nav + toolbar pill. Actions: id, label, icon, onSelect?/href?, primary (brand fill), group (seam between groups).
breadcrumb{ label: string; href?: string }[]-Leading crumb trail; the last crumb is the current page (aria-current).
statusMorphDockStatus | null-A save/validation outcome the panel blooms into (success/error/info). Success/info auto-dismiss; errors persist.
onStatusDismiss() => void-Called when the status is dismissed, auto for success/info, or via its close button.
statusDismissMsnumber4000Auto-dismiss delay (ms) for success/info status. Errors never auto-dismiss.
tone"dock" | "surface""dock"Dark dock pill (default) or light surface.
navLabelstring"Primary"Accessible name for the nav landmark.
openboolean-Controlled morph open state.
onOpenChange(open: boolean) => void-Open-state change callback.
childrenReact.ReactNode-The panel the dock morphs into.
panelTitleReact.ReactNode-Title shown in the panel header (alongside the drag handle / close / save chrome).
onSave() => void-Renders a Save button in the panel header when provided.
panelWidthnumber360Open-panel width in px.
panelHeightnumber-Open-panel height in px. Omit to size to content (bloom-down).
growHeightbooleantrueBloom width + height (default) or width-only.
placement"top" | "bottom" | "left" | "right""bottom"Which way the panel blooms from the bar.
origin"start" | "center" | "end""start"Where along the dock the panel grows from, a centered dock blooms symmetrically with "center".
draggablebooleanfalseDetach the open panel and drag it free by its handle (flies home on close).
resizablebooleanfalseShow a corner grip to resize the open panel; the morph box follows live.
barebooleanfalseDrop the resting pill background/shadow, items float free until a panel blooms (the panel keeps its surface).

Exports

ExportKindDescription
MorphDockcomponentMorphing navigation dock and panel component.
MorphDockItemtypeConfiguration object for a primary dock item.
MorphDockActiontypeConfiguration object for action/tool items.
MorphDockPropstypePublic props for the MorphDock component.

Slots

SlotElementDescription
morph-dock-breadcrumb-Breadcrumb trail rendered before the dock nav.
morph-dock-tools-Trailing tool zone inside the dock pill.
morph-dock-seam-Visual separator between item or tool groups.

CSS Variables

VariableDefaultDescription
--dock-Dock surface token used by the resting pill.
--dock-tool-Tool-zone surface token.
--dock-active-Active dock item token.

Dependencies

PackageKindDescription
@byronwade/foundationregistryInstalled through the byronwade/ui registry.
@byronwade/utilsregistryInstalled through the byronwade/ui registry.
@byronwade/use-chrome-morphregistryInstalled through the byronwade/ui registry.
@phosphor-icons/reactnpmInstalled from npm.

Source and related

FilePath
Componentregistry/ui/morph-dock.tsx
Default examplecontent/examples/morph-dock/default.tsx
Draggable examplecontent/examples/morph-dock/draggable.tsx
Resizable examplecontent/examples/morph-dock/resizable.tsx