Skip to content

Alternative tooltip positioning library #19673

@FezVrasta

Description

@FezVrasta

I've built my career around Bootstrap, developing and maintaining Bootstrap Material Design. Recently I've started working with BS v4, particularly with the new tooltips and popovers powered by Tether.js.

I rapidly got frustrated by them for several reasons...

That inspired me to create Popper.js, a library to manage tooltips, popovers, dropdowns and so on.

It's the result of several years of experience with complex web interfaces which heavily use "poppers" for UX purpose and it spots a long list of features including:

  • half the size of Tether.js (just ~3.5KB);
  • No CSS dependencies;
  • No dependencies required;
  • Supports automatic detection of the tooltip size (included its arrow) to correctly position the tooltip near its reference element, without need to specify offsets manually;
  • It's fully tested by Karma + Jasmine;
  • When you scroll, you don't notice any lag in the popper movement;
  • You can append your tooltip element on any element in the page, not just the body (and everything will still work properly);
  • Popper.js, has automatic support for tooltip element creation. You can define its content, the markup of its arrow and everything you'd expect;
  • It supports a plugin system you can use to customize the behavior of the library;
  • Particular "flip" behaviors are supported, for example if there's not enough space on the left, you can ask the popper to be placed on the bottom of the reference element;
  • The whole code is fully documented using JSDoc;
  • Licensed under MIT;
  • update:
  • Written in ES6;
  • Includes a side library almost identical to the tooltip.js library of Bootstrap;
  • Active community with responsive maintainers;
  • Performance optimizations such as 60fps throttling and passive events support;
  • Absolutely clear code base, easy to modify and patch;
  • auto placement option;

I’d love for you to check out my library and integrate it with Bootstrap V4.

Here the link to the demo page:
http://popper.js.org/

and of the GitHub repo:
https://github.com/FezVrasta/popper.js

Would you be open to a PR?
Please reach out to me with feedback our questions about Popper.js!

Update:

The library has been rewritten in ES6 and its API improved (also, more features have been added), we are finalizing it.
Right now we are writing a side-library with an API very similar to the one used by Bootstrap tooltips, once it will be ready we'll release the new version.
This is being done because our plan is to first replace Tether.js with Popper.js in Bootstrap Material Design v4 to prove the quality of the library and the ease of integration of it.

Popper.js has been successfully adopted by Atlassian and by Le Roy Merlin and both are really happy with it.

Update 2:

Popper.js V1 has been released along with Tooltip.js, I worked to improve the code quality and now it scores 4/4 on Code Climate and 99 on bitHound.
I also added code coverage reports and it's at 91% right now (actually a bit more, but Karma doesn't properly merges the code coverages from IE10)
We added much more tests, we now have around 150 tests ran on Chrome, Firefox, Safari, IE10, IE11 and Edge.
Companies like Microsoft in WebClipper and Atlassian are using it in production and they are very happy! 🎉

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions