Code
A component for displaying inline code and code blocks with syntax highlighting.
Anatomy
Usage
Inline Code with Color Variants
You can use different color variants for emphasis:
Code Block with Syntax Highlighting
For larger code snippets, use the CodeBlock component:
Code Block Without Controls
You can disable the copy and fullscreen buttons:
Line Numbers
You can show line numbers in code blocks:
Code Props
An inline code component that provides syntax highlighting
| Prop | Type | Default |
|---|
Code.Block Props
A block code component with advanced features
| Prop | Type | Default |
|---|---|---|
children* | string | string[] | — |
isCopyable | boolean | — |
isExpandable | boolean | "true" |