Skip to main content
The Number component creates a numeric input field for entering and displaying numbers.

Basic usage

Constructor

float | Callable | None
default:"None"
Default value. If None, component shows placeholder or 0
str | None
default:"None"
Label displayed above the component
str | None
default:"None"
Placeholder hint text
int | None
default:"None"
Precision for rounding. If 0, converts to int. If None, no rounding
float | None
default:"None"
Minimum allowed value. Raises error if user provides smaller value
float | None
default:"None"
Maximum allowed value. Raises error if user provides larger value
float
default:"1"
Increment step for the number
bool | None
default:"None"
Whether the number field is editable

Events

  • change - Triggered when value changes
  • input - Triggered on every keystroke
  • submit - Triggered when Enter is pressed
  • focus - Triggered when component gains focus
  • blur - Triggered when component loses focus

Examples

With validation

With precision