Skip to content
Content

CodeBlock

A dark-themed syntax-highlighted code block with optional streaming mode, line numbers, copy button, and language label.

Preview:
1280px

Default

typescript
1const greeting = 'Hello, Stellix!';
2console.log(greeting);
2 linesUTF-8

Terminal

Terminal
$npm install @stellix/ui-web
added 42 packages in 3.2s
$npm run dev
ready - started server on http://localhost:3000

Multi-File

tsx3 lines
1export default function App() {
2 return <div>Hello</div>;
3}

Diff

11
1 const name = "Stellix";
2const version = "0.1.0";
3const version = "0.1.4";
4 export { name, version };
4 lines+1-1

Props

PropTypeDefaultDescription
codestring-Source code string to display.
languagestring'typescript'Language label shown in the header.
streamingbooleanfalseAnimate lines in one-by-one.
showLineNumbersbooleantrueToggle line number gutter.
onCopy() => void-Callback fired after copy button click.