The NumberInput component is similar to the Input component, but it has controls for incrementing or decrementing numeric values.

class NumberInputState(rx.State):
    number: int


def number_input_example():
    return rc.number_input(
        value=NumberInputState.number,
        on_change=NumberInputState.set_number,
    )

rc.NumberInput

The wrapper that provides context and logic to the components.

PropType | ValuesDefault
value
Number
allow_mouse_wheel
bool
clamped_value_on_blur
bool
default_value
Number
error_border_color
str
focus_border_color
str
focus_input_on_change
bool
is_disabled
bool
is_invalid
bool
is_read_only
bool
is_required
bool
is_valid_character
str
keep_within_range
bool
max_
Number
min_
Number
variant
"outline" | "filled" | "flushed" | ...
size
"sm" | "md" | "lg" | ...
name
str

Event Triggers

See the full list of default event triggers
TriggerDescription
on_change Fired when the input value changes.

rc.NumberInputField

The input field itself.

Props

No component specific props

rc.NumberInputStepper

The wrapper for the input's stepper buttons.

Props

No component specific props

rc.NumberIncrementStepper

The button to increment the value of the input.

Props

No component specific props

rc.NumberDecrementStepper

The button to decrement the value of the input.

Props

No component specific props