@cyhnkckali/vue3-color-picker

中文文档
2.1.7发布于 2026/02/23TypeScriptESM + CJS零依赖近 30 天下载 4.8万

A color picker component library

原始使用文档
文档目录6 节
  1. Install
  2. Use/Examples
  3. Options
  4. Emits
  5. CSS Colour Variables
  6. Roadmap

Vue 3 Color Picker

A colour selective component for Vue 3. Fast and with small package size. Gradient and Solid in one! No dependency! Fully customisable!

Features with Version 2.0

  • Ability to change mode instantly
  • Change the value in the colour list
  • Delete a value in the colour list
  • New style variables
  • New ui design

Don't forget to star for motivation :)

Try it now Live Demo

Download 1.1.9 to continue with the old version !!!

gradient solid

Install

NPM Install

 npm i @cyhnkckali/vue3-color-picker

Yarn Install

  yarn add @cyhnkckali/vue3-color-picker

Import

Import where you want to use it
import {Vue3ColorPicker} from '@cyhnkckali/vue3-color-picker';

Import the style file into your main.js file

import '@cyhnkckali/vue3-color-picker/dist/style.css'

Use/Examples

<script setup>
import {Vue3ColorPicker} from '@cyhnkckali/vue3-color-picker';
</script>

<template>   

    <Vue3ColorPicker v-model="value" mode="solid" :showColorList="false" :showEyeDrop="false" type="RGBA"/>

    <Vue3ColorPicker v-model="value" mode="gradient" :showColorList="false" :showEyeDrop="false"/>

</template>

Options

ParameterTypeDescription
v-modelstringdefault ''
modestringsolid or gradient default gradient
themestringlight or dark default light
typestringReturn colour value type HEX8 RGBA RGB HEX default HEX8
inputTypestringInput type of colour values RGB HSL HSV CMYK default RGB
disabledbooleandefault false
localobjectdefault { angle: '', positionX: '', positionY: '', solid: '', gradient: '', linear: '', radial: '', colorPalette: '', btnSaveLabel:'Save', btnCancelLabel:'Cancel' }
colorListCountnumberDetermines how many colours to keep in the colour list default 18
showColorListbooleandefault true
showEyeDropbooleandefault true Supports Chrome and Edge only
showAlphabooleandefault true
showInputMenubooleandefault true
showInputSetbooleandefault true
showPickerModebooleandefault true
iconClassesobjectdefault { ruler: '', eyeDroper: '', arrowDown: '', save: '', delete: '' }
gradientModelinear or radialdefault linear Sets the initial gradient mode when the picker is started
showButtonsbooleandefault true

Emits

ParameterTypeDescription
update:model-valueeventreturn 'color value'
onSaveeventreturn 'color value'
onCanceleventreturn 'color value'

CSS Colour Variables

Variables NameHexDark Hex
--cp-primary#5983fc #5983fc#5983fc #5983fc
--cp-container-bg#FFF #FFF#212529 #212529
--cp-select-color#2c5ae6af #2c5ae6af#2c5ae6af #2c5ae6af
--cp-range-border#f7f7f7 #f7f7f7#f7f7f7 #f7f7f7
--cp-range-shadow#4c86f3 #4c86f3#4c86f3 #4c86f3
--cp-container-shadow#58585881 #58585881#2b262696 #2b262696
--cp-gray-100#f9f9f9 #f9f9f9#1b1c22 #1b1c22
--cp-gray-200#f1f1f4 #f1f1f4#26272f #26272f
--cp-gray-300#dbdfe9 #dbdfe9#363843 #363843
--cp-gray-400#c4cada #c4cada#464852 #464852
--cp-gray-500#99a1b7 #99a1b7#636674 #636674
--cp-gray-600#78829d #78829d#808290 #808290
--cp-gray-700#4b5675 #4b5675#9a9cae #9a9cae
--cp-gray-800#252f4a #252f4a#b5b7c8 #b5b7c8
--cp-gray-900#071437 #071437#f5f5f5 #f5f5f5
--cp-inverse-dark#57575723 #57575723#6b6b6b56 #6b6b6b56
--cp-inverse-white#9292920d #9292920d#92929256 #92929256

Roadmap

  • Widget type to add

版本与发布记录

@cyhnkckali/vue3-color-picker 共发布 47 个版本,首次发布于 2023/11/29;过去 12 个月发布了 2 个版本。

版本发布日期距今
2.1.7latest2026/02/238 个月前
2.1.62026/02/238 个月前
2.1.52025/09/021.2 年前
2.1.42025/09/021.2 年前
2.1.32025/08/291.2 年前
2.1.22025/03/251.6 年前

关于 @cyhnkckali/vue3-color-picker 的常见问题

@cyhnkckali/vue3-color-picker 是什么?

A color picker component library

如何安装 @cyhnkckali/vue3-color-picker?

在项目目录运行 npm install @cyhnkckali/vue3-color-picker,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.3.8)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cyhnkckali/vue3-color-picker 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cyhnkckali/vue3-color-picker 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cyhnkckali/vue3-color-picker 可以商用吗?

@cyhnkckali/vue3-color-picker 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@cyhnkckali/vue3-color-picker 的下载量有多少?

根据 npm 官方下载统计,@cyhnkckali/vue3-color-picker 在 2026/10/11 – 2026/11/09 这 30 天内被下载 48,286 次,日均约 1,610 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cyhnkckali/vue3-color-picker 还在维护吗?

最新版本 2.1.7 发布于 2026/02/23(8 个月前);至今共发布 47 个版本,其中过去 12 个月发布了 2 个;首次发布于 2023/11/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。