Baktiyar Ablaikhan

Terminal

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

A macOS-style terminal types shell commands with syntax highlighting and prints their output line by line.

Code

"use client";
import { Terminal } from "@/lab/aceternity/ui/terminal";

const commands = [
  "npx shadcn@latest init",
  "npm install motion",
  "npx shadcn@latest add button card",
  "Term Deez Nuts",
];

const outputs = {
  0: ["✔ Preflight checks passed.", "✔ Created components.json", "✔ Initialized project."],
  1: ["added 1 package in 2s"],
  2: ["✔ Done. Installed button, card."],
};

export default function TerminalDemo() {
  return (
    <section className="@container-[size] relative flex h-full w-full items-center justify-center">
      <Terminal
        commands={commands}
        outputs={outputs}
        typingSpeed={45}
        delayBetweenCommands={1000}
        restartDelay={4000}
        className="max-w-[min(36rem,90cqw)] px-0 text-[clamp(0.6rem,1.6cqw,0.75rem)]"
        contentClassName="h-[max(5rem,calc(80cqh-2.75rem))]"
      />
    </section>
  );
}
Prompt

Build "Terminal", a text animation. What it does: A macOS-style terminal types shell commands with syntax highlighting and prints their output line by line. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/terminal (Aceternity UI, Aceternity UI licence (free component)).