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

web-component-base

v6.2.1

Published

A zero-dependency & tiny JS base class for creating reactive custom elements easily

Readme

Web Component Base

[!Note] HTML boolean attributes semantics shipped in v6 - A boolean prop follows the HTML convention in both directions: presence means true, absence means false. true reflects as a bare attribute and false removes it, so toggleAttribute() and [attr] CSS selectors finally work as expected.

Any present value is true — including the literal flag="false", just like native disabled="false" is still disabled. If you write boolean attributes as setAttribute(name, String(bool)), that now always means true; switch those call sites to toggleAttribute(name, bool). wcb warns in the console when it sees a boolean attribute written as "true"/"false" so the change cannot fail silently. Attributes whose "false" is meaningful (aria-*, contenteditable) should be declared as string props.

See Prop Access for details.

counter example code snippet

Package information: NPM version Package information: NPM license Package information: NPM downloads Bundle Size

🤷‍♂️ zero-dependency, 🤏 tiny JS base class for creating reactive custom elements easily ✨

When you extend the WebComponent class for your component, you only have to define the template and properties. Any change in any property value will automatically cause just the component UI to render.

The result is a reactive UI on property changes.

Quick start

The fastest way to try wcb is to scaffold a new component:

npm create wcb@latest

Next actions:

  1. Read the docs
  2. View demos with code examples
  3. Play with a demo on CodePen.
  4. Try it on TypeScript playground

Want to get in touch?

There are many ways to get in touch:

  1. Open a GitHub issue or discussion
  2. Submit a ticket on SourceHut todo or via Email

Inspirations and thanks

  1. Sara Rainsberger - I never stop singing praises to the Astro documentation team and I use Sarah's "50 docs tips in 50 days" as a guide in reviewing the documentation for wcb. I do not have a team myself, and do not have the level of excellence Sarah brings to reviewing docs. I often need the assistance and have encodified a docs-review skill for it with permission.
  2. htm - I use it for the html function for tagged templates, and take a lot of inspiration in building the rendering implementation. It is highly likely that I will go for what Preact is doing... but we'll see.
  3. fast - When I found that Microsoft has their own base class I thought it was super cool!
  4. lit - lit-html continues to amaze me and I worked to make wcb generic so I (and others) can continue to use it

Size change log

See size-change-log.md for a running record of how each correctness/feature change affects the WebComponent base class bundle size, with the reason and benefit of each.

Background

This is the base class used for web components in Ayo's projects, primarily cozy-games, mcfly, his personal site, his blog, and others.


Just keep building. A project by Ayo