{
 "kind": "tool",
 "slug": "react-leaflet",
 "path": "tools/react-leaflet/",
 "name": "React Leaflet",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "3D and graphics",
   "tools/3d-graphics/"
  ]
 ],
 "lead": "React components for Leaflet maps enabling interactive mapping in React applications.",
 "chips": [
  {
   "label": "3D and graphics",
   "path": "tools/3d-graphics/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install react-leaflet"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/PaulLeCam/react-leaflet"
  },
  {
   "label": "Website",
   "href": "https://react-leaflet.js.org"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "Hippocratic-2.1",
   "status": "cond",
   "sub": "Read the terms",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/PaulLeCam/react-leaflet"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 15, 2026",
   "note": "Latest GitHub release Dec 14, 2024. ",
   "src": "https://github.com/PaulLeCam/react-leaflet"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "61 projects",
   "status": "info",
   "sub": "#4 of 63 in its category",
   "note": "Dependency in 61 public GitHub projects set up for AI coding agents that we scanned (1.0%).",
   "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 React Leaflet does",
   "parts": [
    {
     "t": "prose",
     "text": "React Leaflet wraps Leaflet layers as React components without replacing Leaflet: Leaflet does the DOM rendering, and props are used to create Leaflet instances and are immutable by default."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "React Leaflet popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "69",
       "of": "/ 100",
       "l": "Gid Score, #418 overall"
      },
      {
       "n": "7.7M",
       "l": "downloads a week, npm"
      },
      {
       "n": "5,608",
       "l": "GitHub stars"
      },
      {
       "n": "61",
       "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 React Leaflet is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "React Leaflet is a dependency in 61 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.3% of the 4,867 JavaScript/TypeScript ones), #4 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 388; 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 Leaflet (95.1%), Lucide React (88.5%), clsx (80.3%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "30 projects, 0.9%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "29 projects, 1.2%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "25 projects, 0.8%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "6 projects, 2.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "5 projects, 1.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 95.1% of its projects",
       "v": "Leaflet",
       "path": "tools/leaflet/"
      },
      {
       "l": "In 88.5% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 80.3% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 80.3% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 77.0% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 96.7% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 93.4% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 65.6% of its projects",
       "v": "Radix UI",
       "path": "tools/radix-ui/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "React Leaflet in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Leaflet does the layer rendering",
       "v": "React only renders the <code>&lt;div&gt;</code> for <code>MapContainer</code> and the contents of UI layer components. The docs say rendering the layers to the DOM \"is done by Leaflet itself\"."
      },
      {
       "l": "Refs expose the Leaflet instance",
       "v": "Unless stated otherwise, every exported component supports a ref that exposes the created Leaflet element instance. For panes, the ref exposes the DOM element. The docs say this gives access to Leaflet's imperative APIs when required."
      },
      {
       "l": "Layers follow the render tree",
       "v": "When a child component renders again, the docs say changes to its supported mutable props are applied to the map. When it is removed from the render tree, it removes its layer from the map as needed."
      },
      {
       "l": "A key resets the map",
       "v": "The docs say a unique <code>key</code> on a <code>MapContainer</code> element can be set to reset it."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Not compatible with server-side rendering",
       "v": "The docs say Leaflet makes direct calls to the DOM when it is loaded, and that React Leaflet is therefore not compatible with server-side rendering."
      },
      {
       "l": "Props are immutable by default",
       "v": "Props are used to create the Leaflet instance on the first render. The docs say they will not be updated in the UI when they change unless they are explicitly documented as mutable."
      },
      {
       "l": "Some components must be replaced via key",
       "v": "The docs say some properties can be updated through Leaflet's setters. Other components should be completely replaced by setting a unique value on their <code>key</code> property."
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about React Leaflet",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Packages around it",
       "items": [
        "leaflet: Underlying map library",
        "lucide-react: Icon components",
        "clsx: className builder",
        "tailwind-merge: Tailwind class merging",
        "class-variance-authority: Component style variants",
        "@radix-ui: Headless UI primitives"
       ]
      },
      {
       "title": "More in 3D and graphics",
       "path": "tools/3d-graphics/",
       "items": [
        {
         "text": "Three.js",
         "path": "tools/three/"
        },
        {
         "text": "Leaflet",
         "path": "tools/leaflet/"
        },
        {
         "text": "React Three Fiber",
         "path": "tools/react-three/"
        },
        {
         "text": "@napi-rs/canvas",
         "path": "tools/napi-rs-canvas/"
        },
        {
         "text": "MapLibre GL",
         "path": "tools/maplibre-gl/"
        },
        {
         "text": "Resvg-JS",
         "path": "tools/resvg-resvg-js/"
        },
        {
         "text": "OGL",
         "path": "tools/ogl/"
        },
        {
         "text": "node-canvas",
         "path": "tools/canvas/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "React Leaflet",
       "me": true,
       "facts": [
        "Hippocratic-2.1",
        "Gid 69",
        "7.7M/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": "react-map-gl",
       "why": "React components for MapLibre GL and Mapbox GL for interactive maps.",
       "path": "tools/react-map-gl/",
       "facts": [
        "MIT",
        "Gid 58",
        "3.7M/wk"
       ]
      }
     ],
     "more": "Compare React 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 react-leaflet"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## React Leaflet\n- The docs say React Leaflet \"is not compatible with server-side rendering\" because Leaflet makes direct calls to the DOM when it is loaded. Account for this in SSR frameworks.\n- Use other React Leaflet components and hooks only as descendants of a `MapContainer`.\n- Treat component props as immutable by default. Only props explicitly documented as mutable are updated in the UI when they change.\n- Mutable prop changes are compared by reference unless the docs state otherwise. They are applied by calling the relevant method on the Leaflet instance.\n- For components that should be completely replaced, set a unique value on their `key` prop. To reset a whole map, set a unique `key` on `MapContainer`.\n- Do not use React's `Activity` component with the map. The docs call it incompatible with how React Leaflet works.\n- Use refs to Leaflet instances carefully, since imperative calls may create inconsistencies with props. For v5, React v19 is a required peer dependency and `LeafletProvider` is no longer in the core package.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm react-leaflet"
  ],
  [
   "Category",
   "3D and graphics"
  ],
  [
   "License",
   "Hippocratic-2.1"
  ],
  [
   "Latest version",
   "v5.0.0, December 14, 2024"
  ],
  [
   "On GitHub since",
   "August 2014"
  ],
  [
   "Gid Score",
   "69.3"
  ],
  [
   "Rank in category",
   "#4 of 63"
  ],
  [
   "GitHub",
   "PaulLeCam/react-leaflet"
  ],
  [
   "Last change",
   "Nov 15, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/paullecam.png"
}