usePopper
API
import usePopper from 'react-overlays/usePopper'
usePopper
(referenceElement: VirtualElement | null | undefined, popperElement: HTMLElement | null | undefined, options: object) => UsePopperStatePosition an element relative some reference element using Popper.js
Parameters
referenceElement
VirtualElement | null | undefinedpopperElement
HTMLElement | null | undefinedoptions
objectenabled?
booleantoggle the popper functionality on/off
placement?
stringThe popper element placement relative to the reference element
strategy?
stringthe positioning strategy
modifiers?
objectPopper.js modifiers
eventsEnabled?
booleanhave Popper listen on window resize events to reposition the element
onCreate?
functioncalled when the popper is created
onUpdate?
functioncalled when the popper is updated
config
Return Value
UsePopperStateThe popper state