Skip to main content
Clever Ops

Dock Tray

Bottom utility dock of icon buttons with restrained proximity magnification, springy, capped at 1.4x, mono label tooltips, and arrow-key navigation that never needs the zoom.

Preview & code

Loading Dock Tray preview

Installation

pnpm dlx shadcn@latest add @cleverui/dock-tray

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { DockTray } from '@/components/ui/dock-tray'
Exampletsx
import { Bell, Home, Search, Settings, SquarePen, User } from 'lucide-react'
import { DockTray } from '@/components/ui/dock-tray'

const items = [
  { label: 'Home', href: '#home', icon: <Home strokeWidth={1.75} /> },
  { label: 'Search', href: '#search', icon: <Search strokeWidth={1.75} /> },
  { label: 'Compose', href: '#compose', icon: <SquarePen strokeWidth={1.75} /> },
  { label: 'Alerts', href: '#alerts', icon: <Bell strokeWidth={1.75} /> },
  { label: 'Profile', href: '#profile', icon: <User strokeWidth={1.75} /> },
  { label: 'Settings', href: '#settings', icon: <Settings strokeWidth={1.75} /> },
]

export default function DockTrayDemo() {
  return (
    <div className="relative mx-auto min-h-[420px] max-w-3xl px-4 py-12 sm:px-6">
      <div className="mx-auto max-w-md text-center">
        <p className="text-muted-foreground font-mono text-[11px] uppercase tracking-[0.2em] sm:text-xs">
          Atlas workspace
        </p>
        <h2 className="text-foreground mt-3 text-balance text-2xl font-semibold tracking-tight sm:text-3xl">
          Six destinations. One restrained dock.
        </h2>
        <p className="text-muted-foreground mt-3 text-sm leading-relaxed">
          Hover to magnify, arrow keys to move, labels and the accent mark stay
          available either way.
        </p>
      </div>

      <div className="pointer-events-none absolute inset-x-0 bottom-8 flex justify-center sm:bottom-10">
        <div className="pointer-events-auto">
          <DockTray items={items} ariaLabel="Atlas utility dock" />
        </div>
      </div>
    </div>
  )
}

The example itself also uses lucide-react , install it too if you copy the example as-is (the component itself does not need it).

API reference

DockTray accepts the following props.

PropTypeDefaultDescription
items*DockTrayItem[]4–7 utility destinations
ariaLabelstring'Utility dock'accessible name for the nav landmark
magnificationnumber1.35peak scale under the pointer, hard-clamped to 1.4

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface DockTrayItem {
  label: string
  href: string
  icon: React.ReactNode
}

Frequently asked questions

How do I install the Dock Tray component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/dock-tray`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Dock Tray require?

Dock Tray uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Dock Tray to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services