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

@stealthscale/component-forms

v0.1.0

Published

Composes controls into something a person submits, and reports what is wrong with it.

Readme

@stealthscale/component-forms

Draws what a person fills in: the text field, and the search field with a control that empties it. Every component binds a recipe and draws nothing of its own, so a theme restyles all of them by extending the recipe. The preset under ./theme registers the recipes with an application's compiler.

Every value a theme can change on a component is an axis of its recipe, so a caller sets it as a prop and writes no style. A caller changes the element a component draws with as.

Install

pnpm add @stealthscale/component-forms

The package peers on react, @stealthscale/hooks and @stealthscale/theme. An application lists the preset under ./theme among the presets its compiler installs.

Input

Draws a box a person types one line into. The surface, the edge, the ink, the placeholder, the focus ring and every state a field enters come from the theme, so a theme decides what a field looks like once for every field. The size reads the control scale, so a field lines up with a button of the same size beside it.

import { Input } from "@stealthscale/component-forms";

<label htmlFor="email">Email</label>
<Input id="email" type="email" />;
<Input aria-label="Search invoices" size="sm" variant="subtle" />;
<Input aria-invalid placeholder="[email protected]" />;

| Axis | Values | Default | | --------- | ------------------------------------------------- | --------- | | size | xs, sm, md, lg, xl, 2xl, 3xl, 4xl | md | | variant | outline, subtle, flushed | outline |

The field carries no label of its own. Point a label at it, or state aria-label where the page has drawn the name elsewhere. A field with neither is announced as edit text and nothing more.

A field that is wrong states aria-invalid, which is the attribute the recipe's invalid styling reads and the one a screen reader reads too. There is no separate prop for it, so the two cannot disagree.

The focus ring is drawn inside the box, because a ring outside it is clipped where a field sits flush against the edge of a panel.

SearchInput

Draws a field a person searches from, with a control at its end that empties it.

import { SearchInput } from "@stealthscale/component-forms";

<SearchInput aria-label="Search invoices" clearIndicator={<CloseIcon />} />;
<SearchInput
  aria-label="Search"
  clearIndicator={<CloseIcon />}
  onValueChange={setQuery}
  size="sm"
  value={query}
/>;

| Axis | Values | Default | | ------ | ------------------------------------------------- | ------- | | size | xs, sm, md, lg, xl, 2xl, 3xl, 4xl | md |

It takes value and defaultValue, so one component serves a caller that sets the value and a caller that leaves the component to hold it. onValueChange is called with the contents each time they change.

The control appears only where the field holds something and a caller has passed something to draw in it. A control that is always there and does nothing half the time is one a reader learns to pass over. Clearing puts focus back in the field, because a person who has just emptied a search is about to type another one. Name the control with clearLabel, which defaults to Clear search.

The field reserves room at its end exactly the width of the control, both read off the control scale. One size sets both, so the typing never runs underneath at any size.

The field's own surface, edge and size are the text field's recipe. This one writes the room, the position and the control, and restates none of it.

Licence

MIT. See LICENSE.