Skip to content
Haze UI

Marking menu

Spacious gesture stage with a live active-view header, press-and-hold or flick radial wheel, wedge highlight and keyboard menu trigger.

pnpm dlx shadcn@latest add @haze/marking-menu
Open preview in a new tab
Livesmall script

When to use

  • Canvas, workspace or reader stages benefit from fast press-and-hold or flick directional navigation
  • Four to eight frequent destinations or actions need equal radial distance from the pointer anchor

When not to use

  • Actions exceed eight items or require nested submenus; use context-menu or dropdown-menu
  • Commands belong to a standard toolbar button rather than an interactive gesture stage

Installation

Add the Haze registry to components.json once, then install Marking menu with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/marking-menu
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
id*string–Unique prefix connecting the stage, header menu button, live status and radial popover.
items{ label: string; value?: string; href?: string; shortcut?: string; icon?: string; destructive?: boolean }[]6 navigation viewsFour to eight directional actions arranged clockwise from north.
labelstring"Gesture navigation stage"Accessible name of the press-and-hold gesture region.
triggerLabelstring"Menu"Visible label for the top-right keyboard-focusable menu trigger.
hintstring"Press and hold anywhere, or flick"Primary instructional copy centered inside the default gesture stage.
subhintstring"Right-click opens it too"Muted helper subtitle shown beneath the primary instruction copy.
holdMsnumber180Press-and-hold duration in milliseconds before opening the radial wheel.
classstring–Additional classes on the outer stage card.

Keyboard interactions

EnterSpaceShiftF10
Open the radial menu centered in the stage from the gesture surface or Menu button
Arrow keys
Step clockwise or counter-clockwise around the directional nodes
HomeEnd
Jump to the first or last radial item
Escape
Close the radial menu and restore focus to the opener

Accessibility

  • Provides a keyboard-focusable Menu button in the stage header using native popovertarget so every item stays reachable without pointer gestures or scripts.
  • Without scripts, clicking Menu opens the native popover as a structured vertical list with icons and shortcut hints.
  • Updates the visible active view chip and announces selection changes via an aria-live polite status region, restoring focus on Escape.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Marking menu" with `npx shadcn@latest add @haze/marking-menu`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import MarkingMenu from "@/components/haze/ui/marking-menu.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/marking-menu.md

  • Customize with real content

    Adapt the Haze marking-menu ui for our product. Replace the demo values of these props with our real content: id, items, label, triggerLabel, hint, subhint, holdMs, class. Keep the layout, the heading level rules and these accessibility details: Provides a keyboard-focusable Menu button in the stage header using native popovertarget so every item stays reachable without pointer gestures or scripts. Without scripts, clicking Menu opens the native popover as a structured vertical list with icons and shortcut hints. Updates the visible active view chip and announces selection changes via an aria-live polite status region, restoring focus on Escape. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using marking-menu, check it fits: use it when canvas, workspace or reader stages benefit from fast press-and-hold or flick directional navigation; four to eight frequent destinations or actions need equal radial distance from the pointer anchor. Avoid it when actions exceed eight items or require nested submenus; use context-menu or dropdown-menu; commands belong to a standard toolbar button rather than an interactive gesture stage. Alternatives: @haze/context-menu, @haze/dropdown-menu.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog