Skip to content

Radial Menu

Actions fan out around a central trigger.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import RadialMenu from "./RadialMenu";
export default function Example() {
return (
<RadialMenu
items={[
{
"id": "create",
"label": "Create",
"icon": "+"
},
{
"id": "share",
"label": "Share",
"icon": "↗"
},
{
"id": "save",
"label": "Save",
"icon": "◇"
},
{
"id": "edit",
"label": "Edit",
"icon": "⌘"
}
]}
defaultOpen={true}
radius={86}
startAngle={-90}
sweepAngle={360}
buttonSize={46}
accentColor={"#e1d1f3"}
itemBackground={"#2c2635"}
/>
);
}

Using Radial Menu

Supply labelled actions through items and choose a radius that leaves room around the trigger. startAngle and sweepAngle define the fan's direction.

Use open and onOpenChange for external state, and onSelect to handle actions. Keep the accessible label meaningful when the trigger contains only an icon.

Props

NameTypeRequiredDefaultDescription
itemsobject[]No[]Array of { id, label, icon? }. Icons can be React nodes. Empty arrays render nothing.
openbooleanNoundefinedOptional controlled expanded state.
defaultOpenbooleanNofalseInitial expanded state when uncontrolled.
onOpenChangefunctionNoundefinedCalled with the requested expanded state.
onSelectfunctionNoundefinedCalled with (item, index) when an action is selected.
radiusnumberNo90Distance from the trigger to each action in pixels.
startAnglestringNo-90Angle of the first action in degrees.
sweepAnglenumberNo360Arc covered by the actions. 360 distributes them around a full circle.
buttonSizenumberNo48Diameter of each button in pixels.
accentColorstringNo"#e1d1f3"Central trigger colour.
itemBackgroundstringNo"#2c2635"Action button background colour.
labelstringNo"Toggle actions"Accessible trigger label.
triggerIconReactNodeNoundefinedOptional React node for the trigger icon.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

Pagination Rail

Navigation

A raised selection moves through a compact row of numbered page controls.

Layered chevron tabs create a compact trail with a distinct current page.

Folding Menu

Navigation

Numbered navigation panels unfold beneath a compact, tactile trigger.

Path Stepper

Navigation

Numbered stops connect into a clean vertical route with completed and current states.