DropdownMenu exports many components that combine to create a dropdown menu. The DropdownMenu.Trigger renders a <button> by default, but this can be overridden with the asChild prop, which will instead add all the functional and accessibility requirements to the child component instead (see the below example).
For any modifications of the default DropdownMenu visuals, we recommend utilising the Radix UI DropdownMenu component directly. You will need to wrap each exported component within a styled() function to enable the className prop.
API Reference
DropdownMenu
Prop
Type
Default
Required
defaultOpen
boolean
-
-
dir
"ltr" | "rtl"
-
-
modal
boolean
-
-
onOpenChange
(open: boolean) => void
-
-
open
boolean
-
-
DropdownMenu.Trigger
Prop
Type
Default
Required
asChild
boolean
-
-
DropdownMenu.Content
Prop
Type
Default
Required
align
"center" | "start" | "end"
-
-
alignOffset
number
-
-
arrowPadding
number
-
-
asChild
boolean
-
-
avoidCollisions
boolean
-
-
collisionBoundary
null | Element | Boundary[]
-
-
collisionPadding
number | Partial<Record<"left" | "right" | "top" | "bottom", number>>