caption-bumper
remotionui/caption-bumperFreeBlock
Between-beats card that punches its line in word by word, draws a rule under it, and wipes out when its hold is over
Live preview
live · rendered by the registry
Rendered by remotionui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://remotionui.com/r/caption-bumper.jsonSource
1import { loadFont } from "@remotion/google-fonts/Inter";2import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";3import { CODE_THEMES } from "@/remotion/lib/code-syntax";4import { getSafeAreaPadding } from "@/remotion/lib/layout";5import { EASING } from "@/remotion/lib/motion-tokens";6import { fitHeadline } from "@/remotion/lib/text-fit-utils";78const { fontFamily } = loadFont("normal", {9 weights: ["500", "600", "700"],10 subsets: ["latin"],11});1213export type CaptionBumperProps = {14 /** The line the bumper exists to land. */15 text: string;16 /** Small label above it — segment, chapter, timestamp. */17 eyebrow?: string;18 /** Largest type size at a 1280-wide stage. */19 maxFontSize?: number;20 /**21 * Seconds the line holds before the bumper wipes out. Omit to hold to the end22 * of the composition.23 */24 holdSeconds?: number;25 backgroundColor?: string;26 accentColor?: string;27 theme?: "dark" | "light";28 /** Animation speed multiplier. */29 speed?: number;30};3132/** Beat plan in seconds. */33const T = {34 /** Ground wipes in behind the line. */35 ground: 0,36 groundFor: 0.4,37 eyebrow: 0.16,38 word: 0.3,39 /** Added per word — capped so long copy still finishes inside `wordsBudget`. */40 wordStagger: 0.055,41 /**42 * Total span every word must have started landing within, regardless of43 * word count. Without this, long copy (or a 2x-length stress test) staggers44 * so far past the beat that later words are still mid-slide, clipped by45 * their own reveal mask, when the line is supposed to be fully readable —46 * the clipped fragment reads as a ghost overlapping the settled words.47 */48 wordsBudget: 0.7,49 /** Rule draws under the line once the words have landed. */50 rule: 0.62,51 exitFor: 0.36,52} as const;5354const clamp = {55 extrapolateLeft: "clamp",56 extrapolateRight: "clamp",57} as const;5859/**60 * A bumper that punches its line in rather than fading a sentence up: the61 * ground wipes in, the words land one after another, a rule draws under them,62 * and the whole card wipes out again when its hold is over — the shape a63 * between-beats card actually needs.64 */65export const CaptionBumper: React.FC<CaptionBumperProps> = ({66 text,67 eyebrow,68 maxFontSize = 84,69 holdSeconds,70 backgroundColor,71 accentColor = "#F472B6",72 theme = "dark",73 speed = 1,74}) => {75 const frame = useCurrentFrame();76 const { fps, width, height } = useVideoConfig();77 const palette = CODE_THEMES[theme];78// … truncated
More from remotionui
All 127 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-composer-showcaseai-composer-showcase | remotionui | Blocks | Free | no deps | |
| ai-generation-canvasai-generation-canvas | remotionui | Blocks | Free | no deps | |
| animated-bar-chartanimated-bar-chart | remotionui | Blocks | Free | no deps | |
| audiogram-sceneaudiogram-scene | remotionui | Blocks | Free | no deps | |
| auto-fit-titleauto-fit-title | remotionui | Blocks | Free | no deps | |
| b-roll-stackb-roll-stack | remotionui | Blocks | Free | no deps | |
| bento-panbento-pan | remotionui | Blocks | Free | no deps | |
| browser-flowbrowser-flow | remotionui | Blocks | Free | no deps |
