Device Morph

A device frame on a design canvas morphs from desktop to tablet to phone while the layout reflows. A free, MIT-licensed Remotion media layout.

Installation
$ pnpm dlx shadcn@latest add @remocn/device-morph

Usage

tsx
// src/Root.tsx
import { Composition } from "remotion";
import { DeviceMorph } from "@/components/remocn/device-morph";
 
const DeviceMorphScene = () => (
  <DeviceMorph
    images={["/p/1.jpg", "/p/2.jpg", "/p/3.jpg", "/p/4.jpg", "/p/5.jpg", "/p/6.jpg"]}
    reverse={false}
  />
);
 
export const RemotionRoot = () => (
  <Composition
    id="DeviceMorph"
    component={DeviceMorphScene}
    durationInFrames={410}
    fps={60}
    width={1280}
    height={720}
  />
);

A device frame appears over a size switcher. A cursor picks the tablet size, the frame morphs, then picks the phone size and morphs again, with the content reflowing at each width. Pass your own responsive UI as children (it lays out at the live viewport width), or a flat src screenshot, and set reverse to go from phone to desktop. The built-in dashboard uses staticFile thumbnails from the Remocn repo, so pass your own images. It ships light and dark through theme.

The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.

Props19

PropTypeDefault
children
React.ReactNode—

Your responsive UI. It lays out at the live viewport width.

src
string—

Screenshot shown instead of the built-in dashboard. No reflow.

stops
{ label: string; width: number; height: number }[]DEFAULT_STOPS

Exactly three stops, desktop then tablet then phone.

reverse
booleanfalse

Go from phone to desktop instead of desktop to phone.

brand
string"remocn"

Product name in the built-in dashboard's sidebar and phone header.

greeting
string"Good morning, Maya"

Greeting at the top of the built-in dashboard.

ctaLabel
string"New video"

Label of the built-in dashboard's primary button.

logo
React.ReactNode—

Replaces the remocn mark in the built-in dashboard's sidebar.

accent
string"#3B5BFD"

Accent color of the selection handles and chips.

ink
string—

Text color; overrides the theme ink.

background
string—

Solid fill in place of the gradient ground; pass "transparent" to drop it.

fontFamily
string"Geist"

Typeface for the copy. Load the font in your project first.

scale
number1

Size of the foreground around the frame's center; the background stays put.

delay
number0

Frames to hold the first frame before anything moves.

speed
number1

Playback speed multiplier for the whole timeline.

theme
"light" | "dark""light"

Color scheme. Ships light and dark.

images
string[]DEFAULT_IMAGES

Six thumbnails for the built-in project cards. Defaults to repo-only files.

ground
GshPresetId—

Shader preset id for the animated background.

groundParams
Partial<GradientParams>—

Partial shader parameters that override the ground preset.

  • childrenReact.ReactNode

    Your responsive UI. It lays out at the live viewport width.

  • srcstring

    Screenshot shown instead of the built-in dashboard. No reflow.

  • stops{ label: string; width: number; height: number }[]

    Exactly three stops, desktop then tablet then phone.

    DefaultDEFAULT_STOPS

  • reverseboolean

    Go from phone to desktop instead of desktop to phone.

    Defaultfalse

  • brandstring

    Product name in the built-in dashboard's sidebar and phone header.

    Default"remocn"

  • greetingstring

    Greeting at the top of the built-in dashboard.

    Default"Good morning, Maya"

  • ctaLabelstring

    Label of the built-in dashboard's primary button.

    Default"New video"

  • logoReact.ReactNode

    Replaces the remocn mark in the built-in dashboard's sidebar.

  • accentstring

    Accent color of the selection handles and chips.

    Default"#3B5BFD"

  • inkstring

    Text color; overrides the theme ink.

  • backgroundstring

    Solid fill in place of the gradient ground; pass "transparent" to drop it.

  • fontFamilystring

    Typeface for the copy. Load the font in your project first.

    Default"Geist"

  • scalenumber

    Size of the foreground around the frame's center; the background stays put.

    Default1

  • delaynumber

    Frames to hold the first frame before anything moves.

    Default0

  • speednumber

    Playback speed multiplier for the whole timeline.

    Default1

  • theme"light" | "dark"

    Color scheme. Ships light and dark.

    Default"light"

  • imagesstring[]

    Six thumbnails for the built-in project cards. Defaults to repo-only files.

    DefaultDEFAULT_IMAGES

  • groundGshPresetId

    Shader preset id for the animated background.

  • groundParamsPartial<GradientParams>

    Partial shader parameters that override the ground preset.