Blazorise Dropdown API
Explore the Blazorise Dropdown API reference for parameters, events, methods, and related types.
For examples and usage guidance, see the Dropdown documentation.
API
Parameters
Dropdown
| Parameter | Description | Type | Default |
|---|---|---|---|
AriaDescribedBy |
Specifies the aria-describedby attribute value for the dropdown root element. RemarksWhen set, this value is rendered as-is on the dropdown root element. |
string | |
AriaInvalid |
Specifies the aria-invalid attribute value for the dropdown root element. RemarksWhen set, this value is rendered as-is on the dropdown root element. |
string | |
AriaLabelledBy |
Specifies the aria-labelledby attribute value for the dropdown root element. RemarksWhen set, this value is rendered as-is on the dropdown root element. |
string | |
AriaRequired |
Specifies the aria-required attribute value for the dropdown root element. RemarksWhen set, this value is rendered as-is on the dropdown root element. |
string | |
ChildContent |
Specifies the content to be rendered inside this Dropdown. |
RenderFragment | null |
Direction |
Dropdown-menu slide direction. Possible values: |
Direction | Direction.Default |
Disabled |
If true, dropdown would not react to button click. |
bool | false |
DropdownMenuTargetId |
Provides an alternative, or 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 | |
EndAligned |
If true, a dropdown menu will be aligned to the end. |
bool | false |
HoverCloseDelay |
Delay in milliseconds before hiding a hover-opened dropdown after the mouse leaves it. |
int | DefaultHoverCloseDelay |
PositionStrategy |
Specifies the positioning strategy of the dropdown menu as a 'floating' element. Possible values: |
DropdownPositionStrategy | DropdownPositionStrategy.Fixed |
Submenu |
Forces the dropdown to use submenu classes and behavior. |
bool | false |
Trigger |
Defines which pointer interactions can open or close this dropdown. Possible values: |
DropdownTrigger | default(DropdownTrigger) |
Visible |
If true, a dropdown menu will be visible. |
bool | false |
DropdownMenu
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Specifies the content to be rendered inside this Container. |
RenderFragment | null |
MaxMenuHeight |
Sets the maximum height of the dropdown menu. |
string |
DropdownItem
| Parameter | Description | Type | Default |
|---|---|---|---|
Active |
Indicate the currently active item. |
bool | false |
Checked |
Tracks the Checked state whenever the DropdownItem is in checkbox mode. |
bool | false |
ChildContent |
Specifies the content to be rendered inside this DropdownItem. |
RenderFragment | null |
CloseParentDropdowns |
Specifies whether clicking this item should close the entire dropdown hierarchy or only the current dropdown. |
bool | true |
Disabled |
Indicate the currently disabled item. |
bool | false |
ShowCheckbox |
The dropdown renders a checkbox. |
bool | false |
TabIndex |
Specifies the tabindex value for keyboard navigation. |
int? | null |
Value |
Holds the item value. |
object | null |
DropdownToggle
| Parameter | Description | Type | Default |
|---|---|---|---|
ChildContent |
Specifies the content to be rendered inside this DropdownToggle. |
RenderFragment | null |
Color |
Specifies the dropdown color. |
Color | Color.Default |
Disabled |
Makes the toggle element look inactive. |
bool | false |
Intent |
Specifies the dropdown intent. |
Intent | null |
Outline |
Button outline. |
bool | false |
Size |
Specifies the dropdown size. |
Size? | null |
Split |
Indicates that a toggle should act as a split button. |
bool | false |
TabIndex |
If defined, indicates that its element can be focused and can participates in sequential keyboard navigation. |
int? | null |
ToggleIconVisible |
Specifies a value indicating whether the dropdown toggle icon is visible. RemarksDefault: True |
bool? | null |
Events
Dropdown
| Event | Description | Type |
|---|---|---|
VisibleChanged |
Occurs after the dropdown menu visibility has changed. |
EventCallback<bool> |
DropdownItem
| Event | Description | Type |
|---|---|---|
CheckedChanged |
Occurs after the Checked state is changed, whenever the DropdownItem is in checkbox mode. |
EventCallback<bool> |
Clicked |
Notifies when the item is clicked. |
EventCallback<object> |
DropdownToggle
| Event | Description | Type |
|---|---|---|
Clicked |
Notifies when the toggle button is clicked. |
EventCallback<MouseEventArgs> |
Methods
Dropdown
| Method | Description | Return | Parameters |
|---|---|---|---|
Hide |
Hide the dropdown menu. | Task | bool hideAll |
Show |
Show the dropdown menu. | Task | |
Toggle |
Toggle the visibility of the dropdown menu. | Task | string dropdownToggleElementId |
DropdownToggle
| Method | Description | Return | Parameters |
|---|---|---|---|
Close |
Forces the parent dropdown to close the dropdown-menu. | Task | CloseReason closeReason |
Focus |
Sets focus on the input element, if it can be focused. | Task | bool scrollToElement |
IsSafeToClose |
Returns true of the parent dropdown-menu is safe to be closed. | Task<bool> | string elementId, CloseReason closeReason, bool isChildClicked |