bloxa

Number Input

FREE

Number field with steppers, min/max, step, unit suffix, hold-to-repeat and keyboard stepping.

Playground

Change the props and watch the component and its code update live.

Props
Code
import { NumberInput } from "@/components/ui/number-input";

<NumberInput
  defaultValue={0}
  min={0}
  max={10}
/>

Installation

Terminal
npx @bloxa/cli add number-input
# or: npx shadcn@latest add @bloxa/number-input

Examples

Basic

Hold a stepper to repeat faster. Shift + arrow steps by 10.

Unit and decimals

kg
%

API reference

Every component also accepts the props of the element it renders.

NumberInput

PropTypeDefaultDescription
value / defaultValuenumber | null—Numeric value.
onValueChange(value: number | null) => void—Called when the value changes.
min / max / stepnumber-∞ / ∞ / 1Bounds and step (can be decimal).
unitstring—Unit shown after the number.
size"sm" | "md" | "lg""md"Height and text size.