@equinor/fusion-react-markdown
v0.3.2
Published
React component for editing morkdown language
Downloads
1,997
Readme
@equinor/fusion-react-markdown
Installation
npm install @equinor/fusion-react-markdown
Markdown Editor
Example
import { MarkdownEditor } from '@equinor/fusion-react-markdown';
<MarkdownEditor props>
**some** markdown *text*
</MarkdownEditor>
Usage
import { MarkdownEditor } from '@equinor/fusion-react-markdown';
const markdown = "# my heading here";
<MarkdownEditor value={markdown} onInput={(e)=>{console.log(e.target._value)}} change={console.log} />
Properties/Attributes
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| menuItems
| Array<MdMenuItemType>*
| ['strong', 'em', 'bullet_list', 'ordered_list']
| List of visible menu buttons
| minHeight
| string
| ''
| Markdown Editor minimum height
| value
| string
| ''
| Markdown editors value
| menuSize
| MenuSizes**
| 'medium'
| Size of the menu buttons
* Array<MdMenuItemType>
is list of showing visible menu buttons available as MdMenuItemType
.
type MdMenuItemType =
| 'strong'
| 'em'
| 'link'
| 'ordered_list'
| 'bullet_list'
| 'paragraph'
| 'blockquote'
| 'h1'
| 'h2'
| 'h3';
* MenuSizes
type imported from markdown component.
type MenuSizes = 'small' | 'medium' | 'large';