{"repo":"rexxars/react-lowlight","free":true,"listed":false,"github":"https://github.com/rexxars/react-lowlight","clone":"git clone https://github.com/rexxars/react-lowlight.git","description":"Syntax highlighter for React, utilizing VDOM for efficient updates","language":"JavaScript","stars":114,"topics":["react","syntax-highlighting","syntax"],"license":"MIT","category":"ui-components","readme_excerpt":"react-lowlight Syntax highlighter for React, utilizing VDOM for efficient updates - Thin wrapper on top of lowlight (Syntax highlighting using VDOM) - Lowlight uses highlight.js under the hood, thus supports all the same syntaxes - About 18KB (6.5KB gziped) when using a single language syntax. Each language tends to pack on another 2KB uncompressed. Feel free to check out a super-simple demo. Installation This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm: You'll also need to provide the highlight.js language definitions you want to use. We don't bundle these in order to not bloat the component with unused definitions. Usage Note that the language property is optional, but significantly increases the speed and reliability of rendering. If you want to load multiple languages at once Imports react-lowlight/common and react-lowlight/all are re-exports from lowlight. See here https://github.com/wooorm/lowlight#syntaxes for more details Styling Stylesheets are not automatically handled for you - but there is a bunch of premade styles for highlight.js which you can simply drop in and they'll \"just work\". You can either grab these from the source, or pull them in using a CSS loader - whatever works best for you. They're also available on unpkg: If you have a bundler that supports CSS imports, you can do something like the following: Note that when using the markers feature, there is an additional class name called hljs-marker which is not defin","default_branch":null,"files":null,"tree":[],"storefront":"/r/rexxars","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rexxars/react-lowlight/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}