Weighs just3 kB!
Click on the dots to place the tooltip. There are 12 different placements to choose from.
Edit on CodeSandboximport{ createPopper}from'@popperjs/core';const popcorn=document.querySelector('#popcorn');const tooltip=document.querySelector('#tooltip');createPopper(popcorn, tooltip,{placement:'top',});
Scroll the container (or the whole page) to see the tooltip stay within the boundary. Once the opposite edges of the popcorn and tooltip are aligned, the tooltip is allowed to overflow to prevent detachment.
Edit on CodeSandboximport{ createPopper}from'@popperjs/core';const popcorn=document.querySelector('#popcorn');const tooltip=document.querySelector('#tooltip');createPopper(popcorn, tooltip,{placement:'right',});
Scroll the container (or the whole page) to see the tooltip flip to the opposite side once it's about to overflow the visible area. Once enough space is detected on its preferred side, it will flip back.
Edit on CodeSandboximport{ createPopper}from'@popperjs/core';const popcorn=document.querySelector('#popcorn');const tooltip=document.querySelector('#tooltip');createPopper(popcorn, tooltip);
Popper is proudly sponsored by the following organizations,
join them onOpen Collective to support us.
Popper aims to "just work" without you needing to configure much. Of course, there are cases where you need to configure Popper beyond its defaults – in these cases, Popper shines by offering high granularity of configuration to fine-tune the position or behavior of your popper.
You can extend Popper with your own modifiers (or plugins) to make your popper work for you, no matter how advanced the scenario.
Popper has billions of hits across the web, is trusted by millions of developers in production, and used in popular libraries like Bootstrap and Material UI.
Support usStart readingPopper's documentation!