Types
Input supports various types such as text, password, email, and checkbox to specify the data format.
Some examples below are using the shadcn/ui components for minimalist and modern design.
See shadcn.
text
type="text"
defines a one-line text input field.
password
type="password"
defines a password field. The characters in a password field are masked (shown as asterisks or circles).
submit
type="submit"
defines a button for submitting form data to a form handler.
reset
type="reset"
defines a reset button that will reset all form values to their default values.
button
type="button"
defines a programmable button.
radio
type="radio"
defines a radio button. A radio button lets a user select only one of a limited number of choices.
checkbox
type="checkbox"
defines a checkbox. Checkboxes lets users select zero or more options of a limited number of choices.
type="email"
is used for input fields that should contain an email address.
date
type="date"
is used for input fields that should contain a date.
number
type="number"
defines a numeric input field.
range
type="range"
defines a control for entering a number whose exact value is not important (slider control). Default range is 0 to 100.
tel
type="tel"
is used for input fields that should contain a telephone number.
url
type="url"
is used for input fields that should contain a URL address.
time
type="time"
allows the user to select a time.
file
type="file"
allows the user to choose a file from their device or computer’s storage.
Adding the multiple
attribute to type="file"
allows users to select more than one file from their device or computer's storage.
Example: <input type="file" multiple>
Last updated on