clickworks
Works / Navigation

Multitool Menu

The menu button has a small pearl rivet. Open it and the links swing out as plates, one after another, clicking into place with a slight overshoot. Hover a plate and it slides out along its length. Pick one and the plates fold home and draw back into the button, the chosen one last.

Free5 files0 dependencies5.0 kB gzippedRenders on the serverKeyboard and screen reader

Install

npx shadcn@latest add https://clickworks.dev/r/multitool-menu.json

The files land in components/clickworks/multitool-menu/. No other packages are added.

Usage

import { MultitoolMenu } from "@/components/clickworks/multitool-menu/react/MultitoolMenu"

export function Nav() {
  return (
    <MultitoolMenu
      items={[
        { label: "Work", href: "/work" },
        { label: "Services", href: "/services" },
        { label: "About", href: "/about" },
        { label: "Journal", href: "/journal" },
        { label: "Contact", href: "/contact" },
      ]}
    />
  )
}

Props

items
{ label, href?, target?, rel? }[]

The links, in order. Five reads best.

label
string

Button text.

Default "Menu"

finish
"pearl" | "ink" | "glass"

White plates with a pearl rim, dark plates, or frosted plates for use over photos.

Default "pearl"

theme
"light" | "dark" | "auto"

Picks the pearl finish in light and the ink finish in dark. Auto follows the page, then the device.

side
"left" | "right"

Which way the plates fan out. Left suits a button on the right of the nav.

Default "left"

length
number

Plate length in px from the rivet. Shortens itself on narrow screens.

Default 252

plateHeight
number

Plate height in px.

Default 38

startAngle
number

Angle of the first plate, in degrees below the button line.

Default 12

spread
number

Degrees between plates.

Default 12

open
boolean

Controlled open state. Leave it out and the menu manages itself.

Events

onSelect
(detail: { index, label, href }, event) => void | boolean

A link was picked. Return false to stop navigation, for client-side routing. The menu closes either way.

onOpenChange
(open: boolean) => void

The menu opened or closed.

Styling

Set these custom properties on the component or any parent. Every shade and shadow is mixed from them, so any palette still looks lit.

--mt-button-bg#17171A
--mt-button-text#F5F5F3
--mt-plate-bg#FFFFFF
--mt-plate-text#141416
--mt-rim#DADDE4
--mt-shadow30 45 80
--mt-button-radius14px
--mt-fontinherit

Behaviour and accessibility

  • Every link closes the menu. So do Escape, a click outside and tabbing out.
  • Enter or Space opens it and focuses the first link. Arrow keys move between links, Home and End jump to the ends, Escape closes and returns focus to the button.
  • Touch has no hover state: a tap picks.
  • With reduced motion the menu appears and disappears without moving.

Files

react/MultitoolMenu.tsxReact component
element/index.tsCustom element
element/multitool-menu-element.tsCustom element
core/engine.tsEngine
core/styles.tsEngine