Skip to content
VenusUI
Get started

Camera Shutter

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

Preview

Installation

npx shadcn@latest add @venusui/camera-shutter

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/camera-shutter.tsx

Usage

The code behind the preview above.

camera-shutter-demo.tsx

import { CameraShutter } from "@/components/ui/camera-shutter"

export default function CameraShutterDemo() {
  return <CameraShutter />
}

API reference

PropTypeDefaultDescription
stopsnumber[][1.8 … 16]Apertures as f-numbers, widest first.
defaultStopnumber—Aperture selected at first.
lensLabelstring"50mm 1:1.8"Text engraved on the lens ring.
onStopChange(stop: number) => void—Called when the aperture changes.
onCapture(shot: { stop: number; count: number }) => void—Called each time the shutter fires.

All <div> props; className sets the width.

Requirements

  • React 19 and Tailwind CSS v4.

Customization

  • Connect onCapture to a real camera flow or use it as a playful confirmation control.

Accessibility

  • Apertures are native radio buttons, so the arrow keys work. The shot count is announced politely.
  • With reduced motion the blades move straight to their position.

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

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

Loading preview

Cassette Player

Interactive

A cassette tape whose reels turn and wind the tape from one side to the other as it plays.