formula-editor

1.4.3 • Public • Published

Formula Editor

React based rich text editor for chemical formula

Demo page

Install

npm install formula-editor

Usage

import React, { useState } from 'react';
import FormulaEditor from 'formula-editor';

const FormulaEditorDemo = () => {

    const [editorValue, changeEditorValue] = useState('');

    return (
        <FormulaEditor 
            editorValue = {editorValue}
            onChange = {event => changeEditorValue(event.target.value)}
            placeholder = {'Start typing...'}
        />
    );
};

Available props

prop type description
editorValue string Content of the editor
placeholder string placeholder
onChange func called whenever innerHTML changes
onFocus func called whenever editor input gets focus
onBlur func called whenever editor input looses focus

Package Sidebar

Install

npm i formula-editor

Weekly Downloads

8

Version

1.4.3

License

GNU-GPL3.0

Unpacked Size

93.5 kB

Total Files

27

Last publish

Collaborators

  • pszakacscxn
  • zosimoscxn