Composition and API
Pass the session through the lines prop as an array of { type, text } entries, where type is command, output, error, or comment. The prompt prop sets the symbol shown before each command line (defaults to $). showHeader toggles the window header bar; within it, showTrafficLights toggles the decorative dots, title sets the centered window label, and enableClipboard toggles the copy button, which copies every line joined by newlines (commands prefixed with the prompt). appearance switches between default, subtle, contrast, and glass chrome, and size controls the monospace text scale. The separate animated entry adds stagger and fade reveal presets for the body.
Accessibility
The copy control is a real button, and the traffic-light dots are decorative (aria-hidden) so they are skipped by assistive technology. The root and every line carry data-slot attributes for styling and testing, and each line exposes a data-type attribute reflecting its kind. Line colors ship light and dark pairs that meet contrast on their surfaces; the animated entry's motion is short and easing-based, so pair it with prefers-reduced-motion handling in your app where needed.
Next.js integration notes
The static TerminalEmulator entry ships no framer-motion and is safe in any Server or Client Component tree (it is a Client Component because the copy button manages local state). The animated TerminalEmulatorAnimated entry imports framer-motion, which is an optional peer dependency — install it only if you use the animated entry. Both render deterministically from the same lines, so server and client output match and there is no hydration mismatch.
FAQ
How do I distinguish commands from their output?
Set the type field on each line. command lines are prefixed with the prompt symbol and use the command color, output lines are muted, error lines are red, and comment lines are green and italic. The component never executes anything — it is a presentational view of a session you supply.
Can I change the prompt symbol?
Yes. Use the prompt prop, which defaults to "$". It is rendered before every command line and is also used when building the copy text, so a copied command reads exactly as it appears.
Do I need framer-motion?
Only for the animated entry. The default import from @zentauri-ui/zentauri-components/ui/terminal-emulator is framer-motion-free. Import TerminalEmulatorAnimated from the /animated subpath when you want the stagger or fade reveal, and install framer-motion as a peer dependency.
How do I theme the line colors?
Override the --zui-terminal-emulator-* CSS variables (bg, fg, border, header, prompt, command, output, error, comment, and more) on :root, a theme selector, or a wrapper. Each variable ships a light fallback and a paired -dark variant for dark mode.