Code component

Code is

Usage

Markdown

You can use it in a markdown page with Markdown fence

markdown
```js let counter = 1 + 1 ```

yield:

js
let counter = 1 + 1

Programmatic Page

You can also install it or use it directly in a programmatic page

jsx
import Code from "@combostrap/interact/component/Code"; export default function myPage() { return ( <Code lang="markdown"> **Markdown** text </Code> ) }

yield:

markdown
**Markdown** text

Registration

The code component is registered to the pre html element.

Therefore, it will pretty print the code enclosed by <pre> element and Markdown fence.