Dropdowns expose additional content that "drops down" in a menu.
Dropdowns are toggleable, contextual overlays for displaying lists of links and actions in a dropdown menu format.
Dropdowns are designed to work well with menus to provide a list of options the user can select from. However, dropdowns can also be used in lower-level applications (e.g. color picker and select). The API gives you complete control over showing, hiding, and positioning the menu.
Dropdown the main container
<DropdownToggle> toggle button
<DropdownMenu> the toggable menu, hidden by default
<DropdownItem> each single item of the dropdown menu
<DropdownDivider> a horizontal line to separate dropdown items
By default a dropdown toggle will show and hide a dropdown menu without the need to do it manually. In case you need to control the menu programmatically you have to use the Dropdown reference.
By adding a few more Dropdowns you can add extra levels of submenu to your dropdown. You can apply this to the dropdown in a simple button or within the navbar.
Disables the button or toggle button that are placed inside of dropdown.
bool
false
Direction
Direction of an dropdown menu.
Direction
Default
VisibleChanged
Occurs after the dropdown menu visibility has changed.
EventCallback
PositionStrategy
Defines the positioning strategy of the dropdown menu as a 'floating' element.
DropdownPositionStrategy
DropdownPositionStrategy.Fixed
DropdownMenuTargetId
Provides a custom anchor element id for the dropdown menu.
This is useful when you want the dropdown menu to be anchored from a different element than the toggle.
string
DropdownMenu
Name
Description
Type
Default
MaxMenuHeight
Sets the maximum height of the dropdown menu.
string
DropdownItem
Name
Description
Type
Default
Value
Holds the item value.
object
null
Clicked
Occurs when the item is clicked.
EventCallback
Active
Marks the item with an state.
bool
false
Disabled
Marks the item with disabled state and doesn’t allow the click event.
bool
false
ShowCheckbox
The dropdown renders a checkbox.
bool
false
Checked
Tracks the Checked state whenever the DropdownItem is in checkbox mode.
bool
false
CheckedChanged
Occurs after the Checked state is changed, whenever the DropdownItem is in checkbox mode.