NumberInput
Native numeric entry with browser stepping and validity.
Interactive preview
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:
| Prop | Type | Default | Description |
|---|---|---|---|
| min / max / step | native input values | native defaults | Constraints and keyboard stepping. |
| value / defaultValue / onChange | native 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-inputMake 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.
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.