Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

4.0 KB
Raw Blame
---
title: Shared Axis Z
description: Scale-based shared-axis transition for focus shifts and context depth
component: shared-axis-z
vibe: clean
length: 90
useWhen:
  - "Conveying a zoom-in narrative: moving from a broad context to a focused point."
  - "Transitioning between two text values where the second is a more specific or deeper layer of the first."
  - "Chaining multiple topic shifts in a `<Sequence>` where each swap should feel like a camera push forward."
avoidWhen:
  - "The swap is a lateral topic change with no depth relationship — use `shared-axis-y` for a horizontal-edit-style cut instead."
  - "You only need to bring text in for the first time with no outgoing content — use `scale-down-fade` or `soft-blur-in` for a single-text entrance."
  - "The scene already has a lot of scale motion and you need variety — mix in `shared-axis-y` to alternate the spatial grammar."
askedAs:
  - "zoom depth text change"
  - "focus shift scale transition"
  - "I want text to scale as the context goes from broad to focused"
  - "zoom in narrative moving from big picture to a specific point"
  - "switching between related ideas with a sense of depth"
  - "viewer feels getting closer to the subject as the words scale"
---

<ComponentPreview name="shared-axis-z" />

<InstallBlock name="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:

<ComponentExample name="shared-axis-z" />

### 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}
  />
);
```

<PropsTable title="Props"
  rows={[
    {
      name: "fromText",
      type: "string",
      required: true,
      description: "The outgoing phrase, scales up and fades away.",
    },
    {
      name: "toText",
      type: "string",
      required: true,
      description: "The incoming phrase, rises from a smaller scale into focus.",
    },
    {
      name: "fontSize",
      type: "number",
      default: "72",
      description: "Font size in pixels",
    },
    {
      name: "fontWeight",
      type: "number",
      default: "600",
      description: "CSS font-weight",
    },
    {
      name: "color",
      type: "string",
      default: "\"#171717\"",
      description: "Text color (any valid CSS color)",
    },
    {
      name: "className",
      type: "string",
      description: "Optional className passed to the wrapper",
    },
  ]}
/>