Usage
Examples
With a title
useHistory()
Collapsable
Size
sm
md
lg
Props
| Prop | Type | Default | Description |
|---|---|---|---|
code* | string | - | The code string to display. |
language | Language | 'text' | Programming language for syntax highlighting. |
title | string | - | Title to display above the code block. |
file | string | - | File name to display above the code block. |
size | 'sm' | 'md' | 'lg' | 'md' | Size of the code block. |
showLineNumbers | boolean | true | Whether to show line numbers. |
copyToClipboard | boolean | true | Whether to show the copy button. |
highlight | string | - | Line numbers to highlight (e.g., '1,3-5'). |
maxHeight | string | - | Maximum height of the code block. |
isCollapsable | boolean | false | Whether the code block can be collapsed. |
isCollapsed | boolean | false | Whether the code block starts collapsed. |
explainWithAi | boolean | true | Whether to show the AI explain button. |