Popper.js
Speaking of tricky things to get right: tooltips!
Tooltips need to be particularly self-aware, so they don’t stick out someplace where they can’t be read. Then continue to be smart as the page state changes, like is resized or scrolled. …