WYSIWYG editor
React 5 WYSIWYG editor plugin
MDBootstrap WYSIWYG Editor is a lightweight plugin that enables rich text editing on your website.
Note: Read the API tab to find all available options and advanced customization
Basic example
MDBootstrap
WYSIWYG Editor
MDBootstrap.com © 2020
Features:
- Changing block type
- Text formatting (bold, italic, strikethrough, underline)
- Setting text color
- Setting color highlight
- Text aligning
- Creating a list (bulled or numbered)
- Increase/Decrease indent
- Inserting links
- Inserting pictures
- Insert horizontal line
- show HTML code
- Undo/Redo
Options:
- Translations
- Using your own color palette
- Disabling/enabling sections
Methods:
- Get HTML code from editor
Translations
MDBootstrap WYSIWYG Editor comes with the option that allows you to use custom translations for all text in the editor.
Custom colors
By default, MDBootstrap WYSIWYG Editor use color palette from MDBootstrap's text colors. If you need to use your custom colors, you can simply customize them to fit your project.
MDBootstrap
WYSIWYG Editor
MDBootstrap.com © 2020
Default Colors:
- #1266F1 - Primary
- #B23CFD - Secondary
- #00B74A - Success
- #F93154 - Danger
- #FFA900 - Warning
- #39C0ED - Info
- #FBFBFB - Light
- #262626 - Dark
Disable toolbar section
You can disable any section. The full list of sections can be found in the API tab.
Fixed toolbar
You can set fixedTop
to pin the toolbar to the top of the
screen. This option will be useful when there is a lot of text.
Fixed toolbar offset
Use the offsetTop
property to set the distance from the top
of the screen. This helps to avoid hiding the toolbar behind the navigation bar or other
element on the page.
WYSIWYG editor - API
Import
Properties
Wysiwyg
Name | Type | Default | Description | Example |
---|---|---|---|---|
colors
|
Array<string> |
|
Defines custom color palette |
<MDBWysiwyg colors={customColors} />
|
translations
|
TranslationsObject |
|
Defines custom texts |
<MDBWysiwyg translations={translations} />
|
disableStyles
|
boolean | false |
Set to false to disable the styles section |
<MDBWysiwyg disableStyles />
|
disableFormatting
|
boolean | false |
Set to false to disable the formatting section |
<MDBWysiwyg disableFormatting />
|
disableJustify
|
boolean | false |
Set to false to disable the justify section |
<MDBWysiwyg disableJustify />
|
disableLists
|
boolean | false |
Set to false to disable the lists section |
<MDBWysiwyg disableLists />
|
disableLinks
|
boolean | false |
Set to false to disable the links section |
<MDBWysiwyg disableLinks />
|
disableCode
|
boolean | false |
Set to false to disable the show code section |
<MDBWysiwyg disableCode />
|
disableUndoRedo
|
boolean | false |
Set to false to disable the undo-redo section |
<MDBWysiwyg disableUndoRedo />
|
fixedTop
|
boolean | false |
Set true to scrolls toolbar with the page until it reaches the top, then stays there |
<MDBWysiwyg fixedTop />
|
offsetTop
|
string | '0px' |
Set the distance in pixels from the top edge of the browser |
<MDBWysiwyg fixedTop offsetTop='90px' />
|
Advanced types
TranslationsObject
Events
Name | Type | Description |
---|---|---|
onChange
|
(value: string) => void | This event fires when the input changes. It returns the HTML code. |