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

maplibre-versatiles-styler

v1.1.4

Published

[![NPM version](https://img.shields.io/npm/v/maplibre-versatiles-styler)](https://www.npmjs.com/package/maplibre-versatiles-styler) [![NPM downloads](https://img.shields.io/npm/dt/maplibre-versatiles-styler?label=npm%20downloads)](https://www.npmjs.com/pa

Readme

NPM version NPM downloads GitHub downloads Code coverage CI status License

MapLibre VersaTiles Styler

A lightweight MapLibre GL JS control that allows users to explore and modify VersaTiles map styles directly inside the map. It provides a sidebar with editable color palettes, recoloring tools, style options such as font and language selection, and an export function. Perfect for data journalism, demos, prototyping, or interactive style exploration.


Features

  • Interactive styling UI directly inside MapLibre
  • Switch between vector style presets (colorful, eclipse, graybeard, shadow, neutrino) and satellite
  • Edit individual colors and apply global recoloring (hue, saturation, brightness, contrast)
  • Change fonts and map language
  • Adjust satellite imagery options (opacity, hue, brightness, saturation, contrast)
  • Export styles as style.json download or copy @versatiles/style code to clipboard
  • Works as a standard MapLibre control (map.addControl)
  • CSS is injected automatically — no separate stylesheet needed
  • Written in TypeScript, bundled with Vite

Usage

ES module (recommended)

npm install maplibre-versatiles-styler
import maplibregl from 'maplibre-gl';
import VersaTilesStylerControl from 'maplibre-versatiles-styler';

const map = new maplibregl.Map({
  container: 'map',
});

map.addControl(new VersaTilesStylerControl({ open: true }));

UMD / script tag

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>MapLibre VersaTiles Styler Demo</title>

  <!-- MapLibre -->
  <link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
  <script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js" defer></script>

  <!-- VersaTiles Styler -->
  <script src="https://unpkg.com/maplibre-versatiles-styler" defer></script>

  <style>
    body, html { margin: 0; padding: 0; height: 100%; }
    #map { width: 100%; height: 100%; }
  </style>
</head>

<body>
  <div id="map"></div>
  <script defer>
    window.addEventListener("DOMContentLoaded", () => {
      const map = new maplibregl.Map({
        container: "map",
      });

      map.addControl(
        new VersaTilesStylerControl({ open: true }),
        "top-left"
      );
    });
  </script>
</body>
</html>

When using the UMD build, the control is available as the global VersaTilesStylerControl.


Options

The VersaTilesStylerControl constructor accepts an optional config object:

| Option | Type | Default | Description | | -------- | --------- | ------------------------ | -------------------------------------------------- | | origin | string | window.location.origin | Base URL of the VersaTiles tile server | | open | boolean | false | Whether the sidebar is open initially | | hash | boolean | true | Persist the selected style in the URL hash fragment |