Magnify Dock

A dock whose icons swell as the cursor glides over them.

no dependenciesMIT · free

Installation

npx shadcn@latest add https://ombakui.com/r/magnify-dock.json

Usage

import { MagnifyDock } from "@/components/magnify-dock";

<MagnifyDock
  items={[
    { label: "Home", icon: <HomeIcon />, href: "/" },
    { label: "Search", icon: <SearchIcon />, onClick: openSearch },
  ]}
/>

Props

PropTypeDefaultDescription
items*DockItem[]–The dock items.
sizenumber44Resting item size in px.
magnifiednumber76Size of the item right under the cursor in px.
rangenumber140How far (px) the magnification spreads to neighbours.
classNamestring–
itemClassNamestring–Classes for each item, e.g. colors.