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

@knitui/map

v0.3.1

Published

Cross-platform MapLibre map surface for Knit UI.

Readme

@knitui/map

Cross-platform map components with a unified, RN-first API, wrapping MapLibre GL JS on web and @maplibre/maplibre-react-native on native.

This package is a plain hybrid: it depends only on react, react-native, react-dom, the two MapLibre engines and @types/geojson. It does not use react-native-web or Tamagui — the web implementations (*.tsx) are pure DOM + maplibre-gl, and the native implementations (*.native.tsx) wrap the RN engine. Bundlers pick the right file per platform automatically.

Install

Install @knitui/map plus the MapLibre engine for the platform you target — @maplibre/maplibre-react-native on native, maplibre-gl on web:

# Expo / native
npx expo install @knitui/map @maplibre/maplibre-react-native react-native-svg

# web
npm install @knitui/map maplibre-gl @maplibre/maplibre-gl-style-spec @types/geojson

There is no react-native-reanimated peer — the package is a plain hybrid with no Tamagui or react-native-web dependency.

Usage

import { Map, Camera, GeoJSONSource, CircleLayer } from "@knitui/map";

export function CitiesMap() {
  return (
    <Map mapStyle="https://demotiles.maplibre.org/style.json" compass attribution>
      <Camera initialViewState={{ center: [4.9, 52.37], zoom: 6 }} />
      <GeoJSONSource id="cities" data={cities} cluster>
        <CircleLayer
          id="city-circles"
          source="cities"
          style={{
            circleRadius: 8,
            circleColor: "#4264fb",
            circleStrokeColor: "#fff",
            circleStrokeWidth: 2,
          }}
        />
      </GeoJSONSource>
    </Map>
  );
}

Conventions

  • Container<Map mapStyle={...}> (required mapStyle); ornaments via compass / attribution / logo / scaleBar; events via onPress, onRegionDidChange, etc.
  • Camera — declarative (center / zoom / bearing / pitch / initialViewState) or imperative through a CameraRef (flyTo, fitBounds, zoomTo, easeTo, jumpTo).
  • SourcesGeoJSONSource (clustering), VectorSource, RasterSource, ImageSource. Layers nest inside their source and reference it via source.
  • LayersCircleLayer, LineLayer, FillLayer, FillExtrusionLayer, SymbolLayer, RasterLayer, BackgroundLayer, HeatmapLayer. Each takes a typed camelCase style prop; data-driven values use MapLibre expressions.
  • AnnotationsMarker, ViewAnnotation, Callout, LayerAnnotation.
  • User locationUserLocation (web GeolocateControl); UserLocationPuck and NativeUserLocation are native-only (no-op on web).
  • Styles — nine bundled MapLibre styles are re-exported (positronStyle, voyagerStyle, darkMatterStyle, …).

VectorSource, RasterSource and ImageSource are exported as types only from the barrel to avoid eager native-component registration. Import the runtime component from its subpath, e.g. import { RasterSource } from "@knitui/map/src/components/RasterSource".

Storybook

This package ships its own plain Storybook (no RN→RNW alias, no design-system provider) with 70+ examples that render real maps against keyless public tiles:

pnpm --filter @knitui/map storybook   # http://localhost:6007

Scripts

| Script | Description | | ----------- | --------------------------------- | | typecheck | tsc --noEmit | | lint | eslint . | | test | vitest run (helpers + registry) | | storybook | Storybook dev server | | build | bob build |


Part of Knit UI.