# react-syntax-highlighter/react-syntax-highlighter

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

Repository: https://github.com/react-syntax-highlighter/react-syntax-highlighter
Canonical: https://ross.abutalabs.com/products/react-syntax-highlighter
Homepage: http://react-syntax-highlighter.github.io/react-syntax-highlighter/demo/
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-02-26T22:38:37+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 69, release rhythm 72, longevity 100
- inputs: {"age_days": 3871, "days_push": 188, "days_rel": 188, "gap_med": 3, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4674, forks 315 (observed 2026-08-28T04:08:56.671361+00:00)

## What it is
A React component for syntax highlighting code blocks, built on lowlight/refractor (highlight.js and Prism grammars) using an AST to build the virtual DOM. All styles are JavaScript-based inline styles, so no external stylesheets are required.

## Use cases
- display highlighted code snippets in a react app
- syntax highlighting component for react without css stylesheets
- render markdown code blocks with prism or highlight.js themes
- highlight code in react native
- customize code block colors with inline styles

## When to choose
- you want idiomatic React rendering via virtual DOM instead of dangerouslySetInnerHTML
- you need bundled JS-based themes with no stylesheet tags
- you want both highlight.js and Prism language support in one component

## When to avoid
- you are not using React
- you prefer CSS-class-based highlighting with a tiny bundle
- you need server-side highlighting outside of React components

## Facets
- artifact type: library
- maturity: active
- function: ui-components, frontend-framework
- domain: frontend, web-development, developer-tools
- platform: browser, cross-platform
- tags: react, syntax-highlighting, prismjs, highlightjs, inline-styles, code-display, nodejs

## Member repositories
- react-syntax-highlighter/react-syntax-highlighter (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:56.671361+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:22.234606+00:00, confidence not recorded.
  - readme: https://github.com/react-syntax-highlighter/react-syntax-highlighter (fetched 2026-08-28T04:08:56.671361+00:00, sha 6cd2040a1b4f)
  - homepage: http://react-syntax-highlighter.github.io/react-syntax-highlighter/demo/ (fetched 2026-08-29T09:03:50.448363+00:00, sha 3219ea5ae71e)
  - registry_npm: https://registry.npmjs.org/react-syntax-highlighter (fetched 2026-08-29T09:03:50.457899+00:00, sha 1ccf17ffcec1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
