Two Hit
A two-hit headline, "Streaming now.", in white then blue, right-aligned on black. A free, MIT-licensed Remotion text animation.
In Remotion, Two Hit is a premiere-style card: a right-aligned line such as Streaming now. hits on black in white, then a second hit replaces it in your accent color. Use it for a two-beat teaser or release card.
$ pnpm dlx shadcn@latest add @remocn/two-hitGood to know
- Length: 91 frames of motion at 30 fps (182 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 Urbanist itself through
@remotion/google-fonts. PassfontFamilyto use your own face, and load that font in your project. beforeandafterare separate lines; setaccentto the color of the second hit.
Usage
// src/Root.tsx
import { Composition } from "remotion";
import { TwoHit } from "@/components/remocn/two-hit";
const TwoHitScene = () => (
<TwoHit before="Premieres Friday." after="Streaming now." hitAt={34} />
);
export const RemotionRoot = () => (
<Composition
id="TwoHit"
component={TwoHitScene}
durationInFrames={240}
fps={60}
width={1280}
height={720}
/>
);The first line appears, then at hitAt it is hit and replaced by the second line in the accent colour, right-aligned on a flat background. Pass before, after and hitAt; it ships light and dark.
Props13
| Prop | Type | Default |
|---|---|---|
| before | string"Premieres Friday." First line, shown in the base text colour. | |
| after | string"Streaming now." Second line that replaces it in the accent colour. | |
| hitAt | number34 Frame where the second hit lands. | |
| hitGap | number24 Frames between the first, small hit and the second, full one. | |
| fontWeight | number400 Weight of the lines. | |
| accent | string— Accent colour (any CSS colour). | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Overrides the theme background colour. | |
| fontFamily | string"Urbanist" 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 multiplier; above 1 plays faster. | |
| theme | "dark" | "light""dark" Colour scheme; ships light and dark. | |
- beforestring
First line, shown in the base text colour.
Default
"Premieres Friday." - afterstring
Second line that replaces it in the accent colour.
Default
"Streaming now." - hitAtnumber
Frame where the second hit lands.
Default
34 - hitGapnumber
Frames between the first, small hit and the second, full one.
Default
24 - fontWeightnumber
Weight of the lines.
Default
400 - accentstring
Accent colour (any CSS colour).
- inkstring
Text color; overrides the theme ink.
- backgroundstring
Overrides the theme background colour.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Urbanist" - 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 multiplier; above 1 plays faster.
Default
1 - theme"dark" | "light"
Colour scheme; ships light and dark.
Default
"dark"