usePopper

    API

    import usePopper from 'react-overlays/usePopper'
    • usePopper(referenceElement: VirtualElement | null | undefined, popperElement: HTMLElement | null | undefined, options: object) => UsePopperState

      Position an element relative some reference element using Popper.js

      Parameters

      • referenceElementVirtualElement | null | undefined
      • popperElementHTMLElement | null | undefined
      • optionsobject
        • enabled?boolean

          toggle the popper functionality on/off

        • placement?string

          The popper element placement relative to the reference element

        • strategy?string

          the positioning strategy

        • modifiers?object

          Popper.js modifiers

        • eventsEnabled?boolean

          have Popper listen on window resize events to reposition the element

        • onCreate?function

          called when the popper is created

        • onUpdate?function

          called when the popper is updated

        • config

      Return Value
      UsePopperState

      The popper state