Skip to content

ChemAxon/formula-editor

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •