-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Color Pickers
Sanya Boriskin edited this page Aug 5, 2019
·
15 revisions
Color pickers are composed of 7 components:
- va-color-picker-input
- va-simple-palette-picker
- va-color-input
- va-advanced-color-picker
- va-slider-color-picker
- va-color-square
- color-dot
Let's break them apart:
<va-color-picker-input v-model="value" mode="palette" :palette="palette">
<color-dot :color="value"/>
</va-color-picker-input>
This component provides 3 modes:
- Advanced
- Palette
- Slider
va-color-input
component passed default through the slot with palette mode.
When colors are provided - input is disabled.
Slots are allowed to switch color-input
for something else, for example color-square
.
Picker is shown in dropdown.
-
value
- String - Color string -
mode
- String - Picker mode -
palette
- Array -
selected
- Boolean
<va-simple-palette-picker
v-model="value"
:palette="palette"
/>
Colors are passed through array. For each color in array component creates color-dot
component
-
value
- String - Color string -
palette
- Array - Palette of colors
<va-color-input v-model="value"/>
Consists of of input and va-color-dot
.
Input could be disabled.
<va-color-input v-model="value" disabled/>
Dot could be selected.
<va-color-input v-model="value" selected/>
-
value
- String - Color string -
selected
- Boolean - selected/unselected dot -
disabled
- Boolean - enabled/disabled input
<va-advanced-color-picker v-model="value"/>
-
value
- String - Color string
<va-slider-color-picker v-model="value"/>
-
value
- String - Color string
<va-color-square :value="value"/>
-
value
- String - Color string
<color-dot
color="#value"
:selected="selected"
/>
-
value
- String - Color string -
selected
- Boolean - selected/unselected dot