Calm motion: animations on this site only fade, with no movement
RadialMenu
Press-and-hold or right-click radial menu
A short ring of actions that appears where you pressed: a few well-known choices, reached by direction instead of reading a list. Keep it to three to eight actions and never make it the only way to do something. For longer or nested commands, use a ContextMenu.
Basic
Right-click here, or touch and hold, or focus and press the menu key
chose: nothing yet
vue
<template>
<div class="col" style="max-width: 420px">
<BlessRadialMenu :items label="Message actions" @select="last = $event.label">
<div
tabindex="0"
style="
padding: 2.5rem 1rem;
text-align: center;
border: 1px dashed var(--bless-color-border);
"
>
Right-click here, or touch and hold, or focus and press the menu key
</div>
</BlessRadialMenu>
<small>chose: {{ last }}</small>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { BlessRadialMenu } from "blessing-ui";
const items = [
{ id: "reply", label: "Reply", icon: "↩" },
{ id: "like", label: "Like", icon: "♥" },
{ id: "pin", label: "Pin", icon: "⚑" },
{ id: "delete", label: "Delete", icon: "✕", disabled: true },
{ id: "share", label: "Share", icon: "⇪" },
];
const last = ref("nothing yet");
</script>- Wrap the area it belongs to. It opens on right-click, on a long touch (
holdMs, default 450 ms), and from the keyboard with the menu key or Shift+F10. From the keyboard, it opens at the focused element. A touch that moves more than 8 px is a scroll, not a hold. - Buttons sit on a circle (
radius, 84 px by default) from the top, clockwise. The menu is kept on screen: near an edge the whole ring shifts inward. - With a mouse, click a button. With a finger, keep it down after the menu opens and slide toward a button: the wedge you point at lights up and its name shows in the center. let go to choose, or lift inside the center to leave the ring open and tap.
- Keyboard: focus starts on the first action. ↑ ↓ ← → move (wrapping, skipping disabled ones), Home and End jump, Enter or Space choose, Esc closes and puts focus back.
selectfires with the item.v-model:openmirrors the state.#item="{ item, index }"draws a button's face. By default it isicon, or the label's first letter. Each button keeps its fulllabelas its name for screen readers.- Mouse-only or touch-only features are not required: everything reachable by pointer has the keyboard route above.
Usage
ts
import { BlessRadialMenu } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
items* | T[] | — | |
radius | number | 84 | distance from the centre to the buttons, in px |
holdMs | number | 450 | how long a touch has to stay down to open it, in ms |
disabled | boolean | — | |
label | string | "Actions" | |
open | boolean | false |
Events
| Name | Payload | Description |
|---|---|---|
select | [item: T] | |
update:open | [value: boolean] |
Slots
| Name | Scope | Description |
|---|---|---|
default | — | |
item | { item: T; index: number; } |