Skip to main content

Code API

Returns code snippet representation

added in 1.5.0

Import​

import Code from "@tlgr/fmt/react/code";
// or
import { Code } from "@tlgr/fmt/react";

Props​

NameTypeDefaultDescription
childrennodeThe content of the component.
typestringinlineComponent render type. Can be "inline" or "multiline"
langstringlanguage code. E.g. python, py, js