Modus UI

Dock

Web (React)

A highly interactive macOS-style dock that magnifies items on hover.

A beautiful icon dock. Built with Framer Motion, it applies complex physics interpolation to surrounding icons, smoothly magnifying them as the cursor approaches to create a realistic macOS dock effect.

Installation

CLI

npx @modus-ui/cli add dock

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/dock.tsx.
  3. Paste the code.

Usage

tsx
import { Dock, DockItem } from "@/components/ui/dock";
import { Home, Settings } from "lucide-react";

export default function Example() {
  return (
    <Dock>
      <DockItem label="Home" href="/">
        <Home />
      </DockItem>
      <DockItem label="Settings" href="/settings">
        <Settings />
      </DockItem>
    </Dock>
  );
}

Props

PropTypeDefaultDescription
childrenReactNode-The DockItem components.
sizenumber44Resting size of each item, in pixels.
magnificationnumber76Size an item reaches directly under the pointer.
reachnumber130How far, in pixels, the magnification reaches.
classNamestring""-

Comments

  • No comments yet.