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

leaflet.superbar

v0.1.3

Published

Leaflet layer controler bar

Readme

Leaflet Superbar

Leaflet Superbar is a customizable sidebar component for Leaflet maps that enables users to manage, import, and style vector layers directly from the UI. This plugin is designed to enhance mapping applications with a rich, interactive panel that supports both data control and visual customization.

Features

  • Import Layers: Easily load layers via file input (e.g., GeoJSON).
  • Layer Management: Toggle visibility, set color, view geometry type, and delete layers.
  • Customizable UI:
    • Header background and title colors
    • Logo and title text
    • Font family and sizes
    • Toolbar and toggle button styles
    • Layer name styling and geometry color
  • Minimal and extensible layout designed for plugin or app integration.

Requirements

Leaflet 1.0.0 and plus

Demo

You can view a demo here.

Installation

npm i leaflet.superbar

then add this line in your main html file :

<script src="https://unpkg.com/leaflet.superbar@latest/dist/superbar.js"></script>

Usage

You can customize the appearance of Leaflet Superbar using the applyStyles function before calling initializeApp. Here are all available customization options:

🔧 Customization Options

| Property | Description | Type | Example | | ------------------------------ | -------------------------------------- | -------- | ---------------------- | | HEAD_COLOR | Background color of the sidebar header | string | "#2c3e50" | | HEAD_TITLE | Text shown in the header | string | "My Map" | | HEAD_TITLE_COLOR | Header title text color | string | "#ffffff" | | HEAD_TITLE_FONT_FAMILY | Font family for the header title | string | "Arial, sans-serif" | | HEAD_TITLE_FONT_SIZE | Font size for the header title | string | "1.5rem" | | HEAD_LOGO_WIDTH | Logo image width | string | "30px" | | HEAD_LOGO_HEIGHT | Logo image height | string | "30px" | | HEAD_LOGO_URL | Custom logo image URL | string | "./assets/logo.png" | | BODY_COLOR | Background color of the body | string | "#f4f4f4" | | TOOLBAR_COLOR | Background color of the toolbar | string | "#ecf0f1" | | TOOLBAR_IMPORT_BUTTON_WIDTH | Width of the import button | string | "40px" | | TOOLBAR_IMPORT_BUTTON_HEIGHT | Height of the import button | string | "40px" | | TOGGLE_BUTTON_COLOR | Color of the floating toggle button | string | "#3498db" | | TOGGLE_TEXT_COLOR | Text color on the toggle button | string | "#ffffff" | | LAYERS_NAME_COLOR | Color of layer name text | string | "#2c3e50" | | LAYERS_NAME_FONT_SIZE | Font size of the layer name | string | "1rem" | | LAYERS_NAME_FONT_FAMILY | Font family of the layer name | string | "Roboto, sans-serif" | | LAYERS_GEOMETRY_COLOR | Default color of geometry preview | string | "#e74c3c" |


Example

<script
  src="https://unpkg.com/[email protected]/dist/leaflet.js"
  crossorigin=""
></script>
<script src="https://unpkg.com/leaflet.superbar@latest/dist/superbar.js"></script>
<script>
  const map = L.map("map").setView([48.8566, 2.3522], 13);
  const customStyles = {
    HEAD_COLOR: "#1abc9c",
    HEAD_TITLE: "My Custom Map",
    HEAD_TITLE_COLOR: "#ffffff",
    HEAD_LOGO_URL: "./my_logo.png",
    HEAD_LOGO_WIDTH: "40px",
    HEAD_LOGO_HEIGHT: "40px",
    TOOLBAR_COLOR: "#16a085",
    TOGGLE_BUTTON_COLOR: "#27ae60",
    LAYERS_NAME_COLOR: "#34495e",
    LAYERS_GEOMETRY_COLOR: "#e67e22",
  };
  L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
    attribution: "© OpenStreetMap contributors",
  }).addTo(map);
  SuperBar.applyStyles(customStyles);
  SuperBar.initializeApp(map);
</script>

Licence

This plugin is released under the MIT License. See the LICENSE file for details.

🤝 Contributing

Contributions are welcome! 😄 If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.

If you like this project, don’t forget to ⭐ star it on GitHub — it really helps and is much appreciated!