Show source code in a standardized way. Want to display shell code snippets? try Snippet.
Basic inline codes.
Multi line code display.
Specify width manually, or other styles.
Specify the file name for the code block.
Show more than one code in the same block. Set the names in tabs and change the code when onTabChange is called.
The classic design style with a line border instead of a background.
| Attribute | Description | Type | Accepted values | Default |
|---|---|---|---|---|
| block | show code in pre | boolean | - | false |
| name | text displayed at the top of the code block | string | - | - |
| classic | display with classic style | boolean | - | false |
| tabs | names of the tabs, in place of name | string[] | - | [] |
| activeTab | index of the active tab | number | - | 0 |
| onTabChange | called with the index of the chosen tab | (index: number) => void | - | - |
| ... | native props | HTMLAttributes | 'className', ... | - |