Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

NumberInput

Choose a number of seats and see the resulting quantity.

Preview

Live preview

Changes apply to this preview only.

Team seats

$12 per seat, billed monthly. Add up to eight seats from this plan.

Use the steppers or the arrow keys.

5 seats$60.00 / month

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sizes

sm, md and lg share the Input height scale.

Open preview

Prefix, suffix and precision

The visible text is a formatted string, so affixes and decimals stay readable. Typing a comma as the decimal separator also works.

Open preview

Bounds and keyboard

Arrow keys step by `step`; Page Up and Page Down step ten times; Home and End jump to min and max when provided. Blur clamps out-of-range values.

Open preview

Usage

Use min/max/step appropriate to the domain and validate submitted values independently.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluNumberInputProps

Type source
PimoluNumberInputProps public API
NameTypeDefaultDescription
valuenumber | null | undefined—Controlled numeric value. `null` represents an empty field.
defaultValuenumber | null | undefined—Initial value when uncontrolled.
onValueChange((value: number | null) => void) | undefined—Called with the next numeric value, or `null` when emptied.
minnumber | undefined—Smallest allowed value. Applied on blur and when stepping.
maxnumber | undefined—Largest allowed value. Applied on blur and when stepping.
stepnumber | undefined1Increment used by the steppers and the arrow keys. Defaults to 1.
precisionnumber | undefinedthe decimals found in `step`, so a step of `0.25` keeps two decimalsMaximum number of decimal places. Defaults to the decimals found in `step`, so a step of `0.25` keeps two decimals.
showSteppersboolean | undefinedtrueRender the increment/decrement buttons. Defaults to true.
labelReactNode—Visible label, associated with the text input.
helperTextReactNode—Supporting text below the field.
errorMessageReactNode—Error text, replacing the helper text.
invalidboolean | undefinedfalseInvalid state without an error message.
prefixReactNode—Content rendered before the value (currency, unit, ...).
suffixReactNode—Content rendered after the value (unit, duration, ...).
fullWidthboolean | undefinedfalseStretch to the parent width.
sizePimoluNumberInputSize | undefined"md"Visual size. Defaults to "md".
classNamestring | undefined—Class applied to the outer field.
incrementLabelstring | undefined—Accessible name of the increment button.
decrementLabelstring | undefined—Accessible name of the decrement button.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLInputElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefined—Standard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
requiredboolean | undefined—Standard React/HTML attribute.
value

number | null | undefined

No default extracted.

Controlled numeric value. `null` represents an empty field.

defaultValue

number | null | undefined

No default extracted.

Initial value when uncontrolled.

onValueChange

((value: number | null) => void) | undefined

No default extracted.

Called with the next numeric value, or `null` when emptied.

min

number | undefined

No default extracted.

Smallest allowed value. Applied on blur and when stepping.

max

number | undefined

No default extracted.

Largest allowed value. Applied on blur and when stepping.

step

number | undefined

Default: 1

Increment used by the steppers and the arrow keys. Defaults to 1.

precision

number | undefined

Default: the decimals found in `step`, so a step of `0.25` keeps two decimals

Maximum number of decimal places. Defaults to the decimals found in `step`, so a step of `0.25` keeps two decimals.

showSteppers

boolean | undefined

Default: true

Render the increment/decrement buttons. Defaults to true.

label

ReactNode

No default extracted.

Visible label, associated with the text input.

helperText

ReactNode

No default extracted.

Supporting text below the field.

errorMessage

ReactNode

No default extracted.

Error text, replacing the helper text.

invalid

boolean | undefined

Default: false

Invalid state without an error message.

prefix

ReactNode

No default extracted.

Content rendered before the value (currency, unit, ...).

suffix

ReactNode

No default extracted.

Content rendered after the value (unit, duration, ...).

fullWidth

boolean | undefined

Default: false

Stretch to the parent width.

size

PimoluNumberInputSize | undefined

Default: "md"

Visual size. Defaults to "md".

className

string | undefined

No default extracted.

Class applied to the outer field.

incrementLabel

string | undefined

No default extracted.

Accessible name of the increment button.

decrementLabel

string | undefined

No default extracted.

Accessible name of the decrement button.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

No default extracted.

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

required

boolean | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Name increment/decrement actions and test typed values as well as the stepper buttons.
Read the accessibility guide →