Kinetic UI
Back to Introduction
Navigation

Dock

A fluid, interactive macOS-style dock navigation that dynamically magnifies items on hover.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add dock

The Dock component brings the classic macOS navigation experience to the web. Built entirely with Framer Motion's useMotionValue and useTransform hooks, it tracks the user's cursor distance to smoothly scale up items and gently push adjacent items away. It's perfect for fixed global navigation or sticky sub-menus.

Live Preview

Dock Menu

DockItem Props

PropTypeDefaultDescription
labelstring—Tooltip text to display above the item on hover.
hrefstring—If provided, renders the item as an anchor tag `<a>`.
onClick() => void—Click handler function.
childrenReactNodeRequiredThe icon or content of the item.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { Dock } from "@/components/creative/dock";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { Dock } from "@/components/creative/dock";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <Dock
        variant{/* value */}
        backgroundColor="example"
      >
        <div>Content goes here</div>
      </Dock>
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.