Utility
Terminal
Embedded terminal requires Node.js and may not render in the browser preview.
Installation
$ pnpm dlx shadcn@latest add @termcn/ink/embedded-terminal
Usage
import { EmbeddedTerminal } from "@/components/ui/embedded-terminal";<EmbeddedTerminal
command="bash"
args={["-c", "echo Hello world"]}
width={80}
height={24}
onExit={(code) => console.log(`Exited with ${code}`)}
/>API Reference
EmbeddedTerminal
| Prop | Type | Default |
|---|---|---|
command | string | required |
args | string[] | [] |
cwd | string | - |
width | number | 80 |
height | number | 24 |
onExit | (code: number) => void | - |
width is the preferred maximum. The component clamps itself to the current
Ink stdout width and resizes the PTY without restarting the running process.
Notes
Accessibility
termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.
- Screen reader: Screen-reader mode removes decorative output while preserving meaningful labels and state.