Number Inputs
Bootstrap 5 Number Inputs component
Responsive Number Inputs built with Bootstrap 5. Input fields refer specifically to the number input fields, which are used to obtain data from the users.
Basic example
A basic example of the number input field consists of the input
element with a specified ID
and label
element connected via this ID
with the input. Both elements are wrapped in
.form-outline
class which provides a material design look. The input type="number"
defines the field for entering a number.
Phone number
The input type="tel"
defines a field for entering a telephone number.
Minimum and maximum
The input min=" "
or max=" "
defines a field for minimum or maximum value.
Base value
The input value=" "
defines a field for the base value.
Precision
In some cases, you might need the value to be rounded to specific decimal points or to change the step size when you increment or decrement the value. Simply use the step=" "
input.
Prefix dollar sign
Icon
Add .trailing
to i
tag and .form-icon-trailing
to input
to create trailing $ icon in the input.
Unremovable postfix
Add id="postfix"
to input
and JS to make the $ sign unremovable and behind the number.