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

@c2n/radio

v0.0.16

Published

Radio built with Lit: `c2-radio` options on native `<input type="radio">` elements, and a `c2-radio-group` that turns them into one control with a single value, one name and native-style keyboard navigation.

Readme

@c2n/radio

Radio built with Lit: c2-radio options on native <input type="radio"> elements, and a c2-radio-group that turns them into one control with a single value, one name and native-style keyboard navigation.

npm install @c2n/radio
<script type="module">
  import '@c2n/radio'
</script>

<c2-radio-group name="plan" value="pro">
  <span slot="label">Plan</span>
  <c2-radio value="free">Free</c2-radio>
  <c2-radio value="pro">Pro<span slot="description">Unlimited projects</span></c2-radio>
  <c2-radio value="team" disabled>Team</c2-radio>
</c2-radio-group>
  • Group: value is the checked option's value (set it to select from code), name applies to every option, disabled disables them all, orientation="horizontal" lays them out in a row. It fires one change (detail.value) per user selection and swallows the options' own change events. role="radiogroup" is named by the label slot or aria-label.
  • Keyboard: Arrow keys move and select (wrapping, disabled options skipped), Space checks the focused option, and only the checked option is a tab stop, exactly like native radios.
  • Option: value, checked, disabled, label (or slotted text) and a description slot. Options can be nested in wrapper elements inside the group. Standalone options sharing a name in the same root uncheck each other.
  • Indicator: --c2-radio__control--border-radius reshapes the ring (square at 4px); the dot slot replaces the filled dot with a mark such as a check; icon and checked-icon replace the whole control with an icon per state (--c2-radio__icon--color, --c2-radio__icon__checked--color, --c2-radio__icon--size). With only icon the same icon shows in both states and recolours; with only checked-icon the ring stays while unchecked.
  • Forms: the inputs live in shadow roots and are not submitted with a surrounding form; read value from the group or mirror it into a hidden input.

Import @c2n/radio for both elements, or @c2n/radio/radio.js for the option alone. Every visual aspect is a CSS custom property: --c2-radio__control--* and --c2-radio__dot--* for the circle (an accent border with a transparent fill gives the outlined look), --c2-radio__label--* / --c2-radio__description--* for the text, --c2-radio__container--* for the row (border, padding and checked background make card-style options), and --c2-radio-group--* for spacing and the header. Variables set on the group inherit into every option. The full list is in custom-elements.json and on the docs site.