Radial menu Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/radial-menuPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/radial-menu/ with the shared foundation.
Usage
import { RadialMenu } from "@/components/mu/radial-menu/RadialMenu";
const icon = (d: string) => (
<svg viewBox="0 0 24 24" aria-hidden>
<path d={d} />
</svg>
);
<RadialMenu
label="Site"
current={0}
items={[
{ label: "Home", href: "/", icon: icon("M4.5 10.5 12 4l7.5 6.5V19a1 1 0 0 1-1 1H15v-5.5H9V20H5.5a1 1 0 0 1-1-1z") },
{ label: "Pricing", href: "/pricing" },
{ label: "Docs", href: "/docs", onSelect: (e) => { e.preventDefault(); router.push("/docs"); } },
]}
/>Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/radial-menuOptional. An AI agent in your app can read and set this piece by name, and you can ask before anything it can’t undo. The piece itself doesn’t change; installs with your Pro key, like the piece. Built on UI SDK 0.1.0-beta.23, which is in beta too, so this add-on follows its releases.
Source
How it works
Building with an agent? Hand it a ready prompt for this piece.
Input and reduced motion
- Mouse and pen: rest the pointer on the stick and the plate opens (after 90ms, so passing over it does nothing); move onto a place to light it and click to go. It closes 200ms after the pointer has left both the plate and the stick, so crossing between them never flickers. A plate you close (Escape, a second click on the stick, or a choice) stays shut while the pointer is still on it; hover opens it again only after the pointer has left. A plate opened from the keyboard stays open until Escape, Tab out or a click outside. Hover never plays a sound.
- Pointer / touch: press the stick and the plate opens (touch has no hover: a tap opens it). Push toward a place and it lights under your thumb; let go to go. Let go in the middle (within 14px), or off the plate, and it closes without going. A press that doesn't travel is a click: the plate stays open for a click or tap on a place (a click on a plate the hover just opened keeps it open), and a second click on the stick closes it. Places are 64×52 (56×48 on a phone); the stick is 56px.
- Keyboard: Tab to the stick; Enter or Space opens it with focus on the current place. The arrow keys step the light round (wrapping), Home and End jump, Enter goes, and Escape closes and returns focus to the stick. Tab past the last place, or a click outside, closes it too.
- Screen readers: the stick is a button with
aria-expandedandaria-controls(noaria-haspopup: what opens is anav, not a menu); the plate is anavof links named bylabel, and the current page carriesaria-current="page". - Reduced motion: the same states, hover included: the puck and plate swap at once instead of growing, the light jumps to each place, the stick doesn't tilt, and there is no flare.
Props
| Prop | Default | What it does |
|---|---|---|
items | required | 1–6 places | { label, href, icon?, onSelect? }, clockwise from the top; with none it renders nothing. icon is a line icon on the 24-unit box, drawn at 20px above the word (stroke 1.8, currentColor); onSelect(event) runs when the place is chosen |
label | "Menu" | text | the accessible name of the stick and of the nav |
current | 0 | 0 to items.length − 1 (outside it, the nearest place) | where the light rests (the page the visitor is on, aria-current="page"); it moves to each place the visitor chooses, and to a new current whenever you pass one (the router's pathname) |
onCurrentChange | — | (index) => void | called as a person chooses a place other than the current one, before its link is followed |
open | — | true / false | controlled: a change opens or closes the plate (a shortcut key, a tour) |
defaultOpen | false | — | open at first, when open is left out |
onOpenChange | — | (open) => void | called as a person opens or closes it (a press, a hover, a key, a press outside, a chosen place folding it) |
sound | off | true or 0–1 | open, detent and go sounds (see Sound) |
className | — | — | added to the root |
Sound
Off by default. With sound (or a volume, sound={0.5}), the stick tocks when it opens the plate, each place clicks softly as the light reaches it under your thumb or a key, and choosing one snaps like a switch. It never plays on hover, on mount or from a prop change. setMuted(true) from components/mu/sounds.ts silences every cottoncandy item at once.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
A navigation menu that sits under your thumb. One small rubber stick in a spun-metal plate. Press it and up to six engraved places open round it; push toward one and a single amber light runs round the ring to meet it, then let go to go there. Closed, it takes up 56 pixels.
For quick navigation and action menusMore in Controls & forms