Primitiveoverlay

Dropdown Menu

Stable

Menu de ações ancorado a um gatilho, com grupos, rótulos, submenus, itens de checkbox e de rádio. Composto sobre Base UI Menu. A diferença para o Popover não é visual: um menu tem papel `menu`, foco itinerante pelas setas e typeahead, e dentro dele Tab sai em vez de andar entre campos — por isso uma lista de ações mora aqui e um formulário não.

Instalação

npx up-web-ds add dropdown-menu

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

Preview

Default

With Groups

With State

With Submenu

States

All states

Default

With Groups

With State

With Submenu

States

Usage

Imports de Dropdown Menu
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuShortcut,
  DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
import { Button } from '@/components/ui/button'
Dropdown Menu
<DropdownMenu>
  <DropdownMenuTrigger render={<Button variant="outline" />}>
    Ações do item
  </DropdownMenuTrigger>
  <DropdownMenuContent>
    <DropdownMenuItem>
      Abrir no catálogo
      <DropdownMenuShortcut>⌘O</DropdownMenuShortcut>
    </DropdownMenuItem>
    <DropdownMenuItem>
      Copiar comando de instalação
      <DropdownMenuShortcut>⌘C</DropdownMenuShortcut>
    </DropdownMenuItem>
    <DropdownMenuItem>Regenerar catálogo</DropdownMenuItem>
  </DropdownMenuContent>
</DropdownMenu>

Props

DropdownMenu

Props de DropdownMenu
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 MenuPrimitive.Root.Props.

DropdownMenuPortal

Props de DropdownMenuPortal
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 MenuPrimitive.Portal.Props. Aceita também os atributos padrão de um elemento React (275 não listados).

DropdownMenuTrigger

Props de DropdownMenuTrigger
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 MenuPrimitive.Trigger.Props. Aceita também os atributos padrão de um elemento React (283 não listados).

DropdownMenuContent

Props de DropdownMenuContent
PropTypeDefaultDescription
alignAlign'start'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 | OffsetFunction4Distance 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 MenuPrimitive.Popup.Props & Pick< MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' >. Aceita também os atributos padrão de um elemento React (273 não listados).

DropdownMenuGroup

Props de DropdownMenuGroup
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 MenuPrimitive.Group.Props. Aceita também os atributos padrão de um elemento React (274 não listados).

DropdownMenuLabel

Props de DropdownMenuLabel
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 MenuPrimitive.GroupLabel.Props. Aceita também os atributos padrão de um elemento React (275 não listados).

DropdownMenuItem

Props de DropdownMenuItem
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 MenuPrimitive.Item.Props. Aceita também os atributos padrão de um elemento React (273 não listados).

DropdownMenuSub

Props de DropdownMenuSub
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 MenuPrimitive.SubmenuRoot.Props.

DropdownMenuSubTrigger

Props de DropdownMenuSubTrigger
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 MenuPrimitive.SubmenuTrigger.Props. Aceita também os atributos padrão de um elemento React (273 não listados).

DropdownMenuSubContent

Props de DropdownMenuSubContent
PropTypeDefaultDescription
alignAlign'start'How to align the popup relative to the specified side.
alignOffsetnumber | OffsetFunction-3Additional 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'right'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 DropdownMenuContent>. Aceita também os atributos padrão de um elemento React (273 não listados).

DropdownMenuCheckboxItem

Props de DropdownMenuCheckboxItem
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).

DropdownMenuRadioGroup

Props de DropdownMenuRadioGroup
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 MenuPrimitive.RadioGroup.Props. Aceita também os atributos padrão de um elemento React (274 não listados).

DropdownMenuRadioItem

Props de DropdownMenuRadioItem
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).

DropdownMenuSeparator

Props de DropdownMenuSeparator
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 MenuPrimitive.Separator.Props. Aceita também os atributos padrão de um elemento React (275 não listados).

DropdownMenuShortcut

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

prop obrigatória.

Composition

Gatilho e conteúdo são irmãos. Grupos são opcionais: eles existem para dar um rótulo a um conjunto de itens, não para conter todo item.

Composição de DropdownMenu

DropdownMenu

  • DropdownMenuTrigger
  • DropdownMenuContent
    • DropdownMenuGroup
      • DropdownMenuLabel
      • DropdownMenuItem
      • DropdownMenuCheckboxItem
    • DropdownMenuRadioGroup
      • DropdownMenuRadioItem
    • DropdownMenuSeparator
    • DropdownMenuSub
      • DropdownMenuSubTrigger
      • DropdownMenuSubContent

Metadata

Notas de acessibilidade

Teclado verificado por teste: ArrowDown abre já com o primeiro item destacado, as setas percorrem os itens pulando os rótulos, Home e End vão às pontas, digitar as primeiras letras encontra um item, ArrowRight abre o submenu e ArrowLeft volta ao item que o abriu, e Escape fecha devolvendo o foco ao gatilho. Leitor de tela verificado por teste: o gatilho declara aria-haspopup="menu" e aria-expanded acompanha o estado, o popup tem papel menu, itens de checkbox e de rádio reportam aria-checked em vez de depender do ícone, e um item desabilitado continua anunciado por aria-disabled recusando a execução sem fechar o menu. Touch verificado em navegador com emulação de toque em viewport de 375px: gatilho e itens medem acima do mínimo de 24x24 da WCAG 2.2 SC 2.5.8 e a escolha por toque funciona. Reduced motion verificado com prefers-reduced-motion: reduce — os tokens de motion colapsam para 1ms e a animação de entrada mede 0.001s.

Classificação

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

Origem e distribuição

Fonte
shadcn registry / dropdown-menu
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, chevron-right
Construído sobre
Nenhum
Usado por
Menubar