Code

Show source code in a standardized way. Want to display shell code snippets? try Snippet.

General

Basic inline codes.

Code Block

Multi line code display.

width

Specify width manually, or other styles.

name

Specify the file name for the code block.

classic style

The classic design style with a line border instead of a background.

APIs

Code.Props

AttributeDescriptionTypeAccepted valuesDefault
blockshow code in preboolean-false
nametext displayed at the top of the code blockstring--
classicdisplay with classic styleboolean-false
...native propsHTMLAttributes'className', ...-