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.
npm install vue3-swatchesVerified import paths — ran on the pinned version, not inferred.
Demonstrates local component import and basic usage with a `v-model` binding in a Vue 3 setup script. Also shows the required CSS import.
Refactor imports, component registration, and prop usages to align with Vue 3 conventions and the specific API of `vue3-swatches`.
Add `import 'vue3-swatches/dist/style.css'` to your main entry file (e.g., `main.ts`/`main.js`) or the component where `VSwatches` is used.
Configure `'vue3-swatches/nuxt'` in your `modules` array within `nuxt.config.ts` for proper Nuxt 3 integration.
Ensure you have either `import { VSwatches } from 'vue3-swatches'` in your script setup or `app.use(VSwatches)` in your main.js/ts file for global registration.Add `import 'vue3-swatches/dist/style.css'` to your main entry file or the component where `VSwatches` is used. Verify the path is correct relative to your project structure.
When using `app.use()`, ensure you are importing the default export: `import VSwatches from 'vue3-swatches'` (without curly braces).
For Nuxt 3, ensure you are using the provided module by adding `'vue3-swatches/nuxt'` to your `modules` array in `nuxt.config.ts`.