vtc

vue-tailwind-color-picker

Vue Color Picker using Tailwind@2

Showing:

Popularity

Downloads/wk

85

GitHub Stars

10

Maintenance

Last Commit

3mos ago

Contributors

3

Package

Dependencies

0

Size (min+gzip)

4.8KB

License

Type Definitions

Tree-Shakeable

Yes?

Readme

Vue Tailwind Color Picker

Color picker for vue using Tailwind v2.

Requires Tailwind

Live demo

Installation

$ npm install vue-tailwind-color-picker
$ yarn add vue-tailwind-color-picker

Installation Nuxt

Global add plugins

plugins/vue-tailwind-color-picker.js

import Vue from 'vue'
import VueTailwindColorPicker from 'vue-tailwind-color-picker'
Vue.use(VueTailwindColorPicker)

add nuxt.config.js

plugins: [
    '~/plugins/vue-tailwind-color-picker',
  ],

Installation Nuxt Typescript

Global add plugins

plugins/vue-tailwind-color-picker.ts

import Vue from 'vue'
// @ts-ignore
import VueTailwindColorPicker from 'vue-tailwind-color-picker'
Vue.use(VueTailwindColorPicker)

add nuxt.config.ts

plugins: [
    '~/plugins/vue-tailwind-color-picker',
  ],

Usage

<template>
   <vue-tailwind-color-picker v-model="color" :swatches.sync="swatches" :hide-swatches="false" @change="changedColor" @addSwatch="swatchAdded" @deleteSwatch="swatchDeleted" />
</template>

<script>
import VueTailwindColorPicker from 'vue-tailwind-color-picker.vue'

export default {
  components: {
    VueTailwindColorPicker
  },
  data() {
    return {
      color: '#00FF00FF',
      swatches: [
        '#f94144',
        '#f3722c',
        '#f8961e',
        '#f9c74f',
        '#90be6d',
        '#43aa8b',
        '#577590',
        '#22223b',
        '#4a4e69',
        '#c9ada7'
      ]
    }
  },
  methods: {
    changedColor(color) {
      console.warn('Changed Color', color)
    },
    swatchAdded(color) {
      console.log('Swatch Added', color)
    },
    swatchDeleted(color) {
      console.log('Swatch Deleted', color)
    }
  }
}
</script>

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100