Home (original) (raw)

The future of Popper is here! Floating UI is now available. Get it now!

Popper logo

Tooltip & Popover

Positioning Engine

Weighs just 3 kB!

Star on GitHubDocumentation

npm i @popperjs/core

CDN

https://unpkg.com/@popperjs/core@2

Don't mind tech-related ads? Consider disabling your ad-blocker to help us!
They are small and unobtrusive.
Alternatively, support us on Open Collective!

Popcorn box

Placement

Click on the dots to place the tooltip. There are 12 different placements to choose from.

import { createPopper } from '@popperjs/core';

const popcorn = document.querySelector('#popcorn');

const tooltip = document.querySelector('#tooltip');

createPopper(popcorn, tooltip, {

placement: 'top',

});

Edit on CodeSandbox

Popcorn box

Popcorn

sizes

& Price

XXS: $1.99

XS: $2.99

S: $3.99

M: $4.99

L: $5.99

XL: $6.99

XXL: $7.99

Overflow prevention

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.

import { createPopper } from '@popperjs/core';

const popcorn = document.querySelector('#popcorn');

const tooltip = document.querySelector('#tooltip');

createPopper(popcorn, tooltip, {

placement: 'right',

});

Edit on CodeSandbox

Popcorn box

Flipping

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.

import { createPopper } from '@popperjs/core';

const popcorn = document.querySelector('#popcorn');

const tooltip = document.querySelector('#tooltip');

createPopper(popcorn, tooltip);

Edit on CodeSandbox

In a nutshell, Popper:

Our Sponsors

Popper is proudly sponsored by the following organizations,
join them on Open Collective to support us.

Granular configuration with sensible defaults

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.

No compromises