DropdownMenu

A dropdown menu displays a list of actions or options to a user.

View source code
  • options
    (T | OptionGroup<T>)[]

    The list of options in the menu.

  • renderButton
    (getToggleButtonProps: (options?: GetToggleButtonPropsOptions) => ToggleButtonProps, isDropdownOpened: boolean) => ReactNode

    Function to render the button.

  • className
    string

    className for the element.

  • dropdownContentMaxHeight
    string

    Maximum height of the dropdown content.

  • keepOpenOnSelect
    boolean

    Whether the dropdown should stay open when an option is selected.

    Default: false
  • onSelect
    (option: T) => void

    Handler that is called when a option is selected.

  • placement
    "bottom-end" | "bottom-start" | "end-bottom" | "end-top" | "top-end" | "top-start"

    Placement the menu will render relative to the field.

    Default: bottom-start
  • renderOption
    (option: T, index: number, state?: { isSelected: boolean; }) => ReactNode

    Function to render option. Should return DropdownItem(s).

  • renderOptionGroup
    (optionGroup: OptionGroup<T>) => ReactNode

    Function to render option group.