Skip to content

Code

Code renders inline code snippets or block-level code with optional line numbers and copy button.

Basic Usage

Use npm install to install.

const x = 42
import { Code } from "@paramanu/typography-react"
export default function App() {
return (
<>
<p>Use <Code>npm install</Code> to install.</p>
<Code block>{"const x = 42"}</Code>
</>
)
}
<p>Use <code class="pm-code">npm install</code> to install.</p>
<pre class="pm-code-block"><code>const x = 42</code></pre>