Element: <ins-input>
Defines an input field where user can enter data.
Code Snippet
<ins-input field="color" label="Pick a color"></ins-input>
Code Snippet
<ins-input placeholder="Email" value="john@gmail.com" label="Email" field="email" icon="icon-mail" tooltip="This is a sample tooltip content. It also support html content."> </ins-input>
Code Snippet
<ins-input></ins-input>
Code Snippet
<ins-input id="dsv"> </ins-input> <script> var dsv = document.getElementById('dsv'); dsv.addEventListener('didLoad', function(e){ dsv.placeholder = 'Direct Set Value'; }); </script>
Code Snippet
<ins-input value="John Smith" label="Name"> </ins-input>
Code Snippet
<ins-input value="samplepassword123" label="Password" field="password" disabled> </ins-input>
Code Snippet
<ins-input value="samplepassword123" label="Password" field="password" readonly> </ins-input>
Code Snippet
<ins-input placeholder="Email" value="a sample text" label="Email" field="email" error-message="Please provide valid email address." has-error> </ins-input>
Code Snippet
<ins-input placeholder="Password" label="Password" field="password" icon="icon-lock"> </ins-input>
Code Snippet
<ins-input placeholder="Enter Number" label="Number" field="number" min="1" max="100" step="5"> </ins-input>
Code Snippet
<ins-input value="Value Change"> </ins-input>
Code Snippet
<ins-input placeholder="Placeholder Attribute"> </ins-input>
Code Snippet
<ins-input label="amount" unit-left="$" unit-right=".00" field="number"> </ins-input>
Code Snippet
<ins-input icon="icon-mail"> </ins-input>
Code Snippet
<ins-input label="Name"> </ins-input>
Code Snippet
<ins-input field="password"> </ins-input>
Code Snippet
<ins-input id="oninput" placeholder="Email" label="Email" field="email" icon="icon-mail"> </ins-input> <p id="demo"></p> <script> const oninput = document.getElementById('oninput') oninput.addEventListener('oninput', event => { console.log(event.detail.value); console.log(event.detail.keyCode); document.getElementById("demo").innerHTML = event.detail.value; }); </script>
Code Snippet
<ins-input id="valueChange" placeholder="Email" label="Email" field="email" icon="icon-mail"> </ins-input> <p id="demo"></p> <script> const valueChange = document.getElementById('valueChange') valueChange.addEventListener('valueChange', event => { console.log(event.detail); document.getElementById("demo").innerHTML = event.detail; }); </script>
FIELD ATTRIBUTE | TYPE | DEFAULT | OPTIONS | DESCRIPTION |
---|---|---|---|---|
placeholder | string | "" | any | Defines the short hint that describes the expected value in the input field |
value | string | "" | any | Defines value of input field |
label | string | "" | any | Defines label of input field |
name | string | "" | any | Defines name of input field |
field | string | "text" | email, number, password, text, search | Defines the type input element to display |
field-id | string | "" | any | Defines field id of input field |
error-message | string | "" | any | Defines the error message when input element is wrong |
maxlength | string | "" | any | Defines max length of characters accepted in input field |
min | string | "" | any | Defines min attribute value of the input field (for field type number) |
max | string | "" | any | Defines max attribute value of the input field (for field type number) |
step | string | "" | any | Defines increment value of the input field (for field type number) |
required | boolean | false | true, false | Specifies that the input field must be filled out before submitting the form |
unit-left | string | "" | - | Defines the unit at the start of the input field |
unit-right | string | "" | - | Defines the unit at the end of the input field |
icon | string | "" | icon-close-1, icon-utilities, icon-lock-1 ... | Defines icon of input field |
icon-event | boolean | false | true/false | Defines if field icon has mouse event. |
icon-title | string | "" | any | Defines title of the field icon. Shown when icon is hovered. |
disabled | boolean | false | true, false | Disables input field |
readonly | boolean | false | true, false | Specifies that the input field is read-only |
has-error | boolean | false | true, false | Specifies validation or mandatory input for the input field |
activated | boolean | false | true, false | Displays activated state of input field |
tooltip | string | "" | - | Displays a tooltip beside the label. Supports HTML Content |
EVENT | OBJECT | DESCRIPTION |
---|---|---|
insInput | value, keycode | Execute a script when an element gets user input |
insValueChange | value | Returns value when an element gets user input |
insBlur | value, keycode | Emit field value and keycode on input blur event |
insIconClick | target, value | Emit the field and value when field icon is clicked |
Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.