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

browserux-theme-switcher

v1.1.2

Published

Lightweight and customizable Web Component for theme toggling (light/dark), with i18n, accessibility, and full framework compatibility.

Readme

EN | FR

BrowserUX Theme Switcher

A modern solution to offer a light/dark theme selector and enhance the user experience across all your web interfaces.

BrowserUX Theme Switcher is a lightweight, accessible, and customizable Web Component designed to easily add a theme switcher button to any website or application. It automatically detects the system theme, remembers the user's preference, and applies the correct theme.

npm version unpkg

Features

  • 🎚 Toggles data-theme="light" / "dark" on <html> or a custom target element
  • 💾 Persists user preference in localStorage
  • 🕶 Detects system preference via prefers-color-scheme on first load
  • 📢 Dispatches a theme-change custom event on every theme change
  • 🧠 Dynamic ARIA labels, multilingual, auto-detected or customizable
  • 🌐 Built-in i18n for 9 languages (en, fr, es, de, ja, ru, pt, it, nl)
  • 🖼 Automatic image swapping via filename convention or explicit data-src-* attributes
  • 🎨 Fully customizable via CSS custom properties (--bux-switch-*)
  • 🧩 Optional Shadow DOM, disable with no-shadow

Installation

npm install browserux-theme-switcher

Or via CDN:

<script type="module" src="https://unpkg.com/browserux-theme-switcher/dist/browserux-theme-switcher.esm.js"></script>

Usage

import 'browserux-theme-switcher';
<browserux-theme-switcher></browserux-theme-switcher>

Parameters

| Parameter | Type | Description | |---|---|---| | target | Attribute | CSS selector for the element that receives data-theme | | lang | Attribute | Language code for built-in ARIA labels | | data-label-light | Attribute | Custom ARIA label for activating light mode | | data-label-dark | Attribute | Custom ARIA label for activating dark mode | | no-shadow | Attribute | Disable Shadow DOM encapsulation | | style | Attribute | CSS custom properties for visual customization | | theme-change | Event | Fired on every theme change, e.detail.theme is "light" or "dark" | | light-icon | Slot | Icon displayed on the light side of the toggle | | dark-icon | Slot | Icon displayed on the dark side of the toggle |

Documentation

For detailed documentation, see docs/index.md.

Guide

Reference

  • Attributes : target, lang, data-label-*, no-shadow, style
  • Events : theme-change event with payload and use cases
  • Slots : light-icon, dark-icon named slots
  • Utilities : updateImagesByTheme, updateThemeImages

Additional reference

  • Compatibility : browser support, framework compatibility, build formats
  • Contributing : report a bug, suggest an improvement, submit a PR

License

MIT © 2026 Effeilo