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 🙏

© 2025 – Pkg Stats / Ryan Hefner

moretoggles

v1.0.0

Published

A CSS library for nice-looking toggles

Readme

MoreToggles.css

MoreToggles.css is a pure CSS library that provides you with a variety of nice-looking toggles.

banner

release badge jsDelivr hits badge license badge


You only have to attach a class to the wrapper div and MoreToggles.css will do the magic for you.

Check out all available styles here

Features

🔹 Pure CSS

🔹 13 different styles (more styles are coming)

🔹 Perfect scaling

Usage

Import the stylesheet into your document's <head>

<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/JNKKKK/[email protected]/output/moretoggles.min.css">
</head>

Wrap an extra div around your <input> and <label>. Pick a style here . Add the corresponding mt-* class to <div>.

<div class="mt-ios"> 
  <input id="1" type="checkbox" />
  <label for="1"></label>
</div>

Moretoggles.css is also available through NPM

npm install moretoggles

Import in js/jsx

// Import the minified CSS
import '../node_modules/moretoggles/output/moretoggles.min.css'

// Or
// import the Sass source file
import '../node_modules/moretoggles/src/moretoggles.scss'

Or import in Sass

@charset "utf-8";
@import "../node_modules/moretoggles/src/moretoggles";

Styles

MoreToggles.css currently has 13 different styles. And for each style, several color patterns are provided.

Check out all available styles here

To choose a style, replce the class name of the wrapper <div> with one of the options here.

<div class="REPLACE_ME"> 
  <input id="2" type="checkbox" />
  <label for="2"></label>
</div>

Example for .mt-android-pink style

<div class="mt-android-pink"> 
  <input id="3" type="checkbox" />
  <label for="3"></label>
</div>

Import Only a Single Style

If you care about the size of CSS files. Instead of importing moretoggles.min.css, you can import single style separately.

In the /output folder, you can find all of the built CSS files.

The naming convention is moretoggles.STYLE_NAME.min.css

Example for importing only Android Style

<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/JNKKKK/[email protected]/output/moretoggles.android.min.css">
</head>

Size / Scaling

You can change the size of the toggles by assigning a font-size attribute style="font-size:10px;" to the wrapper div. You can try different numbers and the toggle will scale smoothly.

<div class="mt-ios" style="font-size:10px;">
  <input id="4" type="checkbox" />
  <label for="4"></label>
</div>

Disabled Toggles

Just like regular checkbox, you can add disabled attribute to <input> tag.

<div class="mt-ios">
  <input id="5" type="checkbox" disabled/>
  <label for="5"></label>
</div>

Listening to the change event

Since the toggle is actually an <input> with type="checkbox", you can use addEventListener to listen to the onchange event.

<div class="mt-ios"> 
  <input id="6" type="checkbox" />
  <label for="6"></label>
</div>

<script>
  const toggle = document.getElementById('6');

  toggle.addEventListener('change', (event) => {
    if (event.target.checked) {
      alert('checked');
    } else {
      alert('not checked');
    }
  });
</script>

Notice

Nesting the <input> directly inside the <label> is NOT supported, although it is valid HTML syntax.

Don't ☹️

<div class="mt-ios"> 
  <label>
    <input type="checkbox" />
  </label>
</div>

Do 😃

<div class="mt-ios"> 
  <input id="1" type="checkbox" />
  <label for="1"></label>
</div>

License

MoreToggles.css is licensed under the MIT license. (https://opensource.org/licenses/MIT)

Contributing

This project is still in very early stage. Your contribution is very welcome. Feel free to submit a pull request!

Development Workflow

  1. npm install
  2. npm run start This will start the webpack-dev-server and render the showcase page
  3. Make changes and see live updates in the browser
  4. Build the showcase page and compile Sass to CSS in /output
  • npm run build-doc
  • npm run build-css