Skip to content

ColorInput

Used to select colors from a color area.

import { useState } from 'react';
import { ColorInput } from '@fintech-sandpit/ui/react';
const [color, setColor] = useState('#000000');
return (
<ColorInput
value={color}
size="md"
label="Select a colour"
name="color"
onChange={setColor}
/>
);
NameTypeDefaultDescription
valueColorThe value of the color input
defaultValueColorThe default value of the color input
orientationOrientationverticalThe orientation of the color input
sizeSizemdThe size of the color input
labelstringThe label of the color input
namestringcolorThe name of the color input
clearablebooleanfalseWhether the value can be cleared
requiredbooleanfalseWhether the value is required
readOnlybooleanfalseWhether the input is read only
disabledbooleanfalseWhether the input is disabled
NameTypeDescription
onValueChange(value: Color) => voidCallback fired when the value changes
type Orientation = 'horizontal' | 'vertical'
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'

See Color type definition for more information.