Interactive Terminal

Mock terminal window with animated output, typing, and command handling.

zsh — 80×24
idle
run$ deploy --production
Booting…

Interactive Terminal renders a convincing shell window in the browser with a title bar, prompt, and lines that type out on schedule. It can accept commands from the user and run callbacks against them, so it works as a real, if simple, command interface. Built with React and Tailwind CSS. Great for developer tool landing pages, CLI product demos, and playful contact forms that ditch the usual inputs.

Installation

Examples

Default theme

bash — 80×24
idle
run$ npm create nyxui@latest
Booting…

Synthwave theme

tty1 — neon
idle
run> run --midnight-drive
Booting…

Retro theme — manually type command

zsh — 80×24
idle
run☕ brew --coffee latte
Run a command to begin
☕

Usage

import { InteractiveTerminal } from "@/components/ui/terminal";
import { Terminal } from "lucide-react";
// Basic usage with default theme
<InteractiveTerminal
  command="npm install"
  steps={["Installing packages...", "Resolving dependencies..."]}
  finalMessage="Installation complete!"
/>
 
// Custom styling with different variant
<InteractiveTerminal
  command="deploy --production"
  icon={<Terminal className="mr-2" />}
  steps={[
    "Building project...",
    "Running tests...",
    "Optimizing assets...",
    "Deploying to production..."
  ]}
  finalMessage="Deployment successful!"
  variant="sky"
  stepDelay={800}
/>
 
// Auto-executing command with repeat functionality
<InteractiveTerminal
  command="ping server.example.com"
  steps={["Sending packet...", "Waiting for response..."]}
  finalMessage="Response received: 42ms"
  autoExecute
  repeat
  repeatDelay={2000}
/>
 
// Custom theme and styling
<InteractiveTerminal
  command="hack --mainframe"
  steps={[
    "Bypassing firewall...",
    "Cracking encryption...",
    "Accessing mainframe..."
  ]}
  finalMessage="Access granted!"
  variant="synthwave"
  promptSymbol=">"
  className="border border-fuchsia-500"
/>

Props

PropTypeDefaultDescription
commandstring"help"Command that users need to enter to trigger the terminal sequence
stepsstring[]["Processing command"]Array of processing steps to display sequentially
finalMessagestring"Command executed successfully!"Final message to display after all processing steps
stepDelaynumber1000Delay between processing steps in milliseconds
typingDelaynumber100Delay between individual keystrokes when animating typing
iconReact.ReactNode<TerminalIcon />Icon to display in the title bar
promptSymbolstring"$"Terminal prompt symbol displayed before user input
inputPlaceholderstring"Type a command…"Placeholder text for the input field
autoExecutebooleanfalseEnables automatic command execution without waiting for user input
repeatbooleanfalseWhether to repeat the entire command sequence automatically
repeatDelaynumber3000Delay between repetitions when repeat is enabled
classNamestringundefinedAdditional CSS class names to apply to the terminal container
titlestring"zsh — 80×24"Window title shown in the title bar
variantstring"default"Visual style variant (default, sky, synthwave, retro)