Shiki Code Block
A code block component that uses Shiki to highlight code.
Loading...
Installation
1. Follow the links to install required rlx packages
2. Install the following dependencies
Loading...
API Reference
Props list
| Prop | Type | Default | Example | Description |
|---|---|---|---|---|
code | string | - | console.log("Hello, world!"); | The code to be highlighted. |
lang | BundledLanguage | - | "tsx" | Supported languagesFull list |
className | string | undefined | - | "bg-red-500" | The class name to be applied to the code block. |
Data Slots
List of data slots
Loading...
| Slot | Description |
|---|---|
shiki-code-block-root | The root element of the code block. |
shiki-code-block-container | The container element of the code block. |
shiki-code-block-content | The content element of the code block. |
shiki-code-block-code | The code element of the code block. |
shiki-code-block-lang | The language of the code block. |
shiki-code-block-copy-button | The copy button element of the code block. |