Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Navigation

Menubar <pm-menubar>

Menu bar (role="menubar"): a row of buttons that each open a <pm-menu>, as in desktop applications.

Full screen


This component has no props to try here.

<script type="module"> import '@prismora/css'; import '@prismora/elements/menu'; import '@prismora/elements/menubar'; </script> <pm-menubar label="Document"> <button popovertarget="demo-mb-file">File</button> <pm-menu id="demo-mb-file"> <button role="menuitem"> New <kbd>⌘N</kbd> </button> <button role="menuitem"> Open… <kbd>⌘O</kbd> </button> <hr> <button role="menuitem"> Save <kbd>⌘S</kbd> </button> </pm-menu> <button popovertarget="demo-mb-edit">Edit</button> <pm-menu id="demo-mb-edit"> <button role="menuitem"> Undo <kbd>⌘Z</kbd> </button> <button role="menuitem"> Redo <kbd>⇧⌘Z</kbd> </button> <hr> <button role="menuitem">Find…</button> </pm-menu> <button popovertarget="demo-mb-view">View</button> <pm-menu id="demo-mb-view"> <button role="menuitemcheckbox" aria-checked="true">Sidebar</button> <button role="menuitemcheckbox" aria-checked="false">Minimap</button> </pm-menu> </pm-menubar>

Overview

Arrow Left and Right move along the bar (and switch menus while one is open), Arrow Down opens the focused menu, Home and End jump to the first and last button. Only one button is in the tab order.

Attributes

AttributeTypeDefaultDescription
labelstring—Accessible name of the bar.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Slots

SlotDescription
(default)<button popovertarget="id"> elements, each followed by its <pm-menu id="id">.