1.0.0 • Published 5 years ago

react-decorative-editor v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Decorative Editor Component

A React text component that prints text in a code editor style window. Requires a version of React that supports Hooks.

NPM JavaScript Style Guide

Install

npm i react-decorative-editor

Usage

import React, { Component } from 'react'

import DecorativeEditor from 'react-decorative-editor'

class Example extends Component {
  render () {
    return (
      <DecorativeEditor 
        text={text} 
        darkMode={false}
        speed={85}
        cursor={true} 
        style={{maxWidth: '540px'}}
        />
    )
  }
}

Properties

PropertyTypeRequiredDefault valueDescription
textstringyesText to be displayed in the component. It is recommended to define text in a tilde for formatting.
darkModebooleannofalseUses dark theme if true, light theme otherwise.
speednumberno100Delay between each character being typed.
cursorbooleannofalseShows cursor as text is typed if true
styleobjectno{maxWidth: '540px'}Style object that is applied to the component's outermost div.

License

MIT © Carter McAlister