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

@3mo/segmented-input

v0.2.3

Published

Lit controllers for inputs split into typed segments, such as date units or code cells, with keyboard entry and ARIA.

Readme

Segmented Input

Lit controllers for inputs split into typed segments, such as date units or code cells, with keyboard entry and ARIA.

npm Documentation

Installation

npm install @3mo/segmented-input
import { SegmentedInputController, SegmentedDisplayController } from '@3mo/segmented-input'

Examples

  • Default — Type digits and the focus moves on by itself; the arrows walk the units, Backspace empties one and steps back, and the separators stay inert.
  • Templates — The segments decide everything: how many units there are, how wide they are and what they take.
  • Right To Left — The group reads in the direction of its own text: digits and punctuation alone read left to right in any script, while a right-to-left word among the separators turns the order of the units around.
  • Stepping — With handleStep, the units are spinbuttons: the arrows step, PageUp and PageDown jump, by a quarter of an hour on the minutes, Home and End reach the limits.
  • Code — SegmentedDisplayController: one input, six cells, so the code arrives whole from a keyboard, a paste or the phone's own suggestion.

Accessibility

The group is a group, and each segment a spinbutton with aria-valuenow, aria-valuemin, aria-valuemax and aria-valuetext, which says "Empty" while it is. Name the group, and each segment after its part. The group is one tab stop, on the segment focused last.

| Key | Does | | --- | --- | | ArrowRight ArrowLeft | The next or previous segment, in reading order. | | ArrowUp ArrowDown, PageUp PageDown | Steps the segment by one, or by a larger step. | | Home End | The segment's smallest or largest value. | | Digits | Type into the segment, which hands on to the next once it is full. | | Backspace Delete | Clears the segment. | | Enter | Commits the value. |

API

Exports

| Name | Kind | Description | | --- | --- | --- | | SegmentedInputController | class | Turns a group of elements into one input made of several: each segment is focused and typed into on its own, a filled one hands the focus to the next, and the separators between them stay inert. | | SegmentedDisplayController | class | Draws one value as a row of cells while a single real input holds it. | | isEditableSegment | function | | | LiteralSegment | interface | A separator between two units: shown, never focused, hidden from assistive technology. | | InputSegment | type | One unit of a value as an input renders it — a year, a digit of a code, a group of a card number — or a literal separator between two of them. | | SegmentedInputStep | type | What a step key asks of a segment. | | SegmentedDisplaySegment | type | A cell knows its position in the value, which is where the caret stands when it is the active one. |

Links

License

MIT © 3MO GmbH