CodeHighlight
Display source code with syntax highlighting, a title, and a copy button.
Basic usage
Pass the original text to code and choose a language for highlighting. Enable copyable to let readers copy the snippet and localize the labels as needed.
example.tsx
import { Button } from "@egcs/newui/actions";
<Button variant="soft">Save</Button>;API
Key props and defaults.
| Prop | Values and behavior | Default |
|---|---|---|
code | string | required |
language | text, bash, css, html, javascript, json, typescript, jsx, tsx | text |
title | string | — |
copyable | boolean | false |
copyLabel / copiedLabel / copyErrorLabel | string | — |