Code Block

A code block component that displays code with a background.

console.log('Hello, world!');

Installation

1. Install the following dependencies:

Loading...

bash

2. Add the following CSS variables to your CSS file:

Loading...

css

API Reference

Props list

PropTypeDefaultExampleDescription
codestring-const x = 1The code text to be displayed. Mutually exclusive with children.
childrenReactNode-const x = 1The content to be displayed. Mutually exclusive with code.
classNamestring-custom-classAdditional CSS classes to apply to the component.

Note: code and children are mutually exclusive. If both are provided, code will be used.