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

@carissa-io/components-input

v0.2.1

Published

Carissa UI: text input (label, optional side button, hand-rolled validation) as a React component with SCSS variables

Readme

@carissa-io/components-input

Label + input + optional side button + error line. React component, SCSS-themed, hand-rolled validation.

npm i @carissa-io/components-input

Use

import { Input } from '@carissa-io/components-input'

<Input
    label="Age"
    type="number"            // default: text
    required
    min={18}                 // min/max: numbers and dates
    max={99}
    messages={{ required: t('required'), min: t('too_young'), max: t('too_old') }}
    onChange={(value) => setAge(value)}
    onValidate={(isValid, errorCode) => setFormValid(isValid)}
/>

| Prop | | |---|---| | label, name, id, type (text), placeholder, disabled, className, … | usual; unknown props go to the <input> | | value + onChange(value, event) | controlled; or defaultValue for uncontrolled | | required, min, max, min_length, max_length | built-in validation (min/max apply to number/range and date/time types) | | validate(value) | extra check: return an error code, or a falsy value if fine (runs only on non-empty values) | | onValidate(isValid, errorCode) | fires on mount and whenever the outcome changes | | messages | { [errorCode]: text }; without an entry the bare code is shown | | error | an error from the parent (e.g. the API); wins over the built-in one and shows immediately | | multiline, rows (3) | renders a <textarea> instead of the <input>: same label, validation and error line. type, min and max do not apply to it | | start, end | nodes rendered inside the field before and after the control (an icon, a unit): span.c-input__start / span.c-input__end, only when given. end sits before the side button. See below | | button_icon + button_callback | side button; rendered only when both are given. button_label is its aria-label |

With multiline the control is a <textarea class="c-input__control"> and the root gets the modifier c-input--multiline; min_length and max_length count characters (line breaks included).

start and end are plain markup, with no behaviour of their own; they also work with multiline. Example:

<Input label="Price" type="number" start="$" end="kg" />
<Input label="Search" start={<SearchIcon />} />

Wrappers use them for icons and inline actions (for example the search field's leading icon and clear button). Their gap is $c-input-adornment-gap (extra space on top of the field gap) and their color $c-input-adornment-color.

The built-in error shows after the field is first blurred; onValidate reports from the start. validateValue(value, rules) and isEmpty are exported for use outside the component.

Style

@use '@carissa-io/components-input/scss' with (
    $c-input-border-color: #c0c0c0,
    $c-input-radius: 0
);

All variables are in scss/_variables.scss. Classes: c-input, __box, __label, __field, __control, __start, __end, __button, __error; modifiers --invalid, --required, --disabled, --multiline. For the textarea, $c-input-resize (vertical by default) and $c-input-textarea-min-height (0, so today's look is kept) apply only inside .c-input--multiline.