Kinetik UI

Fan Stack

.md

A loose pile of pictures that fans out like a hand of cards; tap one to lift it out of the fan.

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

Installation

Kinetik CLI
npx kinetik-ui add fan-stack

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/fan-stack.json

Install manually

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

Usage

import { FanStack } from '@/components/kinetik/fan-stack';

<FanStack
  accessibilityLabel="Desert trip"
  items={photos.map((p) => ({ key: p.id, image: { uri: p.url }, title: p.title }))}
  onSelect={(i) => setFocus(i)}
/>;

The stack centres itself in the width it is given and reserves the height the fan needs. The last item lies on top of the pile.

When to use

  • A small set of pictures that belongs together: an album, a trip, a moodboard.
  • Previews where the playful gesture is part of the charm, such as a profile or a shared memory.

When not to use

  • More than seven items. Use a grid or a carousel.
  • Pictures people need to compare side by side. The fan overlaps them.

Notes

  • Tap the pile to fan it out, tap a card to lift it, tap the lifted card to gather the pile.
  • Pass open and onOpenChange to fan it out from elsewhere, for example when its section scrolls into view.
  • With reduced motion the cards move without the stagger or the bounce.

Props

FanStackProps

PropTypeDefaultDescription
itemsrequiredreadonly FanItem[]—Two to seven pictures; the last one lies on top of the pile.
cardWidthnumber148Width of each card. Defaults to 148.
aspectnumber1.3Card height divided by width. Defaults to 1.3.
spreadnumber11Degrees between neighbouring cards when fanned. Defaults to 11.
openboolean—Controlled fan state. Leave unset to let the stack keep its own.
onOpenChange(open: boolean) => void—
onSelect(index: number | null) => void—Called with the lifted card, or null when none is.
accessibilityLabelstring'Photos'Names the pile for screen readers. Defaults to 'Photos'.
hapticsbooleantrueA tap as it fans out and a tick as a card lifts. Defaults to true.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Three springs per card (fan, lift, dim), transforms and opacity only. Nothing runs at rest.
Measured

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

Real-device measurement pending.

Accessibility

Reduced motion
Cards move straight to the fan or the pile without the stagger or the bounce.
Screen readers
Gathered, the pile is one button ('Photos, 5 items'); fanned, every card is a button with a selected state.
Touch target
Cards are 148 by 192 pt by default; overlapping cards keep at least 60 pt of their width uncovered.

Source files

components/kinetik/fan-stack.tsx is in the Code tab of the preview above.