tuil
ReferenceComponentsNavigation

Menubar

Menubar component API, behavior, and executable example.

View rawEdit

Loading executable example…

API and events

Provide terminal-native local navigation, command menus, hierarchical trails, and workflow progress.

export function Menubar({
  menus,
  value,
  defaultValue,
  onValueChange,
  onSelect,
  slots,
  slotProps,
  disabled = false,
  ...props
}: MenubarProps): ReactNode;

Props, functions, and events

MemberTypeRequiredDescriptionRelated types
menusreadonly MenubarMenu[]YesThe menus member uses the readonly MenubarMenu[] contract.
valuestring | undefinedNoThe value member uses the string | undefined contract.
defaultValuestring | undefinedNoThe defaultValue member uses the string | undefined contract.
onValueChange((id: string) => void | Promise<void>) | undefinedNoThe onValueChange member uses the ((id: string) => void | Promise<void>) | undefined contract.
onSelect((item: NavigationItem) => void | Promise<void>) | undefinedNoThe onSelect member uses the ((item: NavigationItem) => void | Promise<void>) | undefined contract.
variantstring | undefinedNoThe variant member uses the string | undefined contract.
size"sm" | "md" | "lg" | undefinedNoThe size member uses the "sm" | "md" | "lg" | undefined contract.
unstyledboolean | undefinedNoThe unstyled member uses the boolean | undefined contract.
classNamestring | undefinedNoThe className member uses the string | undefined contract.
layoutPartial<Omit<LayoutNodeInput, "children" | "id" | "semantics">> | undefinedNoThe layout member uses the Partial<Omit<LayoutNodeInput, "children" | "id" | "semantics">> | undefined contract.
idstring | undefinedNoThe id member uses the string | undefined contract.
testIdstring | undefinedNoThe testId member uses the string | undefined contract.
roleSemanticRole | undefinedNoThe role member uses the SemanticRole | undefined contract.SemanticRole
labelstring | undefinedNoThe label member uses the string | undefined contract.
descriptionstring | undefinedNoThe description member uses the string | undefined contract.
disabledboolean | undefinedNoThe disabled member uses the boolean | undefined contract.
readOnlyboolean | undefinedNoThe readOnly member uses the boolean | undefined contract.
selectedboolean | undefinedNoThe selected member uses the boolean | undefined contract.
checkedboolean | undefinedNoThe checked member uses the boolean | undefined contract.
expandedboolean | undefinedNoThe expanded member uses the boolean | undefined contract.
valueTextstring | undefinedNoThe valueText member uses the string | undefined contract.
slotsPartial<SlotComponents<&#123; root: import("ink").BoxProps; list: import("ink").BoxProps; item: import("ink").TextProps; &#125;>> | undefinedNoThe slots member uses the Partial<SlotComponents<&#123; root: import("ink").BoxProps; list: import("ink").BoxProps; item: import("ink").TextProps; &#125;>> | undefined contract.BoxProps, SlotComponents, TextProps
slotPropsPartial<SlotProps<&#123; root: import("ink").BoxProps; list: import("ink").BoxProps; item: import("ink").TextProps; &#125;, object>> | undefinedNoThe slotProps member uses the Partial<SlotProps<&#123; root: import("ink").BoxProps; list: import("ink").BoxProps; item: import("ink").TextProps; &#125;, object>> | undefined contract.BoxProps, SlotProps, TextProps

Selections and value changes are reported through component callbacks.

Callback props run after the documented input is accepted. Callbacks are not cancellable unless their return type or description states otherwise.

Interaction and capabilities

Arrow keys move within the active navigation model; Enter selects or activates.

The published manifest records keyboard, focus, pointer, theme, terminal, semantic, event, and dependency requirements.

Complete import

import { Menubar } from "@/components/tuil/navigation/navigation";

On this page