Menubar
Creates horizontal application menus.
- Frameworks
- Astro · React · Elements · Dioxus
- Registry
lumen add Menubar- Interaction
- Enhanced runtime
See it and copy it
Framework example
Choose Astro, React, Elements, or Dioxus to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
View Menubar code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React, Elements, and Dioxus use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Menubar } from '@santi020k/lumen-astro'
---
<Menubar aria-label="Application">
<button role="menuitem">File</button>
<button role="menuitem">Edit</button>
<button role="menuitem">View</button>
<button role="menuitem">Help</button>
</Menubar>import { Menubar } from '@santi020k/lumen-react'
export const Example = () => (
<>
<Menubar aria-label="Application">
<button role="menuitem">File</button>
<button role="menuitem">Edit</button>
<button role="menuitem">View</button>
<button role="menuitem">Help</button>
</Menubar>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-menubar aria-label="Application">
<button role="menuitem">File</button>
<button role="menuitem">Edit</button>
<button role="menuitem">View</button>
<button role="menuitem">Help</button>
</lumen-menubar>use dioxus::prelude::*;
use lumen_dioxus::prelude::*;
#[component]
fn Example() -> Element {
let mut last = use_signal(String::new);
rsx! {
Menubar { aria_label: "Application",
MenubarItem { onclick: move |_| last.set("File".into()), "File" }
MenubarItem { onclick: move |_| last.set("Edit".into()), "Edit" }
MenubarItem { disabled: true, "Help" }
}
}
}Choose your target
Add this component
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
Glass
Add the glass prop to apply the shared blur, saturation, border, and highlight tokens. Glass reads best over vivid content, so place the surface above imagery or color.
View Menubar code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React and Elements use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Menubar } from '@santi020k/lumen-astro'
---
<div class="docs-glass-demo" style="justify-items: center;">
<Menubar aria-label="Application" glass>
<button role="menuitem">File</button>
<button role="menuitem">Edit</button>
<button role="menuitem">View</button>
<button role="menuitem">Help</button>
</Menubar>
</div>import { Menubar } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div className="docs-glass-demo" style={{ "justifyItems": "center" }}>
<Menubar aria-label="Application" glass>
<button role="menuitem">File</button>
<button role="menuitem">Edit</button>
<button role="menuitem">View</button>
<button role="menuitem">Help</button>
</Menubar>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div class="docs-glass-demo" style="justify-items: center;">
<lumen-menubar aria-label="Application" glass>
<button role="menuitem">File</button>
<button role="menuitem">Edit</button>
<button role="menuitem">View</button>
<button role="menuitem">Help</button>
</lumen-menubar>
</div>API reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| Attribute | Values | Default | Description |
|---|---|---|---|
| glass | boolean | "subtle" | "strong" | false | Applies the tokenized liquid-glass surface treatment with backdrop-filter fallbacks; "subtle" and "strong" adjust the fill intensity. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |
Customize Menubar
Start with semantic theme tokens and a class on the public component. Keep its accessible name, focus treatment, and interaction state intact.
.product-menubar {
--surface: 0 0% 100%;
--ink: 220 20% 15%;
--line: 220 15% 82%;
}Apply product-menubar through Astro's class, React's className, or the custom element's class. Verify foreground and background contrast in both schemes.
| Hook | Values | Default | Contract |
|---|---|---|---|
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
Use the documented hooks above and adapter types when targeting component states. Theme guide · Accessibility verification scope
Keyboard interactions
Keyboard behavior provided by the Astro UIPrimitives runtime for this component.
| Key | Action |
|---|---|
| ArrowRight, ArrowDown | Move roving focus to the next item, wrapping at the end. |
| ArrowLeft, ArrowUp | Move roving focus to the previous item, wrapping at the start. |
| Home, End | Move roving focus to the first or last item. |