Colorpicker

Recently Updated
# Documentation

LvColorpicker can be used when a user needs to pick a color. Additionally, a customized color palette can also be passed as an array.

# Playground
 <LvColorPicker
     label="Choose Color"
     :value="#38b2ac"
     :clearable="true"
     :bottomBar="true"
     :colors="[
  "#F44336",
  "#E91E63",
  "#9C27B0",
  "#673AB7",
  "#3F51B5",
  "#2196F3",
  "#03A9F4",
  "#00BCD4",
  "#009688",
  "#4CAF50",
  "#8BC34A",
  "#CDDC39",
  "#FFEB3B",
  "#FFC107",
  "#FF9800",
  "#795548"
]"
 />
Realtime Customizations







#Basic Usage

You can use the LvColorPicker with some basic and complex use cases.You can use v-model for two way binding and updating value.You can set the label to colour picker through label prop.You can set the pallet colors by passing a array to colors prop. LightVue color-picker is Both compatible with Vue 2.x and Vue 3.x

#Without input

You can use LvColorPicker without the input. You have to set withoutInput prop true

#Without Pallet

You can use LvColorPicker without the colour pallet. You have to set hidePalette prop true

#Setup

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

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

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

#APIs

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

Props
Type
Default
Description
label
String
Defines the Label of the Color Picker Element
hidePalette
Boolean
false
Toggles the color palette
colors
Array
['#F44336', '#E91E63', '#9C27B0', '#673AB7', '#3F51B5', '#2196F3', '#03A9F4', '#00BCD4', '#009688', '#4CAF50', '#8BC34A', '#CDDC39', '#FFEB3B', '#FFC107', '#FF9800', '#795548']
Array of 16 colors for the color palette
withoutInput
Boolean
false
Displays color picker without input