All blocks
BlocksArtifacts

JSON Render Remotion

Use this when you are prototyping prompt-to-video features, such as intro or slideshow drafts, and want output that plays in Remotion.

Loading pattern preview

Problems solved

Technical challenges this implementation handles out of the box.
  • Generate Remotion video timelines from natural language
  • Stream timeline specs into a Remotion Player preview
  • Compose scenes with cataloged components, transitions, and effects

Use cases

Products and workflows this pattern is designed to support.
  • Product intro videos
  • Photo slideshow generators
  • Testimonial video drafts
  • Prompt-to-Remotion prototyping

Compare with

Similar patterns, and when each one is the better fit.

Setup

Requirements, wiring steps, and what this pattern adds to your project.

Getting started

Pick how you want to pull this pattern in. Then wire env vars and routes the same way.

  1. 1

    Download → Next.js app

    Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).

  2. 2

    Extract the zip and install dependencies

    Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.

  3. 3

    Fill .env.local

    The download includes .env.local placeholders when needed. Add real values for: AI_GATEWAY_API_KEY, AI_GATEWAY_MODEL.

  4. 4

    Customize the agent and tool files

    Adapt prompts, tools, and stop conditions in the generated project for your product.

  5. 5

    Run the app and open the pattern route

    Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.

Environment variables

Capabilities

AI SDK APIs

streamTextgateway

Providers

Claude

External services

Upstash

Files added

12 files
  • app/page.tsx
  • app/page-client.tsx
  • app/layout.tsx
  • app/api/generate/route.ts
  • components/json-render-remotion-demo.tsx
  • components/empty-state.tsx
  • lib/catalog.ts
  • lib/custom-components.tsx
  • lib/geist-pixel-square-base64.ts
  • lib/rate-limit.ts
  • lib/remotion-theme-context.tsx
  • README.md

Dependencies

19 total

npm packages

13
@json-render/core@json-render/remotion@remotion/playerUpstashAISDKlucide-reactNext.jsReactremotionZod@remotion/fontsmotionsonner

Shadcn IconRegistry components

6
buttonemptyinputresizablescroll-areatextarea

Critical files

3 files
  • lib/catalog.ts

    Video catalog using defineCatalog with Remotion schema and standard component/transition/effect definitions. Exports getVideoPrompt() for API.

  • lib/custom-components.tsx

    Remotion component registry (customComponents) passed to Renderer. Includes GradientBackground, CountUp, and other custom scene components.

  • generate/route.ts

    Streaming API for video generation. Uses streamText with getVideoPrompt() as system prompt. Returns toTextStreamResponse() for JSONL.

Requirements

Complexity
Advanced
Setup time
~5 minutes
Node
24+
Memory
256MB
Upstash Redis