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 🙏

© 2024 – Pkg Stats / Ryan Hefner

leaflet.sidepanel

v1.2.1

Published

Slide side panel plugin for Leaflet

Downloads

370

Readme

npm version npm downloads npm license last commit npm dependents

Leaflet.SidePanel

Slide side panel plugin for Leaflet

This repository is a copy of maxwell-ilai/Leaflet.SidePanel

Demo

You can find a demo here

Prerequirements

  • leaflet (v1.0.0 or higher) (Tested with 1.8.0)

Installation

# NPM
npm i leaflet.sidepanel

# yarn
yarn add leaflet.sidepanel

# pnpm
pnpm i leaflet.sidepanel

Or include the script and css in your html file

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css"
/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Options

  • panelPosition: 'left' (default) | 'right' [string]
  • hasTabs: true (default) | false [boolean]
  • tabsPosition: 'top' (default) | 'right' | 'bottom' | 'left' [string]
  • darkMode: true | false (default) [boolean]
  • pushControls: true | false (default) [boolean] Shifts the map controls (like zoom) when the side panels open, to keep them visible and usabe
  • defaultTab: 1 (default) [number | string]
  • size: '400px' (dafault) [string] (everything that can be used for width/higth in css)
  • onTabClick(tabLink: HTMLElement): void executed when a tab is clicked, passed the link as argument
  • onToggle(opened: boolean): void executed when the sidebar opened or closed

Usage

Javascript

import L from 'leaflet';
import 'leaflet.sidepanel';
import 'leaflet.sidepanel/dist/style.css';

const panelRight = L.control
  .sidepanel('panelID', {
    panelPosition: 'right',
    hasTabs: false,
    tabsPosition: 'top',
    pushControls: true,
    darkMode: true,
    defaultTab: 'tab-5',
  })
  .addTo(map);

Html

<div id="panelID" class="sidepanel" aria-label="side panel" aria-hidden="false">
  <div class="sidepanel-inner-wrapper">
    <nav class="sidepanel-tabs-wrapper" aria-label="sidepanel tab navigation">
      <ul class="sidepanel-tabs">
        <li class="sidepanel-tab">
          <a href="#" class="sidebar-tab-link" role="tab" data-tab-link="tab-1">
            <!-- [You can also use images / icons] -->
            Tab 1
          </a>
        </li>
        <!-- [...] -->
      </ul>
    </nav>
    <div class="sidepanel-content-wrapper">
      <div class="sidepanel-content">
        <div class="sidepanel-tab-content" data-tab-content="tab-1">
          <p>Content 1.</p>
        </div>
        <!-- [...] -->
      </div>
    </div>
  </div>
  <div class="sidepanel-toggle-container">
    <button
      class="sidepanel-toggle-button"
      type="button"
      aria-label="toggle side panel"
    ></button>
  </div>
</div>

Vue

There is a Vue wrapper available on vue-leaflet-sidepanel This wrapper was build for Vue 3, there were no tests with Vue 2

Credits

Special thanks to maxwell-ilai for the original project maxwell-ilai/Leaflet.SidePanel

Visitors

Flag Counter