Socket
Socket
Sign inDemoInstall

react-syntax-highlight

Package Overview
Dependencies
22
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-syntax-highlight

React component for syntax highlighting


Version published
Weekly downloads
787
decreased by-17.25%
Maintainers
1
Install size
1.54 MB
Created
Weekly downloads
 

Changelog

Source

15.3.1 (July 10, 2017)

  • fix build error with UglifyJs. issue#2

Readme

Source

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

Keywords

FAQs

Last updated on 10 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc