Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: refactor docs ui
dev_wandry44c0ba7a7aa9
diff --git a/app/(home)/components/sections/get-started.tsx b/app/(home)/components/sections/get-started.tsxindex c8e3f10e..adddad1c 100644--- a/app/(home)/components/sections/get-started.tsx+++ b/app/(home)/components/sections/get-started.tsx@@ -78,8 +78,8 @@ function StepBadge({ n, accent }: { n: number; accent: string }) {function CompactStep({ step, delay }: { step: Step; delay: number }) {return (- <FadeUp delay={delay}>- <div className="surface-card flex flex-col gap-4 rounded-2xl p-5 sm:p-4">+ <FadeUp delay={delay} className="min-w-0">+ <div className="surface-card flex min-w-0 flex-col gap-4 rounded-2xl p-5 sm:p-4"><div className="flex items-center gap-3"><StepBadge n={step.n} accent={step.accent} /><h3 className="text-base font-semibold tracking-tight text-foreground">@@ -101,8 +101,8 @@ function CompactStep({ step, delay }: { step: Step; delay: number }) {function FeaturedStep({ step, delay }: { step: Step; delay: number }) {return (- <FadeUp delay={delay}>- <div className="surface-card flex flex-col gap-5 rounded-2xl p-6 sm:rounded-3xl sm:p-6">+ <FadeUp delay={delay} className="min-w-0">+ <div className="surface-card flex min-w-0 flex-col gap-5 rounded-2xl p-6 sm:rounded-3xl sm:p-6"><div className="flex items-center gap-3"><StepBadge n={step.n} accent={step.accent} /><h3 className="text-lg font-semibold tracking-tight text-foreground">@@ -161,7 +161,7 @@ export function GetStarted() {/><div className="mt-12 grid items-start gap-4 sm:mt-16 sm:gap-6 md:grid-cols-2">- <div className="flex flex-col gap-4 sm:gap-6.5">+ <div className="flex min-w-0 flex-col gap-4 sm:gap-6.5"><CompactStep step={START} delay={0} /><CompactStep step={INIT} delay={0.08} /><CompactStep step={RENDER} delay={0.16} />diff --git a/app/docs/layout.tsx b/app/docs/layout.tsxindex fa6bc64a..bcd5ad21 100644--- a/app/docs/layout.tsx+++ b/app/docs/layout.tsx@@ -10,7 +10,17 @@ export default function Layout({ children }: { children: ReactNode }) {{...baseOptions()}searchToggle={{ enabled: false }}>- {children}+ {/* `relative isolate` scopes the decorative grid to the content column so+ it sits behind the page body but above the base background — the same+ dotted-grid backdrop used behind the landing hero, for visual+ continuity when crossing from the landing into the docs. */}+ <div className="relative isolate">+ <div+ aria-hidden+ className="pointer-events-none absolute inset-x-0 top-0 -z-10 h-[360px] bg-grid-fade"+ />+ {children}+ </div></DocsLayout>);}diff --git a/components/docs/callout.tsx b/components/docs/callout.tsxindex b2421784..fb8243d0 100644--- a/components/docs/callout.tsx+++ b/components/docs/callout.tsx@@ -1,26 +1,46 @@import { AlertTriangleIcon, InfoIcon } from "lucide-react";import type { ReactNode } from "react";+import { MINT, PEACH } from "@/config/landing";import { cn } from "@/lib/utils";function CalloutBase({icon,title,children,+ accent,className,}: {icon: ReactNode;title?: string;children: ReactNode;+ /** Pastel accent that tints the border + icon (matches the landing palette). */+ accent?: string;className?: string;}) {return (<divclassName={cn(- "not-prose my-6 flex max-w-3xl gap-3 rounded-xl bg-muted px-4 py-3 text-sm",+ "surface-card not-prose my-6 flex max-w-3xl gap-3 rounded-2xl px-4 py-3 text-sm",className,)}+ style={+ accent+ ? {+ borderColor: `color-mix(in oklab, ${accent} 40%, var(--color-border))`,+ }+ : undefined+ }>- <div className="mt-0.5 shrink-0 text-muted-foreground">{icon}</div>+ <div+ className="mt-0.5 shrink-0 text-muted-foreground"+ style={+ accent+ ? { color: `color-mix(in oklab, ${accent} 72%, var(--color-foreground))` }+ : undefined+ }+ >+ {icon}+ </div><div className="flex-1 space-y-1 leading-relaxed">{title && <div className="font-medium text-foreground">{title}</div>}<div className="text-muted-foreground [&>p]:m-0">{children}</div>@@ -37,7 +57,7 @@ export function Note({children: ReactNode;}) {return (- <CalloutBase icon={<InfoIcon className="size-4" />} title={title}>+ <CalloutBase icon={<InfoIcon className="size-4" />} title={title} accent={MINT}>{children}</CalloutBase>);@@ -52,8 +72,9 @@ export function Warning({}) {return (<CalloutBase- icon={<AlertTriangleIcon className="size-4 text-amber-500" />}+ icon={<AlertTriangleIcon className="size-4" />}title={title}+ accent={PEACH}>{children}</CalloutBase>diff --git a/components/docs/component-card-grid.tsx b/components/docs/component-card-grid.tsxindex 1f54d1f6..57beebdf 100644--- a/components/docs/component-card-grid.tsx+++ b/components/docs/component-card-grid.tsx@@ -15,8 +15,10 @@ export function ComponentCardGrid({ items }: { items: CardItem[] }) {const card = (<articleclassName={cn(- "group/card relative flex h-full flex-col gap-2 rounded-xl bg-muted p-5 transition-colors",- item.status === "stable" ? "hover:bg-muted/70" : "opacity-60",+ "surface-card group/card relative flex h-full flex-col gap-2 rounded-2xl p-5 transition-[transform,border-color]",+ item.status === "stable"+ ? "hover:-translate-y-0.5 hover:border-foreground/20"+ : "opacity-60",)}><div className="flex items-center justify-between gap-2">@@ -40,7 +42,7 @@ export function ComponentCardGrid({ items }: { items: CardItem[] }) {<Linkkey={item.name}href={item.href}- className="block rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring/40"+ className="block rounded-2xl outline-none focus-visible:ring-2 focus-visible:ring-ring/40">{card}</Link>diff --git a/components/docs/component-customizer.tsx b/components/docs/component-customizer.tsxindex c0a284e5..0128d778 100644--- a/components/docs/component-customizer.tsx+++ b/components/docs/component-customizer.tsx@@ -1,118 +1,194 @@"use client";-import { Input } from "@/components/ui/input";+import { Select as SelectPrimitive } from "@base-ui/react/select";+import { ChevronDownIcon } from "lucide-react";+import { ElasticSlider } from "@/components/ui/elastic-slider";import { Label } from "@/components/ui/label";-import {- Select,- SelectContent,- SelectItem,- SelectTrigger,- SelectValue,-} from "@/components/ui/select";-import { Slider } from "@/components/ui/slider";+import { SelectContent, SelectItem } from "@/components/ui/select";import { Switch } from "@/components/ui/switch";-import type { ControlConfig } from "@/lib/customizer-config";+import type { ControlConfig, ControlType } from "@/lib/customizer-config";+import { cn } from "@/lib/utils";-export function ComponentCustomizer({- controls,- values,+/** Shared pill surface so every non-slider control matches the elastic slider. */+const PILL =+ "flex h-11 items-center gap-3 rounded-xl bg-muted px-3 text-sm transition-colors";++/** Strip trailing zeros so the value reads like the reference (1, 0.8, 0.1). */+function formatNumber(v: number) {+ return String(v);+}++function SelectPill({+ id,+ ctrl,+ value,onChange,}: {- controls: ControlConfig;- values: Record<string, unknown>;- onChange: (key: string, value: unknown) => void;+ id: string;+ ctrl: Extract<ControlType, { type: "select" }>;+ value: string;+ onChange: (value: string) => void;}) {return (- <div className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">- {Object.entries(controls).map(([key, ctrl]) => {- const id = `ctrl-${key}`;- return (- <div key={key} className="flex flex-col gap-2">- <div className="flex items-center justify-between gap-2">- <Label- htmlFor={id}- className="text-xs font-medium text-fd-muted-foreground"- >- {ctrl.label}- </Label>- {ctrl.type === "number" && (- <span className="font-mono text-xs tabular-nums text-fd-muted-foreground">- {values[key] as number}- </span>- )}- {ctrl.type === "color" && (- <span className="font-mono text-xs uppercase text-fd-muted-foreground">- {values[key] as string}- </span>- )}- </div>+ <SelectPrimitive.Root+ value={value}+ // base-ui types the value as `string | null` (null on deselect); the+ // customizer never deselects, but guard it so a null can't leak out.+ onValueChange={(v) => {+ if (v !== null) onChange(v as string);+ }}+ >+ <SelectPrimitive.Trigger+ id={id}+ className={cn(+ PILL,+ "w-full justify-between outline-none hover:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring/40",+ )}+ >+ <span className="font-medium text-muted-foreground">{ctrl.label}</span>+ <span className="flex items-center gap-1 font-medium text-foreground">+ <SelectPrimitive.Value />+ {/* Raw primitive instead of the SelectTrigger wrapper so the chevron+ sits beside the value inside our custom pill layout. */}+ <SelectPrimitive.Icon+ render={+ <ChevronDownIcon className="size-4 text-muted-foreground" />+ }+ />+ </span>+ </SelectPrimitive.Trigger>+ <SelectContent alignItemWithTrigger={false}>+ {ctrl.options.map((opt) => (+ <SelectItem key={opt} value={opt}>+ {opt}+ </SelectItem>+ ))}+ </SelectContent>+ </SelectPrimitive.Root>+ );+}- {ctrl.type === "text" && (- <Input- id={id}- type="text"- value={values[key] as string}- onChange={(e) => onChange(key, e.target.value)}- />- )}+function Control({+ id,+ ctrl,+ value,+ onChange,+}: {+ id: string;+ ctrl: ControlType;+ value: unknown;+ onChange: (value: unknown) => void;+}) {+ switch (ctrl.type) {+ case "number":+ return (+ <ElasticSlider+ label={ctrl.label}+ value={value as number}+ onValueChange={onChange}+ min={ctrl.min}+ max={ctrl.max}+ step={ctrl.step}+ formatValue={formatNumber}+ className="[--elastic-slider-height:--spacing(11)] [--elastic-slider-radius:0.75rem]"+ />+ );- {ctrl.type === "number" && (- <Slider+ case "select":+ return (+ <SelectPill id={id} ctrl={ctrl} value={value as string} onChange={onChange} />+ );++ case "boolean":+ return (+ <div className={cn(PILL, "justify-between")}>+ <Label+ htmlFor={id}+ className="font-medium text-muted-foreground"+ >+ {ctrl.label}+ </Label>+ <Switch+ id={id}+ checked={value as boolean}+ onCheckedChange={onChange}+ />+ </div>+ );++ case "color":+ return (+ <div className={cn(PILL, "justify-between")}>+ <Label htmlFor={id} className="font-medium text-muted-foreground">+ {ctrl.label}+ </Label>+ {/* The native input fills the swatch box, so it is directly+ clickable — no wrapping <label> (which would double-label it). */}+ <span className="flex items-center gap-2">+ <span className="font-mono text-sm font-medium uppercase text-foreground">+ {value as string}+ </span>+ <span className="relative inline-flex size-5 shrink-0 overflow-hidden rounded-md border border-border/60">+ <inputid={id}- min={ctrl.min}- max={ctrl.max}- step={ctrl.step}- value={values[key] as number}- onValueChange={(v) => onChange(key, v)}+ type="color"+ value={value as string}+ onChange={(e) => onChange(e.target.value)}+ className="absolute top-1/2 left-1/2 size-[200%] -translate-x-1/2 -translate-y-1/2 cursor-pointer border-0 bg-transparent p-0"/>- )}+ </span>+ </span>+ </div>+ );- {ctrl.type === "color" && (- <div className="flex items-center gap-2">- <input- id={id}- type="color"- value={values[key] as string}- onChange={(e) => onChange(key, e.target.value)}- className="size-9 shrink-0 cursor-pointer rounded-md border border-fd-border bg-transparent p-0.5"- />- <Input- type="text"- value={values[key] as string}- onChange={(e) => onChange(key, e.target.value)}- className="font-mono text-xs"- />- </div>- )}+ case "text":+ return (+ <div className={PILL}>+ <Label+ htmlFor={id}+ className="shrink-0 font-medium text-muted-foreground"+ >+ {ctrl.label}+ </Label>+ <input+ id={id}+ type="text"+ value={value as string}+ onChange={(e) => onChange(e.target.value)}+ className="min-w-0 flex-1 bg-transparent text-right font-mono text-sm font-medium text-foreground outline-none placeholder:text-muted-foreground/50"+ />+ </div>+ );- {ctrl.type === "select" && (- <Select- value={values[key] as string}- onValueChange={(v) => onChange(key, v as string)}- >- <SelectTrigger id={id} className="w-full">- <SelectValue />- </SelectTrigger>- <SelectContent>- {ctrl.options.map((opt) => (- <SelectItem key={opt} value={opt}>- {opt}- </SelectItem>- ))}- </SelectContent>- </Select>- )}+ default: {+ // Compile-time exhaustiveness: adding a new ControlType errors here.+ const _exhaustive: never = ctrl;+ void _exhaustive;+ return null;+ }+ }+}- {ctrl.type === "boolean" && (- <Switch- id={id}- checked={values[key] as boolean}- onCheckedChange={(checked) => onChange(key, checked)}- />- )}- </div>- );- })}+export function ComponentCustomizer({+ controls,+ values,+ onChange,+}: {+ controls: ControlConfig;+ values: Record<string, unknown>;+ onChange: (key: string, value: unknown) => void;+}) {+ return (+ <div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">+ {Object.entries(controls).map(([key, ctrl]) => (+ <Control+ key={key}+ id={`ctrl-${key}`}+ ctrl={ctrl}+ value={values[key]}+ onChange={(value) => onChange(key, value)}+ />+ ))}</div>);}diff --git a/components/docs/component-preview.tsx b/components/docs/component-preview.tsxindex a8daaf19..3d48b4d2 100644--- a/components/docs/component-preview.tsx+++ b/components/docs/component-preview.tsx@@ -36,7 +36,7 @@ export function ComponentPreview({ name }: { name: string }) {return (<Suspensefallback={- <div className="not-prose mb-6 aspect-video w-full animate-pulse rounded-xl bg-muted" />+ <div className="not-prose mb-6 aspect-video w-full animate-pulse rounded-2xl bg-muted" />}><Preview name={name} config={entry.config} Component={entry.Component} />@@ -150,7 +150,7 @@ function Preview({</TabsList><TabsContent value="preview" className="mt-0">- <div className="aspect-video w-full overflow-hidden rounded-xl bg-muted">+ <div className="surface-card aspect-video w-full overflow-hidden rounded-2xl"><Playercomponent={Component}inputProps={values}@@ -168,17 +168,15 @@ function Preview({</TabsContent><TabsContent value="code" className="mt-0">- <div className="overflow-hidden rounded-xl bg-muted [&_pre]:!rounded-none [&_pre]:!border-0 [&_pre]:!bg-transparent">+ <div className="surface-card overflow-hiddenrounded-2xl [&_pre]:!rounded-none [&_pre]:!border-0 [&_pre]:!bg-transparent"><DynamicCodeBlock lang="tsx" code={code} /></div></TabsContent></Tabs>- <div className="overflow-hidden rounded-xl bg-muted">- <div className="flex items-center justify-between px-5 pt-4 pb-2">- <span className="text-xs font-medium uppercase tracking-wider text-muted-foreground">- Customize- </span>+ <div className="overflow-hidden rounded-2xl">+ <div className="flex items-center justify-between pt-4 pb-2">+ <h2>Customize</h2><div className="flex items-center gap-1"><buttontype="button"@@ -212,13 +210,11 @@ function Preview({</button></div></div>- <div className="px-5 pb-5">- <ComponentCustomizer- controls={config.controls}- values={values as Record<string, unknown>}- onChange={handleCustomizeChange}- />- </div>+ <ComponentCustomizer+ controls={config.controls}+ values={values as Record<string, unknown>}+ onChange={handleCustomizeChange}+ /></div></div>);diff --git a/components/docs/dependencies.tsx b/components/docs/dependencies.tsxindex 2718392e..7ebf2ec6 100644--- a/components/docs/dependencies.tsx+++ b/components/docs/dependencies.tsx@@ -8,7 +8,7 @@ export function Dependencies({ items }: { items: string[] }) {{items.map((item) => (<codekey={item}- className="rounded-md bg-muted px-2 py-0.5 font-mono text-xs text-foreground"+ className="rounded-lg border border-border bg-muted/40 px-2 py-0.5 font-mono text-xs text-foreground">{item}</code>diff --git a/components/docs/install-block.tsx b/components/docs/install-block.tsxindex ee50fed1..eb34a4b2 100644--- a/components/docs/install-block.tsx+++ b/components/docs/install-block.tsx@@ -7,6 +7,7 @@ export function InstallBlock({ name }: { name: string }) {<div className="my-6"><CodeBlockCommandcomponent={name}+ variant="outline"prompt={`Add the @remocn/${name} component to my project.`}{...convertNpmCommand(npmCommand)}/>diff --git a/components/docs/props-table.tsx b/components/docs/props-table.tsxindex a4f9c711..93952a7d 100644--- a/components/docs/props-table.tsx+++ b/components/docs/props-table.tsx@@ -8,7 +8,7 @@ export interface PropDef {export function PropsTable({ rows }: { rows: PropDef[] }) {return (- <div className="not-prose my-6 max-w-4xl overflow-hidden rounded-xl bg-muted">+ <div className="surface-card not-prose my-6 max-w-4xl overflow-hidden rounded-2xl"><div className="overflow-x-auto"><table className="w-full border-collapse text-sm"><thead>diff --git a/components/ui/elastic-slider.tsx b/components/ui/elastic-slider.tsxnew file mode 100644index 00000000..f0b5f13b--- /dev/null+++ b/components/ui/elastic-slider.tsx@@ -0,0 +1,565 @@+"use client";++import {+ animate,+ motion,+ useMotionValue,+ useReducedMotion,+ useTransform,+} from "motion/react";+import {+ useCallback,+ useEffect,+ useLayoutEffect,+ useRef,+ useState,+} from "react";+import { useControllableState } from "@/lib/use-controllable-state";+import { cn } from "@/lib/utils";++// Drag detection & rubber band+const CLICK_THRESHOLD = 3;+const DEAD_ZONE = 32;+const MAX_CURSOR_RANGE = 200;+const MAX_STRETCH = 8;++// Layout offsets used by the "handle dodges label/value" calculation.+const HANDLE_BUFFER = 8;+const LABEL_OFFSET = 12 + 4;+const VALUE_OFFSET = 12 - 8;++function clamp(v: number, lo: number, hi: number) {+ return Math.max(lo, Math.min(hi, v));+}++function decimalsForStep(step: number): number {+ const s = step.toString();+ const dot = s.indexOf(".");+ return dot === -1 ? 0 : s.length - dot - 1;+}++function roundValue(val: number, step: number): number {+ const raw = Math.round(val / step) * step;+ return parseFloat(raw.toFixed(decimalsForStep(step)));+}++// Magnetic snap to the nearest decile when within 3.125% of it.+function snapToDecile(rawValue: number, min: number, max: number): number {+ const normalized = (rawValue - min) / (max - min);+ const nearest = Math.round(normalized * 10) / 10;+ if (Math.abs(normalized - nearest) <= 0.03125) {+ return min + nearest * (max - min);+ }+ return rawValue;+}++export type ElasticSliderProps = {+ /** Label shown inside the track. */+ label: string;++ /** Controlled value. Use together with `onValueChange` */+ value?: number;+ /** Initial value for uncontrolled mode. Falls back to `min` */+ defaultValue?: number;+ /** Called with the new value on drag, click, or key press. */+ onValueChange?: (value: number) => void;++ /**+ * Minimum value.+ * @defaultValue 0 */+ min?: number;+ /**+ * Maximum value.+ * @defaultValue 1 */+ max?: number;+ /**+ * Smallest increment.+ * @defaultValue 0.01 */+ step?: number;+ /** Format the displayed value. Defaults to `value.toFixed(...)` based on `step` */+ formatValue?: (value: number) => string;++ className?: string;+ /** Accessible name. Falls back to `label` */+ "aria-label"?: string;+};++export function ElasticSlider({+ label,++ value: valueProp,+ defaultValue,+ onValueChange,++ min = 0,+ max = 1,+ step = 0.01,+ formatValue,++ className,+ "aria-label": ariaLabel,+}: ElasticSliderProps) {+ const [value = min, setValue] = useControllableState<number>({+ prop: valueProp,+ defaultProp: defaultValue ?? min,+ onChange: onValueChange,+ });++ const shouldReduceMotion = useReducedMotion();++ const wrapperRef = useRef<HTMLDivElement>(null);+ const trackRef = useRef<HTMLDivElement>(null);+ const labelRef = useRef<HTMLSpanElement>(null);+ const valueRef = useRef<HTMLSpanElement>(null);++ const [isInteracting, setIsInteracting] = useState(false);+ const [isDragging, setIsDragging] = useState(false);+ const [isHovered, setIsHovered] = useState(false);+ /** Ring only for Tab focus or keyboard value nudges, not pointer press/drag. */+ const [keyboardFocusRing, setKeyboardFocusRing] = useState(false);++ // Pointer session state — mutable, does not trigger re-renders.+ const pointerDownPos = useRef<{ x: number; y: number } | null>(null);+ const pendingPointerFocusRef = useRef(false);+ const isClickRef = useRef(true);+ const animRef = useRef<ReturnType<typeof animate> | null>(null);+ const wrapperRectRef = useRef<DOMRect | null>(null);+ const scaleRef = useRef(1);++ const percentage = ((value - min) / (max - min)) * 100;+ const isActive = isInteracting || isHovered;+ const displayValue = formatValue+ ? formatValue(value)+ : value.toFixed(decimalsForStep(step));++ // Fill + handle driven by a single motion value for imperative updates.+ const fillPercent = useMotionValue(percentage);+ const fillWidth = useTransform(fillPercent, (pct) => `${pct}%`);+ const handleLeft = useTransform(+ fillPercent,+ (pct) => `max(4px, calc(${pct}% - 8px))`,+ );++ // Rubber band: widens the track and pulls it left when dragged past bounds.+ const rubberStretch = useMotionValue(0);+ const rubberWidth = useTransform(+ rubberStretch,+ (s) => `calc(100% + ${Math.abs(s)}px)`,+ );+ const rubberX = useTransform(rubberStretch, (s) => (s < 0 ? s : 0));++ // Sync from props when not interacting and no spring is in flight.+ useEffect(() => {+ if (!isInteracting && !animRef.current) {+ fillPercent.jump(percentage);+ }+ }, [percentage, isInteracting, fillPercent]);++ const positionToValue = useCallback(+ (clientX: number) => {+ const rect = wrapperRectRef.current;+ if (!rect) return min;++ const sceneX = (clientX - rect.left) / scaleRef.current;+ const nativeWidth = wrapperRef.current?.offsetWidth ?? rect.width;+ const percent = clamp(sceneX / nativeWidth, 0, 1);++ return clamp(min + percent * (max - min), min, max);+ },+ [min, max],+ );++ const percentFromValue = useCallback(+ (v: number) => ((v - min) / (max - min)) * 100,+ [min, max],+ );++ // Animate fill to a target percent, or jump instantly when the user prefers+ // reduced motion. Position still updates — only the spring is skipped.+ const animateFillTo = useCallback(+ (targetPercent: number) => {+ animRef.current?.stop();++ if (shouldReduceMotion) {+ fillPercent.jump(targetPercent);+ animRef.current = null;+ return;+ }++ animRef.current = animate(fillPercent, targetPercent, {+ type: "spring",+ stiffness: 300,+ damping: 25,+ mass: 0.8,+ onComplete: () => {+ animRef.current = null;+ },+ });+ },+ [fillPercent, shouldReduceMotion],+ );++ const computeRubberStretch = useCallback((clientX: number, sign: number) => {+ const rect = wrapperRectRef.current;+ if (!rect) return 0;++ const distancePast = sign < 0 ? rect.left - clientX : clientX - rect.right;+ const overflow = Math.max(0, distancePast - DEAD_ZONE);++ return (+ sign * MAX_STRETCH * Math.sqrt(Math.min(overflow / MAX_CURSOR_RANGE, 1))+ );+ }, []);++ const handlePointerDown = useCallback((e: React.PointerEvent) => {+ e.preventDefault();+ (e.target as HTMLElement).setPointerCapture(e.pointerId);++ pointerDownPos.current = { x: e.clientX, y: e.clientY };++ isClickRef.current = true;++ setIsInteracting(true);++ pendingPointerFocusRef.current = true;+ setKeyboardFocusRing(false);++ // Pointer interactions should move focus to the slider so subsequent+ // keyboard input is received and focus styles match the active state.+ trackRef.current?.focus({ preventScroll: true });+ requestAnimationFrame(() => {+ pendingPointerFocusRef.current = false;+ });++ // Snapshot the wrapper rect so later math is immune to layout shifts.+ const wrapper = wrapperRef.current;+ if (wrapper) {+ const rect = wrapper.getBoundingClientRect();+ wrapperRectRef.current = rect;+ scaleRef.current = rect.width / wrapper.offsetWidth;+ }+ }, []);++ const handlePointerMove = useCallback(+ (e: React.PointerEvent) => {+ if (!isInteracting || !pointerDownPos.current) return;++ const dx = e.clientX - pointerDownPos.current.x;+ const dy = e.clientY - pointerDownPos.current.y;++ if (isClickRef.current && Math.hypot(dx, dy) > CLICK_THRESHOLD) {+ isClickRef.current = false;+ setIsDragging(true);+ }++ if (isClickRef.current) return;++ const rect = wrapperRectRef.current;+ if (rect && !shouldReduceMotion) {+ if (e.clientX < rect.left) {+ rubberStretch.jump(computeRubberStretch(e.clientX, -1));+ } else if (e.clientX > rect.right) {+ rubberStretch.jump(computeRubberStretch(e.clientX, 1));+ } else {+ rubberStretch.jump(0);+ }+ }++ const newValue = positionToValue(e.clientX);+ animRef.current?.stop();+ animRef.current = null;+ fillPercent.jump(percentFromValue(newValue));+ setValue(roundValue(newValue, step));+ },+ [+ isInteracting,+ positionToValue,+ percentFromValue,+ setValue,+ step,+ fillPercent,+ rubberStretch,+ computeRubberStretch,+ shouldReduceMotion,+ ],+ );++ const handlePointerUp = useCallback(+ (e: React.PointerEvent) => {+ if (!isInteracting) return;++ if (isClickRef.current) {+ // Coarse sliders (≤10 positions) snap to the nearest step;+ // continuous sliders keep the decile-magnetic behavior.+ const rawValue = positionToValue(e.clientX);+ const discreteSteps = (max - min) / step;+ const snapped =+ discreteSteps <= 10+ ? clamp(min + Math.round((rawValue - min) / step) * step, min, max)+ : snapToDecile(rawValue, min, max);++ animateFillTo(percentFromValue(snapped));+ setValue(roundValue(snapped, step));+ }++ if (!shouldReduceMotion && rubberStretch.get() !== 0) {+ animate(rubberStretch, 0, {+ type: "spring",+ visualDuration: 0.35,+ bounce: 0.15,+ });+ }++ setIsInteracting(false);+ setIsDragging(false);+ pointerDownPos.current = null;+ },+ [+ isInteracting,+ positionToValue,+ percentFromValue,+ setValue,+ min,+ max,+ step,+ animateFillTo,+ rubberStretch,+ shouldReduceMotion,+ ],+ );++ const handleKeyDown = useCallback(+ (e: React.KeyboardEvent) => {+ // Shift + Arrow is a Figma-style fast nudge: jumps by 10x the step,+ // independent of the WAI-ARIA Page step (which scales with range).+ const arrowStep = e.shiftKey ? step * 10 : step;++ let next: number | null = null;++ switch (e.key) {+ case "ArrowRight":+ case "ArrowUp":+ next = value + arrowStep;+ break;++ case "ArrowLeft":+ case "ArrowDown":+ next = value - arrowStep;+ break;++ case "Home":+ next = min;+ break;++ case "End":+ next = max;+ break;++ default:+ return;+ }++ e.preventDefault();++ setKeyboardFocusRing(true);++ const snapped = roundValue(clamp(next, min, max), step);+ animateFillTo(percentFromValue(snapped));+ setValue(snapped);+ },+ [value, min, max, step, animateFillTo, percentFromValue, setValue],+ );++ const handleTrackFocus = useCallback(() => {+ if (!pendingPointerFocusRef.current) {+ setKeyboardFocusRing(true);+ }+ }, []);++ const handleTrackBlur = useCallback(() => {+ setKeyboardFocusRing(false);+ }, []);++ // Measure label + value to derive "dodge" thresholds so the handle fades+ // when it would overlap either text.+ const [dodge, setDodge] = useState({ left: 38, right: 72 });++ useLayoutEffect(() => {+ const wrapper = wrapperRef.current;+ if (!wrapper) return;++ const measure = () => {+ const trackWidth = wrapper.offsetWidth;+ if (trackWidth <= 0) return;++ const labelEl = labelRef.current;+ const valueEl = valueRef.current;++ const left = labelEl+ ? ((LABEL_OFFSET + labelEl.offsetWidth + HANDLE_BUFFER) / trackWidth) *+ 100+ : 38;++ const right = valueEl+ ? ((trackWidth - VALUE_OFFSET - valueEl.offsetWidth - HANDLE_BUFFER) /+ trackWidth) *+ 100+ : 72;++ setDodge((prev) => {+ return prev.left === left && prev.right === right+ ? prev+ : { left, right };+ });+ };++ measure();++ const observer = new ResizeObserver(measure);+ observer.observe(wrapper);++ if (labelRef.current) observer.observe(labelRef.current);+ if (valueRef.current) observer.observe(valueRef.current);++ return () => observer.disconnect();+ }, []);++ const valueDodge = percentage < dodge.left || percentage > dodge.right;+ const handleOpacity = !isActive+ ? 0+ : valueDodge+ ? 0.1+ : isDragging+ ? 0.8+ : 0.5;++ const discreteSteps = (max - min) / step;+ const hashMarkCount = discreteSteps <= 10 ? discreteSteps - 1 : 9;++ const hashMarkPct = (i: number) => {+ return discreteSteps <= 10+ ? (((i + 1) * step) / (max - min)) * 100+ : (i + 1) * 10;+ };++ return (+ <div+ ref={wrapperRef}+ data-slot="elastic-slider"+ className={cn(+ "[--elastic-slider-height:--spacing(9)] [--elastic-slider-radius:var(--radius-lg)]",+ "[--elastic-slider-bg:var(--muted)]",+ "[--elastic-slider-fill:var(--muted-foreground)]/10",+ "[--elastic-slider-fill-active:var(--muted-foreground)]/20",+ "[--elastic-slider-hash:var(--muted-foreground)]/30",+ "[--elastic-slider-handle:var(--foreground)]",+ "[--elastic-slider-label:var(--muted-foreground)]",+ "[--elastic-slider-focus:var(--foreground)]",+ "relative h-(--elastic-slider-height)",+ className,+ )}+ >+ <motion.div+ ref={trackRef}+ role="slider"+ tabIndex={0}+ data-slot="elastic-slider-track"+ data-active={isActive}+ data-focus-visible={keyboardFocusRing}+ aria-label={ariaLabel ?? label}+ aria-orientation="horizontal"+ aria-valuemin={min}+ aria-valuemax={max}+ aria-valuenow={value}+ aria-valuetext={displayValue}+ className={cn(+ "group/elastic-slider absolute inset-0 cursor-pointer touch-none overflow-hidden rounded-(--elastic-slider-radius) bg-(--elastic-slider-bg) outline-none select-none",+ "data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-ring/50 data-[focus-visible=true]:ring-offset-1 data-[focus-visible=true]:ring-offset-background",+ )}+ style={{ width: rubberWidth, x: rubberX }}+ onPointerDown={handlePointerDown}+ onPointerMove={handlePointerMove}+ onPointerUp={handlePointerUp}+ onFocus={handleTrackFocus}+ onBlur={handleTrackBlur}+ onKeyDown={handleKeyDown}+ onMouseEnter={() => setIsHovered(true)}+ onMouseLeave={() => setIsHovered(false)}+ >+ <div+ data-slot="elastic-slider-hash-marks"+ aria-hidden="true"+ className="pointer-events-none absolute inset-0"+ >+ {Array.from({ length: hashMarkCount }, (_, i) => (+ <div+ // biome-ignore lint/suspicious/noArrayIndexKey: hash marks are positional and static+ key={i}+ className={cn(+ "absolute top-1/2 h-2 w-px -translate-x-1/2 -translate-y-1/2 rounded-full transition-colors duration-200",+ "bg-transparent group-data-[active=true]/elastic-slider:bg-(--elastic-slider-hash)",+ )}+ style={{ left: `${hashMarkPct(i)}%` }}+ />+ ))}+ </div>++ <motion.div+ data-slot="elastic-slider-fill"+ aria-hidden="true"+ className={cn(+ "pointer-events-none absolute inset-y-0 left-0 transition-colors",+ "bg-(--elastic-slider-fill) group-data-[active=true]/elastic-slider:bg-(--elastic-slider-fill-active)",+ )}+ style={{ width: fillWidth }}+ />++ <motion.div+ data-slot="elastic-slider-handle"+ aria-hidden="true"+ className="pointer-events-none absolute top-1/2 h-5 w-1 rounded-full bg-(--elastic-slider-handle)"+ style={{ left: handleLeft, y: "-50%" }}+ animate={{+ opacity: handleOpacity,+ scaleX: isActive ? 1 : 0.25,+ scaleY: isActive && valueDodge ? 0.75 : 1,+ }}+ transition={+ shouldReduceMotion+ ? { duration: 0 }+ : {+ scaleX: {+ type: "spring",+ visualDuration: 0.25,+ bounce: 0.15,+ },+ scaleY: { type: "spring", visualDuration: 0.2, bounce: 0.1 },+ opacity: { duration: 0.15 },+ }+ }+ />++ <span+ ref={labelRef}+ data-slot="elastic-slider-label"+ aria-hidden="true"+ className="pointer-events-none absolute top-1/2 left-3 inline-flex -translate-y-1/2 items-center text-sm/none font-medium text-(--elastic-slider-label) transition-colors"+ >+ {label}+ </span>++ <span+ ref={valueRef}+ data-slot="elastic-slider-value"+ aria-hidden="true"+ className={cn(+ "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 font-mono text-sm/none font-medium transition-colors",+ "text-(--elastic-slider-label) group-data-[active=true]/elastic-slider:text-(--elastic-slider-focus)",+ )}+ >+ {displayValue}+ </span>+ </motion.div>+ </div>+ );+}diff --git a/content/docs/compositions/ai-generation-canvas.mdx b/content/docs/compositions/ai-generation-canvas.mdxindex 97cc1c9f..94600f37 100644--- a/content/docs/compositions/ai-generation-canvas.mdx+++ b/content/docs/compositions/ai-generation-canvas.mdx@@ -5,9 +5,6 @@ description: A prompt input morphs into a dashboard header, then skeletons flip<ComponentPreview name="ai-generation-canvas" />-A four-phase composition that tells the story of AI generation in one shot. The prompt types into a centered input, the input springs upward and stretches into a header bar, brand-tinted skeleton cards fade in beneath it, then each card flips on its Y axis to reveal the rendered dashboard content with a staggered cascade.--## Installation<InstallBlock name="ai-generation-canvas" />@@ -68,9 +65,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Skeletons should not feel like loading spinners">- The shimmer is intentionally tinted with the accent color at low alpha rather than the usual neutral gray. That single detail reframes the wait as anticipation — it reads as the model thinking, not as the network stalling.-</Note>diff --git a/content/docs/compositions/browser-flow.mdx b/content/docs/compositions/browser-flow.mdxindex 21980d77..a95bfff6 100644--- a/content/docs/compositions/browser-flow.mdx+++ b/content/docs/compositions/browser-flow.mdx@@ -5,9 +5,6 @@ description: A full Safari/Chrome simulation from URL typing to scroll and click<ComponentPreview name="browser-flow" />-A complete browser interaction in one block. The address bar takes focus, the URL types itself in (with an autocomplete suggestion that follows along), the loading bar stalls at 15% before snapping to 100%, the page renders, and a virtual cursor arcs down toward a CTA — clicking it with a real scale dip and a synchronous press on the button. Every phase is frame-deterministic.--## Installation<InstallBlock name="browser-flow" />@@ -58,9 +55,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="The 15% stall is what sells it">- Real browsers fake progress. The loading bar jumps to 15% on Enter, holds there for half a second of suspense, then races to 100%. Removing that pause makes the whole flow feel synthetic — keep it.-</Note>diff --git a/content/docs/compositions/changelog-bite.mdx b/content/docs/compositions/changelog-bite.mdxindex f445dbab..8511b590 100644--- a/content/docs/compositions/changelog-bite.mdx+++ b/content/docs/compositions/changelog-bite.mdx@@ -5,10 +5,6 @@ description: Seamlessly looping square card showing a before/after diff with a f<ComponentPreview name="changelog-bite" />-A square (1080×1080) micro-loop built for changelog posts and social. A centered squircle card holds a before/after diff that's revealed by a frosted glass shutter sweeping left-to-right, with a pulsing "New" pill anchored top-right. The loop is gapless: the first 10 frames and the last 15 frames mirror each other (scale `0.95 → 1.0`, opacity `0 → 1`) so you can export straight to GIF/MP4 without a visible seam.--Pass any React node into `oldContent` and `newContent` to drop in your own before/after — the defaults render a simple code diff so the composition works out of the box.-## Installation<InstallBlock name="changelog-bite" />@@ -56,13 +52,3 @@ export const RemotionRoot = () => ({ name: "className", type: "string", description: "Optional className for the outer container." },]}/>--## Notes--<Note title="The loop is already seamless">- The first 10 frames and the last 15 frames intentionally mirror each other so a flat loop never shows a seam. Don't add a separate fade-in / fade-out on top of the composition — you'll double up the envelope.-</Note>--<Note title="Portrait format">- Setting `format="portrait"` only changes the inner card aspect. Your `<Composition>` still needs to declare `compositionWidth: 1080`, `compositionHeight: 1350` to match.-</Note>diff --git a/content/docs/compositions/dashboard-populate.mdx b/content/docs/compositions/dashboard-populate.mdxindex 2e149626..5979343e 100644--- a/content/docs/compositions/dashboard-populate.mdx+++ b/content/docs/compositions/dashboard-populate.mdx@@ -5,9 +5,6 @@ description: An empty dashboard fills itself with data in a cascaded spring sequ<ComponentPreview name="dashboard-populate" />-A composition primitive that stages a full dashboard reveal in two acts. First the structure fades in — tiles, axes, gridlines, legends. Then, with a deliberate beat of silence, the data crashes in: KPIs spin up from zero, bars launch from the baseline on staggered springs, the line chart traces itself left to right, and the donut sweeps to its final value.--## Installation<InstallBlock name="dashboard-populate" />@@ -64,9 +61,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Structure first, then data">- The first 15 frames are reserved for the empty scaffolding — gridlines, axes, tile chrome — so the eye has something to anchor to before the springs hit. Without this beat the populate cascade reads as chaotic; with it, the dashboard feels like it's coming alive in a deliberate, choreographed way.-</Note>diff --git a/content/docs/compositions/ecosystem-constellation.mdx b/content/docs/compositions/ecosystem-constellation.mdxindex f8c0a3fe..325a72b4 100644--- a/content/docs/compositions/ecosystem-constellation.mdx+++ b/content/docs/compositions/ecosystem-constellation.mdx@@ -5,9 +5,6 @@ description: A central product logo orbited by integration satellites with pulsi<ComponentPreview name="ecosystem-constellation" />-A composition for telling an "everything connects" story. A pulsing logo sits in the center while integration satellites fly in from beyond the frame and settle into elliptical orbits at different radii and angular speeds. Connection lines between the hub and each satellite periodically light up — and the firing satellite scales up by a hair to feel like real data is moving.--## Installation<InstallBlock name="ecosystem-constellation" />@@ -68,9 +65,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Orbits are elliptical, not circular">- Each satellite uses a slightly different `radiusX` and `radiusY` plus its own angular speed, so the constellation never falls into a robotic, perfectly-symmetric pattern. Data pulses cycle through satellites deterministically using `Math.floor(frame / 30) % count`, which keeps the animation render-stable while still feeling alive.-</Note>diff --git a/content/docs/compositions/hero-device-assemble.mdx b/content/docs/compositions/hero-device-assemble.mdxindex 4dbbdd4e..60b5ed89 100644--- a/content/docs/compositions/hero-device-assemble.mdx+++ b/content/docs/compositions/hero-device-assemble.mdx@@ -5,9 +5,6 @@ description: Layered device mockup that snaps together in 3D before the screen w<ComponentPreview name="hero-device-assemble" />-A cinematic hero composition: a laptop (or phone) materializes from floating layers — back lid, chassis, bezel, and display — drifting in from different Z depths and tilted in 3D space. A single spring collapses everything into place, then the screen fades from black to a mock dashboard with a soft shimmer, mimicking a real display waking up.--## Installation<InstallBlock name="hero-device-assemble" />@@ -68,9 +65,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="The screen stays dark until the layers settle">- The display panel is rendered as a black layer until the assembly spring resolves, then the mock UI fades in with a diagonal shimmer sweep. That delayed wake-up is what sells the illusion of a physical device powering on rather than a flat image flying into place.-</Note>diff --git a/content/docs/compositions/infinite-bento-pan.mdx b/content/docs/compositions/infinite-bento-pan.mdxindex 3312e7c4..44868f0f 100644--- a/content/docs/compositions/infinite-bento-pan.mdx+++ b/content/docs/compositions/infinite-bento-pan.mdx@@ -5,9 +5,6 @@ description: A hypnotic diagonal camera glide over an oversized grid of bento ca<ComponentPreview name="infinite-bento-pan" />-A composition that builds a super-sized bento grid (well beyond the canvas) and slowly drifts the camera across it on a diagonal trajectory. Each card renders a different miniature — line charts, counters, code fragments, gradients, logo marks — with subtle deterministic micro-animations driven by `Math.sin(frame)`. A radial vignette swallows the edges so cards seem to fade in and out of darkness as the camera moves.--## Installation<InstallBlock name="infinite-bento-pan" />@@ -64,9 +61,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Vignette is the trick">- The grid itself is an absurdly large absolutely-positioned super-container that you `translate(-X, -Y)` linearly. The illusion of "infinite" depth comes entirely from the radial vignette painted on top — without it, the edges of the card wall would be visible and the spell would break.-</Note>diff --git a/content/docs/compositions/live-code-compilation.mdx b/content/docs/compositions/live-code-compilation.mdxindex 67e76c94..5c9699ed 100644--- a/content/docs/compositions/live-code-compilation.mdx+++ b/content/docs/compositions/live-code-compilation.mdx@@ -5,9 +5,6 @@ description: A split-screen where code is typed on the left and the right-side U<ComponentPreview name="live-code-compilation" />-A timeline-driven composition that pairs a glass code editor with a live preview pane. As each event fires, a new code fragment is appended to the editor and the preview button instantly applies the matching style — no CSS transitions, no easing — mimicking the feel of a real Vite HMR update.--## Installation<InstallBlock name="live-code-compilation" />@@ -52,9 +49,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="No transitions on the preview">- The preview button intentionally sets `transition: none`. Each style change snaps in on a single frame so the right pane reads as a real hot module reload — instant, mechanical, and synchronized to the code being typed on the left.-</Note>diff --git a/content/docs/compositions/pipeline-journey.mdx b/content/docs/compositions/pipeline-journey.mdxindex 8df2f86f..e080e2e0 100644--- a/content/docs/compositions/pipeline-journey.mdx+++ b/content/docs/compositions/pipeline-journey.mdx@@ -5,9 +5,6 @@ description: A Kanban ticket flies between columns, triggering events along the<ComponentPreview name="pipeline-journey" />-A workflow primitive that animates a single ticket on a Kanban board. The card lifts out of Todo, arcs through the air with a tilt and growing shadow, lands in In Progress where a brief timer ticks, then takes off again toward Done — where it triggers a deterministic confetti burst on touchdown.--## Installation<InstallBlock name="pipeline-journey" />@@ -64,9 +61,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Determinism beats Math.random">- The confetti burst looks chaotic but is fully deterministic — particle angles, distances, and colors are derived from `Math.sin(i * 12.9898) * 43758.5453` style hashing so every render produces an identical frame. Never reach for `Math.random` inside a Remotion component.-</Note>diff --git a/content/docs/compositions/pricing-tier-focus.mdx b/content/docs/compositions/pricing-tier-focus.mdxindex 7f70c500..8ab78892 100644--- a/content/docs/compositions/pricing-tier-focus.mdx+++ b/content/docs/compositions/pricing-tier-focus.mdx@@ -5,9 +5,6 @@ description: Highlight the recommended pricing tier by dimming and blurring its<ComponentPreview name="pricing-tier-focus" />-A composition that stages a classic three-tier pricing table and then dramatically focuses the camera on the recommended plan. The focused card scales up, lifts off the page with a heavy drop shadow, while the side cards retreat into a soft, brightness-dimmed blur. A subtle shimmer sweeps across the CTA button to seal the moment.--## Installation<InstallBlock name="pricing-tier-focus" />@@ -64,9 +61,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Shimmer is the closer">- The focus animation lands the visual hierarchy, but the shimmer sweep on the Pro CTA button is what makes the moment feel cinematic. It runs once around frame 90 — late enough that the eye has already settled on the focused card, so the highlight reads as confirmation rather than distraction.-</Note>diff --git a/content/docs/compositions/product-launch-trailer.mdx b/content/docs/compositions/product-launch-trailer.mdxindex e266e4bc..1ce5d9c3 100644--- a/content/docs/compositions/product-launch-trailer.mdx+++ b/content/docs/compositions/product-launch-trailer.mdx@@ -5,10 +5,6 @@ description: Cinematic Product Hunt teaser with logo pulse, zoom-through, 3D ben<ComponentPreview name="product-launch-trailer" />-A drop-in launch video for Product Hunt, Twitter, or your homepage hero. The composition opens on a pulsing logo, punches through it with a zoom transition, assembles a faux app shell (glass code block on the left, bento grid on the right) inside a 3D camera fly-over, and lands on a "v1.0 is live" headline with a soft confetti burst.--Built around four pastel tokens — peach, lavender, mint, and the `#141318` obsidian background — so it sits naturally next to the rest of the remocn registry. Every camera move uses the soft `cubic-bezier(0.16, 1, 0.3, 1)` easing for the "tactile" feel.-## Installation<InstallBlock name="product-launch-trailer" />@@ -55,13 +51,3 @@ export const RemotionRoot = () => ({ name: "className", type: "string", description: "Optional className for the outer container." },]}/>--## Notes--<Note title="Audio hooks are stubbed">- The composition leaves a `// TODO(audio)` marker at frames 38 and 200 — those are the natural anchors for a `TransitionWhoosh` and a `SuccessChime` once the audio module ships. The visual track works on its own with no audio.-</Note>--<Note title="3D camera">- The fly-over uses a `perspective: 2000px` parent and a `transformStyle: preserve-3d` child. If you nest this composition inside another transformed container, the 3D may flatten — render it at the top level for best results.-</Note>diff --git a/content/docs/compositions/terminal-to-browser-deploy.mdx b/content/docs/compositions/terminal-to-browser-deploy.mdxindex d393f970..dbc0763a 100644--- a/content/docs/compositions/terminal-to-browser-deploy.mdx+++ b/content/docs/compositions/terminal-to-browser-deploy.mdx@@ -5,9 +5,6 @@ description: A CLI deploy completes and the live site grows out of the URL print<ComponentPreview name="terminal-to-browser-deploy" />-A composition that pairs a build log with a celebratory reveal. The terminal types out a deploy sequence, and the moment the success line lands, the terminal scales down and blurs while a fully formed browser window springs out from exactly the URL that was just printed — making the deployed site feel like it physically emerged from the command that shipped it.--## Installation<InstallBlock name="terminal-to-browser-deploy" />@@ -67,9 +64,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="The browser grows from the URL, not the screen center">- The browser window's `transform-origin` is computed from the pixel position of the URL line inside the terminal body. As `scale` springs from 0 to 1, the window literally unfurls out of the success line — sell the gag by keeping the terminal visible (just blurred and dimmed) behind it.-</Note>diff --git a/content/docs/compositions/visual-docs-snippet.mdx b/content/docs/compositions/visual-docs-snippet.mdxindex 5dcbc703..549be19c 100644--- a/content/docs/compositions/visual-docs-snippet.mdx+++ b/content/docs/compositions/visual-docs-snippet.mdx@@ -5,10 +5,6 @@ description: Calm tutorial flow — virtual cursor arcs to a button, clicks, and<ComponentPreview name="visual-docs-snippet" />-A medium-paced explainer for "docs that move." A virtual cursor traces a soft bezier arc to a CTA button inside a faux browser, clicks with a micro-bounce, then a peach bounding box draws itself around the changed element while a side tooltip stagger-fades in to explain the action. The cursor exits to the bottom-right after the click so it never blocks the new content.--The background is a flat `#141318` — no particles, no gradients — to keep the focus on the action being taught.-## Installation<InstallBlock name="visual-docs-snippet" />@@ -56,13 +52,3 @@ export const RemotionRoot = () => ({ name: "className", type: "string", description: "Optional className for the outer container." },]}/>--## Notes--<Note title="Retiming">- All five timing anchors (`cursorEndFrame`, `clickFrame`, `boundingBoxFrame`, `tooltipFrame`, `settleFrame`) are derived from the single `clickFrame` prop. Bumping `clickFrame` shifts the whole flow without breaking sync.-</Note>--<Note title="Cursor coordinates are absolute">- `cursorStart` and `cursorTarget` are in the 1280×720 frame's coordinate space, not relative to the browser window. If you re-aim the cursor, also re-aim `cursorTarget` so it lands on the centered CTA — or fork the file and edit the `BUTTON` constants directly.-</Note>diff --git a/content/docs/environment/dynamic-grid.mdx b/content/docs/environment/dynamic-grid.mdxindex 266ab83b..5c43d1e0 100644--- a/content/docs/environment/dynamic-grid.mdx+++ b/content/docs/environment/dynamic-grid.mdx@@ -5,9 +5,6 @@ description: Subtle moving grid background for tech and dev scenes.<ComponentPreview name="dynamic-grid" />-A minimal grid background built from two CSS linear gradients, translated each frame via `transform`. Cheaper than animating `background-position` because the browser keeps layout untouched.--## Installation<InstallBlock name="dynamic-grid" />@@ -82,9 +79,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Seamless loop">- Offset uses modulo `cellSize`, so the grid loops perfectly — ideal as a base layer under intros and outros.-</Note>diff --git a/content/docs/environment/mesh-gradient-bg.mdx b/content/docs/environment/mesh-gradient-bg.mdxindex 0de4d78c..ffde3232 100644--- a/content/docs/environment/mesh-gradient-bg.mdx+++ b/content/docs/environment/mesh-gradient-bg.mdx@@ -5,9 +5,6 @@ description: Living gradient with amorphous color blobs slowly drifting across t<ComponentPreview name="mesh-gradient-bg" />-A background primitive that renders several large radial-gradient blobs and animates them via `transform: translate()` using `Math.sin(frame)` and `Math.cos(frame)` for organic, deterministic drift. Heavy CSS blur plus `mix-blend-mode` creates a soft mesh gradient without shaders.--## Installation<InstallBlock name="mesh-gradient-bg" />@@ -74,13 +71,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic motion">- Motion uses `Math.sin(frame)` and `Math.cos(frame)`, so every render produces the same output for the same frame — safe for server-side rendering.-</Note>--<Warning title="Blur performance">- Large blur radii on big elements are expensive. If you see slow renders, reduce `blur` or the blob size before reaching for shaders.-</Warning>diff --git a/content/docs/environment/spotlight-card.mdx b/content/docs/environment/spotlight-card.mdxindex 1a44ce6c..1de9a855 100644--- a/content/docs/environment/spotlight-card.mdx+++ b/content/docs/environment/spotlight-card.mdx@@ -5,9 +5,6 @@ description: A card with a moonlight-cool radial spotlight that follows a synthe<ComponentPreview name="spotlight-card" />-A bento-style card primitive in the dark. A virtual cursor traces a slow Lissajous figure-8 across the card surface; under it, a wide radial gradient softly lights the inside while a brighter, narrower gradient bleeds through a 1px wrapper to pick out the microborder. The cursor lags by exactly one frame so the highlight feels organic instead of robotic.--## Installation<InstallBlock name="spotlight-card" />@@ -117,9 +114,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Keep the light cold">- Use white or near-white glow at very low opacity (0.05–0.1). Brand-colored glow tends to read as cheap when amplified by the radial gradient.-</Note>diff --git a/content/docs/primitives/bounding-box-selector.mdx b/content/docs/primitives/bounding-box-selector.mdxindex 571298aa..9889f4fd 100644--- a/content/docs/primitives/bounding-box-selector.mdx+++ b/content/docs/primitives/bounding-box-selector.mdx@@ -5,9 +5,6 @@ description: Figma-style selection rectangle appears around any element.<ComponentPreview name="bounding-box-selector" />-A composition that wraps its children in a relatively positioned container and overlays an absolutely positioned selection border with eight corner and edge handles. The border fades in and slightly scales up via `spring()` at the configured frame.--## Installation<InstallBlock name="bounding-box-selector" />@@ -81,9 +78,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Sizing">- This component reads its size from the wrapped child via `display: inline-block`. If you need pixel-perfect placement around dynamic content, pass children with explicit `width`/`height` instead of relying on intrinsic sizing.-</Note>diff --git a/content/docs/primitives/brush-stroke-simulator.mdx b/content/docs/primitives/brush-stroke-simulator.mdxindex 27171048..4fb2132f 100644--- a/content/docs/primitives/brush-stroke-simulator.mdx+++ b/content/docs/primitives/brush-stroke-simulator.mdx@@ -5,8 +5,6 @@ description: A simulated fingertip drags a blur brush across an image, revealing<ComponentPreview name="brush-stroke-simulator" />-A semi-transparent fingertip glides across the frame along a chain of cubic-bezier waypoints, leaving a pixelated overlay in its wake. The reveal is driven by an SVG `<mask>` whose stroked `<path>` is rebuilt every frame from the cursor's accumulated trail — that's why the brush stroke feels continuous instead of stamping discrete dots. The cursor scales down slightly while it is "pressed" against the surface and springs back when it lifts between regions.-## Installation<InstallBlock name="brush-stroke-simulator" />@@ -102,13 +100,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Mask, not clip-path">- SVG `<clipPath>` ignores `stroke-width`, so a stroked path can't be used as a clip. The reveal is built with an SVG `<mask>` instead — white background, black stroked trail — applied to the pixelated overlay rectangle. The black stroke punches a hole through which the sharp base layer shows.-</Note>--<Warning title="Trail length grows with progress">- The mask path is rebuilt from the cursor's accumulated samples every frame. At default settings that's roughly 110 sample points by the end of the sweep — fast enough, but if you crank `sweepDuration` past 240 frames you'll want to reduce the per-segment sample count inside `sampleBrushPath`.-</Warning>diff --git a/content/docs/primitives/cursor-flow.mdx b/content/docs/primitives/cursor-flow.mdxindex ed73b75d..a0af2d36 100644--- a/content/docs/primitives/cursor-flow.mdx+++ b/content/docs/primitives/cursor-flow.mdx@@ -5,9 +5,6 @@ description: A realistic mouse that arcs along cubic Bezier paths, pauses, and c<ComponentPreview name="cursor-flow" />-A more sophisticated cousin of `SimulatedCursor`. Instead of moving on straight lines between waypoints, the cursor follows per-segment cubic Bezier curves whose control points are offset perpendicular to the chord, so the trajectory always has a "belly". An ease-in-out function shapes velocity inside each segment so the cursor accelerates, glides, and decelerates before arrival. At click moments, an independent spring drives a hard 4-frame `1 → 0.85 → 1` press while the click target dips to `0.98` in sync — that's the moment that sells the impact.--## Installation<InstallBlock name="cursor-flow" />@@ -95,16 +92,6 @@ export const RemotionRoot = () => (]}/>-## Notes--<Note title="The arc is the point">- Per-segment perpendicular control points alternate sign every other segment so the path snakes naturally. If you flatten the offset to 0 you get robotic straight lines — keep it.-</Note>--<Warning title="No d3-shape">- Curves are computed inline with a small `cubicBezier` evaluator to avoid pulling in `d3-shape` (~30KB) just for path math.-</Warning>-## Variant: Simulated CursorA simpler primitive that renders a macOS-style cursor (inline SVG, no external assets) and moves it between a list of points on straight lines. Each waypoint can hold for a configurable number of frames and optionally trigger a click animation: a brief scale dip plus an expanding SVG ripple. Use this when you don't need the realistic Bezier-arc trajectory of `CursorFlow`.diff --git a/content/docs/primitives/pulsing-indicator.mdx b/content/docs/primitives/pulsing-indicator.mdxindex b5542960..5dc9c52c 100644--- a/content/docs/primitives/pulsing-indicator.mdx+++ b/content/docs/primitives/pulsing-indicator.mdx@@ -5,9 +5,6 @@ description: Continuous pulsing dot for loading and "live" states.<ComponentPreview name="pulsing-indicator" />-A tiny UI primitive for signalling activity. An inner dot breathes via `Math.sin(frame)` mapped to `scale` and `opacity`, while an outer ring "pings" outward on a separate phase.--## Installation<InstallBlock name="pulsing-indicator" />@@ -70,9 +67,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic pulse">- Animation is driven by `Math.sin(frame / speed)` — no `setInterval`, no randomness, fully frame-accurate on every render.-</Note>diff --git a/content/docs/primitives/spring-pop-in.mdx b/content/docs/primitives/spring-pop-in.mdxindex b1ed13a2..02a97ed5 100644--- a/content/docs/primitives/spring-pop-in.mdx+++ b/content/docs/primitives/spring-pop-in.mdx@@ -5,9 +5,6 @@ description: Elastic scale-in wrapper for any element.<ComponentPreview name="spring-pop-in" />-A UI primitive that wraps its children in a spring-driven `transform: scale()`. Based directly on Remotion's `spring()` so timing and overshoot stay framerate-independent.--## Installation<InstallBlock name="spring-pop-in" />@@ -80,9 +77,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Transform origin">- The scale is applied with `transform-origin: center`. Override it via `className` if you need corner-anchored growth.-</Note>diff --git a/content/docs/primitives/success-confetti.mdx b/content/docs/primitives/success-confetti.mdxindex afd3a927..11185d8e 100644--- a/content/docs/primitives/success-confetti.mdx+++ b/content/docs/primitives/success-confetti.mdx@@ -5,9 +5,6 @@ description: Deterministic confetti burst from a focal point with optional headl<ComponentPreview name="success-confetti" />-A workflow finale: a burst of SVG confetti particles fanning out from a configurable origin under gravity. Particle directions, colors, sizes, and rotations are derived from Remotion's seeded `random()`, so renders are perfectly deterministic.--## Installation<InstallBlock name="success-confetti" />@@ -110,13 +107,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic randomness">- Particle properties are derived from `random("seed:i:property")` so the same seed always yields the same burst — critical for chunked video renders.-</Note>--<Warning title="Avoid Math.random">- Never replace `random()` with `Math.random()` here. It would produce different results on every frame and tear the burst across rendered chunks.-</Warning>diff --git a/content/docs/primitives/toast-notification.mdx b/content/docs/primitives/toast-notification.mdxindex a4d370a6..aa4cc106 100644--- a/content/docs/primitives/toast-notification.mdx+++ b/content/docs/primitives/toast-notification.mdx@@ -5,9 +5,6 @@ description: System-style toast that pops in, holds, then slides out.<ComponentPreview name="toast-notification" />-A micro-interaction primitive that drives a toast through three phases — `spring()`-based enter (translateY + opacity), a hold, and an `interpolate`-based exit. Position is anchored to the bottom-right of the frame and the variant controls the icon and accent.--## Installation<InstallBlock name="toast-notification" />@@ -92,13 +89,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Phase timing is derived from durationInFrames">- The toast reserves 15 frames for enter and 15 frames for exit, with the rest of the composition serving as the hold phase. Increase `durationInFrames` if you want the toast to linger longer.-</Note>--<Warning title="Anchored absolutely">- The toast is positioned with `position: absolute` at `right: 32, bottom: 32`. Make sure the parent composition fills the frame so it lands where you expect.-</Warning>diff --git a/content/docs/transitions/chromatic-aberration-wipe.mdx b/content/docs/transitions/chromatic-aberration-wipe.mdxindex 79bec9cc..3cd4b5e0 100644--- a/content/docs/transitions/chromatic-aberration-wipe.mdx+++ b/content/docs/transitions/chromatic-aberration-wipe.mdx@@ -5,9 +5,6 @@ description: An ultra-fast slide transition with an RGB glitch on the peak frame<ComponentPreview name="chromatic-aberration-wipe" />-A high-energy transition built for DevTools demos and product reels. Two scenes slide past each other in just 5–8 frames, and on the middle of that window the entire container gets a red+cyan `drop-shadow` filter to fake RGB channel separation. The glitch is intentionally short — restraint is the whole point. Three to five frames is enough for the viewer's eye to register speed without ever consciously parsing the colors.--## Installation<InstallBlock name="chromatic-aberration-wipe" />diff --git a/content/docs/transitions/device-mockup-zoom.mdx b/content/docs/transitions/device-mockup-zoom.mdxindex f8f19525..b5389a45 100644--- a/content/docs/transitions/device-mockup-zoom.mdx+++ b/content/docs/transitions/device-mockup-zoom.mdx@@ -5,9 +5,6 @@ description: Pull back from a UI to reveal it inside a device frame.<ComponentPreview name="device-mockup-zoom" />-A transition that starts zoomed into a UI screen and animates `transform: scale()` from 2 down to 1, revealing an inline SVG laptop or phone frame around it. No external assets — the device chrome is rendered with plain divs.--## Installation<InstallBlock name="device-mockup-zoom" />@@ -75,9 +72,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Replace with real mockups">- The inline SVG/div frame is intentional so the component has zero asset dependencies. If you want a photoreal mockup, swap the frame for an image loaded via `staticFile()` and place your UI underneath it.-</Note>diff --git a/content/docs/transitions/directional-wipe.mdx b/content/docs/transitions/directional-wipe.mdxindex b88347c3..8b163916 100644--- a/content/docs/transitions/directional-wipe.mdx+++ b/content/docs/transitions/directional-wipe.mdx@@ -5,9 +5,6 @@ description: Slide one scene in while pushing the other out.<ComponentPreview name="directional-wipe" />-A transition primitive that animates two scenes with `transform: translateX/Y`. The outgoing scene slides off in one direction while the incoming scene slides in from the opposite side. Uses `transform` (not `left`/`top`) so the browser doesn't trigger a layout reflow per frame.--## Installation<InstallBlock name="directional-wipe" />@@ -75,13 +72,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Pair with Sequence">- For multi-scene videos, wrap each scene in `<Sequence>` and overlap their durations so the wipe blends cleanly between them.-</Note>--<Warning title="Use transform, not left/top">- Animating positional CSS properties triggers layout reflow per frame. Stick to `transform: translateX/Y` for smooth 60fps renders.-</Warning>diff --git a/content/docs/transitions/frosted-glass-wipe.mdx b/content/docs/transitions/frosted-glass-wipe.mdxindex e723e347..eeac5ea9 100644--- a/content/docs/transitions/frosted-glass-wipe.mdx+++ b/content/docs/transitions/frosted-glass-wipe.mdx@@ -5,9 +5,6 @@ description: Elegant scene transition through a sliding pane of frosted glass.<ComponentPreview name="frosted-glass-wipe" />-A transition primitive that slides a pane of frosted glass across the screen between two scenes. The outgoing scene blurs beneath the glass; once the pane crosses the midpoint, the incoming scene is revealed in its place. Uses `backdrop-filter` for the glass and `transform: translateX` for movement so the browser stays on the compositor.--## Installation<InstallBlock name="frosted-glass-wipe" />@@ -75,9 +72,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Give the glass physical properties">- The pane uses thin 1px white borders on its left and right edges so light catches as it slides over darker scenes. Keep the blur radius high enough (16-32px) for the glass to feel substantial rather than like a flat tint.-</Note>diff --git a/content/docs/transitions/grid-pixelate-wipe.mdx b/content/docs/transitions/grid-pixelate-wipe.mdxindex 50465597..e91ed56e 100644--- a/content/docs/transitions/grid-pixelate-wipe.mdx+++ b/content/docs/transitions/grid-pixelate-wipe.mdx@@ -5,9 +5,6 @@ description: Dissolve from one scene to the next through a deterministic grid of<ComponentPreview name="grid-pixelate-wipe" />-The screen is split into a CSS grid of black mask cells covering the outgoing scene. Each cell fades out on its own schedule, computed from a deterministic pattern function (`wave`, `diagonal`, or `spiral`). Because the per-cell delay is pure math over `(x, y)` — no `Math.random` — every frame is reproducible across renders, which is essential for video output.--## Installation<InstallBlock name="grid-pixelate-wipe" />@@ -93,13 +90,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Pick a pattern that fits the beat">- `wave` radiates from the center and feels organic. `diagonal` reads as a sweep — great for hand-off between two product shots. `spiral` is the most dramatic and works best for hero reveals.-</Note>--<Warning title="Never reach for Math.random">- Random per-cell delays will resample on every render call, producing flickering noise instead of a clean dissolve. Always derive cell timing from `(x, y)` coordinates or `@remotion/random` with a stable seed.-</Warning>diff --git a/content/docs/transitions/image-expand-to-fullscreen.mdx b/content/docs/transitions/image-expand-to-fullscreen.mdxindex 431aed76..a13f12e9 100644--- a/content/docs/transitions/image-expand-to-fullscreen.mdx+++ b/content/docs/transitions/image-expand-to-fullscreen.mdx@@ -5,8 +5,6 @@ description: A thumbnail in a feed post lifts off the card and morphs seamlessly<ComponentPreview name="image-expand-to-fullscreen" />-A shared-element transition in the spirit of native iOS photo editors. The image starts life as a thumbnail inside a fake feed post — when the morph fires, the post UI fades, the dark editor canvas swells in underneath, and the image itself rides a single spring all the way to its fullscreen rect. Toolbars slide in from the top and bottom in the last third, called in by the image landing.-## Installation<InstallBlock name="image-expand-to-fullscreen" />@@ -130,13 +128,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="One spring, four properties">- `top`, `left`, `width`, and `height` are all derived from a single `spring()` value. Independent springs would drift out of phase and the image would warp during travel.-</Note>--<Warning title="Toolbars arrive last">- The toolbars only slide in across `[0.5, 1]` of the morph spring — that delay is what makes them feel summoned by the image landing, instead of racing it to the finish line.-</Warning>diff --git a/content/docs/transitions/kinetic-type-mask.mdx b/content/docs/transitions/kinetic-type-mask.mdxindex e55b651e..efb9a7b0 100644--- a/content/docs/transitions/kinetic-type-mask.mdx+++ b/content/docs/transitions/kinetic-type-mask.mdx@@ -5,9 +5,6 @@ description: Use giant typography as a window into the next scene.<ComponentPreview name="kinetic-type-mask" />-A transition primitive that turns a giant headline into a window into the next scene. The text is rendered as an SVG `<clipPath>` over the incoming scene, so its interior literally shows what's underneath. After a brief hold, the text scales exponentially until the inside of one letter expands past the screen edges and fully reveals the new scene.--## Installation<InstallBlock name="kinetic-type-mask" />@@ -87,9 +84,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Use a heavy display weight">- The mask works best with the boldest weight you have on hand (Geist 900 or similar). Heavy letterforms have generous interior space, so the camera has somewhere to fly through before the reveal.-</Note>diff --git a/content/docs/transitions/morphing-modal.mdx b/content/docs/transitions/morphing-modal.mdxindex 283d4292..82bdc481 100644--- a/content/docs/transitions/morphing-modal.mdx+++ b/content/docs/transitions/morphing-modal.mdx@@ -5,9 +5,6 @@ description: A bento card lifts off the grid and blooms into a full-screen modal<ComponentPreview name="morphing-modal" />-The most expensive transition in the kit. Five properties — `top`, `left`, `width`, `height`, and `borderRadius` — are all driven by **one** spring with high mass and low stiffness so the modal "blooms" instead of jumping. The source card's content fades out in the first third of the morph, the modal's content fades in (with a 20px translateY) only in the last third — that asymmetric handoff is what stops it from feeling like a cheap slideshow. Backdrop dims in lockstep with the spring.--## Installation<InstallBlock name="morphing-modal" />@@ -141,13 +138,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="One spring, five properties">- Animating each rect property from a single spring value is the trick — independent springs would drift out of phase and the morph would feel jelly-like in the worst way.-</Note>--<Warning title="Asymmetric content fade">- Source content fades over `[0, 0.33]`, modal content arrives over `[0.66, 1]`. Don't overlap them — the empty middle third is what makes the bloom feel intentional.-</Warning>diff --git a/content/docs/transitions/spatial-push.mdx b/content/docs/transitions/spatial-push.mdxindex a4d77555..0e4508e9 100644--- a/content/docs/transitions/spatial-push.mdx+++ b/content/docs/transitions/spatial-push.mdx@@ -5,9 +5,6 @@ description: A new scene physically presses the old one back into the frame.<ComponentPreview name="spatial-push" />-A transition primitive with weight. Scene A shrinks, dims, and rounds its corners as if being pushed into the background, while Scene B drops in via a spring with overshoot, carrying a heavy directional drop shadow. The result feels kinetic — as if the incoming scene has real mass pressing against the outgoing one.--## Installation<InstallBlock name="spatial-push" />@@ -75,9 +72,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Spring overshoot creates mass">- The incoming scene uses a spring with `mass: 1.2` and moderate damping so it overshoots its final position by a hair before settling. That tiny bounce — combined with the directional drop shadow — is what sells the illusion of physical weight pressing into the frame.-</Note>diff --git a/content/docs/transitions/swipe-transition-wipe.mdx b/content/docs/transitions/swipe-transition-wipe.mdxindex 2f0be8ab..d4e72e21 100644--- a/content/docs/transitions/swipe-transition-wipe.mdx+++ b/content/docs/transitions/swipe-transition-wipe.mdx@@ -5,8 +5,6 @@ description: A mobile-style swipe transition where the outgoing scene flicks off<ComponentPreview name="swipe-transition-wipe" />-A swipe-style transition borrowed from native mobile UIs. Two scenes sit side-by-side inside a flex slider; one snappy spring drives the slider's `translateX` from `0%` to `-100%` (or the mirror), so the outgoing scene flicks off the edge while the incoming one slides in right behind it. A parallax background layer moves at a fraction of the foreground speed to fake depth, and the outgoing scene gets a subtle darkening overlay so it visibly recedes instead of just exiting.-## Installation<InstallBlock name="swipe-transition-wipe" />@@ -132,13 +130,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="One spring, two layers">- The same spring value drives the foreground slider and the parallax background — they can never desync, which is what sells the depth illusion.-</Note>--<Warning title="Keep the flick snappy">- Swipes feel natural when they're fast. The default spring resolves in ~50 frames with a touch of overshoot; slowing it down past ~80 frames starts to feel like a slide carousel instead of a gesture.-</Warning>diff --git a/content/docs/transitions/zoom-through-transition.mdx b/content/docs/transitions/zoom-through-transition.mdxindex 617942ff..4913df4f 100644--- a/content/docs/transitions/zoom-through-transition.mdx+++ b/content/docs/transitions/zoom-through-transition.mdx@@ -5,9 +5,6 @@ description: Aggressively scale into the center of an element to fly through it.<ComponentPreview name="zoom-through-transition" />-A scene transition that interpolates `transform: scale()` with an exponential easing curve, creating the impression of flying *through* an element. Pair with the next scene rendered behind it for a continuous reveal.--## Installation<InstallBlock name="zoom-through-transition" />@@ -69,13 +66,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Aim the camera">- `transformOrigin` controls the focal point of the zoom. Set it to the exact pixel of the element you want to fly through (e.g. `"50% 30%"`).-</Note>--<Warning title="Match with the next scene">- This transition reads as a real fly-through only if the next scene is composited underneath. Use `<Sequence>` to overlap timings.-</Warning>diff --git a/content/docs/typography/blur-reveal.mdx b/content/docs/typography/blur-reveal.mdxindex a4bc36ee..fda5f823 100644--- a/content/docs/typography/blur-reveal.mdx+++ b/content/docs/typography/blur-reveal.mdx@@ -5,9 +5,6 @@ description: Text fades in from a heavy blur into sharp focus.<ComponentPreview name="blur-reveal" />-A typography primitive that animates `opacity` from 0 to 1 and `filter: blur()` from a configurable amount down to 0. Useful for title cards and intro shots.--## Installation<InstallBlock name="blur-reveal" />@@ -76,13 +73,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Load fonts before render">- Make sure your font is loaded before the first frame renders. Use [`@remotion/google-fonts`](https://www.remotion.dev/docs/google-fonts) or `@remotion/fonts` so the blur effect doesn't apply to a fallback system font.-</Note>--<Warning title="Performance">- Heavy blur on large text blocks is expensive. If you stack multiple `BlurReveal`s, consider rendering them in their own `<Sequence>` to keep render time predictable.-</Warning>diff --git a/content/docs/typography/infinite-marquee.mdx b/content/docs/typography/infinite-marquee.mdxindex 36b3e058..6bc82888 100644--- a/content/docs/typography/infinite-marquee.mdx+++ b/content/docs/typography/infinite-marquee.mdx@@ -5,9 +5,6 @@ description: A continuously scrolling horizontal text strip that loops seamlessl<ComponentPreview name="infinite-marquee" />-A typography primitive that translates a row of duplicated text spans on the X axis at a fixed pixel-per-frame rate. The offset is taken `mod` the approximate width of one repetition so the loop is seamless and fully deterministic.--## Installation<InstallBlock name="infinite-marquee" />@@ -100,13 +97,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Seamless looping">- Width is approximated as `text.length * fontSize * 0.55`. For very wide or very narrow fonts you may see a small jump on loop — tweak the multiplier to match your typeface, or pass a longer `text` to make any seam imperceptible.-</Note>--<Warning title="No layout reads">- This component intentionally avoids `useRef` / measurement so it stays render-deterministic. If you need pixel-perfect looping for a specific font, hard-code the repetition width via `text` length and `fontSize`.-</Warning>diff --git a/content/docs/typography/inline-highlight.mdx b/content/docs/typography/inline-highlight.mdxindex b4f5f413..42a1e770 100644--- a/content/docs/typography/inline-highlight.mdx+++ b/content/docs/typography/inline-highlight.mdx@@ -5,9 +5,6 @@ description: Animate one word inside a sentence from a base color to a brand col<ComponentPreview name="inline-highlight" />-A typography primitive that splits a sentence into `before`, `highlight`, and `after` parts and animates the color of the middle word using `interpolateColors` from Remotion.--## Installation<InstallBlock name="inline-highlight" />@@ -93,9 +90,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Smooth color blending">- `interpolateColors` blends in RGB space, so transitions between contrasting hues stay smooth without going through muddy intermediate colors.-</Note>diff --git a/content/docs/typography/marker-highlight.mdx b/content/docs/typography/marker-highlight.mdxindex 4c795814..9b43711a 100644--- a/content/docs/typography/marker-highlight.mdx+++ b/content/docs/typography/marker-highlight.mdx@@ -5,9 +5,6 @@ description: A colored marker block draws behind a phrase while the text color s<ComponentPreview name="marker-highlight" />-A typography primitive that mimics a physical highlighter sweeping behind a word. The colored block grows from left to right via a spring, and the target text color interpolates to a contrast color.--## Installation<InstallBlock name="marker-highlight" />@@ -105,9 +102,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Pick a contrast color">- For the classic marker effect, keep `markerColor` bright and leave `highlightedTextColor` dark. Or invert both for a neon look on dark backgrounds.-</Note>diff --git a/content/docs/typography/masked-slide-reveal.mdx b/content/docs/typography/masked-slide-reveal.mdxindex 3eb7c59c..e20d4775 100644--- a/content/docs/typography/masked-slide-reveal.mdx+++ b/content/docs/typography/masked-slide-reveal.mdx@@ -5,9 +5,6 @@ description: Words rise out of an invisible horizontal mask with a springy motio<ComponentPreview name="masked-slide-reveal" />-A strict, architectural typography primitive: each word is wrapped in a fixed-height container with `overflow: hidden`, and the inner span springs upward from `translateY(100%)` to `0`. The result is text that grows out of an invisible baseline.--## Installation<InstallBlock name="masked-slide-reveal" />@@ -82,9 +79,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Mind descenders">- The mask uses `lineHeight: 1`, which clips letter descenders (g, y, p) by design. If you need extra room, wrap the component in your own container with padding.-</Note>diff --git a/content/docs/typography/matrix-decode.mdx b/content/docs/typography/matrix-decode.mdxindex c6b10a02..3ab45f2c 100644--- a/content/docs/typography/matrix-decode.mdx+++ b/content/docs/typography/matrix-decode.mdx@@ -5,9 +5,6 @@ description: Random scramble resolves left-to-right into target text.<ComponentPreview name="matrix-decode" />-A typography primitive that starts as a stream of random symbols and decodes character by character into the target text. Perfect for DevTools, cybersecurity, and AI reveal moments.--## Installation<InstallBlock name="matrix-decode" />@@ -88,9 +85,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic randomness">- Uses Remotion's `random(seed)` keyed on character index and frame, so scrambled glyphs are stable across renders — no flicker between frames.-</Note>diff --git a/content/docs/typography/perspective-marquee.mdx b/content/docs/typography/perspective-marquee.mdxindex adbb4d3f..f110315f 100644--- a/content/docs/typography/perspective-marquee.mdx+++ b/content/docs/typography/perspective-marquee.mdx@@ -5,9 +5,6 @@ description: A 3D-tilted infinite marquee with depth-of-field blur on items roll<ComponentPreview name="perspective-marquee" />-A typography primitive that takes the seamless modulo-based loop from `InfiniteMarquee` and tilts it in 3D space using CSS `perspective` and `rotateX/Y`. Items further from the viewport center receive progressively heavier `filter: blur()` and lower opacity, mimicking depth of field. Edge vignettes fade the marquee into the background so the loop is invisible.--## Installation<InstallBlock name="perspective-marquee" />@@ -116,13 +113,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Slow is hypnotic">- Keep `pixelsPerFrame` between 1 and 3. The 3D tilt amplifies perceived speed — anything faster reads as motion sickness.-</Note>--<Warning title="Match `fadeColor` to `background`">- The vignette assumes `fadeColor === background`. If they differ you will see hard edges where the marquee ends and the background begins.-</Warning>diff --git a/content/docs/typography/rgb-glitch-text.mdx b/content/docs/typography/rgb-glitch-text.mdxindex 1001143c..25c0c5c3 100644--- a/content/docs/typography/rgb-glitch-text.mdx+++ b/content/docs/typography/rgb-glitch-text.mdx@@ -5,9 +5,6 @@ description: Three RGB-offset text copies jitter for a few frames to create a ch<ComponentPreview name="rgb-glitch-text" />-A typography primitive that stacks red, green, and blue copies of the same text and offsets them on each frame during a short glitch window. Uses `random(seed)` from Remotion so the jitter is fully deterministic across renders.--## Installation<InstallBlock name="rgb-glitch-text" />@@ -100,13 +97,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Determinism">- The RGB offsets use `random(seed)` from `remotion`, never `Math.random()`. The same `seed` and `frame` always produce the same offset, so the glitch renders identically on every frame.-</Note>--<Warning title="Light backgrounds only">- The RGB copies use `mixBlendMode: "multiply"` so they read correctly on a light background. On a dark background you'll want to switch to `screen` or stack opaque copies instead.-</Warning>diff --git a/content/docs/typography/shimmer-sweep.mdx b/content/docs/typography/shimmer-sweep.mdxindex 921efe0e..ba78587c 100644--- a/content/docs/typography/shimmer-sweep.mdx+++ b/content/docs/typography/shimmer-sweep.mdx@@ -5,9 +5,6 @@ description: A bright shine travels across muted text to draw attention.<ComponentPreview name="shimmer-sweep" />-A typography primitive that layers a gradient shine on top of muted base text using `background-clip: text`. The gradient sweeps horizontally across the text, lighting up letters as it passes. Great for AI and generation moments.--## Installation<InstallBlock name="shimmer-sweep" />@@ -82,9 +79,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Background-clip support">- This effect relies on `background-clip: text`. It works in all modern browsers and Remotion's Chromium renderer.-</Note>diff --git a/content/docs/typography/slot-machine-roll.mdx b/content/docs/typography/slot-machine-roll.mdxindex 3ebd5962..ac803746 100644--- a/content/docs/typography/slot-machine-roll.mdx+++ b/content/docs/typography/slot-machine-roll.mdx@@ -5,9 +5,6 @@ description: Vertical reel scrolls each character from an old value to a new val<ComponentPreview name="slot-machine-roll" />-A typography primitive that animates changing values (prices, counters, statuses) as a vertical reel. Each character column rolls independently with a staggered spring, giving a slot-machine feel.--## Installation<InstallBlock name="slot-machine-roll" />@@ -82,13 +79,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Right-aligned by design">- `from` and `to` are left-padded with spaces to the same length so digits align on the right. This matches how prices and counters read.-</Note>--<Warning title="Monospaced digits recommended">- Each column is a fixed width (`0.7em`). If you use a proportional font, wide characters like `W` may get clipped. Use a mono font or characters of similar width.-</Warning>diff --git a/content/docs/typography/staggered-fade-up.mdx b/content/docs/typography/staggered-fade-up.mdxindex 0cdd33da..c642a93a 100644--- a/content/docs/typography/staggered-fade-up.mdx+++ b/content/docs/typography/staggered-fade-up.mdx@@ -5,9 +5,6 @@ description: Words slide up and fade in sequentially with a wave-like cascade.<ComponentPreview name="staggered-fade-up" />-A typography primitive that splits text into words and animates each one with a small delay, sliding up from a configurable distance while fading in. Great for hero titles and intro shots.--## Installation<InstallBlock name="staggered-fade-up" />@@ -88,9 +85,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Tune the stagger">- A smaller `staggerDelay` (2-3 frames) feels punchy, larger values (6-8) feel cinematic. Pair with `speed` to fit your composition's pacing.-</Note>diff --git a/content/docs/typography/text-fade-replace.mdx b/content/docs/typography/text-fade-replace.mdxindex 79c85f53..786a665f 100644--- a/content/docs/typography/text-fade-replace.mdx+++ b/content/docs/typography/text-fade-replace.mdx@@ -5,9 +5,6 @@ description: Cross-fade between two strings on the same line without layout shif<ComponentPreview name="text-fade-replace" />-A typography primitive that swaps one string for another in place. Both spans are absolutely positioned in a relative container so they never push each other in the DOM during the fade.--## Installation<InstallBlock name="text-fade-replace" />@@ -77,16 +74,6 @@ export const RemotionRoot = () => (]}/>-## Notes--<Note title="Absolute positioning">- Both texts are `position: absolute` inside a zero-size relative anchor. This guarantees there is no layout reflow during the cross-fade, even when `from` and `to` have different widths.-</Note>--<Warning title="Long strings">- If your strings are very long, make sure your composition is wide enough — neither span will wrap because they use `whiteSpace: nowrap`.-</Warning>-## Variant: Strikethrough ReplaceA companion primitive that animates a strikethrough line growing left-to-right across the `from` text, then cross-fades to the `to` text. Useful for "old way / new way" comparisons.diff --git a/content/docs/typography/tracking-in.mdx b/content/docs/typography/tracking-in.mdxindex 6523bb29..851c06af 100644--- a/content/docs/typography/tracking-in.mdx+++ b/content/docs/typography/tracking-in.mdx@@ -5,9 +5,6 @@ description: Letter-spacing collapses and blur clears with a springy entrance.<ComponentPreview name="tracking-in" />-A typography primitive that starts text with a wide `letter-spacing` and a heavy blur, then springs both back to normal. The result is a tight, premium-feeling title reveal.--## Installation<InstallBlock name="tracking-in" />@@ -88,13 +85,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Load fonts before render">- Make sure your font is loaded before the first frame renders. Use [`@remotion/google-fonts`](https://www.remotion.dev/docs/google-fonts) so the blur and tracking effects don't apply to a fallback system font.-</Note>--<Warning title="Overflow">- Wide initial tracking can push text outside the container. Either reduce `startTracking`, lower `fontSize`, or wrap the component in a parent with `overflow: hidden`.-</Warning>diff --git a/content/docs/typography/typewriter.mdx b/content/docs/typography/typewriter.mdxindex 0de00a67..5f5de66a 100644--- a/content/docs/typography/typewriter.mdx+++ b/content/docs/typography/typewriter.mdx@@ -5,9 +5,6 @@ description: Character-by-character text reveal with a deterministic blinking cu<ComponentPreview name="typewriter" />-A typography primitive that reveals text one character at a time using `interpolate` and `substring`. The cursor blinks via integer math on the current frame, so it stays consistent across re-renders.--## Installation<InstallBlock name="typewriter" />@@ -88,13 +85,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic blink">- The cursor uses `Math.floor(frame / 15) % 2 === 0` instead of `setInterval` or `Math.random()`. This is required for Remotion: every frame must be a pure function of `frame`, otherwise the rendered video will glitch.-</Note>--<Warning title="Composition length">- Make sure your composition's `durationInFrames` is long enough to fit `text.length / speed` seconds of typing plus a hold at the end.-</Warning>diff --git a/content/docs/ui-blocks/ai-generate-overlay.mdx b/content/docs/ui-blocks/ai-generate-overlay.mdxindex 035c09fe..c517d998 100644--- a/content/docs/ui-blocks/ai-generate-overlay.mdx+++ b/content/docs/ui-blocks/ai-generate-overlay.mdx@@ -5,8 +5,6 @@ description: A "thinking" overlay for AI-driven UI — source image blurs out un<ComponentPreview name="ai-generate-overlay" />-The overlay you reach for any time you need to communicate "the model is working on it." The source image blurs from `0px` to `~20px`, a screen-blended SVG dot pattern shimmers in over the top with a tiny `Math.sin(frame / 6)` jitter, and a pill-shaped indicator with a backdrop-filtered glass background pulses in the center. When the spring-driven reveal fires, the generated image fades in over the blurred source and the pill (and grid) fades back out. Every layer is driven by the current frame so it renders deterministically — no `setInterval`, no random flicker.-## Installation<InstallBlock name="ai-generate-overlay" />@@ -130,17 +128,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic shimmer">- The dot grid jitter is `Math.sin(frame / 6) * 0.05` — a pure function of the current frame. Don't be tempted to reach for `Math.random()` or `setInterval`; both will introduce mismatched output between preview and final render.-</Note>--<Note title="Swap in real images">- The defaults render two CSS gradients so the component is dependency-free, but in practice you'll pass `sourceImageBg`/`generatedImageBg` as `url(...)` strings (loaded via `staticFile()` in your scene) so the blur is applied to a real photo.-</Note>--<Warning title="Heavy blur is expensive">- `filter: blur(20px)` on a viewport-sized layer is one of the costlier CSS effects. Keep the blurred layer on its own absolutely-positioned `<div>` (as it is here) so the browser can promote it and avoid re-layouting the rest of the scene each frame.-</Warning>diff --git a/content/docs/ui-blocks/animated-bar-chart.mdx b/content/docs/ui-blocks/animated-bar-chart.mdxindex 1746ef28..fcbe65f2 100644--- a/content/docs/ui-blocks/animated-bar-chart.mdx+++ b/content/docs/ui-blocks/animated-bar-chart.mdx@@ -5,9 +5,6 @@ description: Bars spring up from the baseline with a staggered cascade.<ComponentPreview name="animated-bar-chart" />-A data-viz primitive that renders SVG `<rect>` bars and animates each one with a `spring()` driven `scaleY` transform. Each bar is offset by `staggerFrames`, producing a clean cascade.--## Installation<InstallBlock name="animated-bar-chart" />@@ -96,9 +93,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Transform origin">- Each bar uses `transformOrigin: bottom` so the spring animation grows from the baseline rather than the center. We rely on `transformBox: fill-box` to scope the origin to the rect's own box.-</Note>diff --git a/content/docs/ui-blocks/animated-line-chart.mdx b/content/docs/ui-blocks/animated-line-chart.mdxindex f2339c8b..0c45e017 100644--- a/content/docs/ui-blocks/animated-line-chart.mdx+++ b/content/docs/ui-blocks/animated-line-chart.mdx@@ -5,9 +5,6 @@ description: A line chart whose path draws on from left to right.<ComponentPreview name="animated-line-chart" />-A data-viz primitive built with SVG `<path>`. The full path length is computed analytically (sum of segment distances) and animated via `strokeDasharray` + `strokeDashoffset`. An optional leading dot rides the head of the line as it draws.--## Installation<InstallBlock name="animated-line-chart" />@@ -97,13 +94,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="No getTotalLength()">- The path length is computed analytically by summing distances between consecutive points. This avoids `useEffect` and DOM measurement, so the first frame renders correctly during server-side bundling.-</Note>--<Warning title="Data range">- The chart auto-scales to the min/max of `data`. If all values are equal, the line is drawn at the top of the chart area.-</Warning>diff --git a/content/docs/ui-blocks/code-accordion.mdx b/content/docs/ui-blocks/code-accordion.mdxindex b4c5d52a..5bdabe4d 100644--- a/content/docs/ui-blocks/code-accordion.mdx+++ b/content/docs/ui-blocks/code-accordion.mdx@@ -5,9 +5,6 @@ description: A code window that springs a range of lines closed and replaces the<ComponentPreview name="code-accordion" />-A code primitive for fixing camera attention. The window starts fully open, then a single spring drives the height of a wrapped range from `lineCount * lineHeight` down to one line, fading the original code out and the placeholder in. Because both inner content and the bar share the same spring, the bottom of the window snaps up with the same micro-bounce — the accordion feels like it has weight.--## Installation<InstallBlock name="code-accordion" />@@ -115,9 +112,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="One spring, many properties">- A single `spring()` with `damping: 10` drives the inner height, original-code opacity, placeholder opacity, and the window's effective height all from one value. Animating from a single source is what makes the bounce feel coherent.-</Note>diff --git a/content/docs/ui-blocks/code-diff-wipe.mdx b/content/docs/ui-blocks/code-diff-wipe.mdxindex a978755c..36801341 100644--- a/content/docs/ui-blocks/code-diff-wipe.mdx+++ b/content/docs/ui-blocks/code-diff-wipe.mdx@@ -5,9 +5,6 @@ description: Reveal an "after" code snippet by wiping a "before" snippet away.<ComponentPreview name="code-diff-wipe" />-A dev-block that stacks two code panes and animates a vertical wipe from left to right. The top "before" layer is masked with `clip-path: inset(0 X% 0 0)` where `X` interpolates from `0` to `100`, revealing the "after" code beneath. An optional handle marker rides the wipe line.--## Installation<InstallBlock name="code-diff-wipe" />@@ -95,13 +92,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="GPU friendly">- `clip-path` is composited on the GPU in modern browsers, so the wipe stays cheap even with long code blocks.-</Note>--<Warning title="Long lines">- The pane uses `whiteSpace: pre` and `overflow: hidden`, so very long lines get clipped rather than wrapped. Pre-format your snippets if you need them to fit.-</Warning>diff --git a/content/docs/ui-blocks/data-flow-pipes.mdx b/content/docs/ui-blocks/data-flow-pipes.mdxindex 90f1ae1c..04c4f4a1 100644--- a/content/docs/ui-blocks/data-flow-pipes.mdx+++ b/content/docs/ui-blocks/data-flow-pipes.mdx@@ -5,9 +5,6 @@ description: Glowing data packets travel along SVG bezier pipes between system n<ComponentPreview name="data-flow-pipes" />-A diagramming primitive for showing data moving through a system. Nodes are positioned absolutely; edges become SVG cubic-bezier paths with horizontally-pulled handles so the routes look like API/DB diagrams instead of straight wires. Each pulse is rendered as a bright dash that animates along the path via `strokeDashoffset`, with three faded ghost copies offset behind it to fake motion blur. Path arc length is sampled numerically (no DOM `getTotalLength`), so the math is fully render-deterministic.--## Installation<InstallBlock name="data-flow-pipes" />@@ -114,9 +111,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Stagger by `startFrame`">- Each edge has its own `startFrame`. Stagger them in increments of 8–12 frames to create a chain reaction across the diagram.-</Note>diff --git a/content/docs/ui-blocks/drag-and-drop-flow.mdx b/content/docs/ui-blocks/drag-and-drop-flow.mdxindex 1f5f8920..613d4479 100644--- a/content/docs/ui-blocks/drag-and-drop-flow.mdx+++ b/content/docs/ui-blocks/drag-and-drop-flow.mdx@@ -5,9 +5,6 @@ description: Simulates dragging a file into a drop zone, then a progress bar fil<ComponentPreview name="drag-and-drop-flow" />-A micro-interaction composition: a file icon is dragged across the frame into a dashed dropzone. The dropzone border highlights via `interpolateColors`, the file fades, and a progress bar grows from 0 to 100%.--## Installation<InstallBlock name="drag-and-drop-flow" />@@ -74,13 +71,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Three timed phases">- The animation splits `durationInFrames` into a drag phase (~45%), a highlight handoff (~10%), and an upload phase (the remainder). All phases derive from `durationInFrames`, so resizing the composition stays in sync.-</Note>--<Warning title="Width is intentional here">- The progress bar grows by animating `width` instead of `transform: scaleX` so the rounded ends stay crisp at any progress value.-</Warning>diff --git a/content/docs/ui-blocks/dynamic-split-screen.mdx b/content/docs/ui-blocks/dynamic-split-screen.mdxindex 825a1dab..2237898c 100644--- a/content/docs/ui-blocks/dynamic-split-screen.mdx+++ b/content/docs/ui-blocks/dynamic-split-screen.mdx@@ -5,9 +5,6 @@ description: Cinematic two-column split where one panel shrinks and the other ex<ComponentPreview name="chat-to-preview-layout" />-A layout block that animates the `flex-basis` of two side-by-side panels — perfect for chat-to-preview handoffs, before/after comparisons, or any moment where one workspace cedes real estate to another. Both panels use `overflow: hidden` so their content doesn't break the layout while the widths animate.--## Installation<InstallBlock name="chat-to-preview-layout" />@@ -75,9 +72,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Why flex-basis is OK here">- Most Remotion animations should stick to `transform`/`opacity`. This component is an exception because the resizing of two panels *is* the effect — there's no way to fake it with `transform`. Keep both child panels' contents inside an `overflow: hidden` wrapper to avoid reflow artifacts.-</Note>diff --git a/content/docs/ui-blocks/glass-code-block.mdx b/content/docs/ui-blocks/glass-code-block.mdxindex 495c42f1..ee5cdadc 100644--- a/content/docs/ui-blocks/glass-code-block.mdx+++ b/content/docs/ui-blocks/glass-code-block.mdx@@ -5,9 +5,6 @@ description: A premium frosted-glass code editor window with a regex tokenizer a<ComponentPreview name="glass-code-block" />-A code window primitive that ditches the flat black rectangle look. The card uses `backdrop-filter: blur()` over a slow animated aura for real refraction; a 1px linear-gradient ring fakes a top-edge highlight; macOS-style traffic lights are dimmed to 60% so they don't shout. Lines fade in one after another with a tiny upward slide via `Sequence`. Syntax highlighting is a small built-in regex tokenizer — no `highlight.js` dependency.--## Installation<InstallBlock name="glass-code-block" />@@ -108,13 +105,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Tokenizer scope">- The built-in tokenizer covers JS/TS keywords, strings, numbers, and `//` comments. It is intentionally not a full parser — for richer highlighting, replace `tokenizeLine` with your own and keep the same `Token` shape.-</Note>--<Warning title="Backdrop filter requires content behind">- The frosted glass effect only shows refraction if there is something behind it. The component renders a slow built-in aura. If you wrap it inside another scene, make sure that scene has visual content.-</Warning>diff --git a/content/docs/ui-blocks/progress-steps.mdx b/content/docs/ui-blocks/progress-steps.mdxindex 14b3dcd1..aee9fd9a 100644--- a/content/docs/ui-blocks/progress-steps.mdx+++ b/content/docs/ui-blocks/progress-steps.mdx@@ -5,9 +5,6 @@ description: Multi-step pipeline with nodes lighting up sequentially.<ComponentPreview name="progress-steps" />-A workflow primitive that visualizes a multi-step process. Each node is staggered through `spring()` scale and `interpolateColors`, while connecting SVG lines fill via `strokeDashoffset`. Switch `orientation` to render as a horizontal pipeline or a vertical timeline.--## Installation<InstallBlock name="progress-steps" />@@ -92,13 +89,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Lines fill via strokeDashoffset">- Connecting lines use `strokeDasharray` set to the segment length and animate `strokeDashoffset` from full length down to zero. This is GPU-friendly and stays crisp at any composition size.-</Note>--<Warning title="Pick a duration that fits all steps">- Make sure `durationInFrames` is at least `steps.length * stepDuration + 30` so the final node has time to pop into its active state.-</Warning>diff --git a/content/docs/ui-blocks/staggered-bento-grid.mdx b/content/docs/ui-blocks/staggered-bento-grid.mdxindex 9a22c3e2..abb49e0d 100644--- a/content/docs/ui-blocks/staggered-bento-grid.mdx+++ b/content/docs/ui-blocks/staggered-bento-grid.mdx@@ -5,9 +5,6 @@ description: Cards pop into a bento grid one after another with a spring.<ComponentPreview name="staggered-bento-grid" />-A composition that maps an array of items into a CSS grid and wraps each card in a `<Sequence>` offset by `staggerDelay` frames. Each card uses `spring()` for its scale and opacity, so its life cycle starts at frame 0 inside the sequence.--## Installation<InstallBlock name="staggered-bento-grid" />@@ -89,9 +86,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Sequence per card">- Wrapping each card in `<Sequence from={index * staggerDelay}>` resets `useCurrentFrame()` to 0 inside that card, so the spring math stays clean and per-item.-</Note>diff --git a/content/docs/ui-blocks/terminal-simulator.mdx b/content/docs/ui-blocks/terminal-simulator.mdxindex 664504ce..399e9bb0 100644--- a/content/docs/ui-blocks/terminal-simulator.mdx+++ b/content/docs/ui-blocks/terminal-simulator.mdx@@ -5,9 +5,6 @@ description: A console window that types out commands and rolls older lines off<ComponentPreview name="terminal-simulator" />-A dev-block that simulates a terminal session. Each line is revealed via `<Sequence>` and typed character-by-character with a substring + `interpolate` pattern. Once the visible line count exceeds the window, the inner container slides up via `translateY` so the latest line is always in view.--## Installation<InstallBlock name="terminal-simulator" />@@ -92,13 +89,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Deterministic cursor">- The blinking cursor uses `Math.floor(frame / 15) % 2 === 0` rather than `setInterval`, so the animation is fully deterministic and renders the same on every machine.-</Note>--<Note title="Auto scroll">- Once more lines have started than fit in the window, the entire content layer translates upward in `lineHeight` increments, simulating scroll without overflow.-</Note>diff --git a/content/docs/ui-blocks/tool-menu-slide-in.mdx b/content/docs/ui-blocks/tool-menu-slide-in.mdxindex cbc3966e..8b6e636f 100644--- a/content/docs/ui-blocks/tool-menu-slide-in.mdx+++ b/content/docs/ui-blocks/tool-menu-slide-in.mdx@@ -5,8 +5,6 @@ description: A horizontal pill of tool icons whips up from below the canvas, the<ComponentPreview name="tool-menu-slide-in" />-A snappy editor-style toolbar reveal. The frosted-glass panel slides up from `translateY(120%)` to `0%` via a stiff, low-mass spring — no overshoot, no slow ramp — and as soon as it locks in place each icon pops from `scale: 0` to `1` with a small caskaded delay. Every icon is wrapped in its own `<Sequence>` so its internal `useCurrentFrame` resets cleanly to zero, which keeps the spring math local and predictable.-## Installation<InstallBlock name="tool-menu-slide-in" />@@ -98,13 +96,3 @@ export const RemotionRoot = () => (},]}/>--## Notes--<Note title="Snappy, not bouncy">- The slide-in spring uses `stiffness: 320`, `damping: 20`, `mass: 0.6` — high stiffness with enough damping to land hard without overshoot. Tool menus that bounce read as toy-like; this one feels like macOS.-</Note>--<Warning title="Sequence resets the icon clock">- Each icon is rendered inside its own `<Sequence from={...}>` so that the spring inside `<ToolIcon>` always sees `frame: 0` at the moment it should start. Don't try to compute the offset manually — let `<Sequence>` reset the clock for you.-</Warning>diff --git a/lib/use-controllable-state.ts b/lib/use-controllable-state.tsnew file mode 100644index 00000000..72039cee--- /dev/null+++ b/lib/use-controllable-state.ts@@ -0,0 +1,60 @@+import * as React from "react";++type UseControllableStateParams<T> = {+ /** Controlled value. When defined, the hook operates in controlled mode. */+ prop?: T | undefined;+ /** Initial value used in uncontrolled mode. */+ defaultProp?: T | undefined;+ /** Called whenever the value changes (in either mode). */+ onChange?: (state: T) => void;+};++type SetStateFn<T> = (prev: T | undefined) => T;++/**+ * Radix-style controllable state: behaves as a controlled value when `prop` is+ * provided, otherwise manages its own state seeded from `defaultProp`. Accepts+ * both a plain next value and an updater function, and only fires `onChange`+ * when the value actually changes.+ *+ * `setValue` is referentially stable (empty deps) — it reads the latest `prop`+ * and `onChange` through refs so consumers can safely list it in their own+ * `useCallback`/`useEffect` deps without invalidating them on every render.+ */+export function useControllableState<T>({+ prop,+ defaultProp,+ onChange = () => {},+}: UseControllableStateParams<T>) {+ const [uncontrolledProp, setUncontrolledProp] = React.useState(defaultProp);+ const isControlled = prop !== undefined;+ const value = isControlled ? prop : uncontrolledProp;++ const onChangeRef = React.useRef(onChange);+ const propRef = React.useRef(prop);+ React.useEffect(() => {+ onChangeRef.current = onChange;+ propRef.current = prop;+ });++ const setValue = React.useCallback((next: T | SetStateFn<T>) => {+ const currentProp = propRef.current;+ if (currentProp !== undefined) {+ // Controlled: derive the next value and bubble it up; the parent owns it.+ const nextValue =+ typeof next === "function"+ ? (next as SetStateFn<T>)(currentProp)+ : next;+ if (nextValue !== currentProp) onChangeRef.current?.(nextValue);+ } else {+ setUncontrolledProp((prev) => {+ const nextValue =+ typeof next === "function" ? (next as SetStateFn<T>)(prev) : next;+ if (nextValue !== prev) onChangeRef.current?.(nextValue);+ return nextValue;+ });+ }+ }, []);++ return [value, setValue] as const;+}