DropdownMenu | DropdownMenuTrigger
DropdownMenuTrigger#
Description#
- Component that opens the dropdown menu via click or keyboard interaction.
- Uses a render function to clone the child and apply ARIA attributes directly.
- Can act as a wrapper (
as-childdisabled) or clone the child without a wrapper (as-childenabled).
Props#
asChild(boolean) — Clones the child without a wrapper, applying attributes directly. Default:false.disabled(boolean) — Disables the trigger. Default:false.
Usage#
| |
Notes#
- Enter, space, arrow down, and arrow up open the menu. Escape closes it.
- With
as-child, ARIA attributes apply directly to the button, not to a wrapper. preventDefaulton keyboard prevents the browser’s synthetic duplicate click.