Dropdown

View Source

A compact way of displaying content or actionable items in a popover. Use Select for selectable options if needed.

Items

With Tooltip

Custom children

Fetch data on open

No arrow and text truncation

Custom Trigger

Guitar

Props

Accepts Button and Popover props.

asnever

Closes Popover upon selecting a Dropdown.Item.

Externally control Popover open state on initial render.

fontSizeStyleProps['fontSize']
fontWeightStyleProps['fontWeight']
forceOpenboolean

Forces Popover open for testing purposes.

iconLeftstring | ComponentProps
iconRightButtonProps['iconRight'] | null

Gain access to the internal ref.

keepInViewboolean

Attempts to keep popover in view clipping edges if too large.

Locks external scrollbars when open.

matchWidthsboolean | 'minimum'

Matches anchor and popover widths.

onClickMouseEventHandler
onClose() => void

Callback when Popover is closed.

onKeyDownKeyboardEventHandler
onOpen() => void

Callback when Popover is opened.

onSearch(event: KeyboardEvent) => void

Overrides the default search function for selecting a dropdown item via keyboard.

onSelect(data: any) => void
paddingLeftStyleProps['paddingLeft']
paddingVerticalStyleProps['paddingVertical']
placementPlacement

'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end'

Where to place the popover.

Accepts any valid Popover props.

renderToHTMLElement | string

Where to render the popover into. Accepts an HTML element or selector. Uses the closest fixed parent or document.body by default. This will only be computed once on initial render.

spinnerboolean
titleJSX.Element | string
triggerElementReactReactElement | ReactElementType | string | ReactComponentClass | ReactFunctionComponent

Allows specifying a type or custom element that will be cloned and provided Dropdown trigger props. (Defaults to a Button.)

variantstring