PastelColorField
PastelColorField renders a colored bar button that opens a popover containing 13 pastel color circles. On mount the first color in the palette (#A597CC) is automatically selected and emitted via onChange. This component is functionally identical to ColorPaletteField; use either depending on naming preference in your codebase.
Props
| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| value | string | Yes | — | Currently selected color (CSS hex string). |
| onChange | (color: string) => void | Yes | — | Called with the selected hex color string. |
| label | string | No | — | Label rendered above the color bar. |
| description | string | No | — | Helper text rendered below the component. |
| containerStyle | React.CSSProperties | No | — | Styles applied to the root container. |
| labelStyle | React.CSSProperties | No | — | Styles applied to the label element. |
| descriptionStyle | React.CSSProperties | No | — | Styles applied to the description paragraph. |
| className | string | No | — | CSS class name applied to the root container. |
| id | string | No | — | id attribute on the root container. |
Usage
Basic
import React, { useState } from 'react';
import PastelColorField from '@/components/fields/PastelColorField';
export default function Example() {
const [color, setColor] = useState('');
return (
<PastelColorField
label="Tag color"
value={color}
onChange={setColor}
/>
);
}