MDArea is a textarea
augmentation that adds a toolbar and keyboard shortcuts to any textarea to turn it into a lightweight markdown editor.
Install via NPM
npm install github:bemky/mdarea
import MDArea from 'mdarea';
new MDArea(document.querySelector('textarea'));
MDArea will also render it's own textarea if not given one. Instead it can take an object where each key is an attribute of the textarea.
import MDArea from 'mdarea';
const area = new MDArea({
name: "building[details]",
rows: 10,
class: "uniformInput"
});
document.append(area.el);
<textarea class="example-1" rows="8">Styled textarea</textarea>
.example-1 {
background: rgba(240, 237, 255, 1.000);
border-radius: 0.75em;
border-color: rgba(223, 199, 255, 1.000);
color: rgba(108, 51, 186, 1.000);
width: 100%;
padding: 2em;
}