Skip to content
Velkin LogoVelkin Logo
Velkin
VELKIN/UI

Modern UI components for product teams and their AI agents. Lit core, typed wrappers, live MCP.

sales@velkinui.com

Product

  • Docs
  • Components
  • Studio
  • Pricing

Resources

  • Quick start
  • Blog
  • Changelog
  • Roadmap
  • Status

Project

  • About
  • Contact
  • License
  • Privacy
  • Terms

© 2026 Velkin. MIT core · Pro licenses available.

VELKIN

Color Picker

A color picker component with swatches, sliders, and input field.

vu-color-picker · @velkin/react/color-picker

Copy page

Import

React
npm i @velkin/react

import { VuColorPicker } from "@velkin/react/color-picker";

Examples

API

Props

PropTypeDefaultDescription
valuestring"#3b82f6"Selected color as hex, rgb(), hsl(), or a named CSS color. Default: `"#3b82f6"`.
formatVuColorPickerFormat"hex"Text field and emitted string format. Default: `"hex"`.
showalphaboolean—Renders the alpha slider (`showalpha` attr). Default: `false`.
showformatboolean—Renders the hex / rgb / hsl format `<select>` (`showformat` attr). Default: `true`.
swatchesstring[][]Optional preset palette of CSS color strings.
labelstring""Accessible name forwarded to area, sliders, and input.
formatlabelstring—Accessible name for the format `<select>` (`formatlabel` prop).
swatcheslabelstring—Accessible name for the preset swatch list (`swatcheslabel` prop).
triggerVuColorPickerTrigger"inline"`inline` panel or `swatch` popover opener. Default: `"inline"`.
placementVuColorPickerPlacement"bottom-start"Popover placement when `trigger="swatch"`. Default: `"bottom-start"`.
openbooleanfalsePopover open state when `trigger="swatch"`. Default: `false`.
planecolorspaceVuColorAreaColorSpace—2D pad color model (`planecolorspace` attr). Default: `"hsb"`.
planexchannelVuColorAreaChannel—Horizontal pad axis (`planexchannel` attr). Default: `"saturation"`.
planeychannelVuColorAreaChannel—Vertical pad axis (`planeychannel` attr). Default: `"brightness"`.
planeshowdotsboolean—Passes `showdots` to `<vu-color-area>` (`planeshowdots` attr). Default: `false`.
showareaboolean—Renders the 2D color pad (`showarea` attr). Default: `true`.
showhuesliderboolean—Renders the hue gradient slider (`showhueslider` attr). Default: `true`.
showinputboolean—Renders the text color field (`showinput` attr). Default: `true`.
showpreviewboolean—Renders the live preview chip (`showpreview` attr). Default: `true`.
sliderorientationVuColorSliderOrientation—Hue and alpha slider axis (`sliderorientation` attr). Default: `"horizontal"`.
namestring—Form field name for submit.
defaultvaluestring—Value restored on `<form reset>` (`defaultvalue` attr).
formidstring—External `<form>` id (`formid` attr).
disabledboolean—Non-interactive; blocks popover and input.
readonlyboolean—Focusable but value cannot be edited.
requiredboolean—Blocks valid submit when empty.
requiredmessagestring—Custom `valueMissing` message (`requiredmessage` attr).
showerrorsboolean—Shows validation after activation (`showerrors` attr). Default: `false`.
validationactiveboolean—Drives invalid styling after activation (`validationactive` attr). Default: `false`.
invalidbooleanfalseTrue when last validation found errors (`invalid` attr). Default: `false`.
showAlphabooleanfalseRenders the alpha slider (`showalpha` attr).
showFormatbooleantrueRenders the format `<select>` (`showformat` attr).
formatLabelstring""Accessible name for the format `<select>`.
swatchesLabelstring""Accessible name for the preset swatch list.
planeColorSpaceVuColorAreaColorSpace"hsb"2D pad color model (`planecolorspace` attr).
planeXChannelVuColorAreaChannel"saturation"Horizontal pad axis (`planexchannel` attr).
planeYChannelVuColorAreaChannel"brightness"Vertical pad axis (`planeychannel` attr).
planeShowDotsbooleanfalsePasses `showdots` to `<vu-color-area>` (`planeshowdots` attr).
showAreabooleantrueRenders the 2D color pad (`showarea` attr).
showHueSliderbooleantrueRenders the hue slider (`showhueslider` attr).
showInputbooleantrueRenders the text color field (`showinput` attr).
showPreviewbooleantrueRenders the live preview chip (`showpreview` attr).
sliderOrientationVuColorSliderOrientation"horizontal"Hue and alpha slider axis (`sliderorientation` attr).
showErrorsbooleanfalseShows validation after activation.
validationActivebooleanfalseDrives invalid styling after activation.

Events

EventDetailDescription
vu-inputVuColorPickerChangeDetailLive value while dragging or typing.
vu-changeVuColorPickerChangeDetailCommitted value on pointer up, blur, or swatch pick.
——{CustomEvent<{ open: boolean }>} vu-open-change - When `open` changes (`trigger="swatch"`).
vu-openCustomEventPopover opened (`trigger="swatch"`).
vu-closeCustomEventPopover closed (`trigger="swatch"`).
vu-invalidCustomEventWhen validation messages are recomputed while `validationActive`.

Slots

SlotDescription
errorReplaces default validation message list when assigned.

CSS parts

PartDescription
basePicker body wrapper (area, sliders, input, swatches).
slidersHue and optional alpha slider group.
rowPreview chip, text input, and format toggle row.
previewLive color preview chip.
inputText input that round-trips the value.
formatHex / rgb / hsl format `<select>`.
swatchesPreset swatch list container.
triggerSwatch button when `trigger="swatch"`.
popoverPopover panel when `trigger="swatch"`.
error-messageRegion for `slot="error"` or stacked default validation lines.
error-lineOne default validation string when `slot="error"` is empty.
fieldColumn that stacks the picker and optional error.

Methods

MethodDescription
show- Opens the swatch popover; no-op when `trigger="inline"`.
hide- Closes the swatch popover; no-op when `trigger="inline"`.
validateInput- Runs validators and syncs validity.

Types

NameDefinition
VuColorAreaChannel
"hue"
| "saturation"
| "brightness"
| "lightness"
| "red"
| "green"
| "blue"
VuColorAreaColorSpace
"hsb" | "hsl" | "rgb"
VuColorPickerChangeDetail
{
  value: string;
  hex: string;
  hsv: HSV;
  hsl: HSL;
  rgb: RGB;
  alpha: number;
}
VuColorPickerFormat
"hsl" | "rgb" | "hex"
VuColorPickerPlacement
"bottom-start" | "bottom-end" | "top-start" | "top-end"
VuColorPickerTrigger
"inline" | "swatch"
VuColorSliderOrientation
"horizontal" | "vertical"

Related

Inputs

  • Advanced FilterAn advanced filter component with expression input and visual builder.
  • ButtonA clickable button component with multiple variants and states.
  • Button GroupA button group component with shared styling and optional selection.
  • CheckboxA checkbox component with label, hint, and validation.
  • Checkbox GroupA checkbox group component with shared label and validation.
  • Color AreaA two-dimensional color picker component for saturation and brightness.

Guides

  • FormsFormData, VuForm, and validation
  • EventsonVu* / v-model / e.detail
  • Appearancevariant, color, tone, size

Browse

  • Previous: Color AreaEarlier in the sidebar
  • Next: Color SliderLater in the sidebar
  • All componentsBrowse the full index