A Remotion template for creating vertical (9:16 aspect ratio) videos with animations, similar to Instagram/Facebook Stories format. Includes both News Stories and Quote modules.
- Quick Start Guide - Get started in 5 minutes
- Features Guide - New features: Factory, Multi-Story, Zod validation
- Advanced Usage - Detailed customization guide
- Architecture - Component structure and technical details
- GitHub Actions Guide - 🆕 Generate videos automatically with GitHub Actions
- Quote Module Documentation - Complete guide to the Quote module
- Quote Quick Start - Create your first quote video in 5 minutes
- Quote Module README - API reference and examples
- ✅ Vertical format (9:16): Optimized for social media stories
- ✅ Background images with animations: Support for zoom-in, zoom-out, and fade effects
- ✅ Animated text segments: Multiple text animations (fade, slide, typing)
- ✅ Publication date display: Shows date in top-left corner
- ✅ Tags support: Display multiple tags with animations
- ✅ Copyright line: Configurable copyright text
- ✅ Zod schema validation: Runtime type checking with clear error messages
- ✅ Story factory: Fluent builder API for creating stories
- ✅ Multi-story support: Combine multiple stories with transitions
- ✅ Fully configurable: All aspects can be customized via props
- ✅ Quote videos: Create beautiful short quote videos
- ✅ Flexible backgrounds: Support for both images and videos
- ✅ Audio support: Add background music or narration
- ✅ Friendly animations: Smooth fade-in, zoom, and pan effects
- ✅ Stories/Tags: Display related categories
- ✅ Builder pattern: Fluent API for easy configuration
- ✅ Type-safe: Full TypeScript support with Zod validation
- ✅ Pre-built examples: 7 ready-to-use quote templates
npm installStart the Remotion Studio to preview and edit your video:
npm run devRender the video to an MP4 file:
npm run buildThe video will be saved to out/video.mp4.
The NewsStory component accepts the following props:
interface NewsStoryProps {
backgroundImages: BackgroundImage[];
textSegments: TextSegment[];
publishDate: string;
tags: string[];
copyright: string;
}
interface BackgroundImage {
url: string;
animation?: 'zoom-in' | 'zoom-out' | 'fade' | 'none';
}
interface TextSegment {
text: string;
startFrame: number;
durationInFrames: number;
animation?: 'fade' | 'slide' | 'typing' | 'none';
}<Composition
id="NewsStory"
component={NewsStory}
durationInFrames={300}
fps={30}
width={1080}
height={1920}
defaultProps={{
backgroundImages: [
{
url: 'https://example.com/image.jpg',
animation: 'zoom-in',
},
],
textSegments: [
{
text: 'Breaking News: Important announcement',
startFrame: 30,
durationInFrames: 90,
animation: 'fade',
},
{
text: 'More details about this story',
startFrame: 130,
durationInFrames: 90,
animation: 'slide',
},
],
publishDate: '2024-03-15',
tags: ['#News', '#Breaking', '#World'],
copyright: '© 2024 Your Company. All rights reserved.',
}}
/>The story factory provides a fluent builder API for creating news stories with automatic validation.
import { createStory } from './storiesFactory';
const story = createStory()
.withBackgroundImage(
'https://example.com/image.jpg',
'zoom-in'
)
.withTextSegment('Breaking News', 30, 90, 'fade')
.withTextSegment('More details', 130, 90, 'slide')
.withPublishDate('2024-03-15')
.withTags('#News', '#Breaking')
.withCopyright('© 2024 News Agency')
.build();- Type-safe: Full TypeScript support
- Validated: Automatic Zod validation
- Readable: Clear, fluent API
- Flexible: Easy to modify and extend
Combine multiple stories into one video with smooth transitions.
import { MultiStory } from './components/MultiStory';
import { createStory } from './storiesFactory';
const stories = [
{
story: createStory()
.withBackgroundImage(url1, 'zoom-in')
.withTextSegment('First story', 30, 180, 'fade')
.withPublishDate('2024-03-15')
.withTags('#News')
.withCopyright('© 2024')
.build(),
durationInFrames: 240,
transition: 'fade',
transitionDuration: 20,
},
{
story: createStory()
.withBackgroundImage(url2, 'zoom-out')
.withTextSegment('Second story', 30, 180, 'slide')
.withPublishDate('2024-03-15')
.withTags('#News')
.withCopyright('© 2024')
.build(),
durationInFrames: 240,
transition: 'slide-left',
transitionDuration: 25,
},
];
<MultiStory stories={stories} />- fade: Smooth fade in/out
- slide-left: Slide from right to left
- slide-right: Slide from left to right
- zoom: Zoom in on entry, zoom out on exit
- none: Instant cut (no transition)
- zoom-in: Gradually zooms into the background image
- zoom-out: Gradually zooms out from the background image
- fade: Fades in and out
- none: No animation
- fade: Smooth fade in and out effect
- slide: Slides in from bottom with spring animation
- typing: Typewriter effect
- none: No animation
The default video duration is 300 frames (10 seconds at 30 fps). You can adjust this in src/index.tsx:
durationInFrames={300} // 10 seconds at 30 fps
fps={30}The video is set to 1080x1920 (9:16 aspect ratio) for vertical stories:
width={1080}
height={1920}Control when text appears and how long it stays on screen:
{
text: 'Your text here',
startFrame: 30, // Appears at 1 second (30 frames / 30 fps)
durationInFrames: 90, // Stays for 3 seconds
animation: 'fade',
}You can customize the styling by modifying the components in src/components/NewsStory.tsx:
- Text size, color, and font
- Tag colors and styling
- Date display format and position
- Copyright text appearance
- Background overlay gradients
The Quote Module is a complete solution for creating short quote videos. See QUOTE_MODULE.md for full documentation.
import { createQuote } from './quote';
const myQuote = createQuote()
.withQuote('The only way to do great work is to love what you do.')
.withAuthor('Steve Jobs')
.withBackgroundImage('https://example.com/image.jpg', 'zoom-in')
.withStories('Motivation', 'Success')
.build();The module includes 7 ready-to-use quotes:
- Motivational Quote (Steve Jobs)
- Wisdom Quote (Robert Frost)
- Success Quote (Winston Churchill)
- Inspiration Quote (Theodore Roosevelt)
- Happiness Quote (Dalai Lama)
- Simple Quote (Oscar Wilde)
- Quote with Audio (Henry Wadsworth Longfellow)
All are available in the Remotion Studio when you run npm run dev.
- Builder Pattern: Fluent API for creating quotes
- Background Support: Both images and videos
- Audio Support: Add background music
- Animations: zoom-in, zoom-out, fade, pan
- Automatic Duration: Calculates optimal video length
- Stories/Tags: Add categories to quotes
- Validation: Zod schema validation
For more details, see QUOTE_QUICKSTART.md.
npm run dev- Start Remotion Studio for developmentnpm run build- Render video to MP4npm run preview- Preview the videonpm run format- Format code with Prettiernpm run type-check- Check TypeScript types
This repository includes GitHub Actions workflows that allow you to generate videos directly from GitHub without setting up a local environment.
Workflow: .github/workflows/generate-video.yml
This workflow allows you to render any pre-configured composition with a simple click.
How to use:
- Go to the "Actions" tab in your GitHub repository
- Select "Generate Video" workflow
- Click "Run workflow"
- Choose your options:
- Composition ID: Select from available compositions (NewsStory, BreakingNews, MotivationalQuote, etc.)
- Output filename: Name for your video file (default: video.mp4)
- Video quality: CRF value for quality (18 is default, lower = better quality)
- Click "Run workflow" button
- Wait for the workflow to complete (usually 1-3 minutes)
- Download the generated video from the workflow artifacts
Available Compositions:
NewsStory- Original news story templateBreakingNews- Breaking news with factory patternTechNews- Technology news storySportsNews- Sports news storyMultiSegmentTest- Multi-segment news storyMultiStory- Multiple stories with transitionsQuickNews- Quick news compilationMotivationalQuote- Motivational quote by Steve JobsWisdomQuote- Wisdom quote by Robert FrostSuccessQuote- Success quote by Winston ChurchillInspirationQuote- Inspiration quote by Theodore RooseveltHappinessQuote- Happiness quote by Dalai LamaSimpleQuote- Simple quote by Oscar WildeQuoteWithAudio- Quote with background audio
Workflow: .github/workflows/generate-custom-video.yml
This workflow allows you to render videos with custom properties passed as JSON.
How to use:
- Go to the "Actions" tab in your GitHub repository
- Select "Generate Custom Video" workflow
- Click "Run workflow"
- Choose your options:
- Composition type: news or quote
- Custom props JSON: Provide custom properties (optional, see examples below)
- Output filename: Name for your video file
- Duration frames: Video duration in frames (300 = 10 seconds at 30fps)
- Click "Run workflow" button
- Wait for the workflow to complete
- Download the generated video from the workflow artifacts
Example Custom Props for News:
{
"backgroundImages": [{"url": "https://example.com/image.jpg", "animation": "zoom-in"}],
"textSegments": [{"text": "Your custom text", "startFrame": 30, "durationInFrames": 90, "animation": "fade"}],
"publishDate": "2024-12-25",
"tags": ["#Custom", "#News"],
"copyright": "© 2024 Your Company"
}Example Custom Props for Quote:
{
"quote": "Your custom quote text here",
"author": "Author Name",
"backgroundImage": {"url": "https://example.com/bg.jpg", "animation": "zoom-in"},
"stories": ["Inspiration", "Motivation"]
}- ✅ No local setup required - Generate videos without installing dependencies
- ✅ Cloud rendering - Uses GitHub's infrastructure for rendering
- ✅ Version control - All video configurations are version controlled
- ✅ Automated workflow - Integrate video generation into your CI/CD pipeline
- ✅ Team collaboration - Anyone with repository access can generate videos
- ✅ Artifact storage - Videos are automatically stored as workflow artifacts
- Remotion: Video creation framework
- React: UI library
- TypeScript: Type-safe development
- Prettier: Code formatting
ISC