Dropdown

Dropdown allow users select a single item from a list of options.

Default

Default usage of Dropdown

Custom Toggle

We can set custom toggler for Dropdown via renderTitle prop.

Trigger

Dropdown allow us to settrigger mode to click, hover or context.

Placement

Dropdown menu placement can be assign around the trigger element in different positions via placement prop.

Default Active

Set Dropdown.Item eventKey value to activeKey prop to highlight the Dropdown.Item active status.

Disabled

disabled prop can be use in both Dropdown or Dropdown.Item to disable user action.

API

Dropdown
PropDescriptionTypeDefault
titleDropdown titlestring-
renderTitleCustom Dropdown titleReactNode-
triggerTrigger mode of Dropdown'click' | 'hover' | 'context' 'click'
placementPlacement where the Dropdown menu expand'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' | 'middle-start-top'| 'middle-start-bottom' | 'middle-end-top'| 'middle-end-bottom''bottom-start'
menuClassAdditional class for dropdown menu (! modifier recommended for tailwind css overiding)string-
menuStyleAdditional styles for dropdown menuobject-
toggleClassNameAdditional class dropdown toggle (! modifier recommended for tailwind css overiding)string-
disabledWhether to disable Dropdown expandboolean-
activeKeyMark corresponded Dropdown.Itemto active by matching it eventkey propstring-
onClickCallback when Dropdown toggle is clicked(e: MouseEvent) => void-
onMouseEnterCallback when Dropdown toggle is on mouse enter(e: MouseEvent) => void-
onMouseLeaveCallback when Dropdown toggle is on mouse leave(e: MouseEvent) => void-
onContextMenuCallback when Dropdown toggle is right clicked(e: MouseEvent) => void-
onSelectCallback when Dropdown item is clicked(e: MouseEvent) => void-
onOpenCallback when Dropdown is open() => void-
onCloseCallback when Dropdown is close() => void-
onToggleCallback when Dropdown is open or close(open: boolean) => void-
Dropdown.Item
PropDescriptionTypeDefault
activeWhether active current Dropdown Itemboolean-
disabledWhether disabled current Dropdown Itemboolean-
variantDefine the type of Dropdown Item 'default' | 'header' | 'divider' | 'custom'-
eventKeyThe value of Dropdown Itemstring-
onClickCallback when Dropdown Item is clicked() => void-
onSelectCallback when Dropdown Item is clicked(eventKey: string, e: MouseEvent) => void-
Dropdown.Menu
PropDescriptionTypeDefault
titleTitle for submenustring | ReactNode-
eventKeyThe value of Dropdown submenustring-
placementPlacement where the Dropdown menu expand'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' | 'middle-start-top'| 'middle-start-bottom' | 'middle-end-top'| 'middle-end-bottom'-