Home > front end >  How to create a code box with HTML and React
How to create a code box with HTML and React

Time:07-03

I'm doing my portfolio and I want to create a box like this:

enter image description here

A box that colorize the text with a programming language. Is there any library to do this?

CodePudding user response:

You can use react-highlight.js:

import Highlight from 'react-highlight.js';

<Highlight language={language}>
  {content}
</Highlight>
<link rel='stylesheet' href='https://highlightjs.org/static/demo/styles/railscasts.css'/>

  • Related