@youyouzone/react-code-highlight
TypeScript icon, indicating that this package has built-in type declarations

0.0.18 • Public • Published

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';

//use as a react component
<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

Contact

Package Sidebar

Install

npm i @youyouzone/react-code-highlight

Weekly Downloads

0

Version

0.0.18

License

none

Unpacked Size

1.7 MB

Total Files

12

Last publish

Collaborators

  • sumnus_eric