Skip to content

Number Input

The NumberInput component is used to enter and control numeric values with built-in support for increment/decrement interactions and validation.

  • Numeric control: Ensures only valid number input.
  • Bounded values: Supports min and max constraints.
  • Flexible variants: Multiple visual styles via variant.
  • State-ready: Works with two-way binding (bind:value).
  • Accessible interaction: Supports keyboard and input controls.
PropTypeDefaultDescription
valuenumber0Current numeric value (supports binding).
variantstringVisual style variant of the input.
minnumberMinimum allowed value.
maxnumberMaximum allowed value.
disabledbooleanfalseDisables user interaction.
autoFocusbooleanfalseAutomatically focuses the input on mount.
  • Always define min and max when the range is known.
  • Use bind:value for reactive state management.
  • Prefer clear constraints to prevent invalid input.
  • Use disabled only for non-editable or locked states.
  • Keep numeric steps consistent for better UX.