Skip to content
r.

react-syntax-highlighter

react-syntax-highlighter/react-syntax-highlighter · Public GitHub repository

syntax highlighting component for react with prismjs or highlightjs ast using inline styles

Open project in RepoShelf

Open the project to try its demo, view the repository, or save it to your collection. Repository and demo actions use RepoShelf’s sign-in flow.

react-syntax-highlighter live demo screenshot
Captured from the live demo · 2026-11-02

About this project

Author-written excerpt from the project README.

Syntax highlighting component for React using the seriously super amazing lowlight and refractor by wooorm

For React Native you can use react-native-syntax-highlighter

There are other syntax highlighters for React out there so why use this one? The biggest reason is that all the others rely on triggering calls in componentDidMount and componentDidUpdate to highlight the code block and then insert it in the render function using dangerouslySetInnerHTML or just manually altering the DOM with native javascript. This utilizes a syntax tree to dynamically build the virtual dom which allows for updating only the changing DOM instead of completely overwriting it on any change, and because of this it also uses more idiomatic React and allows the use of pure…

Requirements and intended audience

Syntax highlighting component for React using the seriously super amazing lowlight and refractor by wooorm

Not recorded: account, external api key, paid service, self-hosting. Missing information does not mean there are no requirements.

Statements extracted from the author’s documentation · Checked 2026-10-26. Source: https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/README.md

Recorded maintenance information

Last recorded source update: 2026-10-08. Saved release: v16.1.2 · 2026-10-08. These dates do not guarantee ongoing maintenance.

Technologies
React
Licence
MIT. Generally permits modification and commercial use, subject to the licence’s notices and conditions.
Demo check
A public page loaded on 2026-11-16. This does not test every feature.

Browse related categories