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

@surstromming/checkbox

v0.1.0

Published

Checkbox with a drawn box over a native input.

Downloads

80

Readme

@surstromming/checkbox

Checkbox. A native <input type="checkbox"> made invisible on top of a drawn box — so keyboard, click, form submission and :checked stay native, and only the paint is ours.

Dependency graph

graph LR
  checkbox["@surstromming/checkbox"]
  design["@surstromming/design"]
  icon["@surstromming/icon"]
  checkbox --> design
  checkbox --> icon

Usage

<template>
  <Label for="terms">
    <Checkbox id="terms" v-model="agreed" /> Accept terms and conditions
  </Label>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Checkbox } from '@surstromming/checkbox'

const agreed = ref(false)
</script>

Props

| Prop | Type | Default | Notes | | --------- | --------- | ------- | ----------------- | | v-model | boolean | — | defineModel() | | indeterminate | boolean | false | Shows a dash — "some of the things below are checked" |

id · disabled · required · name · value · aria-invalid and every other attribute fall through to the inner <input> (inheritAttrs: false) — it's the interactive element, so that's where a Label's for must land.

Anatomy

span.root         // 1rem square, positioning context
  ├─ input.input  // the real checkbox: invisible, on top, receives every event
  └─ span.box     // the painted box + check icon

States & tokens

| State | Border | Background | Icon | | ------------------ | ------------- | ---------- | -------------------- | | resting | input | — | — | | :checked | primary | primary | primary-foreground | | :indeterminate | primary | primary | primary-foreground | | :focus-visible | ring | — | — | | [aria-invalid] | destructive | — | — | | :disabled | — | — | 50% opacity |

Size spacing(4) (1rem), radius(sm), 3px focus ring, check icon at 14px.

Accessibility

  • It is a native checkbox: Space toggles it, it submits with the form, and screen readers announce the real state — no role/aria-checked juggling.
  • Give it an id and point a Label at it, or nest it inside the label as above.
  • Indeterminate state isn't supported yet; it needs a DOM property (not an attribute) and a third model value.

Indeterminate

indeterminate is a display state, not a third value. v-model stays a boolean and a click still resolves to one — what that click should mean (select all? clear all?) is the consumer's call, which is why the prop is one-way.

It's a DOM property with no attribute behind it, so Vue can't bind it; the component assigns it to the real input, which is what lets CSS style it through :indeterminate and what screen readers read as aria-checked="mixed".

DataTable is the reason it exists: its header checkbox shows a dash when only some rows on the page are selected.