Input
Get user Input. Use with Field to access all functionalities
Class props
Input component
Get user Input. Use with Field to access all functionalities
html
<o-input></o-input>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
autocomplete | Native options to use in HTML5 validation | string | - | From config: input: { |
autosize | Automatically adjust height in textarea | boolean | - | false |
clearIcon | Icon name to be added on the clear button | string | - | From config: input: { |
clearable | Add a button/icon to clear the inputed text | boolean | - | From config: input: { |
counter | Show character counter when maxlength prop is passed | boolean | - | From config: input: { |
disabled | Same as native disabled | boolean | - | false |
expanded | Makes input full width when inside a grouped or addon field | boolean | - | false |
icon | Icon to be shown | string | - | From config: input: { |
iconClickable | Makes the icon clickable | boolean | - | false |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: input: { |
iconRight | Icon to be added on the right side | string | - | From config: input: { |
iconRightClickable | Make the icon right clickable | boolean | - | false |
iconRightVariant | Variant of right icon | string | - | |
id | Same as native id. Also set the for label for o-field wrapper. | string | - | Default function (see source code) |
maxlength | Same as native maxlength, plus character counter | number|string | - | |
override | Override existing theme classes completely | boolean | - | |
passwordReveal | Adds the reveal password functionality | boolean | - | false |
placeholder | Input placeholder | string | - | |
rounded | Makes the element rounded | boolean | - | false |
size | Size of the control | string | small , medium , large | From config: input: { |
statusIcon | Show status icon using field and variant prop | boolean | - | From config: { |
type | Input type, like native | string | Any native input type , and textarea | "text" |
useHtml5Validation | Enable html 5 native validation | boolean | - | From config: { |
v-model | string|number | - | "" | |
validationMessage | The message which is shown when a validation error occurs | string | - | |
variant | Color of the control | string | primary , info , success , warning , danger , and any other custom color | From config: input: { |
Events
Event name | Properties | Description |
---|---|---|
update:modelValue | value string | number - updated modelValue prop | modelValue prop two-way binding |
input | value string | number - input valueevent Event - native event | on input change event |
focus | event Event - native event | on input focus event |
blur | event Event - native event | on input blur event |
invalid | event Event - native event | on input invalid event |
icon-click | event Event - native event | on icon click event |
icon-right-click | event Event - native event | on icon right click event |
Sass variables
Current theme ➜ Oruga Base
SASS Variable | Default |
---|---|
$input-background-color | #ffffff |
$input-border-color | $grey-lighter |
$input-border-style | solid |
$input-border-width | 1px |
$input-border-radius | $base-border-radius |
$input-rounded-border-radius | $base-rounded-border-radius |
$input-box-shadow | inset 0 1px 2px hsla(0, 0%, 4%, 0.1) |
$input-color | #363636 |
$input-icon-zindex | 4 |
$input-counter-font-size | 0.75rem |
$input-counter-margin | 0.25rem 0 0 0.5rem |
$input-height | $control-height |
$input-line-height | $base-line-height |
$input-margin | 0 |
$input-padding | $control-padding-vertical $control-padding-horizontal |
$input-textarea-max-height | 600px |
$input-textarea-min-height | 120px |
$input-textarea-padding | 0.625em |
See ➜ 📄 Full scss file
Current theme ➜ Oruga Full
SASS Variable | Default |
---|---|
$input-background-color | #ffffff |
$input-border-color | $grey-lighter |
$input-border-style | solid |
$input-border-width | 1px |
$input-border-radius | $base-border-radius |
$input-rounded-border-radius | $base-rounded-border-radius |
$input-box-shadow | inset 0 1px 2px hsla(0, 0%, 4%, 0.1) |
$input-color | #363636 |
$input-icon-zindex | 4 |
$input-counter-font-size | 0.75rem |
$input-counter-margin | 0.25rem 0 0 0.5rem |
$input-height | $control-height |
$input-line-height | $base-line-height |
$input-margin | 0 |
$input-padding | $control-padding-vertical $control-padding-horizontal |
$input-textarea-max-height | 600px |
$input-textarea-min-height | 120px |
$input-textarea-padding | 0.625em |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
The theme does not have any custom variables for this component.
Current theme ➜ Bootstrap
SASS Variable | Default |
---|---|
$input-icon-color | $input-color |
$input-icon-spacer | 0.75rem |
$input-icon-padding-sm | 2rem |
$input-icon-padding | 2.5rem |
$input-icon-padding-lg | 3rem |
See ➜ 📄 Full scss file