interface PopperProps {
    animationDuration?: number;
    appendTo?: HTMLElement | "inline" | (() => HTMLElement);
    direction?: "up" | "down";
    distance?: number;
    enableFlip?: boolean;
    entryDelay?: number;
    exitDelay?: number;
    flipBehavior?: "flip" | (
        | "right"
        | "left"
        | "top"
        | "bottom"
        | "top-start"
        | "top-end"
        | "bottom-start"
        | "bottom-end"
        | "left-start"
        | "left-end"
        | "right-start"
        | "right-end")[];
    isVisible?: boolean;
    maxWidth?: string;
    minWidth?: string;
    onBlur?: ((event?: FocusEvent) => void);
    onDocumentClick?: ((event?: MouseEvent, triggerElement?: HTMLElement, popperElement?: HTMLElement) => void);
    onDocumentKeyDown?: ((event?: KeyboardEvent) => void);
    onFocus?: ((event?: FocusEvent) => void);
    onHidden?: (() => void);
    onHide?: (() => void);
    onMount?: (() => void);
    onMouseEnter?: ((event?: MouseEvent) => void);
    onMouseLeave?: ((event?: MouseEvent) => void);
    onPopperClick?: ((event?: MouseEvent) => void);
    onPopperMouseEnter?: ((event?: MouseEvent) => void);
    onPopperMouseLeave?: ((event?: MouseEvent) => void);
    onShow?: (() => void);
    onShown?: (() => void);
    onTriggerClick?: ((event?: MouseEvent) => void);
    onTriggerEnter?: ((event?: KeyboardEvent) => void);
    placement?: Placement;
    popper: ReactElement<any, string | JSXElementConstructor<any>>;
    popperRef?: HTMLElement | RefObject<any> | (() => HTMLElement);
    position?:
        | "start"
        | "right"
        | "center"
        | "end"
        | "left";
    positionModifiers?: {
        bottom?: string;
        bottomEnd?: string;
        bottomStart?: string;
        left?: string;
        leftEnd?: string;
        leftStart?: string;
        right?: string;
        rightEnd?: string;
        rightStart?: string;
        top?: string;
        topEnd?: string;
        topStart?: string;
    };
    preventOverflow?: boolean;
    trigger?: ReactNode;
    triggerRef?: HTMLElement | RefObject<any> | (() => HTMLElement);
    width?: string;
    zIndex?: number;
}

Properties

animationDuration?: number

The duration of the CSS fade transition animation.

appendTo?: HTMLElement | "inline" | (() => HTMLElement)

The container to append the popper to. Defaults to 'inline'.

direction?: "up" | "down"

popper direction

distance?: number

Distance of the popper to the trigger

enableFlip?: boolean

Enable to flip the popper when it reaches the boundary

entryDelay?: number

Delay in ms before the popper appears

exitDelay?: number

Delay in ms before the popper disappears

flipBehavior?: "flip" | (
    | "right"
    | "left"
    | "top"
    | "bottom"
    | "top-start"
    | "top-end"
    | "bottom-start"
    | "bottom-end"
    | "left-start"
    | "left-end"
    | "right-start"
    | "right-end")[]

The behavior of how the popper flips when it reaches the boundary

isVisible?: boolean

True to make the popper visible

maxWidth?: string

Maximum width of the popper. If the value is "trigger", it will set the max width to the trigger element's width

minWidth?: string

Minimum width of the popper. If the value is "trigger", it will set the min width to the trigger element's width

onBlur?: ((event?: FocusEvent) => void)

Callback function when trigger is blurred (focus leaves)

onDocumentClick?: ((event?: MouseEvent, triggerElement?: HTMLElement, popperElement?: HTMLElement) => void)

Callback function when document is clicked

onDocumentKeyDown?: ((event?: KeyboardEvent) => void)

Callback function when keydown event occurs on document

onFocus?: ((event?: FocusEvent) => void)

Callback function when trigger is focused

onHidden?: (() => void)

Callback when popper's hide transition has finished executing

onHide?: (() => void)

Lifecycle function invoked when the popper begins to transition out.

onMount?: (() => void)

Lifecycle function invoked when the popper has been mounted to the DOM.

onMouseEnter?: ((event?: MouseEvent) => void)

Callback function when mouse enters trigger

onMouseLeave?: ((event?: MouseEvent) => void)

Callback function when mouse leaves trigger

onPopperClick?: ((event?: MouseEvent) => void)

Callback function when popper is clicked

onPopperMouseEnter?: ((event?: MouseEvent) => void)

Callback function when mouse enters popper content

onPopperMouseLeave?: ((event?: MouseEvent) => void)

Callback function when mouse leaves popper content

onShow?: (() => void)

Lifecycle function invoked when the popper begins to transition in.

onShown?: (() => void)

Lifecycle function invoked when the popper has fully transitioned in.

onTriggerClick?: ((event?: MouseEvent) => void)

Callback function when trigger is clicked

onTriggerEnter?: ((event?: KeyboardEvent) => void)

Callback function when Enter key is used on trigger

placement?: Placement

Instead of direction and position can set the placement of the popper

popper: ReactElement<any, string | JSXElementConstructor<any>>

The popper (menu/tooltip/popover) element

popperRef?: HTMLElement | RefObject<any> | (() => HTMLElement)

Reference to the popper (menu/tooltip/popover) element. Passing this prop will remove the wrapper div element from the popper.

position?:
    | "start"
    | "right"
    | "center"
    | "end"
    | "left"

popper position

positionModifiers?: {
    bottom?: string;
    bottomEnd?: string;
    bottomStart?: string;
    left?: string;
    leftEnd?: string;
    leftStart?: string;
    right?: string;
    rightEnd?: string;
    rightStart?: string;
    top?: string;
    topEnd?: string;
    topStart?: string;
}

Map class names to positions, for example: { top: styles.modifiers.top, bottom: styles.modifiers.bottom, left: styles.modifiers.left, right: styles.modifiers.right }

preventOverflow?: boolean

Flag to prevent the popper from overflowing its container and becoming partially obscured.

trigger?: ReactNode

Trigger reference element to which the popper is relatively placed to.

triggerRef?: HTMLElement | RefObject<any> | (() => HTMLElement)

A reference to the trigger reference element that can be passed instead of or along with the trigger prop. When passed along with the trigger prop, the div element that wraps the trigger will be removed.

width?: string

Custom width of the popper. If the value is "trigger", it will set the width to the trigger element's width

zIndex?: number

z-index of the popper element