Leaflet

The leading lightweight open-source JavaScript library for mobile-friendly interactive maps.

Library
npm
v1.9.4
45,772 stars
BSD-2-Clause

Repository Health

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

Technical Analysis

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

Leaflet is a lightweight, open-source JavaScript library for building interactive maps on the web. Weighing roughly 40 kB of gzipped JS plus a few kilobytes of CSS, it provides all the core mapping primitives most applications need — tile layers, markers, popups, vector overlays, and GeoJSON rendering — without pulling in a heavy dependency tree.

Designed around simplicity, performance, and cross-platform usability, Leaflet works efficiently across desktop and mobile browsers out of the box and degrades gracefully on older ones. Its small, class-based core is intentionally minimal; almost everything beyond the basics (routing, clustering, heatmaps, drawing tools, additional tile providers) is delivered through a large third-party plugin ecosystem rather than baked into the library itself, which keeps the base bundle small while still supporting sophisticated mapping applications.

What You Get

  • A tile-layer engine that works with any XYZ/TMS raster tile provider (OpenStreetMap, Mapbox, custom servers) with no vendor lock-in
  • Vector drawing primitives — polylines, polygons, circles, and rectangles — rendered via SVG or Canvas
  • Marker, popup, and tooltip components with custom icon support out of the box
  • Built-in GeoJSON layer support for rendering and styling geographic data directly from standard GeoJSON objects
  • Touch, keyboard, and mouse interaction handling (drag, zoom, double-click zoom, box zoom, touch pinch-zoom) tuned for mobile
  • A documented extension API (L.Class, L.Evented, L.Handler) that the plugin ecosystem builds on for routing, clustering, drawing tools, and additional tile sources

Common Use Cases

  • Embedding a store-locator or ‘find us’ map with custom markers and popups on a marketing site
  • Building internal dashboards that plot GeoJSON boundaries or sensor/asset locations over a base map
  • Powering data-journalism or humanitarian-mapping projects that need lightweight, self-hostable maps without a paid API key
  • Adding a drawable/interactive map layer to a field-operations or logistics app via plugins like Leaflet.draw or marker clustering

Under The Hood

Architecture Leaflet’s execution model centers on L.Map (src/map/Map.js), which owns the DOM container, coordinate transforms, and a panning/zoom animation loop, and delegates rendering to a stack of L.Layer subclasses (src/layer/Layer.js, LayerGroup.js, tile/, vector/) added and removed via a shared addLayer/removeLayer lifecycle. Geometry and projection math live in src/geo and src/geometry, decoupling coordinate-system logic (CRS, projections) from DOM rendering, while user interaction (drag, scroll-wheel zoom, touch, keyboard) is implemented as pluggable L.Handler instances (src/core/Handler.js) attached per-map-instance rather than hardcoded into L.Map — the same pattern third-party plugins use to add new interactions without forking the core.

Tech Stack The library is plain, dependency-free JavaScript (ES modules, "type": "module" in package.json) built with Rollup (build/rollup-config.js) into UMD and ES bundles plus a companion leaflet.css; there is no runtime dependency on a framework or a specific tile/basemap provider. Development tooling is modern (ESLint 10 flat config, Husky pre-commit hooks, Vitest with a real-browser Playwright provider for DOM-accurate tests), and the project self-monitors bundle size via bundlemon.

Code Quality The spec/suites directory contains roughly 49 test files covering core classes, layers, geometry, and DOM interaction helpers, run against an actual browser via @vitest/browser-playwright rather than a DOM shim, which gives meaningfully higher confidence for a browser-rendering library than jsdom-based tests would. Source files carry structured leafdoc comments (// @function, // @class) that double as the API reference generator input, and the core class system (src/core/Class.js) enforces a consistent extension/options-merging convention used uniformly across the codebase.

API Design The public API follows one consistent idiom throughout — chainable methods returning this, a class-mixin pattern (L.Class.extend) for building custom layers/handlers, and declarative options objects merged via mergeOptions — so once a developer learns L.Map/L.Marker, plugin APIs feel familiar rather than bolted-on. Getting a basic map on screen requires only a few lines (instantiate L.map, add a L.tileLayer, call setView), and the leafdoc-generated reference plus a large library of runnable examples (docs/examples) keep the learning curve shallow for a library of this scope.

Used by 19 apps in this directory

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
Python
58%
Apache 2.0

MLflow

AI Development · Monitoring

28,512

The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.

View details
96
Repo Health
86
Technical
67
Dependency
Built with
Python 58%
TypeScript 35%
Updated 5 days ago
TypeScript
65%
Other

NocoDB

Databases · Low Code Platforms · No Code Platforms

65,340

Turn any SQL database into a collaborative no-code spreadsheet with automatic REST APIs and real-time views.

View details
91
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 65%
Vue 30%
Updated 5 days ago
Python
38%
Other

Open WebUI

AI Agents · AI Assistants

156,607

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
92
Repo Health
75
Technical
66
Dependency
Built with
Python 38%
Svelte 35%
JavaScript 19%
Updated 5 days ago
TypeScript
39%
AGPL 3.0

OpenObserve

Analytics · Devops · Monitoring

22,475

Open source observability platform for logs, metrics, traces, and real user monitoring — delivering 140x lower storage costs than Elasticsearch with a single binary you can run in under 2 minutes.

View details
90
Repo Health
9
Technical
68
Dependency
Built with
TypeScript 39%
Rust 30%
Vue 17%
Updated 5 days ago
Go
69%
MIT

PocketBase

Authentication · Databases · Ecommerce

61,570

Open Source realtime backend in 1 file — embedded SQLite, auth, file storage, and admin UI as a single Go binary.

View details
90
Repo Health
87
Technical
77
Dependency
Built with
Go 69%
JavaScript 24%
Updated 6 days ago
Python
45%
Other

Redash

Analytics · Data Engineering

28,849

Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.

View details
91
Repo Health
74
Technical
61
Dependency
Built with
Python 45%
JavaScript 29%
TypeScript 19%
Updated 1 weeks ago
TypeScript
97%
AGPL 3.0

Swetrix

Analytics

1,213

Privacy-first, cookieless web analytics with error tracking, session replays, and performance monitoring — self-host or use Cloud.

View details
87
Repo Health
71
Technical
66
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,119

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
64
Dependency
Built with
TypeScript 98%
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