Navigated to /docs/ui/components/menubar

Menubar

Horizontal application menu bar with link and button items.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { Menubar } from "@tavojs/ui/menubar";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/menubar.

When to use

Use it when

Use Menubar when you need horizontal application menu bar with link and button items.

Choose something else when

Avoid Menubar when for arbitrary button groups that do not navigate.

Examples

Menubar example

TSX
tsximport { Menubar } from "@tavojs/ui/menubar";

export function MenubarExample1() {
  return (
    <>
      <Menubar />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
itemsArray

Navigation items when supported by the component. Applies to Menubar.
aria-labelstring

Accessible label for navigation landmarks when needed. Applies to Menubar.
childrenChild

Navigation content or custom item structure. Applies to Menubar.

Complete TypeScript API

Import from @tavojs/ui/menubar. Published exports: Menubar, MenubarItem, MenubarItemProps, MenubarProps, MenubarRoot.

MenubarProps

PropertyTypeRequiredDescription
childrenChild

No

Navigation content or custom item structure. Applies to Menubar.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Menubar.

idstring

No

Inherited id attribute accepted by Menubar.

rolestring

No

Inherited role attribute accepted by Menubar.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Menubar.

titlestring

No

Inherited title attribute accepted by Menubar.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Menubar.

hiddenboolean

No

Inherited hidden attribute accepted by Menubar.

disabledboolean

No

Inherited disabled attribute accepted by Menubar.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Menubar.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Menubar.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Menubar.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Menubar.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Menubar.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Menubar.

MenubarItemProps

PropertyTypeRequiredDescription
childrenChild

No

Navigation content or custom item structure. Applies to Menubar.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Menubar.

idstring

No

Inherited id attribute accepted by Menubar.

rolestring

No

Inherited role attribute accepted by Menubar.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Menubar.

titlestring

No

Inherited title attribute accepted by Menubar.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Menubar.

hiddenboolean

No

Inherited hidden attribute accepted by Menubar.

disabledboolean

No

Inherited disabled attribute accepted by Menubar.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Menubar.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Menubar.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Menubar.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Menubar.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Menubar.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Menubar.

hrefstring

No

Inherited href attribute accepted by Menubar.

currentboolean

No

Inherited current attribute accepted by Menubar.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetPublic passthrough props target the component root. Treat nested elements and private class names as implementation details.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid Menubar when for arbitrary button groups that do not navigate.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Navigation components should expose current-page state and landmark labels when context is not obvious.

  • Use aria-current for active destinations where supported.

  • Add aria-label when multiple nav landmarks exist.

  • Keep link text descriptive.

Component status

ContractCurrent value
Maturitystable
Categorynavigation
Component import@tavojs/ui/menubar
Explicit CSS import@tavojs/ui/css/menubar
PreviewInteractive preview available on this page