DropdownMenu
DropdownMenu displays a menu to the user — such as a set of actions or functions — triggered by a button.
Import
Importimport { DropdownMenu } from '@backyard-ui/core';Usage
UsageIcon
IconUse the icon prop to render an icon on DropdownMenu.Item.
Submenu
SubmenuUse the DropdownMenu.Sub prop to render a SubMenu.
Checkbox
CheckboxUse the DropdownMenu.CheckboxItem prop to render a CheckBox field.
RadioGroup
RadioGroupUse the DropdownMenu.RadioGroup prop to render a Radio field.
Controlled
ControlledThe Popover can have a controlled state, using isOpen and onOpenChange props
API Reference
API ReferenceRoot
Root- isOpenDescription If `true` the Dialog will be initially openedType
booleanDefaultfalse - isModalDescription The modality of the dropdown menu. When set to `true`, interaction with outside elements will be disabled and only menu content will be visible to screen readers.Type
boolean
Trigger
TriggerContent
Content- isLoopDescription If `true`, keyboard navigation will loop from last item to first, and vice versa.Type
booleanDefaultfalse - asChildDescriptionType
boolean
Item
Item- iconDescriptionType
ReactElement<any, string | JSXElementConstructor<any>> - isDisabledDescriptionType
boolean - asChildDescriptionType
boolean
Group
Group- asChildDescriptionType
boolean
Label
Label- asChildDescriptionType
boolean
CheckboxItem
CheckboxItem- isCheckedDescriptionType
boolean | "indeterminate" - isDisabledDescriptionType
boolean - asChildDescriptionType
boolean
RadioGroup
RadioGroupRadioItem
RadioItem- isDisabledDescription If `true`, prevents the user from interacting with the item.Type
booleanDefaultfalse - asChildDescriptionType
boolean
Separator
Separator- asChildDescriptionType
boolean
Sub
Sub- isOpenDescription The controlled open state of the submenu. Must be used in conjunction with `onOpenChange`.Type
booleanDefaultfalse - isDefaultOpenDescription The open state of the submenu when it is initially rendered. Use when you do not need to control its open state.Type
booleanDefaultfalse
SubTrigger
SubTrigger- iconDescription Custom icon elementType
ReactElement<any, string | JSXElementConstructor<any>> - isDisabledDescription If `true`, prevents the user from interacting with the item.Type
boolean
SubContent
SubContent- isLoopDescription If `true`, keyboard navigation will loop from last item to first, and vice versa.Type
booleanDefaultfalse - asChildDescriptionType
boolean