项目作者: mecm1993

项目描述 :
React Interactive Code Block component
高级语言: TypeScript
项目地址: git://github.com/mecm1993/react-interactive-code-block.git
创建时间: 2020-06-03T02:24:36Z
项目社区:https://github.com/mecm1993/react-interactive-code-block

开源协议:MIT License

下载


React Interactive Code Block Component

NPM JavaScript Style GuideLicense
Known VulnerabilitiesDownloads

Reusable interactive code block component for React. Here you can find a live demo.

Install

  1. npm install --save react-interactive-code-block
  2. or
  3. yarn add -D react-interactive-code-block

Usage

  1. import CodeBlock from 'react-interactive-code-block'
  2. import 'react-interactive-code-block/dist/index.css'
  3. class Example extends Component {
  4. render() {
  5. return <CodeBlock
  6. message={'Interactive code block 😄'}
  7. typing
  8. speed={30}
  9. ></CodeBlock>
  10. }
  11. }

Props

name type isRequired default description
message string N/A text shown in container
typing bool false typing effect
speed number -1 velocity of the typing effect, requires typing
icon string icon copy icon
className string undefined className of the container
style object {} custom styles

Examples

License

MIT) © mecm1993