Primitivenavigation

Menubar

Stable

Barra de comandos persistente de uma aplicação. Composto sobre Base UI Menubar e sobre o DropdownMenu do Up Web DS, que fornece todo o interior — o menubar não reimplementa item, submenu nem estado. O que ele acrescenta é ser um controle só: a página gasta um único Tab stop, as setas andam entre os menus, e com um menu aberto ir para o lado abre o vizinho sem clique.

Instalação

npx up-web-ds add menubar

Gera check para a biblioteca de ícones do projeto (components.json → iconLibrary).

Preview

Basic

Default

With State And Submenu

All states

Basic

Default

With State And Submenu

Usage

@/components/ui/menubar
import {
  Menubar,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarTrigger,
} from '@/components/ui/menubar'
Menubar
<Menubar>
  <MenubarMenu>
    <MenubarTrigger>Catálogo</MenubarTrigger>

    <MenubarContent>
      <MenubarItem>Criar item</MenubarItem>
      <MenubarItem>Regenerar catálogo</MenubarItem>
    </MenubarContent>
  </MenubarMenu>
</Menubar>

Props

Menubar

Props de Menubar
PropTypeDefaultDescription
classNamestring | ((state: MenubarState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
disabledbooleanfalseWhether the whole menubar is disabled.
loopFocusbooleantrueWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
modalbooleantrueWhether the menubar is modal.
orientationMenuRootOrientation'horizontal'The orientation of the menubar.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenubarState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenubarState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende MenubarPrimitive.Props. Aceita também os atributos padrão de um elemento React (275 não listados).

MenubarMenu

Props de MenubarMenu
PropTypeDefaultDescription
actionsRefReact.RefObject<MenuRootActions | null>sem valor padrãoA ref to imperative actions. - `unmount`: Manually unmounts the menu. Call this after any externally controlled closing animation finishes. - `close`: When specified, the menu can be closed imperatively.
childrenReact.ReactNode | PayloadChildRenderFunction<unknown>sem valor padrãoThe content of the menu. This can be a regular React node or a render function that receives the `payload` of the active trigger.
closeParentOnEscbooleanfalseWhen in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu.
defaultOpenbooleanfalseWhether the menu is initially open. To render a controlled menu, use the `open` prop instead.
defaultTriggerIdstring | nullsem valor padrãoID of the trigger that the menu is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open menu.
disabledbooleanfalseWhether the component should ignore user interaction.
handleMenuHandle<unknown>sem valor padrãoA handle to associate the menu with a trigger. If specified, allows external triggers to control the menu's open state.
highlightItemOnHoverbooleantrueWhether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
loopFocusbooleantrueWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
modalbooleantrueDetermines if the menu enters a modal state when open. - `true`: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed. On touch devices, a `true` modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior. Nested menus ignore this prop, and menus opened by hover are never modal.
onOpenChange((open: boolean, eventDetails: MenuRoot.ChangeEventDetails) => void)sem valor padrãoEvent handler called when the menu is opened or closed.
onOpenChangeComplete((open: boolean) => void)sem valor padrãoEvent handler called after any animations complete when the menu is opened or closed.
openbooleansem valor padrãoWhether the menu is currently open.
orientationMenuRootOrientation'vertical'The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys.
triggerIdstring | nullsem valor padrãoID of the trigger that the menu is associated with. This is useful in conjunction with the `open` prop to create a controlled menu. There's no need to specify this prop when the menu is uncontrolled (that is, when the `open` prop is not set).

Estende React.ComponentProps<typeof DropdownMenu>.

MenubarGroup

Props de MenubarGroup
PropTypeDefaultDescription
childrenReact.ReactNodesem valor padrãoThe content of the component.
classNamestring | ((state: MenuGroupState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuGroupState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuGroupState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuGroup>. Aceita também os atributos padrão de um elemento React (274 não listados).

MenubarPortal

Props de MenubarPortal
PropTypeDefaultDescription
classNamestring | ((state: MenuPortalState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
containerHTMLElement | ShadowRoot | React.RefObject<HTMLElement | ShadowRoot | null> | nullsem valor padrãoA parent element to render the portal element into.
keepMountedbooleanfalseWhether to keep the portal mounted in the DOM while the popup is hidden.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuPortalState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuPortalState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuPortal>. Aceita também os atributos padrão de um elemento React (275 não listados).

MenubarTrigger

Props de MenubarTrigger
PropTypeDefaultDescription
childrenReact.ReactNodesem valor padrão
classNamestring | ((state: MenuTriggerState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
closeDelaynumber0How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the `openOnHover` prop.
delaynumber100How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the `openOnHover` prop.
disabledbooleanfalseWhether the component should ignore user interaction.
handleMenuHandle<unknown>sem valor padrãoA handle to associate the trigger with a menu.
nativeButtonbooleantrueWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).
openOnHoverbooleansem valor padrãoWhether the menu should also open when the trigger is hovered.
payloadunknownsem valor padrãoA payload to pass to the menu when it is opened.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuTriggerState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuTriggerState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuTrigger>. Aceita também os atributos padrão de um elemento React (283 não listados).

MenubarContent

Props de MenubarContent
PropTypeDefaultDescription
alignAlign'start'How to align the popup relative to the specified side.
alignOffsetnumber | OffsetFunction-4Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side.
childrenReact.ReactNodesem valor padrão
classNamestring | ((state: MenuPopupState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
finalFocusboolean | React.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)sem valor padrãoDetermines the element to focus when the menu is closed. - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
idstringsem valor padrão
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuPopupState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
sideSide'bottom'Which side of the anchor element to align the popup against. May automatically change to avoid collisions.
sideOffsetnumber | OffsetFunction8Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side.
styleReact.CSSProperties | ((state: MenuPopupState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuContent>. Aceita também os atributos padrão de um elemento React (273 não listados).

MenubarItem

Props de MenubarItem
PropTypeDefaultDescription
insetbooleansem valor padrão
variant"default" | "destructive"'default'
classNamestring | ((state: MenuItemState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickbooleantrueWhether to close the menu when the item is clicked.
disabledbooleanfalseWhether the component should ignore user interaction.
idstringsem valor padrão
labelstringsem valor padrãoOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonbooleanfalseWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.
onClick((event: BaseUIEvent<React.MouseEvent<HTMLDivElement, MouseEvent>>) => void)sem valor padrãoThe click handler for the menu item.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuItemState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuItemState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuItem>. Aceita também os atributos padrão de um elemento React (273 não listados).

MenubarCheckboxItem

Props de MenubarCheckboxItem
PropTypeDefaultDescription
insetbooleansem valor padrão
checkedbooleansem valor padrãoWhether the checkbox item is currently ticked. To render an uncontrolled checkbox item, use the `defaultChecked` prop instead.
classNamestring | ((state: MenuCheckboxItemState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickbooleanfalseWhether to close the menu when the item is clicked.
defaultCheckedbooleanfalseWhether the checkbox item is initially ticked. To render a controlled checkbox item, use the `checked` prop instead.
disabledbooleanfalseWhether the component should ignore user interaction.
idstringsem valor padrão
labelstringsem valor padrãoOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonbooleanfalseWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.
onCheckedChange((checked: boolean, eventDetails: MenuCheckboxItem.ChangeEventDetails) => void)sem valor padrãoEvent handler called when the checkbox item is ticked or unticked.
onClick((event: BaseUIEvent<React.MouseEvent<HTMLDivElement, MouseEvent>>) => void)sem valor padrãoThe click handler for the menu item.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuCheckboxItemState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuCheckboxItemState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende MenuPrimitive.CheckboxItem.Props. Aceita também os atributos padrão de um elemento React (273 não listados).

MenubarRadioGroup

Props de MenubarRadioGroup
PropTypeDefaultDescription
childrenReact.ReactNodesem valor padrãoThe content of the component.
classNamestring | ((state: MenuRadioGroupState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
defaultValueanysem valor padrãoThe uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the `value` prop instead.
disabledbooleanfalseWhether the component should ignore user interaction.
onValueChange((value: any, eventDetails: MenuRadioGroup.ChangeEventDetails) => void)sem valor padrãoFunction called when the selected value changes.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuRadioGroupState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuRadioGroupState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.
valueanysem valor padrãoThe controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the `defaultValue` prop instead.

Estende React.ComponentProps<typeof DropdownMenuRadioGroup>. Aceita também os atributos padrão de um elemento React (274 não listados).

MenubarRadioItem

Props de MenubarRadioItem
PropTypeDefaultDescription
insetbooleansem valor padrão
value, obrigatóriaanysem valor padrãoValue of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
classNamestring | ((state: MenuRadioItemState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
closeOnClickbooleanfalseWhether to close the menu when the item is clicked.
disabledbooleanfalseWhether the component should ignore user interaction.
idstringsem valor padrão
labelstringsem valor padrãoOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonbooleanfalseWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.
onClick((event: BaseUIEvent<React.MouseEvent<HTMLDivElement, MouseEvent>>) => void)sem valor padrãoThe click handler for the menu item.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuRadioItemState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuRadioItemState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende MenuPrimitive.RadioItem.Props. Aceita também os atributos padrão de um elemento React (273 não listados).

MenubarLabel

Props de MenubarLabel
PropTypeDefaultDescription
insetbooleansem valor padrão
classNamestring | ((state: MenuGroupLabelState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuGroupLabelState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuGroupLabelState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuLabel>. Aceita também os atributos padrão de um elemento React (275 não listados).

MenubarSeparator

Props de MenubarSeparator
PropTypeDefaultDescription
classNamestring | ((state: SeparatorState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
orientationOrientation'horizontal'The orientation of the separator.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SeparatorState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: SeparatorState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuSeparator>. Aceita também os atributos padrão de um elemento React (275 não listados).

MenubarShortcut

Estende React.ComponentProps<typeof DropdownMenuShortcut>. Aceita também os atributos padrão de um elemento React (280 não listados).

MenubarSub

Props de MenubarSub
PropTypeDefaultDescription
actionsRefReact.RefObject<MenuRootActions | null>sem valor padrãoA ref to imperative actions. - `unmount`: Manually unmounts the menu. Call this after any externally controlled closing animation finishes. - `close`: When specified, the menu can be closed imperatively.
childrenReact.ReactNodesem valor padrãoThe content of the submenu.
closeParentOnEscbooleanfalseWhen in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu.
defaultOpenbooleanfalseWhether the menu is initially open. To render a controlled menu, use the `open` prop instead.
disabledbooleanfalseWhether the component should ignore user interaction.
highlightItemOnHoverbooleantrueWhether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
loopFocusbooleantrueWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
onOpenChange((open: boolean, eventDetails: MenuSubmenuRoot.ChangeEventDetails) => void)sem valor padrãoEvent handler called when the menu is opened or closed.
onOpenChangeComplete((open: boolean) => void)sem valor padrãoEvent handler called after any animations complete when the menu is opened or closed.
openbooleansem valor padrãoWhether the menu is currently open.
orientationMenuRootOrientation'vertical'The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys.

Estende React.ComponentProps<typeof DropdownMenuSub>.

MenubarSubTrigger

Props de MenubarSubTrigger
PropTypeDefaultDescription
insetbooleansem valor padrão
classNamestring | ((state: MenuSubmenuTriggerState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
closeDelaynumber0How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the `openOnHover` prop.
delaynumber100How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the `openOnHover` prop.
disabledbooleanfalseWhether the component should ignore user interaction.
idstringsem valor padrão
labelstringsem valor padrãoOverrides the text label to use when the item is matched during keyboard text navigation.
nativeButtonbooleanfalseWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.
onClick((event: BaseUIEvent<React.MouseEvent<HTMLDivElement, MouseEvent>>) => void)sem valor padrão
openOnHoverbooleansem valor padrãoWhether the menu should also open when the trigger is hovered.
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuSubmenuTriggerState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleReact.CSSProperties | ((state: MenuSubmenuTriggerState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuSubTrigger>. Aceita também os atributos padrão de um elemento React (273 não listados).

MenubarSubContent

Props de MenubarSubContent
PropTypeDefaultDescription
alignAlign'center'How to align the popup relative to the specified side.
alignOffsetnumber | OffsetFunction0Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side.
childrenReact.ReactNodesem valor padrão
classNamestring | ((state: MenuPopupState) => string | undefined)sem valor padrãoCSS class applied to the element, or a function that returns a class based on the component's state.
finalFocusboolean | React.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)sem valor padrãoDetermines the element to focus when the menu is closed. - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
idstringsem valor padrão
renderReact.ReactElement<unknown, string | React.JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, MenuPopupState>sem valor padrãoAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
sideSide'bottom'Which side of the anchor element to align the popup against. May automatically change to avoid collisions.
sideOffsetnumber | OffsetFunction0Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`. - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`. - `data.side`: which side of the anchor element the positioner is aligned against. - `data.align`: how the positioner is aligned relative to the specified side.
styleReact.CSSProperties | ((state: MenuPopupState) => React.CSSProperties | undefined)sem valor padrãoStyle applied to the element, or a function that returns a style object based on the component's state.

Estende React.ComponentProps<typeof DropdownMenuSubContent>. Aceita também os atributos padrão de um elemento React (273 não listados).

prop obrigatória.

Composition

Cada MenubarMenu é um menu da barra: o gatilho fica visível o tempo todo, o conteúdo só quando aberto.

Composição de Menubar

Menubar

  • MenubarMenu
    • MenubarTrigger
    • MenubarContent
      • MenubarGroup
        • MenubarLabel
        • MenubarItem
        • MenubarCheckboxItem
      • MenubarRadioGroup
        • MenubarRadioItem
      • MenubarSeparator
      • MenubarSub
        • MenubarSubTrigger
        • MenubarSubContent

Metadata

Notas de acessibilidade

Teclado verificado por teste: a barra inteira custa um Tab stop — o segundo Tab sai dela —, ArrowLeft e ArrowRight andam entre os gatilhos, com um menu aberto ir para o lado abre o vizinho diretamente, e Escape fecha deixando o foco no gatilho. Leitor de tela verificado por teste: a barra tem papel menubar, cada gatilho é um menuitem com aria-haspopup="menu" e aria-expanded acompanhando o estado, o vocabulário do DropdownMenu chega intacto (aria-checked em itens de checkbox, aria-haspopup em gatilho de submenu) e um item desabilitado continua anunciado por aria-disabled. Touch verificado em navegador com emulação de toque em viewport de 375px: gatilhos e itens medem acima do mínimo de 24x24 da WCAG 2.2 SC 2.5.8. Reduced motion verificado com prefers-reduced-motion: reduce — os tokens de motion colapsam para 1ms e a animação de entrada dos menus mede 0.001s.

Classificação

Layer
Primitive
Domínio
Domain-free (compartilhado)
Categoria
navigation
Status
Stable

Origem e distribuição

Fonte
shadcn registry / menubar
Licença
MIT
Distribuição
Interna

Acessibilidade

  • Teclado: revisado
  • Leitor de tela: revisado
  • Touch: revisado
  • Reduced motion: revisado

Dependências

Pacotes
@base-ui/react
Ícones
check
Construído sobre
Dropdown Menu
Usado por
Nenhum ainda