Vue 3 Swatch Picker

1.2.4 · active · verified Sun Apr 19

vue3-swatches is a dedicated color swatch picker component designed for Vue 3 applications. It is a complete re-implementation, not a fork, of the popular vue-swatches library, adapted specifically for the Vue 3 composition API and ecosystem. The current stable version is 1.2.4. As a direct port, its features, API, and visual design closely mirror its Vue 2 predecessor. While no explicit release cadence is stated, updates are likely tied to significant changes in the original vue-swatches or general Vue 3 ecosystem evolution. Key differentiators include its robust feature set inherited from vue-swatches, ease of integration as a component or global plugin, and built-in support for custom triggers and integration with frameworks like Nuxt 3. Its primary advantage is providing a well-tested and familiar swatch picker solution for Vue 3 developers who might have previously used vue-swatches.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates local component import and basic usage with a `v-model` binding in a Vue 3 setup script. Also shows the required CSS import.

import { ref } from 'vue';
import { VSwatches } from 'vue3-swatches';
import 'vue3-swatches/dist/style.css';

const color = ref("#1FBC9C");

// In a Vue SFC <template> section:
// <VSwatches v-model="color" />

// Example with custom trigger (for demonstration, not runnable JS):
/*
<template>
  <VSwatches v-model="color">
    <template #trigger>
      <input :value="color" readonly />
    </template>
  </VSwatches>
</template>
*/

view raw JSON →