Code Block
Display formatted source code with syntax highlighting.
Preview
Import
import { CodeBlock } from "@sigil-ui/components";Usage
<CodeBlock language="tsx" code={`import { Button } from "@sigil-ui/components";
export function CTA() {
return <Button>Ship it</Button>;
}`} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
code | string | — | Code content. |
language | string | — | Language label. |
showLineNumbers | boolean | true | Show line numbers. |
fileName | string | — | File name to display. |
Token integration
| CSS Variable | Purpose |
|---|---|
--s-radius-card | Radius card |
--s-border | Border |
--s-border-style | Border style |
--s-code-bg | Code bg |
--s-background | Background |
--s-code-font-family | Code font family |
--s-surface | Surface |
--s-text-muted | Text muted |
--s-text | Text |
--s-duration-fast | Duration fast |
--s-radius-sm | Radius sm |