ColorPicker
A picker component for color selection
(code example)
note
This is a screen width component
#
Usage<ColorPicker colors={[Colors.green10, Colors.green20, Colors.green30, Colors.green40, Colors.green50, Colors.green60, Colors.green70]} initialColor={Colors.green10} value={currentColor} onDismiss={() => console.log('dismissed')} onSubmit={() => console.log('submit')} onValueChange={() => console.log('value changed')}/>
#
API#
accessibilityLabelsAccessibility labels as an object of strings
{
addButton: string,
dismissButton: string,
doneButton: string,
input: string}
#
animatedIndex#
Default is lastThe index of the item to animate at first render
number
#
backgroundColorThe ColorPicker's background color
string
#
colorsArray of colors for the picker's color palette (hex values)
string[]
#
onValueChangeCallback for the picker's color palette change
(value: string, colorInfo: ColorInfo) => void
#
testIDThe test id for e2e tests
string
#
valueThe value of the selected swatch
string