Skip to content

ColorInput

Used to select colors from a color area.

import { useState } from 'react';
// Import component
import { ColorInput } from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/color_input.css';
const [color, setColor] = useState('#000000');
return (
<ColorInput
value={color}
size="md"
label="Select a colour"
name="color"
onChange={setColor}
/>
);
NameTypeDefaultDescription
valueColor—The value of the color input
defaultValueColor—The default value of the color input
orientationOrientationverticalThe orientation of the color input
sizeFieldSizemdThe size of the color input
labelstring—The 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 FieldSize = 'sm' | 'md' | 'lg'
type Orientation = 'horizontal' | 'vertical'

See Color type definition for more information.