15.3.1 • Published 7 years ago
react-syntax-highlight v15.3.1
react-highlight
React component for syntax highlighting
Change Log
Please see CHANGELOG.
Installation
$ npm install --save react react-dom # peer dependencies
$ npm install --save react-syntax-highlight
Compatibility: React 15.3.0+
This package is compatible with React 15.3.0 and higher. (https://github.com/facebook/prop-types#compatibility)
npm install --save react@^15.3.0 react-dom@^15.3.0
Usage
Highlight Theme
include a highlight.js theme in your HTML file
<link rel='stylesheet' href='https://highlightjs.org/static/demo/styles/default.css'/>
<link rel='stylesheet' href='https://highlightjs.org/static/demo/styles/xxxx.css'/>
or if you're using webpack
, you can require themes like is:
require('highlight.js/styles/default.css');
require('highlight.js/styles/xxxx.css');
see all the highlight theme here
React Part
const Highlight = require('react-syntax-highlight');
<Highlight lang={language} value={content} />
Example
License
MIT
15.3.1
7 years ago
15.3.1-alpha
7 years ago
15.3.0
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
8 years ago
0.0.1
8 years ago
0.0.0-alpha
8 years ago