Number input

A number field with raised minus and plus buttons. Hold a button to keep stepping. A real spinbutton with arrow, PageUp, PageDown, Home and End keys.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

NumberInput3D props

PropTypeDefaultDescription
valuenumberCurrent value. Set it to control the component.
defaultValuenumber0Starting value when uncontrolled.
onValueChange(value: number) => voidCalled with the new value.
minnumber-InfinitySmallest allowed value.
maxnumberInfinityLargest allowed value.
stepnumber1Amount added or taken away by each step.
unitstringText shown after the number, such as "kg".
aria-labelstringRequired: names the field for screen readers.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks