A Mapbox React component.

Usage no npm install needed!

<script type="module">
  import mapboxReactPopoverTrigger from 'https://cdn.skypack.dev/@mapbox/react-popover-trigger';



Interact with the content of a PopoverTrigger to open and close a Popover.

This component internally manages the open-closed state of the Popover. If you want to manage it yourself, use react-popover directly.

respondsToClick, respondsToHover, and respondsToFocus props determine the means of opening and closing the Popover with interactions. If you open the Popover with a hover or focus, you can also close it by hovering away or blurring. If, however, you open the Popover with a click, you can only close it with another click, on the trigger or outside the Popover. If you've opened the Popover with a hover and then you click, it is then considered to be opened with a click and will only close with another click (not hovering away).


npm install @mapbox/react-popover-trigger


Please check propTypes in src/popover-trigger.js.