byDefaultHuman
Components

Number Input

A hand-drawn number input with rough increment and decrement buttons.

Installation

package manager
npx shadcn add https://bydefaulthuman.fun/r/number-input.json

Props

PropTypeDefaultDescription
className
string
Additional Tailwind classes applied to the component.
defaultValue
number
0
Initial uncontrolled value.
disabled
boolean
Disables interaction.
error
string
Error message shown below the component.
id
string
Optional stable id used for sketch seeding and accessibility.
label
string
Optional label text shown with the component.
max
number
Upper bound for the value.
min
number
Lower bound for the value.
onChange
(value: number) => void
Callback fired when the value changes.
step
number
1
Increment between values.
theme
CrumbleTheme
Overrides the global Crumble theme for this instance.
value
number
Controlled value for the component.

Min, max and step

Error state

Must be at least 6

Disabled

Accessibility

NumberInput uses a native number field plus semantic buttons for stepping, so focus management remains predictable. Keep the label visible when the number has units or limits that are not obvious.

Examples

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

<NumberInput label="Quantity" defaultValue={1} min={0} />;