Nexus floating dock, animated React component
A macOS-style dock: tiles swell under the pointer and push their neighbours aside on springs, a tooltip names each one, and a click bounces the tile like a launching app before a running dot slides under it. Below md it turns into one glass button that springs the tiles up as a stack.
- Free
- Navbars
- Hover
- Spring
Like Nexus floating dock? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Nexus floating dock stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| items | FloatingDockItem[] | — | Tiles: { title, icon, href, tint?, badge? }. tint is any CSS colour or gradient; with it the icon turns white. |
| position | "fixed" | "inline" | "fixed" | fixed pins the dock to the bottom of the viewport; inline renders it where you place it. Both switch to the compact menu below md. |
| activeHref | string | — | Href of the item that gets the running dot. Defaults to matching the current pathname. |
| onSelect | (item: FloatingDockItem) => void | — | Called with the item when a tile is clicked. |
| disableLinks | boolean | false | Render tiles as buttons instead of links, for in-app actions. |
| autoplay | boolean | false | Sweeps an invisible pointer across the dock and bounces a tile until someone points at it. |
| desktopClassName | string | — | Extra classes on the desktop dock wrapper. |
| mobileClassName | string | — | Extra classes on the mobile menu wrapper. |
Add it to your project
- 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 createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/floating-dock
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/floating-dock.tsxfloating-dock/floating-dock-desktop.tsxfloating-dock-mobile.tsxfloating-dock.tsxicon-container.tsxindex.tstypes.ts - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion lucide-react
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { FloatingDock } from "@/components/floating-dock"; export default function Page() { return ( <main> <FloatingDock /> </main> ); }
Like Nexus floating dock? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Nexus floating dock stays free.
About Nexus floating dock
The Floating Dock is a macOS-style icon bar with magnification spring physics that scales icons based on cursor proximity. As the cursor approaches an icon, it magnifies using Framer Motion spring interpolation, while adjacent icons scale proportionally — the same effect Apple uses in macOS. The dock floats above page content with glass morphism styling. Use it in product demos to showcase a polished navigation metaphor, or as actual application navigation.
Good for
- App navigation bars
- macOS-style product demos
- Portfolio and creative portfolio navigation
- Interactive landing page elements