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 Swatch Picker

A color swatch picker component with preset or custom palettes.

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

Copy page

Import

React
npm i @velkin/react

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

Examples

API

Props

PropTypeDefaultDescription
valuestring""Current selection (`swatch.value` or `swatch.color` when value is empty).
colorsstring[][]Auto-mode palette (CSS strings); ignored when slotted swatches exist.
columnsnumber0Grid column count; `0` = auto-fill (grid layout only).
sizeVuColorSwatchSize"md"Swatch size forwarded to each chip.
variantVuColorSwatchPickerVariant"circle"Swatch outline: `circle` (default) or `square`.
layoutVuColorSwatchPickerLayout"grid"`grid` (default) or vertical `stack`.
labelstring""Accessible name for the radiogroup; empty uses the locale catalog.
showErrorsbooleanfalseShows validation after activation.
validationActivebooleanfalseDrives invalid styling after activation.
invalidbooleanfalseTrue when the last validation run found errors.

Events

EventDetailDescription
vu-changeVuColorSwatchPickerChangeDetailSelection changed.
vu-invalidCustomEventWhen validation messages are recomputed while `validationActive`.

Slots

SlotDescription
—- Optional `<vu-color-swatch>` children (composition mode). When non-empty, `colors` is ignored.
errorReplaces default validation message list when assigned.

CSS parts

PartDescription
baseSwatch container (grid or stack).
fieldColumn that stacks the palette and optional error.
error-messageRegion for `slot="error"` or stacked default validation lines.
error-lineOne default validation string when `slot="error"` is empty.

Types

NameDefinition
VuColorSwatchPickerChangeDetail
{
  value: string;
  color: string;
  index: number;
  parsed: VuColorSwatchPickerColor | null;
}
VuColorSwatchPickerLayout
"grid" | "stack"
VuColorSwatchPickerVariant
"circle" | "square"
VuColorSwatchSize
"sm" | "md" | "lg" | "xs" | "xl"

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 SwatchEarlier in the sidebar
  • Next: ComboboxLater in the sidebar
  • All componentsBrowse the full index