Ruby Press
A word in a sentence is pressed out and replaced from a list, with small glosses above. A free, MIT-licensed Remotion text animation.
$ pnpm dlx shadcn@latest add @remocn/ruby-pressUsage
// src/Root.tsx
import { Composition } from "remotion";
import { RubyPress } from "@/components/remocn/ruby-press";
const RubyPressScene = () => (
<RubyPress before="Subtitles for every market in" words={["a fortnight", "a morning", "one render"]} after="." />
);
export const RemotionRoot = () => (
<Composition
id="RubyPress"
component={RubyPressScene}
durationInFrames={340}
fps={60}
width={1280}
height={720}
/>
);Each entry in words is pressed down and swapped for the next inside a sentence built from before and after, with a small gloss rising above each. Pass before, words and after. It ships in light and dark through the theme prop.
Props14
| Prop | Type | Default |
|---|---|---|
| before | string"Subtitles for every market in" Text before the swapping word. | |
| words | string[]— Words pressed in order. | |
| after | string"." Text after the swapping word. | |
| hold | number14 Frames each state stays on screen before the next one. | |
| stagger | number3 Frames between words as the lead line rises in. | |
| press | number22 Frames the gloss takes to press down into the line. | |
| accent | string— Accent color override; falls back to the theme accent. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background color override; falls back to the theme background. | |
| fontFamily | string"Zen Kaku Gothic New" Typeface for the copy. Load the font in your project first. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
| theme | "dark" | "light""dark" Ships light and dark; picks the palette. | |
- beforestring
Text before the swapping word.
Default
"Subtitles for every market in" - wordsstring[]
Words pressed in order.
- afterstring
Text after the swapping word.
Default
"." - holdnumber
Frames each state stays on screen before the next one.
Default
14 - staggernumber
Frames between words as the lead line rises in.
Default
3 - pressnumber
Frames the gloss takes to press down into the line.
Default
22 - accentstring
Accent color override; falls back to the theme accent.
- inkstring
Text color; overrides the theme ink.
- backgroundstring
Background color override; falls back to the theme background.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Zen Kaku Gothic New" - scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - speednumber
Playback speed multiplier for the whole timeline.
Default
1 - theme"dark" | "light"
Ships light and dark; picks the palette.
Default
"dark"