Dynamic Split Screen

Cinematic two-column split where one panel shrinks and the other expands into view

Installation

$ pnpm dlx shadcn@latest add @remocn/chat-to-preview-layout

Usage

// src/Root.tsx
import { Composition } from "remotion";
import { ChatToPreviewLayout } from "@/components/remocn/chat-to-preview-layout";

const ChatToPreviewLayoutScene = () => (
  <ChatToPreviewLayout
    chat={<MyChat />
);

export const RemotionRoot = () => (
  <Composition
    id="ChatToPreviewLayout"
    component={ChatToPreviewLayoutScene}
    durationInFrames={120}
    fps={30}
    width={1280}
    height={720}
  />
);

Props

PropTypeDefaultDescription
chat
ReactNodeThe chat panel. Falls back to a sample chat mockup.
preview
ReactNodeThe preview panel. Falls back to a sample landing page mockup.
startChatRatio
number0.5Initial fraction of width given to the chat panel (0..1)
endChatRatio
number0.25Final fraction of width given to the chat panel (0..1)
background
string"#0a0a0a"Outer background color
className
stringOptional className for the outer container