PrismJS is required for code highlighting. Select the required languages from here and import the script as shown below
<html>
<head>
..
</head>
<body>
..
<script src="/prism.js" data-manual></script>
</body>
</html>
Import code styling from MumpUI
import 'mumpui/dist/styles/code.css'
Usage example
const snippet = `
function fun () {
return (
<div>Hello there!</div>
)
}`
<Code snippet={snippet} lang='jsx' />
Code
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
snippet | string | Code to be rendered |
lang | string | Check all available languages here |