Skip to main content
Version: 7.0.0

ColorSwatch

A color swatch component
(code example)

Usage

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

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

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