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

@cutlersheridan/dynamic-ui-elements

v1.0.0

Published

Some dynamic UI elements to transform your HTML

Readme

Dynamic UI Elements

A small collection of pre-made functions to make your DOM elements more dynamic

turnIntoDropdown(menuContainerElement)

In your HTML, create a structure like this:

<div class="dropdown">
    <div>Menu</div>
    <div>Entrées</div>
    <div>Sides</div>
    <div>Drinks</div>
    <div>Desserts</div>
</div>

Then pass it into the function and it will transform into a dynamic dropdown menu.

The following arguments can, in this order, be passed:

| Argument (= default) | Description | | ---------------------------- | --------------------------------------------------------------------------------------------- | | menuContainerElement | Required. The DOM element that will become a dropdown | | toggleDash (= false) | If true, the label toggles between the text content and the material icon ligature for a dash | | transitionTime (= "0.2s") | Customize the transition time | | transitionStyle (= "linear") | Customize the transition style |

makeNavBarDisappearWhenScrollingDown(navElement)

Pass any DOM element situated at the top of the page and transform it so, when a user scrolls down, it slides up and disappears, and when a user scrolls up, it slides back into view.

Accepts the following arguments:

| Argument (= default) | Description | | ---------------------------- | ----------------------------------------- | | navElement | Required. The DOM element to make dynamic | | transitionTime (= "0.2s") | Customize the transition time | | transitionStyle (= "linear") | Customize the transition style |

createAndInsertCarousel()

Pass an array of file paths leading to images and get an image carousel.

Accepts the following arguments:

| Argument (= default) | Description | | ---------------------------- | ---------------------------------------------------------- | | precedingElement | Required. The DOM element you want to precede the carousel | | imgFilesArray | Required. An array of image file paths | | carouselWidth (= "50%") | Customize the width of the carousel | | transitionTime (= "0.3s") | Customize the transition time | | transitionStyle (= "linear") | Customize the transition style |

TO-DO NEXT

TO-DO LATER

Features
Behavior
  • make carousel image a link to the image file or just make the image big
  • recreate carousel upon document resize
Style

DONE

  • 1.0.0
  • adjust arrow width
  • adjust arrow font
  • Raise dropdown's z-axis
  • fix dropdown alignment with box-sizing: content-box
  • 0.2.6
  • fix that "undefined" that appears on the page
  • figure out why carousel images become misaligned when dev console is closed but stay perfect when it's open (it was because the % width sometimes resulted in sub pixels that increased each slide)
  • 0.2.5
  • make carousel dots clickable to navigate
  • make carousel switch every four seconds
  • stop auto-rotation if user clicks to switch an image manually
  • stop auto-rotation if user clicks a nav dot
  • 0.2.4
  • make carousel arrows invisible unless you're hovering over image
  • prevent the arrows from disappearing on mobile
  • 0.2.3
  • make dots change image indication upon clicking instead of upon transition end
  • make next/previous buttons highlight on hover
  • 0.2.2
  • add carousel dots that indicate which image you're looking at
  • 0.2.1
  • make carousel pixel-perfect
  • add optional parameters for carousel
  • clean up carousel code
  • 0.2.0
  • write image carousel creation function
  • add next button to swipe right
  • extract some logic into another function to reuse for previous button
  • add previous button to swipe left
  • 0.1.0
  • create a function that makes DOM element disappear when scrolling down and reappear when scrolling up
  • 0.0.2
  • add ability to toggle a dash when material icons are being used
  • 0.0.1
  • create a function to turn DOM element into dropdown menu