Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: short slide down
dev_wandrye24b71271dd4
diff --git a/content/docs/components.mdx b/content/docs/components.mdxindex 736ebfb4..43f79870 100644--- a/content/docs/components.mdx+++ b/content/docs/components.mdx@@ -223,6 +223,12 @@ Text effects, reveals, and kinetic type.status: "stable",href: "/docs/typography/kinetic-center-build",},+ {+ name: "ShortSlideDown",+ description: "Words drop in from above and stack into a centered composition",+ status: "stable",+ href: "/docs/typography/short-slide-down",+ },]}/>diff --git a/content/docs/typography/index.mdx b/content/docs/typography/index.mdxindex d890ac48..02823f57 100644--- a/content/docs/typography/index.mdx+++ b/content/docs/typography/index.mdx@@ -223,5 +223,11 @@ Word-by-word builds with motion and momentum.status: "stable",href: "/docs/typography/kinetic-center-build",},+ {+ name: "ShortSlideDown",+ description: "Words drop in from above and stack into a centered composition",+ status: "stable",+ href: "/docs/typography/short-slide-down",+ },]}/>diff --git a/content/docs/typography/meta.json b/content/docs/typography/meta.jsonindex 0f2b9825..6d16e0d8 100644--- a/content/docs/typography/meta.json+++ b/content/docs/typography/meta.json@@ -19,6 +19,7 @@"shared-axis-z","short-slide-right","kinetic-center-build",+ "short-slide-down","staggered-fade-up","mask-reveal-up","tracking-in",diff --git a/content/docs/typography/short-slide-down.mdx b/content/docs/typography/short-slide-down.mdxnew file mode 100644index 00000000..a48b144d--- /dev/null+++ b/content/docs/typography/short-slide-down.mdx@@ -0,0 +1,108 @@+---+title: Short Slide Down+description: Words drop in from above and stack into a centered multi-line composition+---++<ComponentPreview name="short-slide-down" />++## Installation++<InstallBlock name="short-slide-down" />++## Usage++```tsx+// src/Root.tsx+import { Composition } from "remotion";+import { ShortSlideDown } from "@/components/remocn/short-slide-down";++const ShortSlideDownScene = () => (+ <ShortSlideDown text="Build from above." entryOffset={28} />+);++export const RemotionRoot = () => (+ <Composition+ id="ShortSlideDown"+ component={ShortSlideDownScene}+ durationInFrames={60}+ fps={30}+ width={1280}+ height={720}+ />+);+```++Each word drops in from above onto its own line and pushes the existing words down so the growing stack stays vertically centered — the words split onto separate lines, best for short three-word headings.++This is a layout-aware effect — it measures word heights to keep the stack centered, so it works best with short headings.++### 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 { ShortSlideDown } from "@/components/remocn/short-slide-down";+import { Backdrop } from "@/components/remocn/backdrop";++const ShortSlideDownScene = () => (+ <Backdrop fill={{ type: "color", value: "#ffffff" }}>+ <ShortSlideDown text="Build from above." entryOffset={28} />+ </Backdrop>+);++export const RemotionRoot = () => (+ <Composition+ id="ShortSlideDown"+ component={ShortSlideDownScene}+ durationInFrames={60}+ fps={30}+ width={1280}+ height={720}+ />+);+```++## Props++<PropsTable+ rows={[+ {+ name: "text",+ type: "string",+ required: true,+ description: "The phrase to build. Each word becomes its own line; best with short three-word phrases.",+ },+ {+ name: "entryOffset",+ type: "number",+ default: "28",+ description: "How far in pixels each incoming word starts above its line before dropping in.",+ },+ {+ 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 stack container",+ },+ ]}+/>diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 6bce22c8..aab59045 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -39,6 +39,8 @@ import { ShortSlideRight } from "@/registry/remocn/short-slide-right";import { shortSlideRightConfig } from "@/registry/remocn/short-slide-right/config";import { KineticCenterBuild } from "@/registry/remocn/kinetic-center-build";import { kineticCenterBuildConfig } from "@/registry/remocn/kinetic-center-build/config";+import { ShortSlideDown } from "@/registry/remocn/short-slide-down";+import { shortSlideDownConfig } from "@/registry/remocn/short-slide-down/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";@@ -238,6 +240,7 @@ const registry: Record<string, RegistryEntry> = {"shared-axis-z": { Component: SharedAxisZ, config: sharedAxisZConfig },"short-slide-right": { Component: ShortSlideRight, config: shortSlideRightConfig },"kinetic-center-build": { Component: KineticCenterBuild, config: kineticCenterBuildConfig },+ "short-slide-down": { Component: ShortSlideDown, config: shortSlideDownConfig },typewriter: { Component: Typewriter, config: typewriterConfig },"inline-highlight": {Component: InlineHighlight,diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex d8b9bf55..2a0da9b6 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -259,6 +259,22 @@}]},+ {+ "name": "short-slide-down",+ "type": "registry:component",+ "title": "Short Slide Down",+ "description": "Each new word drops in from above into its own line and pushes the stack downward until a centered three-line composition locks in place.",+ "dependencies": [+ "remotion"+ ],+ "files": [+ {+ "path": "short-slide-down/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/short-slide-down.tsx"+ }+ ]+ },{"name": "typewriter","type": "registry:component",diff --git a/registry/remocn/short-slide-down/config.ts b/registry/remocn/short-slide-down/config.tsnew file mode 100644index 00000000..4e51a7d6--- /dev/null+++ b/registry/remocn/short-slide-down/config.ts@@ -0,0 +1,43 @@+import {+ type ComponentConfig,+ FONT_WEIGHT_OPTIONS,+ FPS,+ H,+ W,+} from "@/lib/customizer-config";++export const shortSlideDownConfig: ComponentConfig = {+ componentName: "ShortSlideDown",+ importPath: "@/components/remocn/short-slide-down",+ controls: {+ text: { type: "text", default: "Build from above.", label: "Text" },+ entryOffset: {+ type: "number",+ default: 28,+ min: 8,+ max: 80,+ step: 1,+ label: "Entry offset",+ },+ 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: 60,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#ffffff" },+};diff --git a/registry/remocn/short-slide-down/index.tsx b/registry/remocn/short-slide-down/index.tsxnew file mode 100644index 00000000..7fd79dec--- /dev/null+++ b/registry/remocn/short-slide-down/index.tsx@@ -0,0 +1,154 @@+"use client";++import { useMemo } from "react";+import { Easing, interpolate, useCurrentFrame } from "remotion";++export interface ShortSlideDownProps {+ text: string;+ entryOffset?: number;+ fontSize?: number;+ color?: string;+ fontWeight?: number;+ speed?: number;+ className?: string;+}++const FONT_FAMILY =+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";++export function ShortSlideDown({+ text,+ entryOffset = 28,+ fontSize = 72,+ color = "#171717",+ fontWeight = 600,+ speed = 1,+ className,+}: ShortSlideDownProps) {+ const frame = useCurrentFrame() * speed;++ const words = useMemo(() => text.split(" "), [text]);+ const n = words.length;++ const lineGap = 12;+ const rowHeight = fontSize;+ const firstDur = 11;+ const pushDur = 15;+ const entryScale = 0.992;+ const entryBlur = 2.4;+ const reflowBlur = 0.7;+ const firstWordY = -14;+ const easing = Easing.bezier(0.2, 0.8, 0.2, 1);++ const positionsAt = useMemo(() => {+ const out: number[][] = [];+ for (let k = 1; k <= n; k++) {+ const total = rowHeight * k + lineGap * (k - 1);+ const start = -total / 2 + rowHeight / 2;+ const ys: number[] = [];+ for (let j = 0; j < k; j++) ys.push(start + j * (rowHeight + lineGap));+ out.push(ys);+ }+ return out;+ }, [n, rowHeight]);++ return (+ <div+ style={{+ position: "absolute",+ inset: 0,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ background: "transparent",+ }}+ >+ <div+ className={className}+ style={{+ position: "relative",+ fontSize,+ fontWeight,+ color,+ letterSpacing: "-0.03em",+ fontFamily: FONT_FAMILY,+ whiteSpace: "nowrap",+ }}+ >+ {words.map((word, j) => {+ const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;+ const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);+ const targetY = positionsAt[j][j];+ const yFrom = j === 0 ? firstWordY : targetY - entryOffset;++ let y = targetY;+ let opacity = 1;+ let scale = 1;+ let blur = 0;++ if (frame < entryStart) {+ opacity = 0;+ y = yFrom;+ scale = entryScale;+ blur = entryBlur;+ } else if (frame <= entryEnd) {+ const range: [number, number] = [entryStart, entryEnd];+ const opts = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+ easing,+ };+ y = interpolate(frame, range, [yFrom, targetY], opts);+ opacity = interpolate(frame, range, [0, 1], opts);+ scale = interpolate(frame, range, [entryScale, 1], opts);+ blur = interpolate(frame, range, [entryBlur, 0], opts);+ } else {+ for (let w = j + 1; w < n; w++) {+ const pushStart = firstDur + (w - 1) * pushDur;+ const pushEnd = pushStart + pushDur;+ const fromY = positionsAt[w - 1][j];+ const toY = positionsAt[w][j];+ if (frame >= pushEnd) {+ y = toY;+ } else if (frame >= pushStart) {+ y = interpolate(frame, [pushStart, pushEnd], [fromY, toY], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing,+ });+ blur = interpolate(+ frame,+ [pushStart, (pushStart + pushEnd) / 2, pushEnd],+ [0, reflowBlur, 0],+ { extrapolateLeft: "clamp", extrapolateRight: "clamp" },+ );+ break;+ } else {+ y = fromY;+ break;+ }+ }+ }++ return (+ <span+ key={j}+ style={{+ position: "absolute",+ left: "50%",+ top: "50%",+ whiteSpace: "nowrap",+ backfaceVisibility: "hidden",+ transform: `translate(-50%, -50%) translate3d(0px, ${y}px, 0) scale(${scale})`,+ filter: `blur(${blur}px)`,+ opacity,+ }}+ >+ {word}+ </span>+ );+ })}+ </div>+ </div>+ );+}