Shell
A command transcript and prompt with command history. Bring the commands and their effects.
afterglow shell
Type help, status, or clear.
Installation
npx shadcn@latest add @afterglow/shellComposition
Component structure.
Shell
├── ShellOutput
│ ├── ShellCommand
│ └── ShellLine
└── ShellPromptAPI Reference
Shell
The bordered shell surface. It accepts section props and labels itself Shell unless aria-label says otherwise.
ShellOutput
A scrolling role=log transcript that announces added lines politely.
ShellCommand
A submitted command with its prompt.
| Prop | Type | Default |
|---|---|---|
| prompt | string | "$" |
ShellLine
One output line with an optional status tone.
| Prop | Type | Default |
|---|---|---|
| tone | "command" | "default" | "error" | "muted" | "warning" | "default" |
ShellPrompt
The command field. It trims submitted text, clears after submission and recalls the last 40 commands with Arrow Up and Arrow Down.
| Prop | Type | Default |
|---|---|---|
| label | string | "Command" |
| onSubmit | (command: string) => void | - |
| placeholder | string | - |
| prompt | string | "$" |