useDropdownMenu

    Create custom dropdown menus without the extra component with useDropdownMenu. Make sure to spread through the returned props. If creating a navigation menu (as described here), make sure to provide the role='menu' prop to automatically get correct keyboard focus handling.

    API

    import useDropdownMenu from 'react-overlays/DropdownMenu'
    • useDropdownMenu(options: object) => void

      Parameters

      • optionsobject
        • flipboolean

          Automatically adjust the menu drop position based on viewport edge detection

        • offset[number, number]

          Define an offset distance between the Menu and the Toggle

        • showboolean

          Display the menu manually, ignored in the context of a Dropdown

        • usePopperboolean

          opt in/out of using PopperJS to position menus. When disabled you must position it yourself.

        • rootCloseEventstring

          The pointer event to listen for when determining "clicks outside" the menu for triggering a close.

        • popperConfigobject

          Options passed to the usePopper hook.