Popper

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

Library
npm
v2.11.8
32,701stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
83/100Excellent
Development Activity80
Maintenance84
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture85
Code Quality85
Innovation88
Learning Curve78

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
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
Other

Akaunting

Invoicing Finance

10,070

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Updated yesterday
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,394

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
TypeScript45%
Rust43%
Updated today
PHP
48%
AGPL 3.0

Crater

Invoicing Finance

8,341

Open source invoicing and billing platform for freelancers and small businesses — create estimates, track expenses, accept Stripe payments, and run recurring invoices from your own server.

View details
54
Repo Health
68
Technical
69
Dependency
Built with
PHP48%
Vue40%
Updated 2 years ago
TypeScript
80%
Other

Directus

CMS · Low Code Platforms

37,462

Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.

View details
93
Repo Health
82
Technical
78
Dependency
Built with
TypeScript80%
Vue18%
Updated yesterday
TypeScript
58%
AGPL 3.0

Frappe Books

Invoicing Finance

4,891

Offline desktop accounting with double-entry, POS, and custom invoice templates

View details
62
Repo Health
77
Technical
75
Dependency
Built with
TypeScript58%
Vue39%
Updated 2 months ago
TypeScript
48%
AGPL 3.0

Grafana

Monitoring · Analytics

76,300

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
65
Dependency
Built with
TypeScript48%
Go46%
Updated today
TypeScript
83%
Apache 2.0

Grist

Databases · No Code Platforms

11,469

A modern relational spreadsheet that combines Python-powered formulas, drag-and-drop dashboards, and granular access controls in a self-hostable, SQLite-backed data platform.

View details
91
Repo Health
93
Technical
68
Dependency
Built with
TypeScript83%
Python11%
Updated yesterday
TypeScript
97%
Other

GrowthBook

Developer Tools · Analytics · Monitoring

8,138

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript97%
Updated today

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

Search