Utility
Terminal
█
code-demo █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Installation
$ pnpm dlx shadcn@latest add @termcn/opentui/code
Usage
import { Code } from "@/components/ui/code";<Code language="typescript">
{`const greeting = "Hello, world!";\nconsole.log(greeting);`}
</Code>Examples
Multiline
Terminal
█
code-multiline █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█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 | - |