Code

Shows source code in a standardized way.

Inline Code

This is a simple Inline Code.

CodeBlock

You can achieve a multi line code display via codeBlock property.

npm install @sonnat/ui
yarn add @sonnat/ui

API

Learn more about the properties and the customization points.

Usage

import Code from "@sonnat/ui/Code";
//or
import { Code } from "@sonnat/ui";

Properties

Note that the documentation avoids mentioning all the native props (there are a lot) in this section of the components.

Code Properties
NameTypeDefaultDescription
childrenstring-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
codeBlockbooleanfalseDetermine whether the component is code-block or not.
If true, the component will be rendered as a <pre> element. otherwise, the component will be rendered as a <code> element.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.