# @multiprova/multiprova-mathquill

> React component wrapper for Mathquill

Latest version **1.0.3** (published 2026-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @multiprova/multiprova-mathquill
pnpm add @multiprova/multiprova-mathquill
yarn add @multiprova/multiprova-mathquill
bun add @multiprova/multiprova-mathquill
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-07-11 |
| First published | 2026-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Multiprova |
| Maintainers | system.multiprova, rexmedeiros, gustavoleitao, fabianapduarte |

## Links

- npm: https://www.npmjs.com/package/@multiprova/multiprova-mathquill
- Repository: https://gitlab.com/tapioca/multiprova/multiprova-mathquill
- Homepage: https://gitlab.com/tapioca/multiprova/multiprova-mathquill#readme
- Issues: https://gitlab.com/tapioca/multiprova/multiprova-mathquill/issues
- npm.io page: https://npm.io/package/@multiprova/multiprova-mathquill

## Recent versions

- 1.0.3 (latest) — 2026-07-11
- 1.0.0 — 2026-07-11

## README

# Componente React personalizado do [Mathquill](http://mathquill.com/) 

### Build

1. Usar o seguinte babelrc:

```javascript
{
  "presets": ["@babel/preset-env", "@babel/preset-react"]
}
```

2. Executar o comando:  
   `npm run build`

3. Remover os presets do item 1 para que o build seja importado corretamente.

# Documentação

### Editable Math Field

```javascript
import React, { useState } from 'react'
import { addStyles, EditableMathField } from 'react-mathquill'

// inserts the required css to the <head> block.
// you can skip this, if you want to do that by yourself.
addStyles()

const EditableMathExample = () => {
  const [latex, setLatex] = useState('\\frac{1}{\\sqrt{2}}\\cdot 2')

  return (
    <div>
      <EditableMathField
        latex={latex}
        onChange={(mathField) => {
          setLatex(mathField.latex())
        }}
      />
      <p>{latex}</p>
    </div>
  )
}
```

### Static Math Field

```javascript
import React from 'react'
import { addStyles, StaticMathField } from 'react-mathquill'

// inserts the required css to the <head> block.
// you can skip this, if you want to do that by yourself.
addStyles()

const StaticMathExample = () => (
  <StaticMathField>{'\\frac{1}{\\sqrt{2}}\\cdot 2'}</StaticMathField>
)
```

## 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](http://docs.mathquill.com/en/latest/Getting_Started/)

## EditableMathField (React Element)

> Wrapper for [Mathquill MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)

### Props

- latex: String - _Initial latex value for the input field_
- config: Object - _A mathquill [config](http://docs.mathquill.com/en/latest/Config/) object_
- onChange([mathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)) - _A function that is called on change events._
- mathquillDidMount([mathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)) - _A function that is called when the Mathquill element is initalized._

Other props will be passed to the wrapping span element, this can be useful for custom _classNames_ or _styles_

## StaticMathField (React Element)

> Wrapper for [Mathquill StaticField](http://docs.mathquill.com/en/latest/Api_Methods/#mqstaticmathhtml_element)

### Props

- children: String - _A string of latex to render statically on the page_

Other props will be passed to the wrapping span element, this can be useful for custom _classNames_ or _styles_

---
_Source: https://npm.io/package/@multiprova/multiprova-mathquill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
