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

slinky-menu

v1.0.3

Published

Slinky menu in vanilla JavaScript

Downloads

27

Readme

Slinky.js

Slinky.js is a lightweight and flexible JavaScript library designed to create multi-level slide-in menus with animation effects. This library allows you to easily implement interactive menus on your website, enhancing user experience with smooth transitions and intuitive navigation.

Features

  • Multi-Level Menus: Supports nested menus, allowing users to drill down into submenus.
  • Custom Transition Speed: Configure the speed of transition animations to fit your design needs.
  • Responsive Design: Seamlessly integrates with existing layouts and styles.
  • Dynamic Title Changes: Automatically updates the menu title based on the current menu depth.
  • Back Navigation: Implement back navigation to return to the previous menu level easily.

Installation

To get started with Slinky.js, you can include it directly in your HTML file or install it via a package manager.

HTML

<link rel="stylesheet" href="slinky.css">
<script src="slinky.js"></script>

Via npm

npm install slinky-menu

Usage

To create a new Slinky instance, instantiate it with the desired selector and options:

import { Slinky } from 'slinky-menu';

const myMenu = new Slinky('.my-menu', {
    transitionSpeed: '300',
    defaultTitle: 'My Menu',
});

HTML Structure

To work with Slinky.js, your HTML must follow a specific structure. Here is a basic example:

<div class="menu">
    <div class="menu-header">
        <div class="slinky-back-btn">Back</div>
        <div class="slinky-title">Title menu</div>
        <div class="menu-close">Close menu</div>
    </div>
    <div class="slinky-container">
        <ul class="slinky">
            <li class="menu-parent">
                <a class="slinky-next" href="#">Catalog</a>
                <div class="menu-child" data-title="Catalog">
                    <ul>
                        <li><a href="#">Subdirectory 1</a></li>
                        <li><a href="#">Subdirectory 2</a></li>
                        <li class="menu-parent">
                            <a class="slinky-next" href="#">Subdirectory 3</a>
                            <div class="menu-child" data-title="Subdirectory 3">
                                <ul>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                    <li><a href="#">Level 3</a></li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
            </li>
            <li class="menu-parent">
                <a class="slinky-next" href="#">Services</a>
                <div class="menu-child" data-title="Services">
                    <ul>
                        <li><a href="#">Service 1</a></li>
                        <li><a href="#">Service 2</a></li>
                        <li><a href="#">Service 3</a></li>
                    </ul>
                </div>
            </li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contacts</a></li>
        </ul>
    </div>
</div>

Options

| Option | Type | Default Value | Description | |---------------------------|--------|----------------|-------------------------------------------------------------------| | titleMenuSelector | string | .slinky-title | CSS selector for the title element of the menu. | | nextButtonSelector | string | .slinky-next | CSS selector for the next buttons. | | backButtonSelector | string | .slinky-back | CSS selector for the back button. | | parentSelector | string | .menu-parent | CSS selector for parent menu items. | | childSelector | string | .menu-child | CSS selector for child menu items. | | transitionSpeed | int | 300 | Speed of the transition animations in milliseconds. | | defaultTitle | string | Menu | Default title displayed in the menu. | | openedClass | string | opened | Class added to opened menu items. | | showBtnClass | string | show | Class for showing the back button when a menu is open. |

Methods

clearMenu()

Resets the menu to its initial state by closing all opened menus and resetting the title.

changeTitle(title)

Updates the displayed title of the menu.

backMenu()

Navigates back to the previous menu level.

Contributing

If you would like to contribute to Slinky.js, please fork the repository, create a new branch, and submit a pull request.