A radial context menu web component
Long-press and drag to select — or click to open
Playground
Adjust the radius, accent color, and item count. The component updates in real time.
Use Cases
The same component adapts to different interaction contexts: file management, media playback, and navigation.
File Actions
Media Controls
Quick Nav
OVERDRIVE
Particle physics, SVG displacement filters, and spatial choreography. Click to activate.
API
Attributes, events, and CSS custom properties for theming.
| Name | Default | Description |
|---|---|---|
radius | 105 | Distance from center to items in pixels |
| Name | Detail |
|---|---|
vp-pie-select |
{ action, icon, ...dataAttrs, element }Bubbles. Passes through all data-* attributes from the source button. |
| Property | Default | Purpose |
|---|---|---|
--vp-accent | #f97316 | Primary accent color (stems, center, selection flash) |
--vp-accent-rgb | 249, 115, 22 | Accent as RGB triplet for rgba() usage |
--vp-overlay-bg | rgba(12,10,9,0.8) | Overlay backdrop color |
--vp-panel-bg | rgba(28,25,23,0.95) | Item panel background |
--vp-panel-border | rgba(68,64,60,0.6) | Item panel border |
--vp-text | #fafaf9 | Item text color |
--vp-stem-color | rgba(accent, 0.45) | Stem line rest state |
--vp-stem-active-color | rgba(accent, 0.85) | Stem line when item is focused/hovered |
Code
Three patterns: basic usage, event handling, and theming.
<vp-pie-menu radius="105"> <button>Open menu</button> <menu class="vp-pie-menu-items"> <li><button data-action="Edit" data-icon="edit">Edit</button></li> <li><button data-action="Share" data-icon="share">Share</button></li> </menu> </vp-pie-menu>
// Listen for selections document.querySelector('vp-pie-menu') .addEventListener('vp-pie-select', (e) => { console.log(e.detail.action); // "Edit" console.log(e.detail.icon); // "edit" // All data-* attrs pass through: // e.detail.dataId, e.detail.dataUrl, etc. });
/* Override accent and colors via CSS custom properties */ vp-pie-menu { --vp-accent: #3b82f6; --vp-accent-rgb: 59, 130, 246; --vp-panel-bg: rgba(15, 23, 42, 0.95); --vp-panel-border: rgba(59, 130, 246, 0.4); --vp-text: #f1f5f9; }