{
 "kind": "tool",
 "slug": "leaflet",
 "path": "tools/leaflet/",
 "name": "Leaflet",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "3D and graphics",
   "tools/3d-graphics/"
  ]
 ],
 "lead": "Lightweight JavaScript library for creating mobile-friendly interactive maps.",
 "chips": [
  {
   "label": "3D and graphics",
   "path": "tools/3d-graphics/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install leaflet"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/Leaflet/Leaflet"
  },
  {
   "label": "Website",
   "href": "https://leafletjs.com/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "BSD-2-Clause",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/Leaflet/Leaflet"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "Latest GitHub release May 18, 2023. ",
   "src": "https://github.com/Leaflet/Leaflet"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "95 projects",
   "status": "info",
   "sub": "#2 of 63 in its category",
   "note": "Dependency in 95 public GitHub projects set up for AI coding agents that we scanned (1.5%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Leaflet does",
   "parts": [
    {
     "t": "prose",
     "text": "Leaflet's site says it \"doesn't try to do everything for everyone\" and instead focuses on \"making the basic things work perfectly\". The project currently sits between a v1.9.4 release from 2023 and a 2.0 alpha that the website already leads with."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Leaflet popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "76",
       "of": "/ 100",
       "l": "Gid Score, #176 overall"
      },
      {
       "n": "11.9M",
       "l": "downloads a week, npm"
      },
      {
       "n": "46K",
       "l": "GitHub stars"
      },
      {
       "n": "95",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Leaflet is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Leaflet is a dependency in 95 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.0% of the 4,867 JavaScript/TypeScript ones), #2 of 63 in 3d and graphics.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 250; those are left out of every share on this page.",
      "The most used alternative in our scan is Mapbox GL (24 projects).",
      "Projects that use it most often also use React Leaflet (61.1%), Tailwind CSS (89.5%), Lucide React (67.4%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "51 projects, 1.6%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "46 projects, 1.5%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "45 projects, 1.8%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "9 projects, 1.9%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "7 projects, 1.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "7 projects, 2.0%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "6 projects, 2.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 61.1% of its projects",
       "v": "React Leaflet",
       "path": "tools/react-leaflet/"
      },
      {
       "l": "In 89.5% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 67.4% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 64.2% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 58.9% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 64.2% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 47.4% of its projects",
       "v": "Recharts",
       "path": "tools/recharts/"
      },
      {
       "l": "In 46.3% of its projects",
       "v": "date-fns",
       "path": "tools/date-fns/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Leaflet in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "No external dependencies",
       "v": "Under \"Misc\", the website's feature list says Leaflet is \"Extremely lightweight\" and has \"No external dependencies\"."
      },
      {
       "l": "Common layer types come built in",
       "v": "The site lists several layer types \"out of the box\": tile layers, WMS, markers, popups, polylines, polygons, circles, rectangles, image overlays and GeoJSON."
      },
      {
       "l": "Inertia panning, shift-drag zoom, marker dragging",
       "v": "The site lists these interaction features: drag panning with inertia, scroll-wheel zoom, pinch-zoom on mobile, double-click zoom, shift-drag zoom to area, keyboard navigation, click and pointer events, and marker dragging."
      },
      {
       "l": "Vector clipping and a modular build",
       "v": "The site says polyline and polygon rendering uses \"dynamic clipping and simplification\", which it says \"makes it very fast\". It also lists a modular build for leaving out unused features, and tap delay elimination on mobile."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Latest GitHub release dates from May 2023",
       "v": "The latest GitHub release is v1.9.4, published 2023-05-18. It was a bug-fix release, with fixes such as tile gaps in Chromium-based browsers."
      },
      {
       "l": "Homepage opens on a 2.0 alpha",
       "v": "The website's first line says Leaflet 2.0.0-alpha.1 \"has been released\" and gives the date August 16, 2025. None of the sources here give release notes for the alpha, so what changed from 1.9.4 is not stated."
      },
      {
       "l": "Missing features: plugins first, then issues",
       "v": "If a feature is missing, the site's advice is to check for a plugin and search past GitHub issues first. Only after that should you open a new GitHub issue."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Homepage example: OpenStreetMap tiles and a marker with a popup"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Javascript",
       "code": "import {LeafletMap, TileLayer, Marker} from 'leaflet';\n\nconst map = new LeafletMap('map').setView([51.505, -0.09], 13);\n\nnew TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n    attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n}).addTo(map);\n\nnew Marker([51.5, -0.09]).addTo(map)\n    .bindPopup('A pretty CSS popup.<br> Easily customizable.')\n    .openPopup();"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Leaflet",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/Leaflet",
        "Open Collective: https://opencollective.com/leafletjs",
        "19 GitHub sponsors"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "react-leaflet: React bindings for Leaflet",
        "lucide-react: Icon components",
        "tailwindcss: Utility-first CSS",
        "tailwind-merge: Tailwind class merging",
        "clsx: Class name joining",
        "class-variance-authority: Component style variants"
       ]
      },
      {
       "title": "More in 3D and graphics",
       "path": "tools/3d-graphics/",
       "items": [
        {
         "text": "Three.js",
         "path": "tools/three/"
        },
        {
         "text": "React Three Fiber",
         "path": "tools/react-three/"
        },
        {
         "text": "React Leaflet",
         "path": "tools/react-leaflet/"
        },
        {
         "text": "@napi-rs/canvas",
         "path": "tools/napi-rs-canvas/"
        },
        {
         "text": "Resvg-JS",
         "path": "tools/resvg-resvg-js/"
        },
        {
         "text": "OGL",
         "path": "tools/ogl/"
        },
        {
         "text": "node-canvas",
         "path": "tools/canvas/"
        },
        {
         "text": "Simplex Noise",
         "path": "tools/simplex-noise/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Leaflet",
       "me": true,
       "facts": [
        "BSD-2-Clause",
        "Gid 76",
        "11.9M/wk"
       ]
      },
      {
       "name": "Mapbox GL",
       "why": "WebGL-based interactive maps library for rendering vector tiles and geospatial data.",
       "path": "tools/mapbox-gl/",
       "facts": [
        "SEE LICENSE IN LICENSE.txt",
        "Gid 64",
        "6.4M/wk"
       ]
      },
      {
       "name": "MapLibre GL",
       "why": "Open-source WebGL interactive maps library with BSD license and community support.",
       "path": "tools/maplibre-gl/",
       "facts": [
        "BSD-3-Clause",
        "Gid 66",
        "11.4M/wk"
       ]
      }
     ],
     "more": "Compare Leaflet with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install leaflet"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Leaflet\n- Create the map in an existing container element (the docs use a `'map'` div), then call `setView` with a center and a zoom level.\n- These layers come with core \"out of the box\": tile layers, WMS, markers, popups, polylines, polygons, circles, rectangles, image overlays and GeoJSON.\n- Restyle popups and controls through CSS, which the docs describe as \"Pure CSS popups and controls for easy restyling\".\n- For custom behaviour, use the docs' \"simple interface for custom map layers and controls\", or extend existing classes with the OOP facilities the docs list.\n- If a feature is missing from core, look for an existing plugin and search GitHub issues before opening a new issue.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm leaflet"
  ],
  [
   "Category",
   "3D and graphics"
  ],
  [
   "License",
   "BSD-2-Clause"
  ],
  [
   "Latest version",
   "v1.9.4, May 18, 2023"
  ],
  [
   "On GitHub since",
   "September 2010"
  ],
  [
   "Gid Score",
   "76.1"
  ],
  [
   "Rank in category",
   "#2 of 63"
  ],
  [
   "GitHub",
   "Leaflet/Leaflet"
  ],
  [
   "Last change",
   "Nov 23, 2026"
  ]
 ],
 "good": [
  "Used by GitHub, foursquare, Pinterest, Facebook, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/leaflet.png"
}