Skip to content
mdxcn is now part of Shadcn Labs. details

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.

[ 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
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.

[ TESTS ]
# run the suite oncepnpm test RUN  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>
[ PROPS ]
PropTypeDefaultDescription
titlestring"shell"Caption drawn on the top edge of the frame.
promptstring"$"The glyph that marks a command line.
childrenstring | fenced code—Plain lines or a fenced code block. Whitespace is kept. Leading and trailing blank lines are dropped.
cornerstring"+"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.
classNamestring—Passed to the outer frame.