Skip to content

Input Number

Allows users to enter numeric values with built-in validation and step controls. This component should be paired with a label to clearly communicate the expected value and improve accessibility.

API Reference

Component attubute(s)

x-h-input-number

Attributes

AttributeValuesRequiredDescription
data-sizesm
default
falseChanges the size of the input.

Examples

Number Input


html
<div x-h-input-number>
  <input type="number" min="0" max="10" step="2" value="4" />
</div>

Invalid Number Input


html
<input x-h-input type="text" aria-invalid="true" />