ColorPicker
A picker component for color selection
(code example)
note
This is a screen width component
Usageβ
Live Editor
<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')} />
Result
Loading...
APIβ
accessibilityLabelsβ
Accessibility labels as an object of strings
{ addButton: string, dismissButton: string, doneButton: string, input: string}
animatedIndexβ
Default is lastβ
The index of the item to animate at first render
number
backgroundColorβ
The ColorPicker's background color
string
colorsβ
Array of colors for the picker's color palette (hex values)
string[]
onValueChangeβ
Callback for the picker's color palette change
(value: string, colorInfo: ColorInfo) => void
testIDβ
The test id for e2e tests
string
valueβ
The value of the selected swatch
string