ValyroUI Русская версия

Swatch Picker

Pick a color from swatches: product, theme, label. Pro · Forms and input › Color, size and emoji

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add swatch-picker
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { SwatchPicker } from 'valyro-ui-pro';

Props

PropTypeDefault
swatches *Swatch[]The colors, in order.
selectionMode'single' | 'multiple''single'single: one color (radios, the default); multiple: any number (checkboxes, for filters).
valuestring[]Selected values (controlled).
defaultValuestring[]Initial value when uncontrolled.
onValueChange(value: string[]) => voidCalled with the new value when it changes.
namestringName of the native inputs, so the selection submits with a form.
size'sm' | 'md' | 'lg''md'Diameter: sm 24px, md 32px, lg 40px. Default md.
shape'circle' | 'square''circle'circle (default) or rounded square.
disabledbooleanfalseDisables every swatch.

Related components

Previous: Color Picker · Next: Size Picker · All Forms and input