Code Block
A code block component that displays code with a background.
console.log('Hello, world!');Installation
1. Install the following dependencies:
Loading...
2. Add the following CSS variables to your CSS file:
Loading...
API Reference
Props list
| Prop | Type | Default | Example | Description |
|---|---|---|---|---|
code | string | - | const x = 1 | The code text to be displayed. Mutually exclusive with children. |
children | ReactNode | - | const x = 1 | The content to be displayed. Mutually exclusive with code. |
className | string | - | custom-class | Additional CSS classes to apply to the component. |
Note: code and children are mutually exclusive. If both are provided, code will be used.