Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

5.9 KB
Raw Blame
---
title: Backdrop
description: Full-frame fill with an optional rounded, shadowed content frame — accepts a color, gradient, image, or any React element as a live animated background
component: backdrop
vibe: clean
length: 150
useWhen:
  - "You need a scene background — wrap every composition in `Backdrop` rather than hardcoding background colors on individual components."
  - "You want the Screen Studio floating-card look: colored surround with a padded, rounded, shadowed inner frame."
  - "The background itself should animate (pass a shader backdrop like `ShaderMeshGradient` as the `fill`)."
avoidWhen:
  - "You need an infinitely looping ambient background as a standalone track — use a shader backdrop directly and let the composition handle framing."
  - "You want a raw full-bleed color with no frame treatment — set `padding={0}` and `radius={0}`, or just set `backgroundColor` in the Remotion composition root."
  - "You're inside a transition presentation — transitions like `whip-pan` manage their own full-frame layout; nesting Backdrop inside them creates double-framing."
askedAs:
  - "scene background wrapper"
  - "frame with rounded content"
  - "I want a full-frame fill with a rounded shadowed card inside"
  - "color gradient or image behind my composition"
  - "wrap every scene in a consistent background"
  - "base layer that holds the content on a nice backdrop"
---

<ComponentPreview name="backdrop" />

<InstallBlock name="backdrop" />

## Usage

Solid color fill with a content frame:

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

<Backdrop fill={{ type: "color", value: "#0f0f0f" }}>
  <YourScene />
</Backdrop>
```

Gradient fill:

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

<Backdrop fill={{ type: "gradient", value: "linear-gradient(135deg, #6366f1, #a855f7)" }}>
  <YourScene />
</Backdrop>
```

Image fill using Remotion's `<Img>` (CORS-safe for MP4 export):

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

<Backdrop fill={{ type: "image", src: "https://example.com/bg.jpg", fit: "cover" }}>
  <YourScene />
</Backdrop>
```

Live animated React element as the fill:

```tsx
import { Backdrop } from "@/components/remocn/backdrop";
import { ShaderGrainGradient } from "@/components/remocn/shader-grain-gradient";

<Backdrop fill={<ShaderGrainGradient />}>
  <YourScene />
</Backdrop>
```

Custom padding, radius, and shadow:

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

<Backdrop
  fill={{ type: "color", value: "#18181b" }}
  padding={6}
  radius={2}
  shadow="0 32px 80px rgba(0,0,0,0.6)"
>
  <YourScene />
</Backdrop>
```

Disable shadow:

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

<Backdrop fill={{ type: "color", value: "#fff" }} shadow="">
  <YourScene />
</Backdrop>
```

## Fill variants

Each `fill` type renders differently — pick the one that fits your scene.

### Color

<BlockPreview name="backdrop-color" />

### Gradient

<BlockPreview name="backdrop-gradient" />

### Image

<BlockPreview name="backdrop-image" />

### Live background

Any React element as fill, e.g. `<ShaderGrainGradient />`.

<BlockPreview name="backdrop-live" />

## Background only

When no children are passed, the content frame is not rendered — the fill covers the full composition bleed with no inset, rounding, or shadow.

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

// full-bleed fill, no frame
<Backdrop fill={{ type: "gradient", value: "linear-gradient(135deg, #6366f1, #a855f7)" }} />

// or a live animated background as the fill
<Backdrop fill={<ShaderGrainGradient />} />
```

To render content edge-to-edge without any decorative frame, pass children but zero out padding, radius, and shadow:

```tsx
import { Backdrop } from "@/components/remocn/backdrop";

<Backdrop
  fill={{ type: "image", src: "/bg.jpg" }}
  padding={0}
  radius={0}
  shadow=""
>
  <YourScene />
</Backdrop>
```

<PropsTable title="Props"
  rows={[
    {
      name: "fill",
      type: "BackdropFill | ReactNode",
      default: "undefined",
      description: "The background layer. Pass a BackdropFill object ({ type: \"color\" | \"gradient\" | \"image\", ... }) for static fills, or any React element (e.g. <ShaderGrainGradient />) to render a live animated background.",
    },
    {
      name: "padding",
      type: "number",
      default: "4",
      description: "Inset of the content frame as a percentage of the composition width. Scales automatically across 720p, 1080p, and 4K.",
    },
    {
      name: "radius",
      type: "number",
      default: "1",
      description: "Corner radius of the content frame as a percentage of the composition width. Scales automatically across resolutions.",
    },
    {
      name: "shadow",
      type: "string",
      default: "\"0 20px 60px rgba(0,0,0,0.4)\"",
      description: "CSS box-shadow applied to the content frame. Pass an empty string to disable the shadow.",
    },
    {
      name: "children",
      type: "ReactNode",
      default: "undefined",
      description: "Content rendered inside the rounded, shadowed frame. When omitted, only the fill is shown full-bleed.",
    },
    {
      name: "className",
      type: "string",
      default: "undefined",
      description: "Additional class names applied to the outer full-frame container.",
    },
  ]}
/>

### BackdropFill shape

<PropsTable
  rows={[
    {
      name: "type: \"color\"",
      type: "{ type: \"color\"; value: string }",
      description: "Solid CSS color value (hex, hsl, oklch, etc.) applied as the background.",
    },
    {
      name: "type: \"gradient\"",
      type: "{ type: \"gradient\"; value: string }",
      description: "Any CSS gradient string (linear-gradient, radial-gradient, conic-gradient) applied as the background.",
    },
    {
      name: "type: \"image\"",
      type: "{ type: \"image\"; src: string; fit?: \"cover\" | \"contain\" }",
      description: "Image rendered via Remotion's <Img> (CORS-safe for MP4 export). fit defaults to \"cover\".",
    },
  ]}
/>