Shared Axis Z

Scale-based shared-axis transition for focus shifts and context depth

Installation
$ pnpm dlx shadcn@latest add @remocn/shared-axis-z

Usage

tsx
// src/Root.tsx
import { Composition, Sequence } from "remotion";
import { SharedAxisZ } from "@/components/remocn/shared-axis-z";
 
const SharedAxisZScene = () => (
  <>
    <Sequence durationInFrames={40}>
      <SharedAxisZ fromText="Zooming between states." toText="Elevate and settle." />
    </Sequence>
    <Sequence from={40} durationInFrames={40}>
      <SharedAxisZ fromText="Elevate and settle." toText="Scale with purpose." />
    </Sequence>
  </>
);
 
export const RemotionRoot = () => (
  <Composition
    id="SharedAxisZ"
    component={SharedAxisZScene}
    durationInFrames={80}
    fps={30}
    width={1280}
    height={720}
  />
);

A Material shared-axis (Z) depth swap — the old phrase scales up and blurs away as it fades, while the new phrase rises from a smaller scale and sharpens into focus. Chaining two in Sequence flows A → B → C.

Chained example

This is the two-Sequence chain above rendered on an 80-frame timeline:

0:00 / 0:02
0s1s2s2.7s
0:00 / 0:02

With Backdrop

The component renders transparent — supply the background via Backdrop. It ships single-theme; edit the copied file to re-theme colors.

Pair with Backdrop to place the text inside a full-frame fill with a rounded, shadowed content frame:

tsx
import { Composition } from "remotion";
import { SharedAxisZ } from "@/components/remocn/shared-axis-z";
import { Backdrop } from "@/components/remocn/backdrop";
 
const SharedAxisZScene = () => (
  <Backdrop fill={{ type: "color", value: "#ffffff" }}>
    <SharedAxisZ
      fromText="Zooming between states."
      toText="Elevate and settle."
    />
  </Backdrop>
);
 
export const RemotionRoot = () => (
  <Composition
    id="SharedAxisZ"
    component={SharedAxisZScene}
    durationInFrames={90}
    fps={30}
    width={1280}
    height={720}
  />
);

Props6

PropTypeDefault
fromTextrequired
string—

The outgoing phrase, scales up and fades away.

toTextrequired
string—

The incoming phrase, rises from a smaller scale into focus.

fontSize
number72

Font size in pixels

fontWeight
number600

CSS font-weight

color
string"#171717"

Text color (any valid CSS color)

className
string—

Optional className passed to the wrapper

  • fromTextrequiredstring

    The outgoing phrase, scales up and fades away.

  • toTextrequiredstring

    The incoming phrase, rises from a smaller scale into focus.

  • fontSizenumber

    Font size in pixels

    Default72

  • fontWeightnumber

    CSS font-weight

    Default600

  • colorstring

    Text color (any valid CSS color)

    Default"#171717"

  • classNamestring

    Optional className passed to the wrapper