Skip to content

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

feat: line by line slide

dev_wandrya9bc00323b30
diff --git a/content/docs/components.mdx b/content/docs/components.mdx
index 16b0df93..64731fd6 100644
--- a/content/docs/components.mdx
+++ b/content/docs/components.mdx
@@ -67,6 +67,12 @@ Text effects, reveals, and kinetic type.
status: "stable",
href: "/docs/typography/focus-blur-resolve",
},
+ {
+ name: "LineByLineSlide",
+ description: "Each line slides in from the left with a staggered flow",
+ status: "stable",
+ href: "/docs/typography/line-by-line-slide",
+ },
{
name: "StaggeredFadeUp",
description: "Words rise from below with a soft cascading delay",
diff --git a/content/docs/typography/index.mdx b/content/docs/typography/index.mdx
index 53f9f13e..be0b8708 100644
--- a/content/docs/typography/index.mdx
+++ b/content/docs/typography/index.mdx
@@ -63,6 +63,12 @@ Every way text can move, fade, glitch, or stretch across the screen. From quiet
status: "stable",
href: "/docs/typography/focus-blur-resolve",
},
+ {
+ name: "LineByLineSlide",
+ description: "Each line slides in from the left with a staggered flow",
+ status: "stable",
+ href: "/docs/typography/line-by-line-slide",
+ },
{
name: "StaggeredFadeUp",
description: "Words rise from below with a soft cascading delay",
diff --git a/content/docs/typography/line-by-line-slide.mdx b/content/docs/typography/line-by-line-slide.mdx
new file mode 100644
index 00000000..e99d1022
--- /dev/null
+++ b/content/docs/typography/line-by-line-slide.mdx
@@ -0,0 +1,106 @@
+---
+title: Line-by-Line Slide
+description: Each line slides in from the left with a staggered flow then exits to the right
+---
+
+<ComponentPreview name="line-by-line-slide" />
+
+## Installation
+
+<InstallBlock name="line-by-line-slide" />
+
+## Usage
+
+```tsx
+// src/Root.tsx
+import { Composition } from "remotion";
+import { LineByLineSlide } from "@/components/remocn/line-by-line-slide";
+
+const LineByLineSlideScene = () => (
+ <LineByLineSlide text={"Think different.\nDo more."} distance={48} />
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="LineByLineSlide"
+ component={LineByLineSlideScene}
+ durationInFrames={90}
+ fps={30}
+ width={1280}
+ height={720}
+ />
+);
+```
+
+The text is split on newline characters into individual lines. Each line slides in from the left, holds steady in the middle of the composition, then slides out to the right—so the duration should leave room for the staggered entry and exit animations.
+
+### 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 { LineByLineSlide } from "@/components/remocn/line-by-line-slide";
+import { Backdrop } from "@/components/remocn/backdrop";
+
+const LineByLineSlideScene = () => (
+ <Backdrop fill={{ type: "color", value: "#ffffff" }}>
+ <LineByLineSlide text={"Think different.\nDo more."} distance={48} />
+ </Backdrop>
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="LineByLineSlide"
+ component={LineByLineSlideScene}
+ durationInFrames={90}
+ fps={30}
+ width={1280}
+ height={720}
+ />
+);
+```
+
+## Props
+
+<PropsTable
+ rows={[
+ {
+ name: "text",
+ type: "string",
+ required: true,
+ description: "The text to animate. Split on newline characters into lines.",
+ },
+ {
+ name: "distance",
+ type: "number",
+ default: "48",
+ description: "Horizontal slide distance in pixels each line travels.",
+ },
+ {
+ 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 underlying span",
+ },
+ ]}
+/>
diff --git a/content/docs/typography/meta.json b/content/docs/typography/meta.json
index a5af3664..390d0bdd 100644
--- a/content/docs/typography/meta.json
+++ b/content/docs/typography/meta.json
@@ -12,6 +12,7 @@
"scale-down-fade",
"blur-out-up",
"focus-blur-resolve",
+ "line-by-line-slide",
"staggered-fade-up",
"masked-slide-reveal",
"tracking-in",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 13e69491..3f2e0e3c 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -25,6 +25,8 @@ import { BlurOutUp } from "@/registry/remocn/blur-out-up";
import { blurOutUpConfig } from "@/registry/remocn/blur-out-up/config";
import { FocusBlurResolve } from "@/registry/remocn/focus-blur-resolve";
import { focusBlurResolveConfig } from "@/registry/remocn/focus-blur-resolve/config";
+import { LineByLineSlide } from "@/registry/remocn/line-by-line-slide";
+import { lineByLineSlideConfig } from "@/registry/remocn/line-by-line-slide/config";
import { BrowserFlow } from "@/registry/remocn/browser-flow";
import { browserFlowConfig } from "@/registry/remocn/browser-flow/config";
import { ChatToPreviewLayout } from "@/registry/remocn/chat-to-preview-layout";
@@ -217,6 +219,7 @@ const registry: Record<string, RegistryEntry> = {
"scale-down-fade": { Component: ScaleDownFade, config: scaleDownFadeConfig },
"blur-out-up": { Component: BlurOutUp, config: blurOutUpConfig },
"focus-blur-resolve": { Component: FocusBlurResolve, config: focusBlurResolveConfig },
+ "line-by-line-slide": { Component: LineByLineSlide, config: lineByLineSlideConfig },
typewriter: { Component: Typewriter, config: typewriterConfig },
"inline-highlight": {
Component: InlineHighlight,
diff --git a/registry/remocn/line-by-line-slide/config.ts b/registry/remocn/line-by-line-slide/config.ts
new file mode 100644
index 00000000..ad177b32
--- /dev/null
+++ b/registry/remocn/line-by-line-slide/config.ts
@@ -0,0 +1,43 @@
+import {
+ type ComponentConfig,
+ FONT_WEIGHT_OPTIONS,
+ FPS,
+ H,
+ W,
+} from "@/lib/customizer-config";
+
+export const lineByLineSlideConfig: ComponentConfig = {
+ componentName: "LineByLineSlide",
+ importPath: "@/components/remocn/line-by-line-slide",
+ controls: {
+ text: { type: "text", default: "Think different.\nDo more.", label: "Text" },
+ distance: {
+ type: "number",
+ default: 48,
+ min: 0,
+ max: 160,
+ step: 1,
+ label: "Distance",
+ },
+ fontSize: {
+ type: "number",
+ default: 72,
+ min: 12,
+ max: 160,
+ step: 1,
+ label: "Font size",
+ },
+ color: { type: "color", default: "#171717", label: "Color" },
+ fontWeight: {
+ type: "select",
+ default: "600",
+ options: FONT_WEIGHT_OPTIONS,
+ label: "Font weight",
+ },
+ },
+ durationInFrames: 90,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+ previewBackdrop: { type: "color", value: "#ffffff" },
+};
diff --git a/registry/remocn/line-by-line-slide/index.tsx b/registry/remocn/line-by-line-slide/index.tsx
new file mode 100644
index 00000000..6748c8b5
--- /dev/null
+++ b/registry/remocn/line-by-line-slide/index.tsx
@@ -0,0 +1,113 @@
+"use client";
+
+import { Easing, interpolate, useCurrentFrame, useVideoConfig } from "remotion";
+
+export interface LineByLineSlideProps {
+ text: string;
+ distance?: number;
+ fontSize?: number;
+ color?: string;
+ fontWeight?: number;
+ speed?: number;
+ className?: string;
+}
+
+export function LineByLineSlide({
+ text,
+ distance = 48,
+ fontSize = 72,
+ color = "#171717",
+ fontWeight = 600,
+ speed = 1,
+ className,
+}: LineByLineSlideProps) {
+ const frame = useCurrentFrame() * speed;
+ const { durationInFrames } = useVideoConfig();
+
+ const lines = text.split("\n");
+
+ const enterDur = 27;
+ const exitDur = 18;
+ const enterStagger = 4;
+ const exitStagger = 2;
+
+ const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);
+ const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);
+
+ const enterEnd = enterDur + (lines.length - 1) * enterStagger;
+ const exitStart = Math.max(enterEnd, durationInFrames - exitDur - (lines.length - 1) * exitStagger);
+
+ return (
+ <div
+ style={{
+ position: "absolute",
+ inset: 0,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ background: "transparent",
+ }}
+ >
+ <span
+ className={className}
+ style={{
+ fontSize,
+ fontWeight,
+ color,
+ letterSpacing: "-0.03em",
+ lineHeight: 1.1,
+ textAlign: "left",
+ fontFamily:
+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif",
+ }}
+ >
+ {lines.map((line, i) => {
+ const enterLocal = frame - i * enterStagger;
+ const exitLocal = frame - exitStart - i * exitStagger;
+
+ const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: enterEasing,
+ });
+
+ const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: exitEasing,
+ });
+
+ const opacity = enterP * (1 - exitP);
+
+ const xEnter = interpolate(enterLocal, [0, enterDur], [-distance, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: enterEasing,
+ });
+
+ const xExit = interpolate(exitLocal, [0, exitDur], [0, distance], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: exitEasing,
+ });
+
+ const x = xEnter + xExit;
+
+ return (
+ <span
+ key={i}
+ style={{
+ display: "block",
+ transformOrigin: "0% 50%",
+ opacity,
+ transform: `translateX(${x}px)`,
+ }}
+ >
+ {line}
+ </span>
+ );
+ })}
+ </span>
+ </div>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 08eae2ed..5da413df 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -147,6 +147,22 @@
}
]
},
+ {
+ "name": "line-by-line-slide",
+ "type": "registry:component",
+ "title": "Line-by-Line Slide",
+ "description": "Each line enters from the left with a staggered slide and exits to the right for a flowing paragraph reveal.",
+ "dependencies": [
+ "remotion"
+ ],
+ "files": [
+ {
+ "path": "line-by-line-slide/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/line-by-line-slide.tsx"
+ }
+ ]
+ },
{
"name": "typewriter",
"type": "registry:component",