A number field on Vercel's UI SDK with steppers that repeat while held, currency, percent and unit formats in any locale, and a drag-to-scrub handle.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- cn
- @ui-sdk/core
- @ui-sdk/react
- @tabler/icons-react
- class-variance-authority
Code
import { Label } from "@/components/ui/label"
import {
NumberInput,
NumberInputControl,
NumberInputDecrement,
NumberInputGroup,
NumberInputIncrement,
NumberInputScrubArea,
NumberInputScrubAreaCursor,
} from "@/components/ui/ui-sdk-number-input"
function UiSdkNumberInputDemo() {
return (
<NumberInput defaultValue={1} min={1} max={99} className="max-w-36">
<NumberInputScrubArea pixelsPerStep={6}>
<Label htmlFor="demo-quantity">Quantity</Label>
<NumberInputScrubAreaCursor />
</NumberInputScrubArea>
<NumberInputGroup>
<NumberInputDecrement />
<NumberInputControl id="demo-quantity" />
<NumberInputIncrement />
</NumberInputGroup>
</NumberInput>
)
}
export { UiSdkNumberInputDemo }
































