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.
type="text"
defines a one-line text input field.
type="password"
defines a password field. The characters in a password field are masked (shown as asterisks or circles).
type="submit"
defines a button for submitting form data to a form handler.
type="reset"
defines a reset button that will reset all form values to their default values.
type="button"
defines a programmable button.
type="radio"
defines a radio button. A radio button lets a user select only one of a limited number of choices.
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.
type="date"
is used for input fields that should contain a date.
type="number"
defines a numeric input field.
type="range"
defines a control for entering a number whose exact value is not important (slider control). Default range is 0 to 100.
type="tel"
is used for input fields that should contain a telephone number.
type="url"
is used for input fields that should contain a URL address.
type="time"
allows the user to select a time.
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>