Number Input

Numeric input with stepper buttons, min/max clamping, precision, and locale-aware formatting.

Forms & Inputs@sisyphos-ui/number-inputView on npmView as Markdown

Preview

tsx

Playground

Flip props to see how the component responds. The snippet below updates as you change options.

Installation

Install the individual package:

$ pnpm add @sisyphos-ui/number-input @sisyphos-ui/core

Or use the umbrella package that bundles everything:

$ pnpm add @sisyphos-ui/ui

Usage

Import the component styles and the component itself:

snippet.tsxtsx
import "@sisyphos-ui/number-input/styles.css";
import { NumberInput } from "@sisyphos-ui/number-input";

With currency prefix

`prefix` + `precision` format money-shaped values.

tsx
$

With suffix

Put units after the value with `suffix`.

tsx
kg

Error state

Track validation yourself and toggle `error` on the control.

tsx

At least 1 seat is required.

API

Props table is being written. See the package README for the complete API surface.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README.

Was this page helpful?
Edit this page on GitHub