A powerful and flexible color picker component for Vue 3.x applications.
Documentation & Examples | 文档和示例
- Multiple Color Modes
- Solid color selection with HEX, RGB, and HSL formats
- Linear gradient with customizable angle and positions
- Radial gradient with adjustable center and radius
- Advanced Controls
- Alpha channel support for transparency adjustment
- Interactive gradient bar with intuitive control points
- Drag, add, or delete gradient stops with ease
- Real-time color preview
- Modern Browser Features
- EyeDropper tool for picking colors from anywhere on screen (Chrome 95+)
- Full keyboard navigation support
- Responsive design that works on both desktop and mobile
demo.mov
# Using npm
npm install @mcistudio/vue-colorpicker
# Using yarn
yarn add @mcistudio/vue-colorpicker
# Using pnpm
pnpm add @mcistudio/vue-colorpicker
import { createApp } from "vue";
import App from "./App.vue";
import ColorPicker from "@mcistudio/vue-colorpicker";
import "@mcistudio/vue-colorpicker/style.css";
const app = createApp(App);
app.use(ColorPicker);
app.mount("#app");
<script setup>
import { ref } from "vue";
import ColorPicker from "@mcistudio/vue-colorpicker";
import "@mcistudio/vue-colorpicker/style.css";
const color = ref({
mode: "solid",
color: {
r: 12,
g: 134,
b: 123,
a: 1,
},
});
</script>
<template>
<ColorPicker v-model="color" />
</template>
- Chrome ≥ 95 (for EyeDropper feature)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
MIT License © 2024