Code Block
Adding code blocks to your docs
Display code blocks, added by default.
- Syntax highlighting powered by Shiki
- Copy button
- Custom titles and icons
Usage
Wrap the pre element in <CodeBlock />
, which acts as the wrapper of code block.
See Markdown for usages.
Keep Background
Use the background color generated by Shiki (the Rehype Code plugin).
Icons
Specify a custom icon by passing an icon
prop to CodeBlock
component.
By default, the icon will be injected by the custom Shiki transformer.
Edit on GitHub
Last updated on