Typo Fix
A misspelled word in a short line is caught by a red spell-check squiggle, then its letters hop into the right order and the word is corrected in place. A free, MIT-licensed Remotion text animation.
In Remotion, Typo Fix shows a misspelled word in a short sentence being noticed and corrected in place. Use it for a quick copy-edit demo that shows how easy a fix is.
$ pnpm dlx shadcn@latest add @remocn/typo-fixHow to build this in Remotion
You don't need a typewriter that backspaces and retypes, or @remotion/transitions. Install the component and pass both spellings:
npx shadcn@latest add @remocn/typo-fixThe line rises in part by part, and a red spell-check squiggle draws under the wrong word. At fixAt (frame 44) the letters both spellings share hop into their new places one after another on a spring(); letters only in wrong fade out and letters only in correct fade in. The squiggle retracts and an accent rule draws under the fixed word. The schedule lives in timeline.ts.
Good to know
- Length: 80 frames of motion at 30 fps (160 at 60 fps) with the default props. That is the minimum for its
Sequence; add your own hold on top. The Usage example below is a 60 fps composition, so the numbers it hands to Remotion (durationInFrames,Sequencelengths) are doubled. The component's own props counted in frames stay in 30 fps frames at any frame rate, see Frame rate. - Installs:
remotion,@remotion/google-fontsfrom npm, plus the remocn helpersglide,frame-rate,timeline. The shadcn CLI copies the source into your project. - Font: loads Onest itself through
@remotion/google-fonts. PassfontFamilyto use your own face, and load that font in your project.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { TypoFix } from "@/components/remocn/typo-fix";
const TypoFixScene = () => (
<TypoFix wrong="Lanuch" correct="Launch" after="day" />
);
export const RemotionRoot = () => (
<Composition
id="TypoFix"
component={TypoFixScene}
durationInFrames={232}
fps={60}
width={1280}
height={720}
/>
);The wrong word appears in a short line, gets flagged, and is corrected to correct in place. Pass wrong, correct and surrounding before and after text. It ships in light and dark through the theme prop.
Props15
| Prop | Type | Default |
|---|---|---|
| wrong | string"Lanuch" Misspelled word shown first. | |
| correct | string"Launch" Correct spelling it becomes. | |
| before | string"" Text before the word. | |
| after | string"day" Text after the word. | |
| fixAt | number44 Frame the letters start hopping into their right places. | |
| accent | string"#3B5BFD" Accent color override; falls back to the theme accent. | |
| errorColor | string— Color of the spell-check squiggle; overrides the theme. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill in place of the lit ground; pass "transparent" to drop it. | |
| fontFamily | string"Onest" Typeface for the copy. Load the font in your project first. | |
| grain | booleantrue Film grain over the scene. | |
| 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. | |
| theme | "dark" | "light""dark" Ships light and dark; picks the palette. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
- wrongstring
Misspelled word shown first.
Default
"Lanuch" - correctstring
Correct spelling it becomes.
Default
"Launch" - beforestring
Text before the word.
Default
"" - afterstring
Text after the word.
Default
"day" - fixAtnumber
Frame the letters start hopping into their right places.
Default
44 - accentstring
Accent color override; falls back to the theme accent.
Default
"#3B5BFD" - errorColorstring
Color of the spell-check squiggle; overrides the theme.
- inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill in place of the lit ground; pass "transparent" to drop it.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Onest" - grainboolean
Film grain over the scene.
Default
true - 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 - theme"dark" | "light"
Ships light and dark; picks the palette.
Default
"dark" - speednumber
Playback speed multiplier for the whole timeline.
Default
1
Common questions
How do I animate a typo being caught and corrected in a line of text?
Install Typo Fix with npx shadcn@latest add @remocn/typo-fix and pass wrong, correct and the before and after text. The typo is underlined, then fixed in place.
Does it delete and retype the word?
No. The letters rearrange in place. To select a phrase and type over it, use Select Replace.
Do the two spellings need the same letters?
No. Shared letters move; extra letters fade out and missing ones fade in.
Related effects
- Select Replace: select a whole phrase and rewrite it.
- Diff Swap: a code-style before/after change.
- Word Insert: add a new word to the sentence.
- Strikethrough Replace: strike a claim and write the correction.