Kinetik UI

Aspect Picker

.md

Aspect-ratio frames drawn to scale; a soft square slides to the pick and its frame grows a touch.

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

Installation

Kinetik CLI
npx kinetik-ui add aspect-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/aspect-picker.json

Install manually

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

Usage

import { AspectPicker } from '@/components/kinetik/aspect-picker';

<AspectPicker
  value={ratio}
  onChange={setRatio}
  options={[
    { value: '1:1', ratio: 1, label: 'Square' },
    { value: '16:9', ratio: 16 / 9, label: 'Widescreen' },
    { value: '9:16', ratio: 9 / 16, label: 'Story' },
  ]}
  action={{ icon: <MoreIcon />, label: 'More ratios', onPress: openRatios }}
/>;

When to use

  • Choosing a crop or canvas shape in a photo, video or design editor.

When not to use

  • More than four or five ratios in a row: show the common ones and put the rest behind the action.

Notes

  • Frames are drawn to scale from ratio, so any ratio works without icons.
  • Defaults to square, 3:2 and 2:3.

Props

AspectPickerProps

PropTypeDefaultDescription
valuerequiredstring—
onChangerequired(value: string) => void—
optionsreadonly AspectOption[]DEFAULT_OPTIONSDefaults to square, landscape 3:2 and portrait 2:3.
labelstring'Aspect ratio'Names the group for screen readers. Defaults to "Aspect ratio".
actionAspectPickerAction—A button after the ratios, e.g. more ratios.
disabledbooleanfalse
hapticsbooleantrueA tick when the ratio changes. Defaults to true.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
The highlight and the picked frame move with UI-thread springs on change; at rest nothing animates.
Measured

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

Real-device measurement pending.

Accessibility

Reduced motion
The highlight jumps and the frame changes without growing.
Screen readers
A radio group named "Aspect ratio"; each frame is a radio named by its label, e.g. "Portrait 2 by 3".
Touch target
Each ratio and the action button are 44 pt square.

Source files

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