CodeBlock
Interactive
See CodeBlock in Storybook for every variant, with live controls.
A block of code with an optional header and a copy button.
import { CodeBlock } from "@kairosis/eidos";
<CodeBlock language="bash" code="npm install @kairosis/eidos" />;
Props
| Prop | Type | Default | Description |
|---|---|---|---|
code | string | — | Required. Rendered verbatim in a <pre> |
title | string | — | Header label; falls back to language |
language | string | — | Shown in the header when there's no title, e.g. "bash" |
copyable | boolean | true | Show the copy button |
Guidelines
languageis a label only — there's no syntax highlighting. Eidos keeps code monochrome.- The copy button confirms for 1.5s, then reverts. If the clipboard is unavailable (insecure origin, denied permission) nothing changes, rather than falsely confirming.
- Long lines scroll horizontally inside the block; they don't wrap or widen the layout.