Skip to content

Context menu

A menu that opens at the pointer on right-click, or from the keyboard with Shift+F10.

CSS + mian.js JSON Markdown Registry item

Right-click area

Right-click here (or focus and press Shift+F10)

Installation

Everything ships in one stylesheet and one small script. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">
<script src="https://mian.ro/dist/mian.js" defer></script>

Prefer to own the files? /r/context-menu.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
[data-mn-context="menu-id"]The area that opens the menu.
mn-menu[popover]The menu: the same markup as the dropdown menu.
mn-context-area-dashedA dashed drop-zone look for demos and canvases.

Accessibility

  • The area is focusable and announces aria-haspopup="menu". Shift+F10 or the Menu key opens it at the area.
  • Menu keyboard support (arrows, Home/End, typeahead, Escape) comes from the dropdown module; focus returns to the area on close.
  • Right-click is not discoverable: offer the same actions elsewhere too.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page