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

@mshafiqyajid/react-number-input

v1.2.0

Published

Headless numeric input hook and styled component for React. Increment/decrement, keyboard, scroll wheel, currency/percent formatting, accessible, fully typed.

Readme

@mshafiqyajid/react-number-input

Headless numeric input hook and styled component for React. Increment/decrement, keyboard, scroll wheel, currency/percent formatting, accessible, fully typed.

Full docs →

Install

npm install @mshafiqyajid/react-number-input

What's new in 0.4.0

  • Hold-to-repeat with acceleration — configurable repeat prop (initialDelay, interval, accel). The step interval shortens each repeat by the accel multiplier (default 0.9×).
  • scrubable label drag — set scrubable on NumberInputStyled to make the label a drag handle. Drag left to decrease, right to increase, at a rate of one step per scrubPixels pixels (default 4). Uses setPointerCapture for reliable tracking.
  • largeStep prop — alias for bigStep; sets the step size for Shift+Arrow / PageUp / PageDown.
  • Digit scroll animation — value changes via stepper buttons animate the input digit up or down. Respects prefers-reduced-motion.

Headless usage

import { useNumberInput } from "@mshafiqyajid/react-number-input";

function MyNumberInput() {
  const { inputProps, incrementProps, decrementProps, formattedValue } =
    useNumberInput({ defaultValue: 0, min: 0, max: 100, step: 1 });

  return (
    <div>
      <button {...decrementProps}>−</button>
      <input {...inputProps} />
      <button {...incrementProps}>+</button>
    </div>
  );
}

Styled usage

import { NumberInputStyled } from "@mshafiqyajid/react-number-input/styled";
import "@mshafiqyajid/react-number-input/styles.css";

function App() {
  return (
    <NumberInputStyled
      label="Price"
      defaultValue={1234}
      min={0}
      format="currency"
      currency="USD"
      locale="en-US"
      tone="primary"
      size="md"
      scrubable
      repeat={{ initialDelay: 500, interval: 80, accel: 0.9 }}
    />
  );
}

Keyboard + interaction

| Input | Action | |-------|--------| | / | Step by step (default 1) | | Shift + ↑/↓ | Step by largeStep / bigStep (default step × 10) | | PageUp / PageDown | Step by largeStep / bigStep | | Home / End | Jump to min / max (when set) | | Mouse wheel (when wheelEnabled) | Step on focused input | | Hold the +/− button | Repeats with acceleration (configurable via repeat) | | Drag label left/right (scrubable) | Decrease/increase by one step per scrubPixels px |

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | bigStep | number | step × 10 | Step size for Shift+Arrow / PageUp / PageDown | | largeStep | number | step × 10 | Alias for bigStep | | wheelEnabled | boolean | true | Allow mouse wheel to step value when input is focused | | repeat | RepeatOptions | { initialDelay: 500, interval: 80, accel: 0.9 } | Hold-to-repeat configuration | | scrubable | boolean | false | Make the label a horizontal drag handle (styled only) | | scrubPixels | number | 4 | Pixels of drag per one step change (styled only) |

RepeatOptions

| Field | Type | Default | Description | |-------|------|---------|-------------| | initialDelay | number | 500 | ms before repeat begins | | interval | number | 80 | ms between repeat fires | | accel | number | 0.9 | Interval multiplier per repeat (< 1 = faster) |

License

MIT