About this set
A dark context menu for file lists, canvases and editors. Right-clicking inside the dashed area opens a 230 pixel menu at the pointer with Copy, Cut, Paste, Rename, Move to and a red Delete, grouped by separators and showing shortcut hints on the right. Because a right-click alone would shut out keyboard and touch users, the area is focusable and the menu also opens with Shift+F10 or the Menu key, and after a half-second long-press on touch screens. The menu follows the WAI-ARIA menu pattern: it has role=”menu” with menuitem buttons, focus moves to the first item on open, the arrow keys move between items, Home and End jump to either end, and Esc or Tab closes it and returns focus to the area. The position is clamped so the menu never spills off the edge of the viewport. The Bootstrap version uses .dropdown-menu-dark and .dropdown-item for the look with the same short script, because Bootstrap’s Dropdown plugin needs a toggle button. The Tailwind version uses utility classes and a small @keyframes pop.
What’s included
- Opens at the pointer, clamped inside the viewport
- Keyboard access with Shift+F10 or the Menu key
- Touch long-press after 500 ms
- Arrow keys, Home, End and Esc inside the menu
- Grouped actions with a red destructive item
Accessibility
The area is a focusable region named Files whose visible hint tells users how to open the menu. The menu is a labelled role="menu" whose items are buttons with role="menuitem"; the shortcut hints and emoji are hidden from screen readers. Focus is moved into the menu on open and back to the area on close, items show a blue outline on keyboard focus, and the pop-in animation is removed under prefers-reduced-motion.
Customise it
Change the menu background, border and hover colours in .ctx (plain CSS), the --bs-dropdown-* variables on .ctx.dropdown-menu (Bootstrap) or the --color-ctx-* theme colours (Tailwind). The long-press delay is the 500 in the script. The shortcut hints shown next to items are labels only; connect them to your own key handlers.



















