Terminal Simulator
snap-cn/terminal-simulatorFreeComponent
Terminal window with chunked command playback, freeze-frame pauses, step scrolling, and an optional cursor-pinned zoom camera.
Install it
npx shadcn@latest add https://snapcn.dev/r/terminal-simulator.jsonSource
1"use client";23import {4 Easing,5 getRemotionEnvironment,6 interpolate,7 useCurrentFrame,8 useVideoConfig,9} from "remotion";10import {11 mixOklch,12 type SnapCnTheme,13 useSnapCnTheme,14 withAlpha,15} from "@/lib/snap-cn-ui";1617export type TerminalLineType = "command" | "log" | "success" | "error";1819/** Package-manager command panel — the flythrough's second station. */20export interface CommandSpec {21 /** Tab labels. The first is the active tab. */22 managers?: string[];23 /** The command typed into the active tab, e.g. "npm install One Tool". */24 text: string;25}2627export interface TerminalLine {28 text: string;29 type: TerminalLineType;30 /** Frame gap before this line starts typing. Defaults to 8. */31 delay?: number;32 /**33 * Extra freeze-frame pause AFTER this line finishes typing, in frames.34 * Use this to build tension before the next batch of logs. If omitted,35 * lines whose text ends in "..." auto-freeze for 18 frames.36 */37 pause?: number;38}3940export interface TerminalZoom {41 /** Turn the extra landing zoom on. */42 enabled: boolean;43 /** Camera zoom the final punch-in lands at. Defaults to 2.4. */44 scale?: number;45 /** Kept for API compatibility; the flythrough camera always leads the eye. */46 followCursor?: boolean;47}4849export interface TerminalSimulatorProps {50 lines?: TerminalLine[];51 /**52 * Headline at the first camera station. Wrap words in `*asterisks*` to tint53 * them with the accent gradient. `null`/"" skips the station — the camera54 * starts on the command panel instead.55 */56 intro?: string | null;57 /**58 * Command panel at the second camera station. `null` skips the station.59 */60 command?: CommandSpec | null;61 /** Command-panel surface color. */62 /** Overrides the design system's `card`. */63 background?: string;64 /** Hairline border color for the command-panel ring and divider. */65 /** Overrides the design system's `border`. */66 borderColor?: string;67 /** Design-system token overrides. */68 theme?: Partial<SnapCnTheme>;69 /** Defaults to `"dark"` — a terminal is lit for dark. */70 mode?: "light" | "dark";71 fontSize?: number;72 /**73 * Reveal speed. The reveal is CHUNKED — every `1 / charsPerFrame` frames74 * bumps the cursor by `chunkSize` characters, so output appears in bursts75 * instead of dripping char-by-char.76 */77 charsPerFrame?: number;78 /** Characters revealed per step. */79 chunkSize?: number;80 /**81// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from snap-cn
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Answer Streamanswer-stream | snap-cn | Components | Free | 2 deps | |
| UI Caretcaret | snap-cn | Components | Free | 1 dep | |
| Follower Rushfollower-rush | snap-cn | Components | Free | 2 deps | |
| Product Herohero-launch | snap-cn | Components | Free | 2 deps | |
| UI Inputinput | snap-cn | Components | Free | 2 deps · 2 files | |
| Karaoke Captionskaraoke-captions | snap-cn | Components | Free | 2 deps | |
| Laptop Framelaptop-frame | snap-cn | Components | Free | 1 dep | |
| Logo Assemblelogo-assemble | snap-cn | Components | Free | 1 dep |
