Skip to content
VenusUI
Get started

Instant Camera

An instant camera that fires its flash and ejects a print that slowly develops.

Preview

Installation

npx shadcn@latest add @venusui/instant-camera

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/instant-camera.tsx

Usage

The code behind the preview above.

instant-camera-demo.tsx

import { InstantCamera } from "@/components/ui/instant-camera"

// Photos: Unsplash (free under the Unsplash License).
const photo = (id: string) => `https://images.unsplash.com/photo-${id}?w=500&h=500&fit=crop&auto=format&q=75`

export default function InstantCameraDemo() {
  return (
    <InstantCamera
      defaultTaken={1}
      photos={[
        { src: photo("1507525428034-b723cf961d3e"), alt: "Gentle waves on a beach at sunrise", caption: "first light" },
        { src: photo("1533105079780-92b9be482077"), alt: "White houses above a blue sea", caption: "the long way down" },
        { src: photo("1502602898657-3e91760cbb34"), alt: "The Eiffel Tower at dusk", caption: "last night in Paris" },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
photos{ src: string; alt: string; caption?: string }[]—Photos it “takes”, in order.
filmnumber8Exposures in a pack.
defaultTakennumber0Photos already taken when it first appears.
onCapture(photo, remaining: number) => void—Called for each shot.

All <div> props.

Requirements

  • lucide-react for icons. React 19 and Tailwind CSS v4. The CLI adds the keyframes.

Customization

  • Square photos fit the print exactly.

Accessibility

  • The shutter is a named button and the remaining film is announced. Reduced motion skips the eject and develop animation.

Troubleshooting

Something looks different from the preview.
Components use your project’s theme tokens, so surrounding colours and radius follow your styles.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

Camera Shutter

Interactive

A lens with a working iris: blades close to the chosen aperture and snap shut when you release the shutter.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.