Kinetik UI

Swatch Picker

.md

Colour swatches with a ring that glides to your pick, a small squeeze and a check in readable ink.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add swatch-picker

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/swatch-picker.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/swatch-picker.tsx
    View source files

Usage

import { SwatchPicker } from '@/components/kinetik/swatch-picker';

<SwatchPicker
  accessibilityLabel="Accent colour"
  swatches={[
    { value: '#2B6BEF', label: 'Cobalt' },
    { value: '#3BA58B', label: 'Sea glass' },
    { value: '#F2C14E', label: 'Butter' },
  ]}
  value={accent}
  onValueChange={setAccent}
/>;

When to use

  • Picking from a fixed set of colours: a label colour, a theme accent, a product finish.
  • Small sets where seeing every option at once matters more than precision.

When not to use

  • Any colour at all. Use a full colour picker with hue and lightness.
  • Choices that are not colours. Use Glide Radio or Choice Cards.

Notes

  • Every swatch needs a label: screen readers read the name, never the hex value.
  • With #RRGGBB values the check is drawn in dark or light ink, whichever reads better on that colour.
  • Each swatch sits in a 44 pt cell, so size can go down to 24 without shrinking the target.
  • With reduced motion the ring jumps and the swatch does not squeeze.

Props

SwatchPickerProps

PropTypeDefaultDescription
swatchesrequiredreadonly Swatch[]—
valuerequiredstring—
onValueChangerequired(value: string) => void—
accessibilityLabelrequiredstring—Names the group, e.g. "Accent colour".
sizenumber32Diameter of each swatch. Defaults to 32.
hapticsbooleantrueA tick when the colour changes. Defaults to true.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain views; one ring on two shared values and two per swatch for the squeeze and check. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.94× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 145 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The ring jumps to the new swatch and the check appears without a spring.
Screen readers
A radio group named by accessibilityLabel; each swatch is a radio read by its label.
Touch target
Each swatch is the centre of a 44 by 44 pt cell.

Source files

components/kinetik/swatch-picker.tsx is in the Code tab of the preview above.