React-Code-Highlight
React component for code highlight base on hightlight.js.
Installation
npm install @youyouzone/react-code-highlight
Usage
import HighLighter from '@youyouzone/react-code-highlight';
<HighLighter />
Props:
- cb?: (content:string) => any - custom callback which accept input string.
- className?: string - custom class name.
- language?: string - highlight langeuage, powered by highlight.js. Default is 'javascript'.
- debounceTime?: number - debounce time of input change to invoke callback function. Default is 666 ms.
- content?: string - content in text box.
License
This project is licensed under ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
Contact