Input Example

How to use this input

Props

NameTypeDefaultDescription
typeenum (see below)textHow an input works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages.
acceptOn type file-Hint for expected file type in file upload controls.
altOn type image-alt attribute for the image type. Required for accessibility.
autocapitalizeOn type all except url, email and password-Controls automatic capitalization in inputted text.
autocompleteOn type all except checkbox, radio and buttons-Hint for form autofill feature.
captureOn type file-Media capture input method in file upload controls.
checkedOn type checkbox, radio-Whether the command or control is checked.
dirnameOn type *hidden, text, search, url, tel, email *-Name of form field to use for sending the element's directionality in form submission.
disabledOn type all-Whether the user can interract with the input or not.
formOn type all-Associates the control with a form element.
formactionOn type image, submit-URL to use for form submission.
formenctypeOn type image, submit-Form data set encoding type to use for form submission.
formmethodOn type image, submit-HTTP method to use for form submission.
formnovalidateOn type image, submit-Bypass form control validation for form submission.
formtargetOn type image, submit-Browsing context for form submission.
heightOn type image-Same as height attribute for img; vertical dimension.
listOn type all except hidden, password, checkbox, radio and buttons-Value of the id attribute of the datalist of autocomplete options.
maxOn type date, month, week, time, datetime-local, number, range-Maximum value.
maxlengthOn type text, search, url, tel, email, password-Maximum length (number of characters) of value.
minOn type date, month, week, time, datetime-local, number, range-Minimum value.
minlengthOn type text, search, url, tel, email, password-Minimum length (number of characters) of value.
multipleBoolean, On type email, file-Whether to allow multiple values.
nameOn type all-Name of the form control. Submitted with the form as part of a name/value pair.
patternOn type text, search, url, tel, email, password-Pattern the value must match to be valid.
placeholderOn type text, search, url, tel, email, password, number-Text that appears in the form control when it has no value set.
popovertargetOn type button-Designates an input type="button" as a control for a popover element.
popovertargetactionOn type button-Specifies the action that a popover control should perform.
readonlyBoolean, On type all except hidden, range, color, checkbox, radio, and buttons-The value is not editable.
requiredBoolean, On type all except hidden, range, color, and buttons-A value is required or must be checked for the form to be submittable.
sizeOn type text, search, url, tel, email, password-Size of the control.
srcOn type image-Same as src attribute for img; address of image resource.
stepOn type date, month, week, time, datetime-local, number, range-Incremental values that are valid.
valueOn type all except image-The value of the control. When specified in the HTML, corresponds to the initial value.
widthOn type image-Same as width attribute for img.

Input type

TypeDescription
buttonA push button with no default behavior displaying the value of the value attribute, empty by default.
checkboxA check box allowing single values to be selected/deselected.
colorA control for specifying a color; opening a color picker when active in supporting browsers.
dateA control for entering a date (year, month, and day, with no time). Opens a date picker or numeric wheels for year, month, day when active in supporting browsers.
datetime-localA control for entering a date and time, with no time zone. Opens a date picker or numeric wheels for date- and time-components when active in supporting browsers.
emailA field for editing an email address. Looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards.
fileA control that lets the user select a file. Use the accept attribute to define the types of files that the control can select.
hiddenA control that is not displayed but whose value is submitted to the server. There is an example in the next column, but it's hidden!
imageA graphical submit button. Displays an image defined by the src attribute. The alt attribute displays if the image src is missing.
monthA control for entering a month and year, with no time zone.
numberA control for entering a number. Displays a spinner and adds default validation. Displays a numeric keypad in some devices with dynamic keypads.
passwordA single-line text field whose value is obscured. Will alert user if site is not secure.
radioA radio button, allowing a single value to be selected out of multiple choices with the same name value.
rangeA control for entering a number whose exact value is not important. Displays as a range widget defaulting to the middle value. Used in conjunction min and max to define the range of acceptable values.
resetA button that resets the contents of the form to default values. Not recommended.
searchA single-line text field for entering search strings. Line-breaks are automatically removed from the input value. May include a delete icon in supporting browsers that can be used to clear the field. Displays a search icon instead of enter key on some devices with dynamic keypads.
submitA button that submits the form.
telA control for entering a telephone number. Displays a telephone keypad in some devices with dynamic keypads.
textThe default value. A single-line text field. Line-breaks are automatically removed from the input value.
timeA control for entering a time value with no time zone.
urlA field for entering a URL. Looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards.
weekA control for entering a date consisting of a week-year number and a week number with no time zone.

Playground

Import from filigran-ui :

Import {Input} from 'filigran-ui'


            <Input type="email" placeholder="Email" />