Easily position tooltips, popovers and so on
with just a line of code!

Trust us, managing poppers can be a pain, we have learned it the hard way!
For this reason we have created Popper.js, your new best friend.

Popper.js is just ~4KB minified and gzpipped, no dependencies required!

Hey!

Choose where to put your popper!

Popper on

Popper on your side!

What are you waiting for ? Select a popper from that dropdown =>

Scroll me

up and down

I follow it

staying between boundaries

Popper on scrolling container

In this example we have a relative div which contains a div with overflow: scroll.
Inside it, there are our popper and reference elements.

var popper = new Popper(referenceElement, onLeftPopper, {
    placement: 'left',
    boundariesElement: container
});

Drag me

on the edges

Flipping popper

which never goes on right side

Custom flip behavior

Try dragging the reference element on the left side, its popper will move on its bottom edge. Then, try to move the reference element on the bottom left corner, it will move on its top edge.

var popper = new Popper(referenceElement, onLeftPopper, {
    placement: 'left',
    flipBehavior: ['left', 'bottom', 'top'],
    boundariesElement: container
});

Reference

Shifted popper

on start

Shifted popper

on end

Shifted poppers

Shift your poppers on start or end of its reference element side.

var shiftStart = new Popper(referenceElement, shiftStartPopper, {
    placement: 'left-start',
    boundariesElement: container
});

var shiftEnd = new Popper(referenceElement, shiftEndPopper, {
    placement: 'bottom-end',
    boundariesElement: container
});

Pop

on the bottom

Popper on bottom

Flips when hits viewport

Viewport boundaries

By default, poppers use as boundaries the page viewport.
Scroll the page to see the popper flip when hits the page viewport margins.

var popper = new Popper(referenceElement, onBottomPopper, {
    placement: 'bottom'
});

Features

We know, every popper has its own story. You must be able to fully customize
its behavior with ease. We have prepared a set of awesome options to satisfy your needs!

But they will never be enough, for this reason, Popper.js supports plugins (we call them "Modifiers")

  • Placements

    You decide where the popper will stay, choose between the four sides of your reference element and shift it on the start or at the end of it.

  • Custom Boundaries

    We don't want your poppers to get lost. Give them some boundaries to make sure they will stay within them.

  • Flip and Move

    What if your popper hits walls? Will it act like a ghost, passing through it, or will it change side of its reference element? It's up to you.

  • Arrows

    Poppers have arrows, usually.
    We take care of them making sure they stay in the right place: between popper and reference element.

  • Fixed or Absolute?

    We automatically detect when your popper should be absolutely positioned or fixed. Don't worry about that!

  • GPU Acceleration

    If supported by browser, poppers will be positioned using CSS translate3d, making your poppers even faster!

  • Offsets

    When you need surgical precision about the position of your popper, set an offset to it to shift it by the given amount of pixels.

  • Modifiers

    Our plugin system allows you to add any kind of feature to Popper.js.
    Most of the built-in behaviors are written as modifiers!

Ready to start?

Visit our GitHub page to know how to get Popper.js and to learn more about it.