Dropdown

Recently Updated
# Documentation

Dropdown component allows user to choose an option from the provided options.

# Playground
Select Option
 <LvDropdown
     optionLabel="name"
     optionValue="code"
     placeholder="Select Option"
     emptyFilterMessage="No result found"
     icon-right="light-icon-arrow-down-circle"
     filterPlaceholder="Search"
     :options="[
  {
    "name": "New York",
    "code": "NY"
  },
  {
    "name": "Rome",
    "code": "RM"
  },
  {
    "name": "London",
    "code": "LDN"
  },
  {
    "name": "Istanbul",
    "code": "IST"
  },
  {
    "name": "Paris",
    "code": "PRS"
  }
]"
     :filter="true"
     :bottom-bar="true"
 />
Realtime Customizations

















#Basic Usage

You can use the LvDropdown with some basic and complex use cases.You can use v-model for two way binding and updating value.You can get the selected value as a model value. LightVue dropdown is Both compatible with Vue 2.x and Vue 3.x

#Disabled

You can disable the dropdown by setting disabled prop true

#Editable Input

You can use the editable input for dropdown by setting editable Prop true

#Search

You can also insert the search input inside the dropdown for filtering the result by setting filter true

#Help Text

You can add a help text to an dropdown by passing a string into help-text prop

#Set Height

You can set the scroll height of the dropdown by passing height to scrollHeight prop.the dropdown will be scrollable

#Floating Label

You can add floating label to the dropdown by setting floating-label prop true

#Rounded

You can use the rounded variation of the dropdown by setting rounded prop true

#Material

You can add the animated bottom bar to the the dropdown by setting bottom-bar prop true

#Custom icons

You can also custmize the right and left icons by passing them into iconLeft & iconRight props respectively

#Setup

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

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

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

#APIs

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

Props
Type
Default
Description
value
string
Defines the value to be displayed on Dropdown component.
optionsLabel
String
Used to define the label of the options.
optionsValue
String
Used to define the value of the options.
closeOnResize
Boolean
Used to close the dropdown on window resize.
scrollHeight
String
200px
Defines the height of the scrollbar.
filter
Boolean
false
Allows to configure the filter option in dropdown.
filterPlaceholder
String
Allows to configure the filter placeholder in dropdown.
disabled
Boolean
false
Disables the dropdown if value is set to true.
clearable
Boolean
false
Makes the value editable in the dropdown if the value is set to true.
iconRight
String
Adds an icon to the right.
emptyFilterMessage
String
No results found
Configures the empty filter message to be shown.
Events
Parameters
Description
before-show
before-show:  String
Changes the events happening before the dropdown is shown.
before-hide
value:  String
Changes the events happening before the dropdown is shown.