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
| Prop | Type | Default | Description |
|---|---|---|---|
initialCommands | Array | [] | Pre-executed commands with outputs |
title | String | "bash" | Terminal window title |
height | String | "400px" | Terminal height |
prompt | String | "user@localhost:~$ " | Command prompt |
readOnly | Boolean | false | Disable input for display mode |
Built-in Commands
ls- List directory contentspwd- Print working directorywhoami- Display current usernamedate- Show current date and timeclear- Clear terminal screenhelp- Show available commandsecho [text]- Echo text back