1.0.5 • Published 4 years ago
@cpfarher/react-highlightjs v1.0.5
@cpfarher/react-highlightjs
A wrapper Highlight.js component for React. I take the ideas from react-highlight.js npm package but without a lot of dependencies and following the KISS principle
Installation NPM
npm install react-highlight.js --save
Choose a highlight.js theme and make sure it's included:
import '@cpfarher/react-highlightjs/src/highlight-styles/railscasts.css';
And then use react-highlightjs to display your text like so:
import Highlight from '@cpfarher/react-highlightjs';
<Highlight language={language} showCopy={true}>
{content}
</Highlight>
License
@cparher/react-highlightjs is available under the MIT License.