Skip to main content

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

PropTypeDefaultDescription
codestringRequired. Rendered verbatim in a <pre>
titlestringHeader label; falls back to language
languagestringShown in the header when there's no title, e.g. "bash"
copyablebooleantrueShow the copy button

Guidelines

  • language is 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.