Skip to main content

ColorSwatch

A color swatch component
(code example)

Usage#

<ColorSwatch color={Colors.red30} selected={true} onPress={() => console.log('pressed')}/>

API#

animated#

Is first render should be animated
boolean

color#

The color of the ColorSwatch
string

index#

The index of the Swatch if in array
number

onPress#

Callback from press event
(value: string, colorInfo: ColorInfo) => void

selected#

Is the initial state is selected
boolean

size#

Color Swatch size
number

style#

Component's style
ViewStyle

testID#

The test id for e2e tests
string

unavailable#

Is the initial state is unavailable
boolean

value#

Must be different than other ColorSwatches in the same group#

The identifier value of the ColorSwatch in a ColorSwatch palette
string