🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

react-linux-terminals

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-linux-terminals

Beautiful, themeable Linux-style terminal component for React apps.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

react-linux-terminals

A React component that renders a Linux-style terminal window with a macOS-like title bar, themeable colors, and optional typewriter animation. Perfect for portfolios, docs, or landing pages.

Demo screenshot

Install

npm install react-linux-terminals

Peer dependencies: React 18 or 19.

Quick example

import { Terminal, themes } from "react-linux-terminals";

function App() {
  return (
    <Terminal
      theme={themes.ubuntu}
      username="alice"
      hostname="dev-box"
      workingDirectory="~/projects"
      commands={[
        "ls -la",
        {
          input: "cat /etc/os-release",
          output: ["PRETTY_NAME=\"Ubuntu 24.04 LTS\"", "NAME=\"Ubuntu\""],
        },
      ]}
      cursorBlink
      typewriterEffect
      showHeader
    />
  );
}

Don’t forget to keep the default styles: the package ships CSS that is applied when you import the component (side-effect).

Props

PropTypeDefaultDescription
theme"ubuntu" | "arch" | "kali" or TerminalThemePreset name or custom theme object.
commandsArray<string | CommandEntry>[]Commands to show. Strings = input only; objects can include output and isError.
usernamestring"user"Username in the prompt.
hostnamestring"localhost"Hostname in the prompt.
workingDirectorystring"~"Current path in the prompt.
showPromptbooleantrueShow user@host:path$ before each command.
showHeaderbooleantrueShow the window bar with red/yellow/green buttons.
cursorBlinkbooleantrueBlink the cursor.
typewriterEffectbooleanfalseAnimate the last command character-by-character.
typewriterSpeednumber40Delay per character (ms) when typewriterEffect is on.
classNamestringExtra class on the root element.
styleReact.CSSPropertiesInline styles on the root element.

CommandEntry

interface CommandEntry {
  input: string;        // The command line
  output?: string[];    // Lines of output
  isError?: boolean;    // Style output as error (e.g. red)
}

Themes

Three built-in themes: Ubuntu, Arch, Kali.

import { Terminal, themes } from "react-linux-terminals";

// By name
<Terminal theme="ubuntu" commands={["neofetch"]} />
<Terminal theme={themes.arch} commands={["pacman -Syu"]} />
<Terminal theme={themes.kali} commands={["whoami"]} />

Optional subpath for themes only:

import { getTheme, themes } from "react-linux-terminals/themes";

const ubuntu = getTheme("ubuntu");

You can pass a full custom theme object (see TerminalTheme in the types) for your own colors and labels.

useTypewriter hook

For custom UIs that need the same typing effect:

import { useTypewriter } from "react-linux-terminals";

const { displayedText, isTyping, reset } = useTypewriter({
  text: "Hello, world!",
  speed: 50,
  autoStart: true,
});

Development

# Build library → dist/
npm run build

# Build demo → preview/
npm run build:demo

# Serve demo at http://localhost:4173/demo.html
npm run demo:serve

# Type-check
npm run typecheck

See PUBLISH.md for publishing and npm link / unlink steps.

License

MIT

Keywords

react

FAQs

Package last updated on 05 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts