Skip to content
R

react-highlight

React component for syntax highlighting

by akiranFree

#503in UI Libraries
0In stores

Description

react-highlight is a React component for syntax highlighting, built on the highlight.js library. You pass a code snippet as the children of…

Highlights

  • Syntax highlighting using highlight.js
  • Snippet highlighting by language class name
  • innerHTML mode for markdown-generated HTML
  • Choice of highlight.js theme
  • CodeSandbox example

Ratings & Reviews

No ratings yet

Be the first to rate react-highlight.

People also visit

R

react-markdown

React component to render markdown

UI Libraries
Launch
S

Sugar High

Super lightweight code syntax highlighter solution

Developer Tools
Launch
R

react-highlighter

Highlight select fragments of texts

UI Libraries
Launch
R

react-markdown

Render Markdown as React components

UI Libraries
Launch
N

ngx-highlightjs

Instant code highlighting, auto-detect language, super easy to use!

UI Libraries
Launch
R

React Textarea Code Editor

A simple code editor with syntax highlighting

Developer Tools
Launch

react-highlight FAQ

What is react-highlight?

A React component that colours code snippets using the highlight.js library.

Is it free?

Yes. The source is public on GitHub and listed as open source.

How do I pick a language?

Pass the code as the children of Highlight and set the language name as its className.

Is innerHTML safe?

The README warns that innerHTML should only be used with HTML from a trusted source, since the markup is rendered directly.

What are the best react-highlight alternatives?

Popular alternatives to react-highlight include react-markdown, react-highlighter and react-markdown. See all react-highlight alternatives

Developer Stuff

Badges