terminal
Terminal
A shell session. Lines starting with `$` are commands, `#` marks a comment and `✓` a passing check. Source code stays in a normal code block, and a file tree is Tree.
- use it
- Good for a command and what it printed.
- instead
- Source code is a fenced code block. A file tree is Tree.
install
Put the session in a fenced block so Markdown leaves it alone. $ marks a command, ✓ a pass.
pnpm dlx shadcn@latest add @mdxcn/callout✓ registry/default/callout/callout.tsx✓ registry/default/graph-frame/graph-frame.tsx2 files written, 0 conflicts
import { Terminal } from "@/registry/default/terminal/terminal"
<Terminal title="SHELL">
```
$ pnpm dlx shadcn@latest add @mdxcn/callout
✓ registry/default/callout/callout.tsx
✓ registry/default/graph-frame/graph-frame.tsx
2 files written, 0 conflicts
```
</Terminal>install
command
comment and output
# lines are comments. Plain lines are output, muted.
# run the suite oncepnpm testRUN v3.2.7✓ lib/http/accept.test.ts (12)✓ lib/agent/copy.test.ts (4)Test Files 2 passed (2)
import { Terminal } from "@/registry/default/terminal/terminal"
<Terminal title="TESTS" prompt=">">
```
# run the suite once
> pnpm test
RUN v3.2.7
✓ lib/http/accept.test.ts (12)
✓ lib/agent/copy.test.ts (4)
Test Files 2 passed (2)
```
</Terminal>| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "shell" | Caption drawn on the top edge of the frame. |
| prompt | string | "$" | The glyph that marks a command line. |
| children | string | fenced code | — | Plain lines or a fenced code block. Whitespace is kept. Leading and trailing blank lines are dropped. |
| corner | string | "+" | Character at each corner of the frame. |
| frame | "box" | "corners" | "rule" | "none" | "box" | box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content. |
| className | string | — | Passed to the outer frame. |