CodeBlock
Highlighted code on a well in Kaeso's syntax palette, in every common language: copy in the header or on hover, tabs, line numbers, collapse.
<div className="w-full">
<CodeBlock tabs={sdkSnippets({ baseUrl: "https://kaeso.example.com" })} />
</div>import { CodeBlock } from "@logicplanes/kaeso-ui";Props
codestringThe code to show.
collapseAfternumber = 24Collapse beyond this many lines (24 by default; 0 never collapses).
copyboolean = trueHide the copy circle.
highlightLinesnumber[] = []1-based line numbers to highlight.
langCodeLang = tsThe language to highlight (
tsby default), ortextto show the code plain.resolveCodeLangturns a Markdown fence name such aspyorshinto one.lineNumbersbooleanShows line numbers.
onTabChange((label: string) => void)Called with the label of the tab a person chooses, to remember it.
surface"well" | "plain" = wellOn a flat plate (
well) or on the panel itself (plain), such as inside a plate of your own.tabstringThe label of the tab to show, such as a language the reader chose before. A label the block lacks leaves its own choice.
tabsCodeTab[]Several versions: "Python · Node · curl", shown as pill tabs in the title bar, the chosen one raised on the plate as in a segmented control.
titleReactNodeA file name in the title bar.
wrapboolean | "phone" = falseLong lines wrap instead of scrolling sideways: code in a narrow column (a model's response). They break at spaces, never inside a flag or a name unless it is wider than the line.
phonewraps them only below 640px, with wrapped parts indented, and scrolls from there up.