Mathquill
React component wrapper forThe original version of library is here! viktorstrate/react-mathquill
Example
Link to an example
/** * Editable component */ // inserts the required css to the <head> block.// You can skip this, if you want to do that by your self. Component { thisstate = latex: '\\frac{1}{\\sqrt{2}}\\cdot 2' } { return <EditableMathQuill latex=thisstatelatex // Initial latex value for the input field onChange= { // Called everytime the input changes this } /> }
/** * Static component */ Component { thisstate = latex: '\\frac{1}{\\sqrt{2}}\\cdot 2' } { return <StaticMathQuill latex=thisstatelatex // Initial latex value for the input field /> }
Documentation
MathQuillComponent (React Element)
Props
- latex: String - Initial latex value for the input field
- config: Object - A mathquill config object
- onChange(mathField) - A function that is called on change events.
- mathquillDidMount(mathField) - A function that is called when the Mathquill element is initalized.
Other props will be passed to the wrapping element, this can be useful for custom classNames or styles
addStyles (function)
This function, when called, will append a <style id="react-mathquill-styles">
tag to the <head>
of the document.
The style tag includes all the required styles for Mathquill to work.
This function is not necessary, provided you include the styles in another way. See Mathquill Docs - Download and Load