MenuBar
A fixed horizontal top bar composed of a brand slot and a right-aligned actions slot.
Installation
npx dafink-ui add menu-barAlso installs: Icons, Menu
Demo
Acme
Composition
<MenuBar>
</MenuBar>
Props
| Name | Type | Default | Description |
|---|---|---|---|
| height | string | 'h-14' | Tailwind height class for the bar. |
| className | string | '' | Additional CSS classes. |
| children | ReactNode | undefined | MenuBar content (brand, nav, search, actions). |
Accessibility
MenuBarNav uses roving tabindex: only the active item (or the first enabled item, before anything is active) sits in the page's Tab order, and the whole MenuBar acts as one tab stop: arrow keys move between every control in it, while Tab and Shift+Tab leave the bar entirely. MenuBarNavItem sets aria-current="page" instead of aria-pressed since this is a navigation landmark, not a toggle group, and MenuBarNavMore composes Menu unmodified, so its own overlay keyboard behavior (focus on open, Escape closes and returns focus to the trigger, arrow-key navigation, typeahead) applies once its dropdown is open.
| Key | Function |
|---|---|
| tab | Enters the bar at the nav group's active item; from anywhere inside the bar, moves focus out to the next page element. |
| shift+tab | From anywhere inside the bar, moves focus out to the previous page element. |
| enter | Activates the focused item, or opens the dropdown when focus is on MenuBarNavMore. |
| space | Activates the focused item, or opens the dropdown when focus is on MenuBarNavMore. |
| right arrow | Moves focus to the next control in the bar, including search and sign in, wrapping from the last to the first. Ignored inside text inputs. |
| left arrow | Moves focus to the previous control in the bar, wrapping from the first to the last. Ignored inside text inputs. |
| home | Moves focus to the first control in the bar. Ignored inside text inputs. |
| end | Moves focus to the last control in the bar. Ignored inside text inputs. |