Code
Code
Use fenced code blocks or Code for syntax-highlighted examples. Both render the standard Basecoat Code Block, with an optional title and copy action.
Usage
```bash title="Terminal"
npm install reallysimpledocs
```In MDX, use Code when the source comes from a string or the header needs custom actions:
<Code title="Terminal" lang="bash" code="npm run build">
<a slot="actions" href="/quickstart/" class="btn" data-variant="ghost" data-size="xs">Quickstart</a>
</Code>Options
The actions slot accepts buttons or links. With a title, actions appear in the header. Otherwise, they float above the code. Custom actions supply their own behavior.
Examples
Default
npm install reallysimpledocs```bash
npm install reallysimpledocs
```With title and actions
npm run build<Code title="Terminal" lang="bash" code="npm run build">
<a slot="actions" href="/quickstart/" class="btn" data-variant="ghost" data-size="xs">Quickstart</a>
</Code>Multiple examples
Compose ordinary tabs with code blocks:
npm install reallysimpledocspnpm add reallysimpledocs<Tabs>
<Tab title="npm">
```bash
npm install reallysimpledocs
```
</Tab>
<Tab title="pnpm">
```bash
pnpm add reallysimpledocs
```
</Tab>
</Tabs>