UIR

ImageStack

Two stacked photos. Press and drag: the stack follows your finger and the photos fan apart. Let go and everything springs back.

Preview

Installation

npx @codewithrabby/ui@latest add image-stack

Usage

import { ImageStack } from "@/components/uir/image-stack";

<ImageStack
  images={[require("./back.jpg"), require("./front.jpg")]}
  size={150}
  spread={70}
/>

Props

PropTypeDefault
images

Back and front photo.

[ImageSource, ImageSource]—
size

Width and height of each photo.

number150
radius

Corner radius of each photo.

number30
spread

How far each photo slides out when fanned.

number70
tilt

Max tilt (deg) of the stack while dragging.

number6
style

Style for the outer container.

ViewStyle—