# Camera

Virtual camera that pans, zooms, rolls and shakes over whatever it wraps, eased between keyframes.

```bash
npx shadcn add https://www.reelcn.dev/r/camera.json
```

Usage:

```tsx
<Camera
  keyframes={[
    { frame: 0, zoom: 1 },
    { frame: 30, x: -210, y: -210, zoom: 2 },
    { frame: 75, zoom: 1 },
  ]}
  shake={4}
>
  <Img src={staticFile("dashboard.png")} style={{ width: "100%" }} />
</Camera>
```

Use for:

- Pushing in on a detail of a screenshot, dashboard or illustration, then pulling back out
- Handheld energy or an impact shake on a title card
- Splitting a scene into background/foreground layers that parallax at different strengths

Avoid:

- Giving one element its own zoom or slide entrance, use `animate`

Dependencies:

- `remotion`


## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| delay? | `number` | — | Frames to wait before entering. |
| duration? | `number` | — | Enter duration in frames. Defaults to 0.6s. Some items reuse `duration` for an unrelated local timing. See that item's own prop docs. |
| exit? | `number \| boolean` | `false` | Exit at the end of the parent `<Sequence>`. `false` keeps it on screen, a number sets the exit length in frames. |
| motion? | `MotionPersonality` | — | Override the theme's motion personality. |
| poster? | `boolean` | — | Renders fully entered, with no exit: for a still frame or thumbnail. Defaults to `false`. |
| holdFrames? | `number` | — | Delays the start of the exit window by this many frames, for a minimum on-screen hold. Defaults to `0`. |
| keyframes | `CameraKeyframe[]` | — |  |
| shake? | `number` | `0` | Handheld shake amplitude in design units. 0 is a locked-off camera. Over full-bleed footage keep `zoom` a little above 1 so the edges never show. |
| shakeSpeed? | `number` | `1.5` | How fast the shake wobbles, in rough cycles per second. |
| children? | `ReactNode` | — |  |
| style? | `CSSProperties` | — |  |
| className? | `string` | — |  |