Popper

A lightweight ~3kB positioning engine that places tooltips, popovers, and dropdowns precisely while keeping them in view.

Library
npm
v2.11.8
32,763 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
79 /100 Good
Development Activity 72
Maintenance 76
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
85 /100 Excellent
Architecture 85
Code Quality 85
Innovation 88
Learning Curve 78

Popper is a small, dependency-free JavaScript positioning engine for “floating” UI elements such as tooltips, popovers, dropdowns, and context menus. Given a reference element and a floating element, it computes the optimal position, keeps the pair aligned through scrolling and resizing, and automatically flips or shifts the element to avoid clipping at the edges of the viewport or any scrolling container.

Built around a tree-shakeable modifier pipeline, Popper handles the countless edge cases of cross-browser positioning (RTL, scrollbars, nested offset parents, virtual elements) so you don’t have to. It powers the overlay primitives of libraries like Bootstrap, Material UI, and Foundation, and integrates cleanly with React, Vue, and Angular.

What You Get

  • A createPopper(reference, popper, options) constructor that positions a floating element relative to a reference element.
  • A library of built-in modifiers for offset, flipping, overflow prevention, arrow placement, and event-driven updates.
  • Collision detection that automatically flips and shifts the element to stay visible within the viewport or scrolling containers.
  • Tree-shakeable ESM builds plus UMD/CDN bundles, along with a smaller createPopperLite entry point for size-sensitive apps.
  • Support for virtual elements, letting you position relative to arbitrary coordinates such as the mouse cursor.

Common Use Cases

  • Positioning tooltips that stay attached to a button while the page scrolls.
  • Building dropdown menus and select popups that flip above the trigger when there is no room below.
  • Rendering popovers and context menus that follow the cursor via a virtual reference element.
  • Powering overlay primitives inside design systems and component libraries.

Under The Hood

Architecture

Popper is organized around a modifier lifecycle orchestrated by popperGenerator in src/createPopper.js. Calling createPopper builds an Instance holding a state object (rects, styles, placement, options); on each update() the engine reads layout via dom-utils helpers (getCompositeRect, getLayoutRect, listScrollParents, getOffsetParent), then runs an ordered list of modifiers through their read and write phases. Modifiers in src/modifiers/ — offset, flip, preventOverflow, arrow, computeStyles, applyStyles, eventListeners, popperOffsets, hide — each mutate state.modifiersData, and orderModifiers topologically sorts them by their requires/requiresIfExists declarations. index.js re-exports the full createPopper, a createPopperLite, and the low-level popperGenerator/detectOverflow primitives.

Tech Stack

The source is authored in JavaScript with Flow type annotations and ships hand-maintained TypeScript definitions (index.d.ts). It has zero runtime dependencies. The build toolchain compiles ES modules with Babel, produces UMD/CJS/ESM bundles with Rollup, generates TypeScript types via flow-to-ts, and lints with ESLint and Prettier. It is marked sideEffects: false to enable aggressive tree-shaking.

Code Quality

The codebase is small, focused, and well-tested. Unit tests (Jest) sit next to the code they cover (roughly 19 *.test.js files across modifiers, utils, and the core constructor) with snapshot coverage, alongside separate tests/functional (browser), tests/visual, tests/flowtype, and tests/typescript suites that validate real positioning behavior across environments. Naming is consistent and the pure-function modifier design keeps logic easy to reason about and test in isolation.

API Design

The public surface is intentionally minimal: one createPopper call plus a declarative modifiers array. Sensible defaults (bottom placement, absolute strategy) mean a working popper needs almost no configuration, while the modifier system exposes deep customization and even custom modifiers for advanced cases. The Lite entry point and CDN bundles lower the barrier to getting started, and the TypeScript/Flow types make options discoverable in editors.

Used by 31 apps in this directory

TypeScript
95%
AGPL 3.0

HeyForm

Forms Surveys · No Code Platforms

9,048

Open-source conversational form builder with AI generation, conditional logic, and 30+ integrations — self-host with full data ownership.

View details
86
Repo Health
67
Technical
67
Dependency
Built with
TypeScript 95%
Updated 5 days ago
PHP
87%
AGPL 3.0

Kimai

Invoicing Finance · Project Management

5,095

Professional open-source time tracking with invoicing, multi-user support, SAML/LDAP auth, and a full REST API—self-host it or use the cloud.

View details
94
Repo Health
78
Technical
64
Dependency
Built with
PHP 87%
Updated 5 days ago
PHP
55%
AGPL 3.0

Leantime

Collaboration · Productivity · Project Management

11,890

Project management built for ADHD, autism, and dyslexia — simple as Trello, powerful as Jira

View details
90
Repo Health
68
Technical
62
Dependency
Built with
PHP 55%
CSS 18%
Blade 14%
Updated 1 weeks ago
JavaScript
42%
Other

LimeSurvey

Forms Surveys

3,778

The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.

View details
86
Repo Health
62
Technical
62
Dependency
Built with
JavaScript 42%
PHP 36%
CSS 12%
Updated 5 days ago
Svelte
32%
GPL 3.0

Mathesar

Databases

5,158

Spreadsheet-like interface for your PostgreSQL database — self-hosted, no SQL required, native Postgres access control.

View details
70
Repo Health
80
Technical
68
Dependency
Built with
Svelte 32%
TypeScript 27%
Python 21%
Updated 6 days ago
Clojure
57%
Other

Metabase

Analytics

49,827

The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.

View details
95
Repo Health
84
Technical
62
Dependency
Built with
Clojure 57%
TypeScript 38%
Updated 5 days ago
JavaScript
88%
GPL 3.0

NodeBB

Community

15,242

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
70
Dependency
Built with
JavaScript 88%
Go Template 11%
Updated 5 days ago
Vue
41%
AGPL 3.0

Operational

Analytics · Automation · Monitoring

474

Open-source event tracker with real-time push notifications and action buttons for tech founders.

View details
54
Repo Health
68
Technical
68
Dependency
Built with
Vue 41%
JavaScript 39%
MDX 13%
Updated 3 weeks ago
PHP
62%
Other

OpnForm

Forms Surveys · Marketing

3,865

Build unlimited, embeddable forms with no code — powered by AI, logic rules, and real-time analytics

View details
91
Repo Health
75
Technical
65
Dependency
Built with
PHP 62%
Vue 28%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers