# Scene (scene)

> Full-bleed cream canvas that fills its composition and clips overflow; one per scene.

- Entry: component
- Category: Layout
- Preview capabilities: player
- Runtime: React
- Needs Remotion: no
- QA page: https://jbm-ui.bns.studio/c/scene
- JSON: https://jbm-ui.bns.studio/catalog/scene.json
- Registry item: https://jbm-ui.bns.studio/r/scene.json (source code in files[].content)

## Install

```sh
npx shadcn@latest add @jbm/scene
```

Also installs @jbm/tokens (registry dependencies install automatically).

## Required setup

1. Add the `@jbm` registry to components.json (keep any entries already there):

   ```json
   {
     "registries": {
       "@jbm": "https://jbm-ui.bns.studio/r/{name}.json"
     }
   }
   ```

2. Map `@/*` to `./src/*` in tsconfig.json `compilerOptions.paths`, so `@/jbm/…` imports resolve to src/jbm/.

## Files

Each file's source code is in the registry item JSON (https://jbm-ui.bns.studio/r/scene.json, files[].content).

| Source path | Installs to | Import |
| --- | --- | --- |
| `registry/jbm/motion/scene.tsx` | `src/jbm/motion/scene.tsx` | `@/jbm/motion/scene` |

## API

### `Scene` (component)

Absolutely positioned div with inset 0, the canvas background color, and overflow hidden. Place one inside each Remotion Sequence and lay out blocks inside it.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `React.ReactNode` | required | Scene content; absolutely positioned children are placed relative to the scene. |
| `style` | `React.CSSProperties` | none | Inline styles merged last, e.g. flex centering or padding. |

## Stage

Declared in stage pixels at the documented defaults.

| Orientation | Width | Height |
| --- | --- | --- |
| Landscape (1920×1080) | fill | 1080 |
| Vertical (1080×1920) | fill | 1920 |

inset: 0 fills the positioned parent, which in a composition is the full stage: 1920×1080 in landscape and 1080×1920 in vertical (stage tokens in lib/tokens.ts).

## Examples

### A headline on the canvas

```tsx
import { Scene } from "@/jbm/motion/scene"
import { Big } from "@/jbm/ui/big" // install @jbm/big separately

<Scene><Big>Una idea a la vez.</Big></Scene>
```

### Centered content

```tsx
import { Scene } from "@/jbm/motion/scene"

<Scene style={{ display: "flex", alignItems: "center", justifyContent: "center", padding: 120 }}>
  {children}
</Scene>
```

## QA

- Check the canvas covers the full composition in both orientations with no white edge, and content outside it is clipped.
- The preview is a single still frame; confirm the background is the cream canvas token, not a hard-coded color.

## Related

Installs:

- [Tokens (tokens)](https://jbm-ui.bns.studio/catalog/tokens.md)

Installed by:

- [SceneFromSpec (scene-spec)](https://jbm-ui.bns.studio/catalog/scene-spec.md)

Imported in examples:

- [Big (big)](https://jbm-ui.bns.studio/catalog/big.md)

## More

- [llms.txt](https://jbm-ui.bns.studio/llms.txt): index of every item
- [catalog.json](https://jbm-ui.bns.studio/catalog.json): every item as JSON
- [Agent contract](https://jbm-ui.bns.studio/docs/agent-contract.md): what each field means
