npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

solidjs-simple-maps

v1.3.2

Published

An svg map chart component built for SolidJS

Downloads

847

Readme

solidjs-simple-maps

An SVG map chart component built for SolidJS, heavily inspired by react-simple-maps.

Features

  • Declarative API: Build maps using composable components.
  • Topographical Support: Works with TopoJSON files.
  • Zoom & Pan: Built-in support for zooming and panning interactions.
  • SEO Ready: Optional MapWithMetadata component for SEO optimization (OpenGraph, Twitter Cards, etc.).
  • Type Safe: Written in TypeScript with full type definitions.
  • Lightweight: Optimized for performance.

Installation

npm install solidjs-simple-maps solid-js @solidjs/meta

Note: d3-geo, d3-selection, d3-zoom and topojson-client are installed automatically as dependencies. @solidjs/meta is required if you use MapWithMetadata.

Basic Usage

Using the <For> component for efficient rendering:

import { For } from "solid-js";
import { ComposableMap, Geographies, Geography } from "solidjs-simple-maps";

const geoUrl = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json";

function App() {
    return (
        <ComposableMap>
            <Geographies geography={geoUrl}>
                {({ geographies }) => <For each={geographies}>{(geo) => <Geography geography={geo} fill="#DDD" stroke="#FFF" />}</For>}
            </Geographies>
        </ComposableMap>
    );
}

Zoomable Map Example

Wrap your map content in ZoomableGroup to enable pan and zoom:

import { For } from "solid-js";
import { ComposableMap, Geographies, Geography, ZoomableGroup } from "solidjs-simple-maps";

const geoUrl = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json";

function App() {
    return (
        <ComposableMap>
            <ZoomableGroup minZoom={1} maxZoom={10}>
                <Geographies geography={geoUrl}>
                    {({ geographies }) => <For each={geographies}>{(geo) => <Geography geography={geo} fill="#EAEAEC" stroke="#D6D6DA" />}</For>}
                </Geographies>
            </ZoomableGroup>
        </ComposableMap>
    );
}

Advanced Usage

SEO & Metadata

You can use the MapWithMetadata wrapper to automatically inject SEO tags into the head of your document using @solidjs/meta.

import { For } from "solid-js";
import { MetaProvider } from "@solidjs/meta";
import { MapWithMetadata, Geographies, Geography } from "solidjs-simple-maps";

const geoUrl = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json";

function App() {
    return (
        <MetaProvider>
            <MapWithMetadata
                metadata={{
                    title: "My Awesome Interactive Map",
                    description: "A detailed map of the world created with SolidJS.",
                    keywords: ["map", "solidjs", "world"],
                    author: "Me",
                    canonicalUrl: "https://example.com/map",
                }}
                enableOpenGraph={true}
                enableTwitterCards={true}
            >
                <Geographies geography={geoUrl}>{({ geographies }) => <For each={geographies}>{(geo) => <Geography geography={geo} />}</For>}</Geographies>
            </MapWithMetadata>
        </MetaProvider>
    );
}

Handling Events & Styling

Props like onClick, onMouseEnter, etc. give you access to the geography data.

import { For } from "solid-js";
import { ComposableMap, Geographies, Geography } from "solidjs-simple-maps";

const geoUrl = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json";

function App() {
    return (
        <ComposableMap>
            <Geographies geography={geoUrl} onGeographyError={(error) => console.error("Failed to load map:", error)}>
                {({ geographies }) => (
                    <For each={geographies}>
                        {(geo) => (
                            <Geography
                                geography={geo}
                                onClick={(e) => alert(`You clicked ${geo.properties.name}`)}
                                style={{
                                    default: { fill: "#D6D6DA", outline: "none" },
                                    hover: { fill: "#F53", outline: "none" },
                                    pressed: { fill: "#E42", outline: "none" },
                                }}
                            />
                        )}
                    </For>
                )}
            </Geographies>
        </ComposableMap>
    );
}

Known Differences from React Version

  • Event Handlers: SolidJS uses standard DOM events.
  • Rendering: Prefer <For> over .map() for lists.
  • Styling: style prop supports signal-based variants (hover, pressed) similar to the original, but optimized for Solid's reactivity.

License

MIT