Skip to content
Overlays & Tooltips

Dropdown Menu

Actions menu with submenus.

Import

tsx
import { DropdownMenu } from "@cronus-ui/ui";
bash
npx cronus-ui add dropdown-menu

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component DropdownMenuDefault layout:inline style:dropdown-menu {
  label "Actions"
  text "Edit"
  text "Delete"
}

page "/audit/dropdown-menu/default" type:custom {
  use DropdownMenuDefault
}

API Reference

Generated from the component's exported types.

DropdownMenuProps

Extends ComponentProps<typeof DropdownMenuPrimitive.Root>

Skip DropdownMenuProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
children
ReactNode—Contents of the component.
modal
boolean—When true, interaction outside the surface is blocked.
dir
"ltr" | "rtl"—Reading direction. Inherits from the document when omitted.

DropdownMenuTriggerProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.Trigger >

Skip DropdownMenuTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuGroupProps

Extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>

Skip DropdownMenuGroupProps props table
PropTypeDefaultDescription
children
ReactNode—Contents of the component.

DropdownMenuPortalProps

Extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>

Skip DropdownMenuPortalProps props table
PropTypeDefaultDescription
forceMount
boolean—Keep the node mounted when closed, for exit animation.

DropdownMenuSubProps

Extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub>

Skip DropdownMenuSubProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.

DropdownMenuRadioGroupProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.RadioGroup >

Skip DropdownMenuRadioGroupProps props table
PropTypeDefaultDescription
value
string—Controlled value.
onValueChange
(value: string) => void—Called when the value changes.

DropdownMenuSubTriggerProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.SubTrigger >

Skip DropdownMenuSubTriggerProps props table
PropTypeDefaultDescription
inset
boolean——
disabled
boolean—Disables pointer and keyboard interaction.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.

DropdownMenuSubContentProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.SubContent >

Skip DropdownMenuSubContentProps props table
PropTypeDefaultDescription
side
"top" | "right" | "bottom" | "left"—Preferred side of the trigger.
align
"start" | "center" | "end"—Alignment along the chosen side.
sideOffset
number—Distance in pixels from the trigger.
alignOffset
number—Offset along the alignment axis.
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuContentProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.Content >

Skip DropdownMenuContentProps props table
PropTypeDefaultDescription
side
"top" | "right" | "bottom" | "left"—Preferred side of the trigger.
align
"start" | "center" | "end"—Alignment along the chosen side.
sideOffset
number—Distance in pixels from the trigger.
alignOffset
number—Offset along the alignment axis.
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuItemProps

Extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>

Skip DropdownMenuItemProps props table
PropTypeDefaultDescription
inset
boolean——
disabled
boolean—Disables pointer and keyboard interaction.
onSelect
(event: Event) => void—Called when the item is chosen.
textValue
string—Text used for typeahead. Defaults to the item's text.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuCheckboxItemProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.CheckboxItem >

Skip DropdownMenuCheckboxItemProps props table
PropTypeDefaultDescription
checked
boolean—Controlled checked state. Pair with `onCheckedChange`.
onCheckedChange
(checked: boolean) => void—Called with the next checked value whenever the control toggles.
disabled
boolean—Disables pointer and keyboard interaction.
onSelect
(event: Event) => void—Called when the item is chosen.
textValue
string—Text used for typeahead. Defaults to the item's text.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuRadioItemProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.RadioItem >

Skip DropdownMenuRadioItemProps props table
PropTypeDefaultDescription
value
string—Controlled value.
disabled
boolean—Disables pointer and keyboard interaction.
onSelect
(event: Event) => void—Called when the item is chosen.
textValue
string—Text used for typeahead. Defaults to the item's text.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuLabelProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.Label >

Skip DropdownMenuLabelProps props table
PropTypeDefaultDescription
inset
boolean——
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

DropdownMenuSeparatorProps

Extends ComponentPropsWithoutRef< typeof DropdownMenuPrimitive.Separator >

Skip DropdownMenuSeparatorProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.

DropdownMenuShortcutProps

Extends HTMLAttributes<HTMLSpanElement>

Skip DropdownMenuShortcutProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.