Ir al contenido

co-color-picker

Selector de color basado en presets. El disparador muestra la muestra actual junto al valor hex y abre un popover con una cuadrícula de colores predefinidos. El valor hex es de solo lectura (sin edición manual) e incluye un botón para copiarlo al portapapeles.

Ver código
<co-color-picker label="Color" value="#0066FF"></co-color-picker>

Props

PropAtributoTipoDefaultDescripción
disableddisabledbooleanfalseDisable the field.
helperTexthelper-textstring | undefinedHelper/error text below the field.
labellabelstring | undefinedField label.
layoutlayout"horizontal" | "vertical"'vertical'Label layout: vertical (label above) or horizontal (label beside)
namenamestring | undefinedField name for form submission.
placeholderplaceholderstring'Select color'Placeholder text when no color is selected.
presetspresetsColorPreset[] | string | string[]''Preset colors as a JSON stringified array of `{ name, value }` objects or plain hex strings. When set programmatically, accepts an actual array.
requiredrequiredbooleanfalseShow required indicator.
sizesize"lg" | "md" | "s" | "sm"'md'Field size (mirrors co-input): s 28 / sm 32 / md 40 / lg 48.
statusstatus"default" | "error" | "success" | "warning"'default'Validation status.
valuevaluestring''Current color value as hex string (e.g. "#0066FF").

Eventos

EventoDetailBubblesCancelableDescripción
coChangestringEmits the selected hex color on change.

Slots

Este componente no expone slots.

CSS Parts

Este componente no expone CSS parts.

CSS Custom Properties

Este componente no expone CSS custom properties.