Dropdown is a combination of OverlayTrigger, Button, and Menu components.
Name | Type | Required | Default | Description |
---|---|---|---|---|
afterHide | ((e?: Event) => void) | false | ||
afterShow | (() => void) | false | ||
beforeHide | BeforeCallback | false | ||
beforeShow | BeforeCallback | false | ||
block | boolean | false | ||
className | string | false | ||
disabled | boolean | false | ||
error | boolean | false | ||
footer | ReactNode | false | Content to render in a footer. | |
hasTabbableElements | boolean | false | Whether to act as modal dialog. Should be used when Dropdown has tabbable elements (e.g. buttons in footer). | |
i18nScope | string | false | The i18n key to use for the dropdowns's configurable strings. Defaults to using the core library's default strings. | |
icon | ReactNode | false | ||
label | string | false | The button text. | |
loading | boolean | false | ||
placement | false | The placement of the overlay. | ||
restoreFocusOnHide | boolean | false | If focus should return to the button after selection. | |
size | false | The button size | ||
trigger | TriggerVariant | TriggerVariant[] | false | ||
type | "button" | "submit" | "reset" | false | ||
variant | false | |||
onSearch | Function | false | Adds a search bar to the dropdown. | |
onSelect | Function | false | Callback for selecting an item from the menu
item will be the item prop supplied to the{' '}
Item component
|
Dropdown expects Dropdown.Item as children.
Dropdown will render the Dropdown.Footer element for you. It has a footer prop slot to manage this.
Passing an onSearch to the dropdown renders a typeahead search.
You can customize the Search placeholder by providing translations to I18nProvider and configuring the Dropdown's i18nScope prop
Since Dropdown uses OverlayTrigger under the hood, the visibility callbacks are also available
Provides state and handlers of dropdown component. Allows you to split up the view while still having access to the internals of dropdown.
10.19.0