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";//orimport { 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.
Name | Type | Default | Description |
---|---|---|---|
children | string | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
codeBlock | boolean | false | Determine 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. |
|