Utility
Terminal
Installation
$ pnpm dlx shadcn@latest add @termcn/ink/code
Usage
import { Code } from "@/components/ui/code";<Code language="typescript">
{`const greeting = "Hello, world!";\nconsole.log(greeting);`}
</Code>Examples
Multiline
Terminal
API Reference
Code
| Prop | Type | Default |
|---|---|---|
children | string | required |
language | string | - |
inline | boolean | false |
borderStyle | "single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | "single" |
showLineNumbers | boolean | true |
lineNumberSeparator | string | "│ " |
keywordColor | string | - |
stringColor | string | - |
numberColor | string | - |
commentColor | string | - |
operatorColor | string | - |
plainColor | string | - |
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.