v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

NumberInput

Native numeric entry with browser stepping and validity.

Interactive preview

Choose between 1 and 100 seats.

Usage

import { NumberInput, Label } from "@devvy-ui/react";

<Label htmlFor="seats">Seats</Label>
<NumberInput id="seats" name="seats" min={1} max={100} step={1} defaultValue={3} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
min / max / stepnative input valuesnative defaultsConstraints and keyboard stepping.
value / defaultValue / onChangenative input props—Native controlled/uncontrolled number entry.

Accessibility & behavior

Platform Behavior & Guidelines

Supply a visible label and help for units. Empty/invalid entry can produce NaN through valueAsNumber; validate before using a number. Native required, disabled, readonly, form/reset, events and refs remain available. inputMode defaults to decimal.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add number-input

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

NumberInput.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.