Command Dock

PreviousNext

Smart macOS-style dock with contextual actions, proximity magnification, and spring motion.

Smart dock

Contextual actions

Open Command Center

Ready for action

Live

Open Command Center

Jump into fuzzy search, recent files, and workflow shortcuts from one adaptive surface.

Installation

pnpm dlx shadcn@latest add https://matos-ui.com/r/command-dock.json

Usage

import {
  CommandDock,
  type CommandDockAction
} from '@/components/matos-ui/command-dock'
const actions: CommandDockAction[] = [
  {
    id: 'command',
    label: 'Open Command Center',
    description: 'Jump into search, recent files, and workflow shortcuts.',
    icon: <Command className="size-5" aria-hidden />,
    shortcut: 'Cmd K',
    tone: 'primary'
  },
  {
    id: 'share',
    label: 'Share Update',
    description: 'Compose a concise status update from the current context.',
    icon: <MessageSquareText className="size-5" aria-hidden />
  }
]

;<CommandDock
  actions={actions}
  defaultActiveId="command"
  panelTitle="Ready for action"
  onSelect={(action) => console.log(action.id)}
/>

Reference

CommandDock Props

PropTypeDefaultDescription
actionsCommandDockAction[]-Actions displayed in the dock.
activeIdstringundefinedControlled selected action id.
defaultActiveIdstringFirst action idInitial selected action for uncontrolled use.
onSelect(action: CommandDockAction) => voidundefinedCalled when an enabled action is selected.
panelTitlestring"Command ready"Small label shown in the contextual panel.
panelDescriptionstring"Select an action to reveal contextual controls."Fallback description for actions.
ariaLabelstring"Command dock"Accessible label for the dock toolbar.
showPanelbooleantrueShows or hides the contextual panel.
size"sm" | "md" | "lg""md"Dock and icon sizing.
align"start" | "center" | "end""center"Horizontal alignment of the component.

CommandDockAction

FieldTypeDescription
idstringUnique action identifier.
labelstringAccessible label and panel heading.
iconReactNodeIcon rendered inside the dock item.
descriptionstring?Contextual panel copy.
badgestring?Optional panel badge.
shortcutstring?Optional keyboard shortcut hint.
tone"default" | "primary" | "success" | "warning" | "danger"Visual tone for the icon.
disabledboolean?Disables selection and lowers opacity.

Also exported: commandDockVariants, CommandDockProps, and CommandDockAction.