react-prism-code
v1.0.6
Published
react component highlight code via prismjs
Downloads
37
Readme
react-prism-code
Installation
npm i react-prism-code
Usage
Block code
<Code lang="jsx">{`import { Code, InlineCode } from "react-prism-code";
import "prismjs/themes/prism-solarizedlight.css";
import "prismjs/components/prism-jsx"; // 默认只有 markup, css, clike and javascript
function Hello() {
return <h2>React typescript</h2>
}`}</Code>
output
import { Code, InlineCode } from "react-prism-code";
import "prismjs/themes/prism-solarizedlight.css";
import "prismjs/components/prism-jsx"; // 默认只有 markup, css, clike and javascript
function Hello() {
return <h2>React typescript</h2>
}