Installation
Usage
Examples
Basic Terminal
Sequential Typing
Without IntersectionObserver
Custom Styling
Mixed Content
Component API
Terminal
Terminal content, typically including TypingAnimation components and static text.
Whether to sequence typing animations. When true, animations wait for the previous one to complete before starting.
Whether to start animations only when the terminal is in view. Uses IntersectionObserver with 30% threshold.
Additional CSS classes to apply to the terminal container.
TypingAnimation
The text to type out character by character.
Duration in milliseconds between each character.
Delay in milliseconds before starting the typing animation.
HTML element type to render.Options:
'div' | 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'Whether to wait for the element to be in view before starting. Only applies when not in a sequence.
Index of this item in the sequence. Required when using
sequence={true} in the parent Terminal.Additional CSS classes to apply to the text element.
Features
- Realistic typing animation with character-by-character reveal
- Sequential animation support with context-based coordination
- IntersectionObserver integration for viewport-triggered animations
- Blinking cursor animation (via CSS keyframes)
- Terminal-style UI with macOS-inspired window controls
- Customizable typing speed and delays
- Flexible content mixing (animated and static)
- Dark mode compatible
- Overflow scrolling support
Terminal UI Elements
The Terminal component includes:- Window controls: Red, yellow, and green dots (macOS style)
- Border: Subtle border with rounded corners
- Max dimensions: 400px height, large width (max-w-lg)
- Scrolling: Overflow auto on the code block
- Grid layout: Gap between lines for readability
Cursor Animation
The blinking cursor uses CSS keyframes:blink-cursor 1.2s step-end infinite
Context Architecture
Whensequence={true}, Terminal provides context:
- Wait for their
itemIndexto matchactiveIndex - Start typing animation
- Call
completeItem()when done - Next item in sequence begins
IntersectionObserver
WhenstartOnView={true}:
- Observes terminal container
- Triggers animation at 30% visibility threshold
- Disconnects after first trigger
- Works with both sequence and non-sequence modes
Dependencies
- runed
- motion-sv (for animated text elements)
Styling Tips
- Use monospace font for authentic terminal appearance
- Combine with color classes for syntax highlighting
- Adjust
max-h-[400px]for different terminal heights - Use
text-smor smaller for compact display - Add custom backgrounds for themed terminals