Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Magnify Dock, animated React component

A macOS-style app dock: icons swell as the pointer passes over them, show a label above, bounce when launched and keep a running dot underneath.

  • Pro
  • Navbars
  • Hover
  • Spring

Props

PropTypeDefaultWhat it does
appsApple Intelligence, Maps, Music, TV, Claude, ChromeEach app has id, label, icon (an image URL of the finished app icon), and bg (any CSS background) and glyph (an icon) for the tile that shows when there is no icon or it fails to load.
autoplayfalseSweeps an invisible pointer across the dock until someone hovers it.
baseSize46Resting size of every icon in px, 32 to 64.
maxSize76Size of the icon right under the pointer in px, up to 104. It never goes below baseSize.
reach150How far from the pointer, in px, icons still swell, 40 to 320. A small reach magnifies one icon, a large one lifts a whole group.
gap10Space between icons in px, 0 to 28.
stiffness320How firmly icons spring to their new size, 100 to 800. Higher is snappier.
showLabelstrueShows the app's name above it while it is hovered or focused.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry with your API key

    Magnify Dock is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and add this entry inside the outermost braces, next to "aliases". Leave {name} and ${NEXUS_API_KEY} exactly as written; the CLI fills them in:
      "registries": {
        "@nexus-labs": {
          "url": "https://www.nexus-ui.com/api/registry/{name}",
          "headers": {
            "Authorization": "Bearer ${NEXUS_API_KEY}"
          }
        }
      }

Magnify Dock questions

How do I install Magnify Dock?

Run `npx shadcn@latest add @nexus-labs/magnify-dock`. It installs framer-motion. Magnify Dock is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).

How do I set my own icons?

Pass `apps` as an array of `DockApp`: `id`, `label`, `bg` (any CSS background) and `glyph` (any React node). Without it you get seven sample apps, from Home to Settings.

How do I change how much the icons grow?

It is not a prop. Edit the constants at the top of the file: `BASE` (46) is the resting size in px, `MAX` (76) the largest size, and `RANGE` (150) how far from the pointer the swelling reaches.

What happens when I click an icon, and can I run my own code?

The icon bounces and a dot appears under it, with Home marked as running from the start. There is no click callback prop, so to run your own action edit the `onLaunch` handler in the source.

Does it work with the keyboard?

Icons are buttons inside a `role="toolbar"` named "Dock", with a visible focus outline, and focusing one shows its label. The swelling follows the pointer only, so keyboard users see no magnification.

Guides