Skip to main content

Terminal Component Examples

Interactive Terminal

Try typing commands like ls, pwd, whoami, date, help, or echo hello world:

bash
user@localhost:~$

Read-only Terminal

This shows pre-executed commands for documentation purposes:

Project Setup

Custom Terminal

With custom styling and configuration:

production-server
admin@prod:~/app$

Direct Component Usage

You can also use the component directly with inline props:

my-terminal
developer@localhost:~/docs$

Available Props

PropTypeDefaultDescription
initialCommandsArray[]Pre-executed commands with outputs
titleString"bash"Terminal window title
heightString"400px"Terminal height
promptString"user@localhost:~$ "Command prompt
readOnlyBooleanfalseDisable input for display mode

Built-in Commands

  • ls - List directory contents
  • pwd - Print working directory
  • whoami - Display current username
  • date - Show current date and time
  • clear - Clear terminal screen
  • help - Show available commands
  • echo [text] - Echo text back