Light-input

# Documentation

Light-input provides with a variety of input fields with various available customizations which helps it to fulfil the need of almost every web application/project.

# Playground
Place where you work...
 <lv-input
     :bottom-bar="true"
     placeholder="Acme Corp."
     help-text="Place where you work..."
     label="Organization Name"
     placeholder-color="rgba(0, 0, 0, 0.3)"
     icon-left="light-icon-search"
     icon-right="light-icon-arrow-up-right-circle"
 />
Realtime Customizations









#Basic Usage

You can use the input component with some basic and complex use cases like setting placeholder through placeholder prop. There is also a prop called helpText to specify a text that will display below the input. You can also specify a label by using the label prop. LightVue input is Both compatible with Vue 2.x and Vue 3.x

#Icons

You can use the input with icons.You can set the left and right icon through icon-left and icon-right prop respectively.
You can also use Light Icons from LightVue and pass it into the input.

#Material Effect

You can set the bottom bar to input by setting bottom-bar prop to true . You can also set the floating lable by passing label into label prop and setting floating-label prop true

#Floating Label

You can also set the floating lable by passing label into label prop and setting floating-label prop true

#Clearable

You can set the clearable input by setting the clearable prop to true.

#Prepend Append

You can prepend append the content inside the input through prepend append slots.

#Rounded

You can use the rounded variation of LvInput by setting rounded prop to true.

#Setup

You can import a component and register it as a local and global vue component as follows:

// import the component
import LvInput from 'lightvue/input';
// Register the component locally
export default {
    components: {
        LvInput
    }
}
// Register the component globally (Vue 2.x)
Vue.component('LvInput', LvInput);

// Register the component globally (Vue 3.x)
const app = Vue.createApp({
  // ...
});
app.component('LvInput', LvInput);
app.mount('#app')
               

#APIs

All of the props, events and slots of the component are mentioned below:

Props
Type
Default
Description
bottom-bar
Boolean
false
A bottom bar will be added to the default input element
floating-label
Boolean
false
Input element with a floating label on the top
help-text
String
Some help text with the input element to give some info to the user
icon-left
String
Input element with an icon on its left
icon-right
String
Input element with an icon on its right
label
String
Label describing the input element
placeholder
String
Input element with placeholder
placeholder-color
String
rgba(0, 0, 0, 0.3)
Input element with custom placeholder-color
value
String
null
Input element with default set value by the user
rounded
Boolean
false
Input element with rounded corners
clearable
Boolean
false
Clearable input element
Events
Parameters
Description
input
value:  String
Input box value
update:modelValue
value:  String
Updates input value
input-native
event:  Object
JavaScript input native function
Slots
Description
append
Adds an icon/label to the left of the input field
prepend
Adds an icon/label to the right of the input field