Skip to content

Latest commit

Β 

History

History
52 lines (37 loc) Β· 2.33 KB

File metadata and controls

52 lines (37 loc) Β· 2.33 KB

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

npm install --save react-interactive-code-block

or

yarn add -D react-interactive-code-block

Usage

import CodeBlock from 'react-interactive-code-block'
import 'react-interactive-code-block/dist/index.css'

class Example extends Component {
  render() {
    return <CodeBlock
      message={'Interactive code block πŸ˜„'}
      typing
      speed={30}
      />
  }
}

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