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

@dcdavidev/jquery-sidenav-css

v3.2.0

Published

A simple side nav written in jQuery with css3 animations

Readme

@dcdavidev/jquery-sidenav-css

A lightweight and performant side navigation plugin for jQuery that leverages CSS3 transitions for ultra-smooth animations. This version is optimized for modern browsers and offers better performance on low-power devices compared to traditional JavaScript-based animations.

Features

  • CSS3 Hardware Accelerated: Uses native browser transitions for maximum smoothness.
  • 📱 Mobile-First: Designed to feel like a native mobile app sidebar.
  • 🛠️ Lightweight: No dependency on jQuery UI.
  • 🧊 Page Freezing: Prevents background scrolling when the menu is active.
  • 🎭 Clickable Mask: Automatically creates a customizable background overlay.
  • ⌨️ TypeScript Ready: Full type definitions included.

Installation

# pnpm
pnpm add @dcdavidev/jquery-sidenav-css

# npm
npm install @dcdavidev/jquery-sidenav-css

# yarn
yarn add @dcdavidev/jquery-sidenav-css

Dependencies

This plugin only requires jQuery (v4.0+ recommended).

<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>

Quick Start

1. HTML Structure

Setup your trigger button and the navigation container.

<!-- Trigger -->
<header>
  <button id="toggle-sidenav">Open Menu</button>
</header>

<!-- Sidenav -->
<nav id="sidenav">
  <div class="sidenav-wrapper">
    <button class="quit-sidenav">Close</button>
    <ul>
      <li><a href="#">Dashboard</a></li>
      <li><a href="#">Settings</a></li>
      <li><a href="#">Logout</a></li>
    </ul>
  </div>
</nav>

2. Basic Initialization

Target your sidenav element and initialize the plugin:

$(document).ready(function () {
  $('#sidenav').sidenav({
    toggler: '#toggle-sidenav',
    quitter: '.quit-sidenav',
  });
});

Advanced Usage

Handling Content Overflow

To ensure long menus are scrollable, add the following CSS to your wrapper:

#sidenav .sidenav-wrapper {
  height: 100%;
  overflow-y: auto;
}

Event Lifecycle

Hook into sidenav events to add custom interactions:

$('#sidenav').sidenav({
  toggler: '#toggle-sidenav',
  events: {
    onOpen: function () {
      console.log('Animation started...');
    },
    afterOpen: function () {
      $('#toggle-sidenav').addClass('active');
    },
    afterClose: function () {
      $('#toggle-sidenav').removeClass('active');
    },
  },
});

Options

| Option | Type | Default | Description | | :------------------- | :------------------ | :--------------- | :--------------------------------------------------------------------- | | toggler | string | '' | Required. Selector for the element that toggles the menu. | | quitter | string | 'a' | Selector for elements inside the menu that will close it when clicked. | | attr | string | 'sidenav-main' | Data attribute prefix. | | align | 'left' \| 'right' | 'left' | Sidebar alignment side. | | width | number | 300 | Width of the menu in pixels. | | gap | number | 64 | Minimum gap from the screen edge on small devices. | | open | boolean | false | Initial state on page load. | | zIndex | number | 3000 | The z-index of the sidenav. | | freezePage | boolean | true | Disables body scrolling when menu is open. | | animation.duration | number | 300 | CSS transition duration in milliseconds. | | animation.easing | string | 'ease-out' | Any valid CSS transition-timing-function. | | mask.display | boolean | true | Enable/disable the background overlay. | | mask.opacity | number | 0.5 | Opacity of the background mask. | | mask.css | object | {...} | Custom CSS for the mask (e.g., backgroundColor). |

Key Differences from @dcdavidev/jquery-sidenav

  • Performance: Uses CSS3 transition instead of jQuery .animate(), leading to smoother 60fps animations.
  • Dependencies: No dependency on jQuery UI easing.
  • Easing: Supports any CSS easing value (e.g., cubic-bezier).
  • Options: mask.opacity is a top-level option for easier customization.

License

MIT © Davide Di Criscito