Skip to content

Number Input

An input that returns a number value and automatically handles invalid inputs.

Open in
pnpm dlx shadcn@latest add https://wds-shadcn-registry.netlify.app/r/number-input.json
import { useState } from "react"
import { NumberInput } from "@/components/ui/NumberInput"
const [value, setValue] = useState<number | null>(null)
<NumberInput value={value} onChange={setValue} />
Open in

Optional