- Installation Guides
- Browser Support
- Languages Support
- Shortcuts
- Activation
- Examples
- Customize the Editor
- Use-cases
- Plugins
- APIs
- Development Frameworks
- Server Integrations
- Server SDKs
- Migration Guides
- Changelog
- Tutorials
- Froala Docs
- /
- Options
Options
Anchor
anchorEditButtons
| Type: | Array |
| Default: | ['anchorEdit', 'anchorRemove'] |
| Plugin: | link_to_anchor.min.js |
The list of buttons that appear in the edit anchor popup, when clicking on an existing link from the editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
anchorEditButtons: ['anchorEdit', 'anchorRemove']
});
Char Counter
charCounterCount
| Type: | Boolean |
| Default: | true |
| Plugin: | char_counter.min.js |
Enables or disables the display of the character counter.
CODE EXAMPLE
new FroalaEditor('.selector', {
charCounterCount: false
});
charCounterMax
| Type: | Number |
| Default: | -1 |
| Plugin: | char_counter.min.js |
The maximum number of characters allowed to be inserted into the rich text editor. -1 means that there is not limit set.
CODE EXAMPLE
new FroalaEditor('.selector', {
charCounterMax: 140
});
Char Counter
charCounterCount
| Type: | Boolean |
| Default: | true |
| Plugin: | char_counter.min.js |
Enables or disables the display of the character counter.
CODE EXAMPLE
new FroalaEditor('.selector', {
charCounterCount: false
});
charCounterMax
| Type: | Number |
| Default: | -1 |
| Plugin: | char_counter.min.js |
The maximum number of characters allowed to be inserted into the rich text editor. -1 means that there is not limit set.
CODE EXAMPLE
new FroalaEditor('.selector', {
charCounterMax: 140
});
Code Beautifier
codeBeautifierOptions
| Type: | Object |
| Default: |
{
end_with_newline: true,
indent_inner_html: true,
extra_liners: "['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'pre', 'ul', 'ol', 'table', 'dl']",
brace_style: 'expand',
indent_char: '\t',
indent_size: 1,
wrap_line_length: 0
} |
| Plugin: | code_beautifier.min.js |
Specify the options for Code Beautifier.
CODE EXAMPLE
new FroalaEditor('.selector', {
codeBeautifierOptions: {
end_with_newline: true,
indent_inner_html: true,
extra_liners: "['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'pre', 'ul', 'ol', 'table', 'dl']",
brace_style: 'expand',
indent_char: ' ',
indent_size: 4,
wrap_line_length: 0
}
});
Code Snippet
codeSnippetDefaultLanguage
| Type: | string |
| Default: |
['JavaScript'] |
| Plugin: | code_snippet.min.js |
Sets the default language selected when opening the code snippet modal.
CODE EXAMPLE
new FroalaEditor('.selector', {
codeSnippetDefaultLanguage: 'Python'
});
codeSnippetLanguage
| Type: | { [key: string]: string } |
| Default: |
{
'JavaScript': 'javascript',
'TypeScript': 'typescript',
'Python': 'python',
'HTML': 'html',
'CSS': 'css',
'Java': 'java',
'C++': 'cpp',
'SQL': 'sql',
'JSON': 'json'
}
|
| Plugin: | code_snippet.min.js |
Defines the available programming languages in the code snippet modal.
CODE EXAMPLE
new FroalaEditor('.selector', {
codeSnippetLanguage: {
'JavaScript': 'javascript',
'Python': 'python',
'Ruby': 'ruby',
'Go': 'go',
'Rust': 'rust'
}
});
Code View
codeMirror
| Type: | Object |
| Default: | window.CodeMirror |
| Plugin: | code_view.min.js |
Disable or enable using the CodeMirror library to highlight the HTML view.
Note: This option requires the CodeMirror library to be included.
CODE EXAMPLE
new FroalaEditor('.selector', {
codeMirror: false
});
codeMirrorOptions
| Type: | Object |
| Default: | {
indentWithTabs: true,
lineNumbers: true,
lineWrapping: true,
mode: 'text/html',
tabMode: 'indent',
tabSize: 2
} |
| Plugin: | code_view.min.js |
Specify the options for CodeMirror.
CODE EXAMPLE
new FroalaEditor('.selector', {
codeMirrorOptions: {
tabSize: 4
}
});
codeViewKeepActiveButtons
| Type: | Array |
| Default: | ["fullscreen"] |
| Plugin: | code_view.min.js |
A list of buttons to keep active while editor is in Code View mode.
CODE EXAMPLE
new FroalaEditor('.selector', {
codeViewKeepActiveButtons: []
});
Colors
colorsBackground
| Type: | Array |
| Default: |
[ '#61BD6D', '#1ABC9C', '#54ACD2', '#2C82C9', '#9365B8', '#475577', '#CCCCCC', '#41A85F', '#00A885', '#3D8EB9', '#2969B0', '#553982', '#28324E', '#000000', '#F7DA64', '#FBA026', '#EB6B56', '#E25041', '#A38F84', '#EFEFEF', '#FFFFFF', '#FAC51C', '#F37934', '#D14841', '#B8312F', '#7C706B', '#D1D5D8', 'REMOVE' ] |
| Plugin: | colors.min.js |
An array of colors used in the colors popup for background. Passing REMOVE as a value in the array will display the Clear Formatting button for colors.
CODE EXAMPLE
new FroalaEditor('.selector', {
colorsBackground: [
'#61BD6D',
'#1ABC9C',
'#54ACD2',
'REMOVE'
]
});
colorsButtons
| Type: | Array |
| Default: | ["colorsBack", "|", "-"] |
| Plugin: | colors.min.js |
Set the buttons the colors popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
colorsButtons: [
"colorsBack",
"|",
"-"
]
});
colorsHEXInput
| Type: | Boolean |
| Default: | true |
| Plugin: | colors.min.js |
Show HEX input to choose custom color.
CODE EXAMPLE
new FroalaEditor('.selector', {
colorsHEXInput: false
});
colorsStep
| Type: | Number |
| Default: | 7 |
| Plugin: | colors.min.js |
The number of colors displayed on a line in the colors popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
colorsStep: 14
});
colorsText
| Type: | Array |
| Default: |
[ '#61BD6D', '#1ABC9C', '#54ACD2', '#2C82C9', '#9365B8', '#475577', '#CCCCCC', '#41A85F', '#00A885', '#3D8EB9', '#2969B0', '#553982', '#28324E', '#000000', '#F7DA64', '#FBA026', '#EB6B56', '#E25041', '#A38F84', '#EFEFEF', '#FFFFFF', '#FAC51C', '#F37934', '#D14841', '#B8312F', '#7C706B', '#D1D5D8', 'REMOVE' ] |
| Plugin: | colors.min.js |
An array of colors used in the colors popup for text. Passing REMOVE as a value in the array will display the Clear Formatting button for colors.
CODE EXAMPLE
new FroalaEditor('.selector', {
colorsText: [
'#61BD6D',
'#1ABC9C',
'#54ACD2',
'REMOVE'
]
});
Configs
cleanReduntantStyleOnGet
| Type: | Boolean |
| Default: |
false |
Whenever you are performing an editor.html.get(), set this to true if you want to remove all the redundant style from the parent to child elements.
CODE EXAMPLE
new FroalaEditor('.selector', {
cleanReduntantStyleOnGet: true
});
clearFormatOnEnterNewLine
| Type: | Boolean |
| Default: |
false |
When starting a new line after pasting content, set this flag to true if you donโt want to retain the parent styles.
CODE EXAMPLE
new FroalaEditor('.selector', {
clearFormatOnEnterNewLine: true
});
Draggable
dragInline
| Type: | Boolean |
| Default: |
true |
| Plugin: | draggable.min.js |
Specifies how the dragged elements should be placed in the new position. When this option is disabled, the dragged elements are placed between block tags and not inside them.
CODE EXAMPLE
new FroalaEditor('.selector', {
dragInline: false
});
Embedly
embedlyKey
| Type: | String |
| Default: | null |
| Plugin: | embedly.min.js |
Your key from Embed.ly to remove the "Powered By Banner".
CODE EXAMPLE
new FroalaEditor('.selector', {
embedlyKey: XXXXXXXXXXXXXXXXXXXXXX
});
embedlyEditButtons
| Type: | Array |
| Default: | ['embedlyRemove'] |
| Plugin: | video.min.js |
The buttons that appear in the edit Embed.ly popup, when an embedded object is selected.
CODE EXAMPLE
new FroalaEditor('.selector', {
embedlyEditButtons: []
});
embedlyInsertButtons
| Type: | Array |
| Default: | ['embedlyBack', '|'] |
| Plugin: | embedly.min.js |
The buttons that appear in the insert Embed.ly popup, when an embeded object is inserted into the WYSIWYG editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
embedlyInsertButtons:
'embedlyBack',
'|'
]
});
embedlyScriptPath
| Type: | String |
| Default: | 'https://cdn.embedly.com/widgets/platform.js' |
| Plugin: | embedly.min.js |
The default script path for the Embedly JS.
CODE EXAMPLE
new FroalaEditor('.selector', {
embedlyScriptPath: 'https://cdn.embedly.com/widgets/platform.js'
});
Emoticons
emoticonsButtons
| Type: | Array |
| Default: | ["emoticonsBack", "|"] |
| Plugin: | emoticons.min.js |
Buttons set for emoticons popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
emoticonsButtons: [
"emoticonsBack",
"|"
]
});
emoticonsSet
| Type: | Array |
| Default: |
[
{code: '1f600', desc: 'Grinning face'},
{code: '1f601', desc: 'Grinning face with smiling eyes'},
{code: '1f602', desc: 'Face with tears of joy'},
{code: '1f603', desc: 'Smiling face with open mouth'},
{code: '1f604', desc: 'Smiling face with open mouth and smiling eyes'},
{code: '1f605', desc: 'Smiling face with open mouth and cold sweat'},
{code: '1f606', desc: 'Smiling face with open mouth and tightly-closed eyes'},
{code: '1f607', desc: 'Smiling face with halo'},
{code: '1f608', desc: 'Smiling face with horns'},
{code: '1f609', desc: 'Winking face'},
{code: '1f60a', desc: 'Smiling face with smiling eyes'},
{code: '1f60b', desc: 'Face savoring delicious food'},
{code: '1f60c', desc: 'Relieved face'},
{code: '1f60d', desc: 'Smiling face with heart-shaped eyes'},
{code: '1f60e', desc: 'Smiling face with sunglasses'},
{code: '1f60f', desc: 'Smirking face'},
{code: '1f610', desc: 'Neutral face'},
{code: '1f611', desc: 'Expressionless face'},
{code: '1f612', desc: 'Unamused face'},
{code: '1f613', desc: 'Face with cold sweat'},
{code: '1f614', desc: 'Pensive face'},
{code: '1f615', desc: 'Confused face'},
{code: '1f616', desc: 'Confounded face'},
{code: '1f617', desc: 'Kissing face'},
{code: '1f618', desc: 'Face throwing a kiss'},
{code: '1f619', desc: 'Kissing face with smiling eyes'},
{code: '1f61a', desc: 'Kissing face with closed eyes'},
{code: '1f61b', desc: 'Face with stuck out tongue'},
{code: '1f61c', desc: 'Face with stuck out tongue and winking eye'},
{code: '1f61d', desc: 'Face with stuck out tongue and tightly-closed eyes'},
{code: '1f61e', desc: 'Disappointed face'},
{code: '1f61f', desc: 'Worried face'},
{code: '1f620', desc: 'Angry face'},
{code: '1f621', desc: 'Pouting face'},
{code: '1f622', desc: 'Crying face'},
{code: '1f623', desc: 'Persevering face'},
{code: '1f624', desc: 'Face with look of triumph'},
{code: '1f625', desc: 'Disappointed but relieved face'},
{code: '1f626', desc: 'Frowning face with open mouth'},
{code: '1f627', desc: 'Anguished face'},
{code: '1f628', desc: 'Fearful face'},
{code: '1f629', desc: 'Weary face'},
{code: '1f62a', desc: 'Sleepy face'},
{code: '1f62b', desc: 'Tired face'},
{code: '1f62c', desc: 'Grimacing face'},
{code: '1f62d', desc: 'Loudly crying face'},
{code: '1f62e', desc: 'Face with open mouth'},
{code: '1f62f', desc: 'Hushed face'},
{code: '1f630', desc: 'Face with open mouth and cold sweat'},
{code: '1f631', desc: 'Face screaming in fear'},
{code: '1f632', desc: 'Astonished face'},
{code: '1f633', desc: 'Flushed face'},
{code: '1f634', desc: 'Sleeping face'},
{code: '1f635', desc: 'Dizzy face'},
{code: '1f636', desc: 'Face without mouth'},
{code: '1f637', desc: 'Face with medical mask'}
] |
| Plugin: | emoticons.min.js |
An array of emoticons available in the insert emoticon popup. Each emoticon is defined by an Object containing the code and description of each emoticon.
CODE EXAMPLE
new FroalaEditor('.selector', {
emoticonsSet: [
{code: '1f630', desc: 'Face with open mouth and cold sweat'},
{code: '1f631', desc: 'Face screaming in fear'},
{code: '1f632', desc: 'Astonished face'},
{code: '1f633', desc: 'Flushed face'},
{code: '1f634', desc: 'Sleeping face'},
{code: '1f635', desc: 'Dizzy face'},
{code: '1f636', desc: 'Face without mouth'},
{code: '1f637', desc: 'Face with medical mask'}
]
});
emoticonsUseImage
| Type: | Boolean |
| Default: |
true |
| Plugin: | emoticons.min.js |
Use EmojiOne svg images instead of Unicode text.
CODE EXAMPLE
new FroalaEditor('.selector', {
emoticonsUseImage: false
});
emoticonsStep
| Type: | Number |
| Default: | 8 |
| Plugin: | emoticons.min.js |
The number of emoticons displayed on a line in the insert emoticon popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
emoticonsStep: 10
});
Entities
entities
| Type: | String |
| Default: | '"'¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿŒœŠšŸƒˆ˜ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ   ‌‍‎‏–—‘’‚“”„†‡•…‰′″‹›‾⁄€ℑ℘ℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋⟨⟩◊♠♣♥♦' |
| Plugin: | entities.min.js |
A list with the characters that are reserved in HTML. More details about using entities in HTML can be found on W3C and Wikipedia.
CODE EXAMPLE
new FroalaEditor('.selector', {
entities: '"'¡¢£¤¥¦'
});
Export to Word
wordExportFileName
| Type: | String |
| Default: | 'NameOfTheFile' |
| Plugin: | export_to_word.min.js |
Specifies the name of the file to be exported. The plugin automatically handles the file extension, so only the base name needs to be provided.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordExportFileName: "myFile"
});
File
fileAllowedTypes
| Type: | Array |
| Default: | ['*'] |
| Plugin: | file.min.js |
The list of file types that are allowed to be uploaded. Although this will restrict uploading other types of files, we strongly recommend you to check the file type on the server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileAllowedTypes: [
'application/pdf',
'application/msword'
]
});
fileInsertButtons
| Type: | Array |
| Default: | ['fileBack', '|'] |
| Plugin: | file.min.js |
The list of buttons that appear in the insert file popup, when inserting a new file into the WYSIWYG editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileInsertButtons: []
});
fileMaxSize
| Type: | Number |
| Default: | 1024 * 1024 * 10 |
| Plugin: | file.min.js |
The maximum file size allowed on upload in bytes. The default value is 10MB. Although this makes an additional check before uploading the file, it is highly recommended to check file size on your server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileMaxSize: 1024 * 1024 * 3
});
fileUpload
| Type: | Boolean |
| Default: | true |
| Plugin: | file.min.js |
Enable or disable file upload.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUpload: false
});
fileUploadMethod
| Type: | String |
| Default: | 'POST' |
| Plugin: | file.min.js |
The HTTP file upload request type.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUploadMethod: 'PUT'
});
fileUploadParam
| Type: | String |
| Default: | 'file' |
| Plugin: | file.min.js |
Customize the name of the parameter that contains the file in the upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUploadParam: 'file_name'
});
fileUploadParams
| Type: | Object |
| Default: | {} |
| Plugin: | file.min.js |
Pass additional parameters to the file upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUploadParams: {
id: 'my_editor'
}
});
fileUploadToS3
| Type: | Object |
| Default: | false |
| Plugin: | file.min.js |
Set the options for file upload to S3. All the fields from the example below are required. Also make sure that you have enabled CORS on Amazon.
Note: uploadURL property can be used instead of bucket and region properties to specify a custom URL from Amazon where to upload the image.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUploadToS3: {
bucket: 'editor',
region: 's3',
keyStart: 'uploads/',
params: {
acl: 'public-read', // ACL according to Amazon Documentation.
AWSAccessKeyId: 'ACCESS_KEY', // Access Key from Amazon.
policy: 'POLICY_STRING', // Policy string computed in the backend.
signature: '', // Signature computed in the backend.
// If you are using Amazon Signature V4, the followings should be used instead.
// "X-Amz-Credential": "...",
// "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
// "X-Amz-Date": "...",
// Policy: "...", //
// "X-Amz-Signature": "", // computed in backend
}
}
});
fileUploadURL
| Type: | String |
| Default: | 'http://i.awsstage.froala.com/upload' |
| Plugin: | file.min.js |
The URL where the files uploaded by the user are saved. When a file is uploaded, the editor sends the file to the server through a HTTP request. The server should process the data from the file parameter of the request and return a JSON object containing a link field with the link to the uploaded file. More details can be found in the File Upload concept article.
E.g. {link: 'path/to/file.pdf'}.
Note 1: By default, the files are stored on our servers, but if you want to have full control over them, you should consider implementing the upload on your server. The files stored on our servers, may be deleted at any time without any notice.
Note 2: If the domain where the file is saved is not the same with the one where the editor is running, you may need to enable requestWithCORS option and make specific customizations on the server. For more information please refer to Cross-origin resource sharing.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUploadURL: '/upload_file'
});
fileUseSelectedText
| Type: | Boolean |
| Default: | false |
| Plugin: | file.min.js |
Enables using the file's name instead of the selected text when a file is inserted.
CODE EXAMPLE
new FroalaEditor('.selector', {
fileUseSelectedText: true
});
Filestack
filestackOptions.filestackAPI
| Type: | String |
| Default: |
"" |
| Plugin: | filestack.min.js |
Your Filestack API key. To get your Filestack API, create a Filestack account.
CODE EXAMPLE
new FroalaEditor('.selector', {
filestackOptions {
filestackAPI: 'AAAaaaBBcc232uuuxsd',
}
});
filestackOptions.pickerOptions
| Type: | Object |
| Default: |
{}
|
| Plugin: | filestack.min.js |
Filestack File Picker configuration. See available options.
CODE EXAMPLE
new FroalaEditor('.selector', {
filestackOptions {
pickerOptions: {
fromSources: [
'local_file_system',
'imagesearch',
'url',
'googledrive',
'facebook',
'instagram',
],
},
}
});
filestackOptions.uploadToFilestackOnly
| Type: | Boolean |
| Default: |
false |
| Plugin: | filestack.min.js |
Switch between the Basic and Filesack-only mode. If enabled, uploading images, videos, and files will be available only through Filestack.
CODE EXAMPLE
new FroalaEditor('.selector', {
filestackOptions {
uploadToFilestackOnly: true
}
});
Find and Replace
enableMatchCase
| Type: | Boolean |
| Default: |
false |
| Plugin: | Find and Replace |
If set to true, case-sensitive search will be enabled by default when the plugin is initialized.
CODE EXAMPLE
new FroalaEditor('.selector', {
enableMatchCase: true
});
enableMatchWholeWord
| Type: | Boolean |
| Default: |
false |
| Plugin: | Find and Replace |
If set to true, the `match whole word` search will be enabled by default when the plugin is initialized.
CODE EXAMPLE
new FroalaEditor('.selector', {
enableMatchWholeWord: true
});
showFindAndReplace
| Type: | Boolean |
| Default: |
false |
| Plugin: | Find and Replace |
If set to true, the Find and Replace popup will be displayed automatically when the editor is initialized.
CODE EXAMPLE
new FroalaEditor('.selector', {
showFindAndReplace: true
});
Font Family
fontFamily
| Type: | Object |
| Default: |
{
'Arial,Helvetica,sans-serif': 'Arial',
'Georgia,serif': 'Georgia',
'Impact,Charcoal,sans-serif': 'Impact',
'Tahoma,Geneva,sans-serif': 'Tahoma',
"'Times New Roman',Times,serif": 'Times New Roman',
'Verdana,Geneva,sans-serif': 'Verdana'
} |
| Plugin: | font_family.min.js |
Defines the fonts that appear under the Font Family button from the rich text editor's toolbar.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontFamily: {
'Arial,Helvetica,sans-serif': 'Font 1',
'Impact,Charcoal,sans-serif': 'Font 2',
'Tahoma,Geneva,sans-serif': 'Font 3'
}
});
fontFamilyDefaultSelection
| Type: | String |
| Default: | 'Font Family' |
| Plugin: | font_family.min.js |
The text to display when the font family is unkown or nothing is selected.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontFamilyDefaultSelection: 'Font'
});
fontFamilySelection
| Type: | Boolean |
| Default: | false |
| Plugin: | font_family.min.js |
The Font Family button from the WYSIWYG editor's toolbar is replaced with a dropdown showing the actual font family name for the current text selection.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontFamilySelection: true
});
Font Size
fontSizeSelection
| Type: | Boolean |
| Default: | false |
| Plugin: | font_size.min.js |
The Font Size button from the WYSIWYG editor's toolbar is replaced with a dropdown showing the actual font size value for the current text selection.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontSizeSelection: true
});
fontSize
| Type: | Array |
| Default: | ['8', '9', '10', '11', '12', '14', '18', '24', '30', '36', '48', '60', '72', '96'] |
| Plugin: | font_size.min.js |
Defines the font sizes that appear under the Font Size button from the rich text editor's toolbar.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontSize: [
'8',
'10',
'12',
'14',
'18',
'30',
'60',
'96'
]
});
fontSizeDefaultSelection
| Type: | String |
| Default: | '12' |
| Plugin: | font_size.min.js |
The text to display when the font size is unkown or nothing is selected.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontSizeDefaultSelection: '14'
});
fontSizeUnit
| Type: | String |
| Default: | 'px' |
| Plugin: | font_size.min.js |
The unit to be used for the font size.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontSizeUnit: 'pt'
});
Form
formEditButtons
| Type: | Array |
| Default: | ["inputStyle", "inputEdit"] |
| Plugin: | form.min.js |
Buttons for form edit popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
formEditButtons: [
"inputStyle",
"inputEdit"
]
});
formMultipleStyles
| Type: | Boolean |
| Default: | true |
| Plugin: | form.min.js |
To enable applying multiple css on form elements.
CODE EXAMPLE
new FroalaEditor('.selector', {
formMultipleStyles: true
});
formStyles
| Type: | Object |
| Default: | {fr-rounded: "Rounded", fr-large: "Large"} |
| Plugin: | form.min.js |
Options for applying styles on form.
CODE EXAMPLE
new FroalaEditor('.selector', {
formStyles: {
class1: "Class 1",
class2: "Class 2"
}
});
formUpdateButtons
| Type: | Array |
| Default: | ["inputBack", "|"] |
| Plugin: | form.min.js |
Buttons for form popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
formUpdateButtons: [
"inputBack",
"|"
]
});
Help
helpSets
| Type: | Array |
| Default: | [
{
title: 'Inline Editor',
commands: [
{ val: 'OSkeyE', desc: 'Show the editor' }
]
},
{
title: 'Common actions',
commands: [
{ val: 'OSkeyC', desc: 'Copy' },
{ val: 'OSkeyX', desc: 'Cut' },
{ val: 'OSkeyV', desc: 'Paste' },
{ val: 'OSkeyZ', desc: 'Undo' },
{ val: 'OSkeyShift+Z', desc: 'Redo' },
{ val: 'OSkeyK', desc: 'Insert Link' },
{ val: 'OSkeyP', desc: 'Insert Image' }
]
},
{
title: 'Basic Formatting',
commands: [
{ val: 'OSkeyA', desc: 'Select All' },
{ val: 'OSkeyB', desc: 'Bold' },
{ val: 'OSkeyI', desc: 'Italic' },
{ val: 'OSkeyU', desc: 'Underline' },
{ val: 'OSkeyS', desc: 'Strikethrough' },
{ val: 'OSkey]', desc: 'Increase Indent' },
{ val: 'OSkey[', desc: 'Decrease Indent' }
]
},
{
title: 'Quote',
commands: [
{ val: 'OSkey\'', desc: 'Increase quote level' },
{ val: 'OSkeyShift+\'', desc: 'Decrease quote level' }
]
},
{
title: 'Image / Video',
commands: [
{ val: 'OSkey+', desc: 'Resize larger' },
{ val: 'OSkey-', desc: 'Resize smaller' }
]
},
{
title: 'Table',
commands: [
{ val: 'Alt+Space', desc: 'Select table cell' },
{ val: 'Shift+Left/Right arrow', desc: 'Extend selection one cell' },
{ val: 'Shift+Up/Down arrow', desc: 'Extend selection one row' }
]
},
{
title: 'Navigation',
commands: [
{ val: 'OSkey/', desc: 'Shortcuts' },
{ val: 'Alt+F10', desc: 'Focus popup / toolbar' },
{ val: 'Esc', desc: 'Return focus to previous position' }
]
}
] |
| Plugin: | help.min.js |
An object of items to show in the help modal.
CODE EXAMPLE
new FroalaEditor('.selector', {
helpSets: [
{
title: 'Common actions',
commands: [
{ val: 'OSkeyC', desc: 'Copy' },
{ val: 'OSkeyX', desc: 'Cut' },
{ val: 'OSkeyV', desc: 'Paste' },
{ val: 'OSkeyZ', desc: 'Undo' },
{ val: 'OSkeyShift+Z', desc: 'Redo' },
{ val: 'OSkeyK', desc: 'Insert Link' },
{ val: 'OSkeyP', desc: 'Insert Image' }
]
},
{
title: 'Basic Formatting',
commands: [
{ val: 'OSkeyA', desc: 'Select All' },
{ val: 'OSkeyB', desc: 'Bold' },
{ val: 'OSkeyI', desc: 'Italic' },
{ val: 'OSkeyU', desc: 'Underline' },
{ val: 'OSkeyS', desc: 'Strikethrough' },
{ val: 'OSkey]', desc: 'Increase Indent' },
{ val: 'OSkey[', desc: 'Decrease Indent' }
]
}
]
});
Image
imageAllowedTypes
| Type: | Array |
| Default: | ['jpeg', 'jpg', 'png', 'gif', 'webp'] |
| Plugin: | image.min.js |
The list of image types that are allowed to be uploaded. Although this will restrict uploading other types of files, we strongly recommend you to check the file type on the server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageAllowedTypes: [
'jpeg',
'jpg',
'png'
]
});
imageAltButtons
| Type: | Array |
| Default: | ['imageBack', '|'] |
| Plugin: | image.min.js |
The list of buttons that appear in the edit image alternate text popup, when changing the alternate text of the image.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageAltButtons: [
'imageBack'
]
});
imageCORSProxy
| Type: | String |
| Default: | 'https://cors-anywhere.awsstage.froala.com' |
| Plugin: | image.min.js |
Proxy server to be used for reading images inserted by URL and upload them to a custom server. By default we provide a proxy hosted on our servers, however for full control, we recommend setting up your own proxy by using the details from CORS Anywhere.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageCORSProxy: 'https://cors-anywhere.herokuapp.com'
});
imageDefaultAlign
| Type: | String |
| Default: | 'center' |
| Plugin: | image.min.js |
Sets the default image alignment when it is inserted in the rich text editor. Possible values are 'left', 'center' and 'right'.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageDefaultAlign: 'left'
});
imageDefaultDisplay
| Type: | String |
| Default: | 'block' |
| Plugin: | image.min.js |
Sets the default display for an image when is is inserted in the rich text. Possible options are: 'inline' and 'block'.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageDefaultDisplay: 'inline'
});
imageDefaultMargin
| Type: | Number |
| Default: | 5 |
| Plugin: | image.min.js |
Sets the default margin for the image when it is inserted in the rich text editor. Setting it to 0 will not set any margin.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageDefaultMargin: 7
});
imageDefaultWidth
| Type: | Number |
| Default: | 300 |
| Plugin: | image.min.js |
Sets the default width of the image when it is inserted in the rich text editor. Setting it to 0 will not set any width.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageDefaultWidth: 200
});
imageEditButtons
| Type: | Array |
| Default: | ['imageReplace', 'imageAlign', 'imageCaption', 'imageRemove', '|', 'imageLink', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageAlt', 'imageSize'] |
| Plugin: | image.min.js |
The list of buttons that appear in the edit image popup, when an image is selected. If Image Aviary plugin is included, then 'aviary' can be used as an option as well.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageEditButtons: [
'imageReplace',
'imageAlign',
'imageCaption',
'imageRemove'
]
});
imageInsertButtons
| Type: | Array |
| Default: | ['imageBack', '|', 'imageUpload', 'imageByURL', 'imageManager'] |
| Plugin: | image.min.js |
The list of buttons that appear in the insert image popup, when inserting a new image into the WYSIWYG editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageInsertButtons: [
'imageBack',
'|',
'imageManager'
]
});
imageMaxSize
| Type: | Number |
| Default: | 1024 * 1024 * 10 |
| Plugin: | image.min.js |
The maximum image size allowed on upload in bytes. The default value is 10MB. Although this makes an additional check before uploading the image, it is highly recommended to check image size on your server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageMaxSize: 1024 * 1024 * 3
});
imageMinWidth
| Type: | Number |
| Default: | 16 |
| Plugin: | image.min.js |
The minimum width in PX the image can be resized to.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageMinWidth: 32
});
imageMove
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Allows changing the position of the images by dragging them. This option will work correctly only when including the draggable plugin.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageMove: false
});
imageMultipleStyles
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Allows multiple image styles to be selected at a time.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageMultipleStyles: false
});
imagePaste
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Allows pasting images from clipboard.
CODE EXAMPLE
new FroalaEditor('.selector', {
imagePaste: false
});
imagePasteProcess
| Type: | Boolean |
| Default: | false |
| Plugin: | image.min.js |
Use default image settings for pasted images.
CODE EXAMPLE
new FroalaEditor('.selector', {
imagePasteProcess: true
});
imageResize
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Disables image resize when set to false.
imageResizeWithPercent
| Type: | Boolean |
| Default: | false |
| Plugin: | image.min.js |
By default the image resize is using PX. Enabling this option will use % instead when resizing an image inside the editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageResizeWithPercent: true
});
imageRoundPercent
| Type: | Boolean |
| Default: | false |
| Plugin: | image.min.js |
Force image percent to round to integer while resizing.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageRoundPercent: true
});
imageOutputSize
| Type: | Boolean |
| Default: | false |
| Plugin: | image.min.js |
When this option is enabled, the images will get the width and height set as attribute in the output.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageOutputSize: true
});
imageSizeButtons
| Type: | Array |
| Default: | ['imageBack', '|'] |
| Plugin: | image.min.js |
The list of buttons that appear in the edit image size popup, when editing the image's width and height.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageSizeButtons: [
'imageBack'
]
});
imageSplitHTML
| Type: | Boolean |
| Default: | false |
| Plugin: | image.min.js |
Enables splitting the HTML when inserting a new image.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageSplitHTML: true
});
imageStyles
| Type: | Object |
| Default: | {
'fr-rounded': 'Rounded',
'fr-bordered': 'Bordered'
} |
| Plugin: | image.min.js |
Set custom styles for the selected image. The classes should be defined in CSS, otherwise no changes will be visible on the image's appearance.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageStyles: {
class1: 'Class 1',
class2: 'Class 2',
class3: 'Class 3'
}
});
imageTUIOptions
| Type: | Object |
| Default: | {
includeUI: {
initMenu: "filter",
menuBarPosition: "left",
theme: {
"menu.activeIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-b.svg",
"menu.disabledIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-a.svg",
"menu.hoverIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-c.svg",
"menu.normalIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-d.svg",
"submenu.activeIcon.name": "icon-c",
"submenu.activeIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-c.svg",
"submenu.normalIcon.name": "icon-d",
"submenu.normalIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-d.svg"
}
} |
| Plugin: | image.min.js |
Set options for TUI editor plugin.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageTUIOptions: {
includeUI: {
initMenu: "filter",
menuBarPosition: "left",
theme: {
"menu.activeIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-b.svg",
"menu.disabledIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-a.svg",
"menu.hoverIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-c.svg",
"menu.normalIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-d.svg",
"submenu.activeIcon.name": "icon-c",
"submenu.activeIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-c.svg",
"submenu.normalIcon.name": "icon-d",
"submenu.normalIcon.path": "https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/svg/icon-d.svg"
}
}
}
});
imageTextNear
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Allows text near an image when it is aligned to the left or to the right. Disabling this option will make the display button for image editor popup unavailable.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageTextNear: false
});
imageUpload
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Enable or disable image upload.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUpload: false
});
imageAddNewLine
| Type: | Boolean |
| Default: | false |
| Plugin: | image.min.js |
Add new line after inserting an image when enabled.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageAddNewLine: true
});
imageUploadMethod
| Type: | String |
| Default: | 'POST' |
| Plugin: | image.min.js |
The HTTP image upload request type.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUploadMethod: 'PUT'
});
imageUploadParam
| Type: | String |
| Default: | 'file' |
| Plugin: | image.min.js |
Customize the name of the parameter that contains the image file in the upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUploadParam: 'file_name'
});
imageUploadParams
| Type: | Object |
| Default: | {} |
| Plugin: | image.min.js |
Pass additional parameters to the upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUploadParams: {
id: 'my_editor'
}
});
imageUploadRemoteUrls
| Type: | Boolean |
| Default: | true |
| Plugin: | image.min.js |
Upload images inserted by URL to custom server instead of linking them by URL.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUploadRemoteUrls: false
});
imageUploadToS3
| Type: | Object |
| Default: | false |
| Plugin: | image.min.js |
Set the options for image upload to S3. All the fields from the example below are required. Also make sure that you have enabled CORS on Amazon.
Note: uploadURL property can be used instead of bucket and region properties to specify a custom URL from Amazon where to upload the image.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUploadToS3: {
bucket: 'editor',
// Your bucket region.
region: 's3-us-east-1',
keyStart: 'uploads/',
params: {
acl: 'public-read', // ACL according to Amazon Documentation.
AWSAccessKeyId: 'ACCESS_KEY', // Access Key from Amazon.
policy: 'POLICY_STRING', // Policy string computed in the backend.
signature: '', // Signature computed in the backend.
// If you are using Amazon Signature V4, the followings should be used instead.
// "X-Amz-Credential": "...",
// "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
// "X-Amz-Date": "...",
// Policy: "...", //
// "X-Amz-Signature": "", // computed in backend
}
}
});
imageUploadURL
| Type: | String |
| Default: | null |
| Plugin: | image.min.js |
The URL where the images uploaded by the user are saved. When an image is uploaded, the editor sends the file to the server through a HTTP request. The server should process the data from the file parameter of the request and return a JSON object containing a link field with the link to the uploaded image. More details can be found in the Image Upload concept article.
E.g. {link: 'path/to/image.jpg'}.
Note 1: By default, the images are stored on our servers, but if you want to have full control over them, you should consider implementing the upload on your server. The images stored on our servers, may be deleted at any time without any notice.
Note 2: If the domain where the image is saved is not the same with the one where the editor is running, you may need to enable requestWithCORS option and make specific customizations on the server. For more information please refer to Cross-origin resource sharing.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageUploadURL: 'http://i.awsstage.froala.com/upload'
});
General
allowStylingOnNonEditable
| Type: | Boolean |
| Default: |
false |
Specifies whether styling is permitted on non-editable content. When set to true, styles can be applied to non-editable elements; when set to false, styling is restricted to editable content only.
CODE EXAMPLE
new FroalaEditor('.selector', {
allowStylingOnNonEditable: true
});
attribution
| Type: | Boolean |
| Default: |
true |
Remove the Powered By Froala message.
CODE EXAMPLE
new FroalaEditor('.selector', {
attribution: false
});
autofocus
| Type: | Boolean |
| Default: |
false |
Focus the editor instance when the page is loaded.
CODE EXAMPLE
new FroalaEditor('.selector', {
autofocus: true
});
direction
| Type: | String |
| Default: |
'auto' |
Sets the direction of the text. Possible values are: 'auto', 'ltr' and 'rtl'. When the option is set to auto the editor automatically detects if the keyboard input is RTL or LTR. However only the text inside the editing box changes direction, the toolbar remains the same. The rtl and ltr values also change the toolbarโs direction.
CODE EXAMPLE
new FroalaEditor('.selector', {
direction: 'rtl'
});
disableRightClick
| Type: | Boolean |
| Default: |
false |
Disables the default browser context menu. Itโs recommended to be used if toolbarVisibleWithoutSelection option is enabled.
CODE EXAMPLE
new FroalaEditor('.selector', {
disableRightClick: true
});
documentReady
| Type: | Boolean |
| Default: |
false |
Turns on the editor best setup for editing documents.
CODE EXAMPLE
new FroalaEditor('.selector', {
documentReady: true
});
editInPopup
| Type: | Boolean |
| Default: |
false |
Edit the text inside the HTML element on which the editor is initialized on in a popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
editInPopup: true
});
editorClass
| Type: | String |
| Default: |
null |
Set a custom class for the WYSIWYG editor editing box.
CODE EXAMPLE
new FroalaEditor('.selector', {
editorClass: 'custom-class'
});
enter
| Type: | String |
| Default: |
FroalaEditor.ENTER_P |
Set the default tag to be used when ENTER key is hit. Possible values are FroalaEditor.ENTER_P, FroalaEditor.ENTER_DIV or FroalaEditor.ENTER_BR.
CODE EXAMPLE
new FroalaEditor('.selector', {
enter: FroalaEditor.ENTER_BR
});
fullPage
| Type: | Boolean |
| Default: |
false |
Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration.
Note: Enabling this option will automatically enables the iframe option.
CODE EXAMPLE
new FroalaEditor('.selector', {
fullPage: true
});
height
| Type: | Number |
| Default: |
null |
Set a height for the rich text editorโs editing box.
CODE EXAMPLE
new FroalaEditor('.selector', {
height: 300
});
heightMax
| Type: | Number |
| Default: |
null |
Set a maximum height for the rich text editorโs editing box.
CODE EXAMPLE
new FroalaEditor('.selector', {
heightMax: 500
});
heightMin
| Type: | Number |
| Default: |
null |
Set a minimum height for the rich text editorโs editing box.
CODE EXAMPLE
new FroalaEditor('.selector', {
heightMin: 200
});
htmlAllowComments
| Type: | Boolean |
| Default: |
true |
Allow comments inside the edited HTML.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlAllowComments: false
});
htmlAllowedAttrs
| Type: | Array |
| Default: |
['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allowfullscreen', 'allowtransparency', 'alt', 'aria-.*', 'async', 'autocomplete', 'autofocus', 'autoplay', 'autosave', 'background', 'bgcolor', 'border', 'charset', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'color', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'data', 'data-.*', 'datetime', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'dropzone', 'enctype', 'for', 'form', 'formaction', 'frameborder', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'mozallowfullscreen', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'scrolling', 'seamless', 'selected', 'shape', 'size', 'sizes', 'span', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'spellcheck', 'style', 'tabindex', 'target', 'title', 'type', 'translate', 'usemap', 'value', 'valign', 'webkitallowfullscreen', 'width', 'wrap'] |
The list of allowed attributes to be used for tags.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlAllowedAttrs: [
'title',
'href',
'alt',
'src',
'style'
]
});
htmlAllowedEmptyTags
| Type: | Array |
| Default: |
['textarea', 'a', 'iframe', 'object', 'video', 'style', 'script', '.fa', '.fr-emoticon', '.fr-inner', 'path', 'line', 'hr'] |
The list of tags that are not removed when they have no content inside.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlAllowedEmptyTags: [
'table',
'strong'
]
});
htmlAllowedStyleProps
| Type: | Array |
| Default: |
[.*] |
The list of allowed CSS attributes to be used for tags.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlAllowedStyleProps: [
'font-family',
'font-size',
'background',
'color',
'width',
'text-align',
'vertical-align',
'background-color'
]
});
htmlAllowedTags
| Type: | Array |
| Default: |
['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'queue', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'style', 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'] |
The list of allowed tags.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlAllowedTags: [
'p',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6'
]
});
htmlDoNotWrapTags
| Type: | Array |
| Default: |
['script', 'style'] |
The list of tags that should not be wrapped inside block tags.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlDoNotWrapTags: [
'script',
'style',
'img'
]
});
htmlExecuteScripts
| Type: | Boolean |
| Default: |
true |
Allow running scripts that are entered in Code View.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlExecuteScripts: false
});
htmlIgnoreCSSProperties
| Type: | Array |
| Default: |
[] |
A list of CSS properties to be ignored when useClasses option is disabled and the CSS from external stylesheets is converted to inline style.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlIgnoreCSSProperties: [
'font-family',
'font-size'
]
});
htmlRemoveTags
| Type: | Array |
| Default: |
['script', 'style'] |
The list of tags that are removed together with their content.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlRemoveTags: [
'script',
'style',
'base'
]
});
htmlSimpleAmpersand
| Type: | Boolean |
| Default: |
false |
Allows the usage of simple ampersands (&) instead of the relative HTML entity (&). This is not recommended by the W3C XHTML specifications, so this option should remain false whenever possible.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlSimpleAmpersand: true
});
htmlUntouched
| Type: | Boolean |
| Default: |
false |
Leave the HTML inside the editor untouched without doing any special processing to it except HTML cleaning.
CODE EXAMPLE
new FroalaEditor('.selector', {
htmlUntouched: true
});
iconsTemplate
| Type: | String |
| Default: |
'svg' |
Set the template to be used for the icons inside the editor UI.
CODE EXAMPLE
new FroalaEditor('.selector', {
iconsTemplate: 'font_awesome_5'
});
iframe
| Type: | Boolean |
| Default: |
false |
When this option is enabled, the editorโs content will be placed in an iframe and isolated from the rest of the page.
CODE EXAMPLE
new FroalaEditor('.selector', {
iframe: true
});
iframeDefaultStyle
| Type: | String |
| Default: |
'html{margin: 0px;}body{padding:10px;background:transparent;color:#000000;position:relative;z-index: 2;-webkit-user-select:auto;margin:0px;overflow:hidden;}body:after{content:"";clear:both;display:block}'
|
Default style needed by the editor to be used inside the iframe to display content.
CODE EXAMPLE
new FroalaEditor('.selector', {
iframeDefaultStyle: 'body{position:relative;z-index:2;}pre{white-space:pre-wrap;word-wrap:break-word;}'
});
iframeStyle
| Type: | String |
| Default: |
'' |
Custom style to be used inside the iframe to display content. This style is added over the iframeDefaultStyle style.
CODE EXAMPLE
new FroalaEditor('.selector', {
iframeStyle: 'body{position:relative;z-index:2;}pre{white-space:pre-wrap;word-wrap:break-word;}'
});
iframeStyleFiles
| Type: | Array |
| Default: |
[] |
An array with custom CSS files to inject inside the iframe to display content.
CODE EXAMPLE
new FroalaEditor('.selector', {
iframeStyleFiles: [
'/path/to/my_cssFile.css',
'/path/to/other_cssFile.css'
]
});
indentMargin
| Type: | Integer |
| Default: |
20 |
The number of pixels to use for indenting the current line.
CODE EXAMPLE
new FroalaEditor('.selector', {
indentMargin: 10
});
initOnClick
| Type: | Boolean |
| Default: |
false |
Only the minimum required events are initialized on page load and the rest of them when the user clicks inside the editable area. This is very useful when using multiple editors on the same page because it reduces the page load time.
CODE EXAMPLE
new FroalaEditor('.selector', {
initOnClick: true
});
keepFormatOnDelete
| Type: | Boolean |
| Default: |
false |
Keep format of the selected text when it is deleted.
CODE EXAMPLE
new FroalaEditor('.selector', {
keepFormatOnDelete: true
});
Key
| Type: | string |
| Default: |
required |
The key received by activating the editor license. The activation key instructions/usage can be found
here.multiLine
| Type: | Boolean |
| Default: |
true |
Allows new line to be inserted when ENTER key is hit.
CODE EXAMPLE
new FroalaEditor('.selector', {
multiLine: false
});
pasteAllowedStyleProps
| Type: | Array |
| Default: |
[] |
The list of allowed CSS attributes to be used for tags on paste.
CODE EXAMPLE
new FroalaEditor('.selector', {
pasteAllowedStyleProps: [
'font-family',
'font-size',
'color'
]
});
pasteAllowLocalImages
| Type: | Boolean |
| Default: |
false |
Removes images that have local path (file://) on paste. Enabling this option might result in having mixed content on HTTPS websites.
CODE EXAMPLE
new FroalaEditor('.selector', {
pasteAllowLocalImages: true
});
pasteDeniedAttrs
| Type: | Array |
| Default: |
['class', 'id', 'style'] |
Attributes that are removed when pasting something into the rich text editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
pasteDeniedAttrs: [
'class',
'id'
]
});
pasteDeniedTags
| Type: | Array |
| Default: |
[] |
Tags that are removed together with their content when pasting something into the rich text editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
pasteDeniedTags: [
'a',
'i'
]
});
pastePlain
| Type: | Boolean |
| Default: |
false |
Removes text formatting when pasting content into the rich text editor, but keeps the contentโs structure.
CODE EXAMPLE
new FroalaEditor('.selector', {
pastePlain: true
});
placeholderText
| Type: | String |
| Default: |
'Type Something' |
The placeholder used when the WYSIWYG editor body is empty.
CODE EXAMPLE
new FroalaEditor('.selector', {
placeholderText: 'Placeholder'
});
pluginsEnabled
| Type: | Array |
| Default: |
null |
The plugins that should be enabled in the current editor instance. By default, all plugins are enabled. Available plugins are: align, charCounter, codeBeautifier, codeView, colors, draggable, embedly, emoticons, entities, file, fontAwesome, fontFamily, fontSize, fullscreen, image, imageTUI, imageManager, inlineStyle, inlineClass, lineBreaker, lineHeight, link, lists, paragraphFormat, paragraphStyle, quickInsert, quote, save, table, url, video, wordPaste.
CODE EXAMPLE
new FroalaEditor('.selector', {
pluginsEnabled: [
'image',
'link'
]
});
pluginsDisabled
| Type: | Array |
| Default: |
null |
Defines a list of plugins to be excluded in the current editor instance. By default, all plugins are enabled unless specified otherwise.
Note: ThepluginsDisabled configuration takes higher priority over the pluginsEnabled configuration, meaning any plugins listed here will be disabled even if they are also specified as enabled elsewhere.
CODE EXAMPLE
new FroalaEditor('.selector', {
pluginsDisabled: [
'track_changes',
'link'
]
});
requestHeaders
| Type: | Object |
| Default: |
{}
|
An Object with additional header key/value pairs to send along with requests using the XMLHttpRequest transport.
CODE EXAMPLE
new FroalaEditor('.selector', {
requestHeaders: {
custom_header: 'My custom header data.'
}
});
requestWithCredentials
| Type: | Boolean |
| Default: |
false |
A that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. For more information refer to XMLHttpRequest.withCredentials.
CODE EXAMPLE
new FroalaEditor('.selector', {
requestWithCredentials: true
});
requestWithCORS
| Type: | Boolean |
| Default: |
true |
Make AJAX requests using CORS. For more information refer to Cross-origin resource sharing.
CODE EXAMPLE
new FroalaEditor('.selector', {
requestWithCORS: false
});
scrollableContainer
| Type: | String |
| Default: |
'body' |
Sets the container in which the editor popups are added.
CODE EXAMPLE
new FroalaEditor('.selector', {
scrollableContainer: '#my_scrollable_container'
});
shortcutsEnabled
| Type: | Array |
| Default: |
['show', 'bold', 'italic', 'underline', 'strikeThrough', 'indent', 'outdent', 'undo', 'redo', 'insertImage', 'createLink'] |
Granular control for enabling or disabling specific shortcuts.
CODE EXAMPLE
new FroalaEditor('.selector', {
shortcutsEnabled: [
'bold',
'italic'
]
});
shortcutsHint
| Type: | Boolean |
| Default: |
true |
When enabled, the shortcut is displayed in the button tooltip.
CODE EXAMPLE
new FroalaEditor('.selector', {
shortcutsHint: false
});
spellcheck
| Type: | Boolean |
| Default: |
true |
Enables browser spellcheck for the text inside the editing box.
CODE EXAMPLE
new FroalaEditor('.selector', {
spellcheck: false
});
tabIndex
| Type: | Number |
| Default: |
null |
The tabIndex to set on the editor element.
CODE EXAMPLE
new FroalaEditor('.selector', {
tabIndex: 10
});
tabSpaces
| Type: | Integer |
| Default: |
0 |
When TAB key is hit, the editor will add the specified number of space. If set to 0 the TAB key allows default navigation through the page.
CODE EXAMPLE
new FroalaEditor('.selector', {
tabSpaces: 4
});
theme
| Type: | String |
| Default: |
null |
Specify the theme name to use in the editor. The theme should be included as CSS. For more details please read the color themes example.
CODE EXAMPLE
new FroalaEditor('.selector', {
theme: "dark"
});
toolbarBottom
| Type: | Boolean |
| Default: |
false |
Enable or disable positioning the toolbar at the bottom of the editor. This option is not available on mobile devices.
CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarBottom: true
});
toolbarButtons
| Type: | Object/Array |
| Default: |
{
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting']
},
'moreParagraph': {
'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
},
'moreRich': {
'buttons': ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile', 'insertHR']
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
'align': 'right',
'buttonsVisible': 2
}
}
|
The list of buttons that appear in the rich text editorโs toolbar on large devices (โฅ 1200px).
Note:| will insert a vertical separator line in the toolbar, and - a horizontal one.
Some of the buttons above require a specific plugin. Here is the complete list of plugins and the files required by each them.
โข align button requires align plugin;
โข color button requires colors plugin;
โข embedly button requires embedly plugin;
โข emoticons button requires emoticons plugin;
โข fontFamily button requires fontFamily plugin;
โข fontSize button requires fontSize plugin;
โข formatOL and formatUL buttons require lists plugin;
โข fullscreen button requires fullscreen plugin;
โข getPDF button requires print plugin;
โข html button requires codeView plugin;
โข inlineStyle button requires inlineStyle plugin;
โข inlineClass button requires inlineClass plugin;
โข insertFile button requires file plugin;
โข insertImage button requires image plugin;
โข insertLink button requires link plugin;
โข insertTable button requires table plugin;
โข insertVideo button requires video plugin;
โข paragraphFormat button requires paragraphFormat plugin;
โข paragraphStyle button requires paragraphStyle plugin;
โข print button requires print plugin;
โข quote button requires quote plugin;
โข specialCharacters button requires specialCharacters plugin;
CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarButtons: {
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting']
},
'moreParagraph': {
'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
},
'moreRich': {
'buttons': ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile', 'insertHR']
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
'align': 'right',
'buttonsVisible': 2
}
}
});
toolbarButtonsMD
| Type: | Object/Array |
| Default: |
null |
The list of buttons that appear in the rich text editorโs toolbar on medium devices (โฅ 992px). By default on MD screens, the editor uses the same buttons as for toolbarButtons.
Note: Some of the buttons above require a specific plugin. See toolbarButtons option for more details.CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarButtonsMD: {
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
'buttonsVisible': 6
}
}
});
toolbarButtonsSM
| Type: | Object/Array |
| Default: |
{
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
'buttonsVisible': 2
},
'moreParagraph': {
'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote'],
'buttonsVisible': 2
},
'moreRich': {
'buttons': ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile', 'insertHR'],
'buttonsVisible': 2
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
'align': 'right',
'buttonsVisible': 2
}
}
|
The list of buttons that appear in the rich text editorโs toolbar on small devices (โฅ 768px).
Note: Some of the buttons above require a specific plugin. See toolbarButtons option for more details.CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarButtonsSM: {
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
'buttonsVisible': 4
}
}
});
toolbarButtonsXS
| Type: | Object/Array |
| Default: |
{
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
'buttonsVisible': 0
},
'moreParagraph': {
'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote'],
'buttonsVisible': 0
},
'moreRich': {
'buttons': ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile', 'insertHR'],
'buttonsVisible': 0
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
'align': 'right',
'buttonsVisible': 2
}
}
|
The list of buttons that appear in the rich text editorโs toolbar on extra small devices (< 768px).
Note: Some of the buttons above require a specific plugin. See toolbarButtons option for more details.CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarButtonsXS: {
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
'align': 'right',
'buttonsVisible': 4
}
}
});
toolbarContainer
| Type: | Boolean |
| Default: |
null |
A custom HTML selector placing the toolbar inside.
CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarContainer: '#toolbarContainer'
});
toolbarInline
| Type: | Boolean |
| Default: |
false |
Enable or disable inline mode.
CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarInline: true
});
toolbarSticky
| Type: | Boolean |
| Default: |
true |
Keeps the toolbar at the top of the editing box in basic mode. Disabling this option, will keep the toolbar at the top of the page when scrolling down.
CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarSticky: false
});
toolbarStickyOffset
| Type: | Number |
| Default: |
0 |
The offset of the sticky toolbar from top of the page. If toolbarBottom option is used, then this option will define the offset of the toolbar from the bottom of the page.
CODE EXAMPLE
new FroalaEditor('.selector', {
toolbarStickyOffset: 50
});
toolbarVisibleWithoutSelection
| Type: | Boolean |
| Default: |
false |
Keeps the editor visible next to the cursor even when there is no selection.
Note: This option is available only when the toolbarInline option is set to true.
CODE EXAMPLE
new FroalaEditor('.selector', {
ย ย toolbarVisibleWithoutSelection: true
});
tooltips
| Type: | Boolean |
| Default: |
true |
Control if tooltips are shown when getting with mouse over the buttons from the toolbar.
CODE EXAMPLE
new FroalaEditor('.selector', {
tooltips: false
});
typingTimer
| Type: | Number |
| Default: |
500 |
Time in milliseconds to define how long the typing pause may be without the change to be saved in the undo stack. The minimum value that can be set is 500.
CODE EXAMPLE
new FroalaEditor('.selector', {
typingTimer: 750
});
useClasses
| Type: | Boolean |
| Default: |
true |
When this options is disabled the edited content will have the external CSS properties converted to inline style. Note: For this option to work correctly, it is necessary to load the CSS files from the same domain the editor is running on.
CODE EXAMPLE
new FroalaEditor('.selector', {
useClasses: false
});
width
| Type: | String |
| Default: |
'auto' |
Sets the width of the editing box.
CODE EXAMPLE
new FroalaEditor('.selector', {
width: '800'
});
zIndex
| Type: | Number |
| Default: |
1 |
The zIndex to set on the editor toolbars and popups.
CODE EXAMPLE
new FroalaEditor('.selector', {
zIndex: 2501
});
Image Manager
imageManagerDeleteMethod
| Type: | String |
| Default: | 'POST' |
| Plugin: | image_manager.min.js |
The HTTP image manager delete image request type.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerDeleteMethod: 'DELETE'
});
imageManagerDeleteParams
| Type: | Object |
| Default: | {} |
| Plugin: | image_mananger.min.js |
Additional parameters passed to the image manager image delete request.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerDeleteParams: {user_id: 4219762}
});
imageManagerDeleteURL
| Type: | String |
| Default: | '' |
| Plugin: | image_manager.min.js |
The URL where the HTTP request is done to delete the image. The request will contain the image source as src parameter.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerDeleteURL: 'http://example.com/delete_image'
});
imageManagerLoadMethod
| Type: | String |
| Default: | 'GET' |
| Plugin: | image_manager.min.js |
The HTTP image manager load images request type.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerLoadMethod: 'POST'
});
imageManagerLoadParams
| Type: | Object |
| Default: | {} |
| Plugin: | image_manager.min.js |
Additional parameters passed to the load images request from the image manager.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerLoadParams: {user_id: 4219762}
});
imageManagerLoadURL
| Type: | String |
| Default: | 'http://i.awsstage.froala.com/load-files' |
| Plugin: | image_manager.min.js |
The URL where the HTTP request is done in order to load a page of images that appear in the image manager. The response should be an array with an Object for each image, similar to:
[
{
url: 'http://exmaple.com/images/photo1.jpg',
thumb: "http://exmaple.com/thumbs/photo1.jpg",
tag: 'flower'
},
{
url: 'http://exmaple.com/images/photo2.jpg',
thumb: "http://exmaple.com/thumbs/photo2.jpg",
tag: 'sport'
}
]Where
url is required, thumb is recommended and tag is optional. The image Object may also contain additional data that will be saved as image attributes data-*. E.g.:
[
{
url: 'http://exmaple.com/images/photo1.jpg',
thumb: "http://exmaple.com/thumbs/photo1.jpg",
tag: 'flower',
name: "Photo 1 Name",
id: 103454285,
}
]
<img src='https://exmaple.com/images/photo1.jpg' data-name='Photo 1 Name' data-id='103454285'>
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerLoadURL: 'http://example.com/load_images'
});
imageManagerPageSize
| Type: | Number |
| Default: | 12 |
| Plugin: | image_manager.min.js |
The number of images loaded per page in the image manager.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerPageSize: 10
});
imageManagerPreloader
| Type: | String |
| Default: | '' |
| Plugin: | image_manager.min.js |
The path to a gif image to be displayed while loading the images from the server in the image manager. If no option is specified, "Loading.." text will appear.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerPreloader: '/images/loader.gif'
});
imageManagerScrollOffset
| Type: | Number |
| Default: | 20 |
| Plugin: | image_manager.min.js |
The distance in pixels from the bottom of the scrollable content at which to trigger the loading of the next page of images.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerScrollOffset: 10
});
imageManagerToggleTags
| Type: | Boolean |
| Default: | true |
| Plugin: | image_manager.min.js |
To enable/disable toggle of filter tags for image manager popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
imageManagerToggleTags: false
});
Import from Word
importFromWordEnableImportOnDrop
| Type: | Boolean |
| Default: |
true |
Whether to trigger the import process when a valid Word file is dropped into the editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
importFromWordEnableImportOnDrop: false
});
importFromWordFileTypesAllowed
| Type: | Array |
| Default: |
['docx'] |
A list of allowed file extensions.
CODE EXAMPLE
new FroalaEditor('.selector', {
importFromWordFileTypesAllowed: ['docx']
});
importFromWordMaxFileSize
| Type: | Number |
| Default: |
3 * 1024 * 1024 //(3MB) |
The maximum allowed file size in bytes.
CODE EXAMPLE
new FroalaEditor('.selector', {
importFromWordMaxFileSize: 2 * 1024 * 1024 //(2MB)
});
importFromWordUrlToUpload
| Type: | String |
| Default: |
null |
The URL of a server-side handler for conversion. If null, client-side conversion via mammoth.js is used. NOTE: If importFromWordUrlToUpload is used, the server should return a JSON object: { "html": "Converted content" }.
CODE EXAMPLE
new FroalaEditor('.selector', {
importFromWordUrlToUpload: 'https://my-ai-api.com/importword'
});
Inline Style
inlineStyles
| Type: | Object |
| Default: | {
'Big Red': 'font-size: 20px; color: red;',
'Small Blue': 'font-size: 14px; color: blue;'
} |
| Plugin: | inline_style.min.js |
Set custom styles for the selected text. This option is an Object where the key is the name of the new style that appears in the dropdown and the value specifies the CSS properties for it.
CODE EXAMPLE
new FroalaEditor('.selector', {
inlineStyles: {
'Big Red': 'font-size: 20px; color: red;',
'Small Blue': 'font-size: 14px; color: blue;'
}
});
Inline Class
inlineClasses
| Type: | Object |
| Default: | {
'fr-class-code': 'Code',
'fr-class-highlighted': 'Highlighted',
'fr-class-transparency': 'Transparent'
} |
| Plugin: | inline_class.min.js |
Set custom classes for the selected text. This option is an Object where the key is the name of the new class that appears in the dropdown and the value specifies the class name for it.
CODE EXAMPLE
new FroalaEditor('.selector', {
inlineClasses: {
'fr-class-code': 'Code',
'fr-class-highlighted': 'Highlighted',
'fr-class-transparency': 'Transparent'
}
});
Language
language
| Type: | String |
| Default: | null |
Select the language to be used in the rich text editor's interface. The corresponding language file is required: /langs/es.js.
CODE EXAMPLE
new FroalaEditor('.selector', {
language: 'es'
});
Line Breaker
lineBreakerHorizontalOffset
| Type: | Number |
| Default: | 10 |
| Plugin: | line_breaker.min.js |
The distance in pixels from the left or right of an element at which to show the line-breaker.
CODE EXAMPLE
new FroalaEditor('.selector', {
lineBreakerHorizontalOffset: 20
});
lineBreakerOffset
| Type: | Number |
| Default: | 15 |
| Plugin: | line_breaker.min.js |
The distance in pixels from the top or bottom of an element at which to show the line-breaker.
CODE EXAMPLE
new FroalaEditor('.selector', {
lineBreakerOffset: 20
});
lineBreakerTags
| Type: | Array |
| Default: | ['table', 'hr', 'form', 'dl', 'span.fr-video', '.fr-embedly', '.fr-img-caption'] |
| Plugin: | line_breaker.min.js |
The list of HTML tags between which the line-breaker should appear.
CODE EXAMPLE
new FroalaEditor('.selector', {
lineBreakerTags: ['table', 'hr', 'form']
});
Link
linkAlwaysBlank
| Type: | Boolean |
| Default: | false |
| Plugin: | link.min.js |
When enabled, all links open in a new tab and no option to set this action would be presented in the UI.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkAlwaysBlank: true
});
linkAlwaysNoFollow
| Type: | Boolean |
| Default: | true |
| Plugin: | link.min.js |
Specifies if the rel="nofollow" attribute should be added on all links.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkAlwaysNoFollow: false
});
linkAttributes
| Type: | Object |
| Default: | {} |
| Plugin: | link.min.js |
An object with additional attributes that could be customized for a link.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkAttributes: {
title: 'Title'
}
});
linkAutoPrefix
| Type: | String |
| Default: | 'http://' |
| Plugin: | link.min.js |
Sets the default URL prefix.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkAutoPrefix: 'https://'
});
linkConvertEmailAddress
| Type: | Boolean |
| Default: | true |
| Plugin: | link.min.js |
Email addresses inserted as link are converted to mailto: links.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkConvertEmailAddress: false
});
linkEditButtons
| Type: | Array |
| Default: | ['linkOpen', 'linkStyle', 'linkEdit', 'linkRemove'] |
| Plugin: | link.min.js |
The list of buttons that appear in the edit link popup, when clicking on an existing link from the editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkEditButtons: ['linkEdit', 'linkRemove']
});
linkInsertButtons
| Type: | Array |
| Default: | ['linkBack', '|', 'linkList'] |
| Plugin: | link.min.js |
The list of buttons that appear in the insert link popup, when inserting a new link into the WYSIWYG editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkInsertButtons: ['linkBack']
});
linkList
| Type: | Array |
| Default: | [] |
| Plugin: | link.min.js |
Set a predefined list of links to select from when inserting or editing a link.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkList: [
{
text: 'Google',
href: 'http://google.com',
target: '_blank',
rel: 'nofollow'
},
{
displayText: 'Froala',
href: 'https://awsstage.froala.com',
target: '_blank'
}
]
});
linkMultipleStyles
| Type: | Boolean |
| Default: | true |
| Plugin: | link.min.js |
Allows multiple link styles to be selected at a time.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkMultipleStyles: false
});
linkNoOpener
| Type: | Boolean |
| Default: | true |
| Plugin: | link.min.js |
Disables adding the noopener attribute when link is set to open in a new tab.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkNoOpener: false
});
linkNoReferrer
| Type: | Boolean |
| Default: | true |
| Plugin: | link.min.js |
Disables adding the noreferrer attribute when link is set to open in a new tab.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkNoReferrer: false
});
linkStyles
| Type: | Object |
| Default: | {
'fr-green': 'Green',
'fr-strong': 'Thick'
} |
| Plugin: | link.min.js |
Set custom styles for the selected link. The classes should be defined in CSS, otherwise no changes will be visible on the link's appearance.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkStyles: {
class1: 'Class 1',
class2: 'Class 2',
class3: 'Class 3'
}
});
linkText
| Type: | Boolean |
| Default: | false |
| Plugin: | link.min.js |
This option allows to edit the link text inside the edit link popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
linkText: true
});
Lists
listAdvancedTypes
| Type: | Boolean |
| Default: | true |
| Plugin: | lists.min.js |
Enables list advanced types for the bullets.
CODE EXAMPLE
new FroalaEditor('.selector', {
listAdvancedTypes: false
});
Page Break
exportPageBreak
| Type: | Boolean |
| Default: | true |
| Plugin: | page_break.min.js |
When set to false, page breaks will be excluded from exported content (PDF, Word, or Print).
CODE EXAMPLE
new FroalaEditor('.selector', {
exportPageBreak: false
});
Paragraph Format
paragraphFormat
paragraphFormatSelection
paragraphMultipleStyles
paragraphStyles
lineHeights
paragraphDefaultSelection
| Type: | String |
| Default: | 'Paragraph Format' |
| Plugin: | paragraph_format.min.js |
The default option to select for Paragraph Format.
CODE EXAMPLE
new FroalaEditor('.selector', {
paragraphDefaultSelection: 'Paragraph'
});paragraphFormat
| Type: | Object |
| Default: | {
N: 'Normal',
H1: 'Heading 1',
H2: 'Heading 2',
H3: 'Heading 3',
H4: 'Heading 4',
PRE: 'Code'
} |
| Plugin: | paragraph_format.min.js |
An Object with the options that will appear in the Paragraph Format dropdown from the toolbar. Where โNโ tag will be treated as a <p> when the enter option is set to FroalaEditor.ENTER_P and as a <div> when the enter option is set to FroalaEditor.ENTER_DIV.
CODE EXAMPLE
new FroalaEditor('.selector', {
paragraphFormat: {
N: 'Normal',
H1: 'Heading 1',
H2: 'Heading 2'
}
});paragraphFormatSelection
| Type: | Boolean |
| Default: | false |
| Plugin: | paragraph_format.min.js |
The Paragraph Format button from the WYSIWYG editorโs toolbar is replaced with a dropdown showing the actual paragraph format name for the current text selection.
CODE EXAMPLE
new FroalaEditor('.selector', {
paragraphFormatSelection: true
});paragraphMultipleStyles
| Type: | Boolean |
| Default: | true |
| Plugin: | paragraph_format.min.js |
Allows multiple paragraph styles to be selected at a time.
CODE EXAMPLE
new FroalaEditor('.selector', {
paragraphMultipleStyles: false
});paragraphStyles
| Type: | Object |
| Default: | {
'fr-text-gray': 'Gray',
'fr-text-bordered': 'Bordered',
'fr-text-spaced': 'Spaced',
'fr-text-uppercase': 'Uppercase'
} |
| Plugin: | paragraph_style.min.js |
Set custom styles for the selected paragraph. The classes should be defined in CSS, otherwise no changes will be visible on the paragraphโs appearance.
CODE EXAMPLE
new FroalaEditor('.selector', {
paragraphStyles: {
class1: 'Class 1',
class2: 'Class 2',
class3: 'Class 3'
}
});lineHeights
| Type: | Object/Array of objects |
| Default: | {
Default: '',
Single: '1',
'1.15': '1.15',
'1.5': '1.5',
Double: '2'
} |
| Plugin: | line_height.min.js |
Set the line height for the current selected paragraph.
CODE EXAMPLE
Object:
The entries in the drop-down are sorted by the natural order of map elements in JavaScript
new FroalaEditor('.selector', {
lineHeights: {
'1.15': '1.15',
'1.5': '1.5',
Double: '2'
}
});Array of objects:
The entries in the drop-down are not sorted, it is shown in the same order as it is passed
new FroalaEditor('.selector', {
lineHeights: [
{label:'1', value:'1'},
{label:'1.15', value:'1.15'},
{label:'1.5', value:'1.5'},
{label:'2', value:'2'},
]
});Quick Insert
quickInsertButtons
| Type: | Array |
| Default: | ['image', 'video', 'embedly', 'table', 'ul', 'ol', 'hr'] |
| Plugin: | quick_insert.min.js |
The buttons to display in quick insert.
CODE EXAMPLE
new FroalaEditor('.selector', {
quickInsertButtons: ['image', 'table']
});
quickInsertEnabled
| Type: | Boolean |
| Default: | true |
| Plugin: | quick_insert.min.js |
To enable quick insert functionality.
CODE EXAMPLE
new FroalaEditor('.selector', {
quickInsertEnabled: false
});
quickInsertTags
| Type: | Array |
| Default: | ['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'blockquote'] |
| Plugin: | quick_insert.min.js |
The list of tags for which the quick insert button will appear when empty.
CODE EXAMPLE
new FroalaEditor('.selector', {
quickInsertTags: ['p', 'div']
});
Font Awesome
faButtons
| Type: | Array |
| Default: | ["fontAwesomeBack", "|"] |
| Third Party: | font_awesome.min.js |
The list of Font Awesome buttons to show in the popup for inserting icons.
CODE EXAMPLE
new FroalaEditor('.selector', {
faButtons: ["fontAwesomeBack", "|"]
});
fontAwesomeSets
| Type: | Object |
| Default: | {} |
| Third Party: | font_awesome.min.js |
The list of Font Awesome icons to show in the modal for inserting icons.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontAwesomeSets: [
{
title: 'Accessibility Icons',
list: [
'american-sign-language-interpreting',
'asl-interpreting',
'assistive-listening-systems',
'audio-description',
'blind',
'braille',
'cc',
'deaf',
'deafness',
'hard-of-hearing',
'low-vision',
'question-circle-o',
'sign-language',
'signing',
'tty',
'universal-access',
'volume-control-phone',
'wheelchair',
'wheelchair-alt'
]
},
{
title: 'Hand Icons',
list: [
'hand-grab-o',
'hand-lizard-o',
'hand-o-down',
'hand-o-left',
'hand-o-right',
'hand-o-up',
'hand-paper-o',
'hand-peace-o',
'hand-pointer-o',
'hand-rock-o',
'hand-scissors-o',
'hand-spock-o',
'hand-stop-o',
'thumbs-down',
'thumbs-o-down',
'thumbs-o-up',
'thumbs-up'
]
}
]
});
fontAwesomeTemplate
| Type: | String |
| Default: | '<i class="fa fa-[NAME] fr-deletable" aria-hidden="true"> </i>' |
| Third Party: | font_awesome.min.js |
Set the template to be used for the Font Awesome icons inserted in the editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
fontAwesomeTemplate: '<i class="fa fa-[NAME] fr-deletable" aria-hidden="true"> </i>'
});
Special Characters
specialCharButtons
| Type: | Array |
| Default: | ["specialCharBack", "|"] |
| Third Party: | special_characters.min.js |
The list of special characters buttons for popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
specialCharButtons: ["specialCharBack", "|"]
});
specialCharactersSets
| Type: | Object |
| Default: | {} |
| Third Party: | special_characters.min.js |
The list of special characters to show.
CODE EXAMPLE
new FroalaEditor('.selector', {
specialCharactersSets: [
{
title: 'Latin',
list: [
{ 'char': '¡', desc: 'INVERTED EXCLAMATION MARK' },
{ 'char': '¢', desc: 'CENT SIGN' },
{ 'char': '£', desc: 'POUND SIGN' },
{ 'char': '¤', desc: 'CURRENCY SIGN' },
{ 'char': '¥', desc: 'YEN SIGN' },
{ 'char': '¦', desc: 'BROKEN BAR' },
{ 'char': '§', desc: 'SECTION SIGN' },
{ 'char': '¨', desc: 'DIAERESIS' },
{ 'char': '©', desc: 'COPYRIGHT SIGN' },
{ 'char': '™', desc: 'TRADEMARK SIGN' },
{ 'char': 'ª', desc: 'FEMININE ORDINAL INDICATOR' },
{ 'char': '«', desc: 'LEFT-POINTING DOUBLE ANGLE QUOTATION MARK' },
{ 'char': '¬', desc: 'NOT SIGN' },
{ 'char': '®', desc: 'REGISTERED SIGN' },
{ 'char': '¯', desc: 'MACRON' },
{ 'char': '°', desc: 'DEGREE SIGN' },
{ 'char': '±', desc: 'PLUS-MINUS SIGN' },
{ 'char': '²', desc: 'SUPERSCRIPT TWO' },
{ 'char': '³', desc: 'SUPERSCRIPT THREE' },
{ 'char': '´', desc: 'ACUTE ACCENT' },
{ 'char': 'µ', desc: 'MICRO SIGN' },
{ 'char': '¶', desc: 'PILCROW SIGN' },
{ 'char': '·', desc: 'MIDDLE DOT' },
]
},
{
title: 'Greek',
list: [
{ 'char': 'Α', desc: 'GREEK CAPITAL LETTER ALPHA' },
{ 'char': 'Β', desc: 'GREEK CAPITAL LETTER BETA' },
{ 'char': 'Γ', desc: 'GREEK CAPITAL LETTER GAMMA' },
{ 'char': 'Δ', desc: 'GREEK CAPITAL LETTER DELTA' },
{ 'char': 'Ε', desc: 'GREEK CAPITAL LETTER EPSILON' },
{ 'char': 'Ζ', desc: 'GREEK CAPITAL LETTER ZETA' },
{ 'char': 'Η', desc: 'GREEK CAPITAL LETTER ETA' },
{ 'char': 'Θ', desc: 'GREEK CAPITAL LETTER THETA' },
{ 'char': 'Ι', desc: 'GREEK CAPITAL LETTER IOTA' },
{ 'char': 'Κ', desc: 'GREEK CAPITAL LETTER KAPPA' }
]
}
]
});
WebSpellChecker
events
| Type: | Object |
| Default: | window.WEBSPELLCHECKER_CONFIG = {
autoSearch: true,
autoDestroy: true,
serviceId: '1:long-identifier-received-from-webspellchecker-after-subscription'
}; |
| Third Party: | wscbundle.min.js |
The options used for WebSpellChecker.
CODE EXAMPLE
new FroalaEditor('.selector', {
events: {
'initialized': function() {
WEBSPELLCHECKER.init({
container: this.el
});
}
}
});
Codox Wave
codoxOptions
| Type: | object |
| Default: | events: {
'initialized': function() {
//Adding Wave configuration
const editor = this;
var config = {
"app" : "froala",
"docId" : "mydoc",
"username" : "Chris",
"editor" : editor,
"apiKey" : "Your-codox-key-here"
};
codox.init(config);
}
} |
| Third Party: | wave.client.min.js |
Set options for codox plugin.
app
| Type: | string |
| Default: | required |
The static string value froala
docId
| Type: | string |
| Default: | required |
A unique identifier for the document. In a content management service, this could for example be the resource identifier for the document.
username
| Type: | string |
| Default: | required |
The name of the user joining the co-editing session. For a content management service, this should be set for each logged-in user based on their credentials. This name will be displayed during real-time co-editing sessions.
apiKey
| Type: | string |
| Default: | required |
The API key for Froala's Codox integration. You can obtain a key from your Wave account. Froala Editor activation instructions can be found here.
editor
| Type: | Froala |
| Default: | required |
A reference to a Froala editor instance, in which the co-editing session should be bootstrapped.
autoStart
| Type: | boolean |
| Default: | optional |
Set to true, if co-editing session should start automatically on init(config). Set to false to initialize but delay start the co-editing (see the start() client API). Default setting is true.
Save
saveInterval
| Type: | Number |
| Default: | 10000 |
| Plugin: | save.min.js |
Time in milliseconds that defines when the autosave should be triggered. Setting a higher interval helps preventing request overload on the server. The autosave will be triggered only if the content was changed from the last interval. Setting the value to 0 will disable autosave.
Note: It is not recommended to use values lower than 2000ms in order to prevent overload.
CODE EXAMPLE
new FroalaEditor('.selector', {
saveInterval: 2500
});
saveMethod
| Type: | String |
| Default: | 'POST' |
| Plugin: | save.min.js |
The HTTP save request type.
CODE EXAMPLE
new FroalaEditor('.selector', {
saveMethod: 'PUT'
});
saveParam
| Type: | String |
| Default: | 'body' |
| Plugin: | save.min.js |
The name of the parameter which contains the rich text editor's content on the save request.
CODE EXAMPLE
new FroalaEditor('.selector', {
saveParam: 'content'
});
saveParams
| Type: | Object |
| Default: | {} |
| Plugin: | save.min.js |
Additional parameters passed to the save request.
CODE EXAMPLE
new FroalaEditor('.selector', {
saveParams: {
id: 'my_editor'
}
});
saveURL
| Type: | String |
| Default: | null |
| Plugin: | save.min.js |
The URL where the save request is being made. The editor will initialize a HTTP request to the specified URL passing the editor's content in the body parameter of the HTTP request.
CODE EXAMPLE
new FroalaEditor('.selector', {
saveURL: 'http://example.com/save'
});
Table
enableTableSelection
| Type: | Boolean |
| Default: | true |
| Plugin: | table.min.js |
Enable or disable table Selection.
CODE EXAMPLE
new FroalaEditor('.selector', {
enableTableSelection: true
});
proportionalTableResize
| Type: | Boolean |
| Default: | true |
| Plugin: | table.min.js |
Controls how a table behaves when you resize it.
If proportionalTableResize is set to true, when you resize the table by dragging any edge (top, bottom, left, or right), all rows or columns will be resized proportionally. If it's set to false, only the row or column you are directly resizing will be affected.
CODE EXAMPLE
new FroalaEditor('.selector', {
proportionalTableResize: true
});
retainLineBreaksInCellsOnWrap
| Type: | Boolean |
| Default: | true |
When false, line breaks are removed when cell content wraps. Default behavior (true) preserves line breaks.
CODE EXAMPLE
new FroalaEditor('.selector', {
retainLineBreaksInCellsOnWrap: false
});
tableCellMultipleStyles
| Type: | Boolean |
| Default: | true |
| Plugin: | table.min.js |
Allows multiple table cell styles to be selected at a time.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableCellMultipleStyles: false
});
tableCellStyles
| Type: | Object |
| Default: | {
'fr-highlighted': 'Highlighted',
'fr-thick': 'Thick'
} |
| Plugin: | table.min.js |
Set custom styles for the selected table cells. The classes should be defined in CSS, otherwise no changes will be visible.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableCellStyles: {
class1: 'Class 1',
class2: 'Class 2',
class3: 'Class 3'
}
});
tableColors
| Type: | Array |
| Default: | [ '#61BD6D', '#1ABC9C', '#54ACD2', '#2C82C9', '#9365B8', '#475577', '#CCCCCC', '#41A85F', '#00A885', '#3D8EB9', '#2969B0', '#553982', '#28324E', '#000000', '#F7DA64', '#FBA026', '#EB6B56', '#E25041', '#A38F84', '#EFEFEF', '#FFFFFF', '#FAC51C', '#F37934', '#D14841', '#B8312F', '#7C706B', '#D1D5D8', 'REMOVE' ] |
| Plugin: | table.min.js |
The list of colors used in the edit table colors popup for the background of a table cell. Passing REMOVE as a value in the array will display the Clear Formatting button for the cell background color.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableColors: ['#61BD6D', '#1ABC9C', '#54ACD2', 'REMOVE']
});
tableColorsButtons
| Type: | Array |
| Default: | ['tableBack', '|'] |
| Plugin: | table.min.js |
The list of buttons that appear in the edit table colors popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableColorsButtons: ['tableBack']
});
tableColorsStep
| Type: | Number |
| Default: | 7 |
| Plugin: | table.min.js |
The number of colors displayed on a line in the edit table colors popup.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableColorsStep: 5
});
tableDefaultAlign
| Type: | String |
| Default: | center |
| Plugin: | table.min.js |
This config defines the alignment of the table. The allowed values are Center, left and right.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultAlign: 'left'
});
tableDefaultBGColor
| Type: | String |
| Default: | '' |
| Plugin: | table.min.js |
This config defines the default background color of the table when we insert a new one. Hex color strings are to be inserted as the default values.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultBGColor: '#000000'
});
tableDefaultBorderColor
| Type: | String |
| Default: | '' |
| Plugin: | table.min.js |
This config defines the border color of the table when we insert a new one. Hex color strings are to be inserted as the default values.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultBorderColor: '#000000'
});
tableDefaultBorderStyle
| Type: | String |
| Default: | '' |
| Plugin: | table.min.js |
This config defines the default border style when inserting a new table.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultBorderStyle: 'dashed'
});
tableDefaultBorderWidth
| Type: | String |
| Default: | '' |
| Plugin: | table.min.js |
This config defines the default width of the border when inserting a new table. The units can be px or in %.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultBorderWidth: '2px'
});
tableDefaultHeight
| Type: | String |
| Default: | 100px |
| Plugin: | table.min.js |
This config defines the default height of the table when we insert a new table.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultHeight: '200px'
});
tableDefaultWidth
| Type: | String |
| Default: | 50% |
| Plugin: | table.min.js |
This config was already existing, the default value has been changed from 100% to 50%. The units can be px or in %
CODE EXAMPLE
new FroalaEditor('.selector', {
tableDefaultWidth: '70%'
});
tableEditButtons
| Type: | Array |
| Default: | ['tableHeader', 'tableRemove', '|', 'tableRows', 'tableColumns', 'tableStyle', '-', 'tableCells', 'tableCellBackground', 'tableCellVerticalAlign', 'tableCellHorizontalAlign', 'tableCellStyle'] |
| Plugin: | table.min.js |
The list of buttons that appear in the edit table popup, when one or many cells are selected.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableEditButtons: [
'tableRows',
'tableColumns',
'tableCells',
'tableCellVerticalAlign',
'tableRemove'
]
});
tableInsertButtons
| Type: | Array |
| Default: | ['tableBack', '|'] |
| Plugin: | table.min.js |
The list of buttons that appear in the insert table popup, when the toolbarInline option is set to true.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableInsertButtons: [
'tableBack'
]
});
tableInsertHelper
| Type: | Boolean |
| Default: | true |
| Plugin: | table.min.js |
Insert rows and columns easier by going to the edge of the table.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableInsertHelper: false
});
tableInsertHelperOffset
| Type: | Integer |
| Default: | 15 |
| Plugin: | table.min.js |
The offset for showing the table insert helper.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableInsertHelperOffset: 25
});
tableInsertMaxSize
| Type: | Number |
| Default: | 10 |
| Plugin: | table.min.js |
The maximum number of lines and columns when inserting a table into the rich text editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableInsertMaxSize: 8
});
tableMultipleStyles
| Type: | Boolean |
| Default: | true |
| Plugin: | table.min.js |
Allows multiple table styles to be selected at a time.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableMultipleStyles: false
});
tableResizer
| Type: | Boolean |
| Default: | true |
| Plugin: | table.min.js |
Enables resizing table cells.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableResizer: false
});
tableResizerOffset
| Type: | Number |
| Default: | 5 |
| Plugin: | table.min.js |
The distance in pixels from the table cell's left or right border at which to show the resizer.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableResizerOffset: 10
});
tableResizingLimit
| Type: | Number |
| Default: | 30 |
| Plugin: | table.min.js |
The minimum width in pixels of a table cell allowed while resizing. The resizer cannot be dragged over this limit.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableResizingLimit: 20
});
tableStyles
| Type: | Object |
| Default: | {
'fr-dashed-borders': 'Dashed Borders',
'fr-alternate-rows': 'Alternate Rows'
} |
| Plugin: | table.min.js |
Set custom styles for the selected table. The classes should be defined in CSS, otherwise no changes will be visible on the table's appearance.
CODE EXAMPLE
new FroalaEditor('.selector', {
tableStyles: {
class1: 'Class 1',
class2: 'Class 2',
class3: 'Class 3'
}
});
Track Changes
showChangesEnabled
| Type: | Boolean |
| Default: | false |
| Plugin: | track_changes.min.js |
If set to true, track changes will be active by default.
CODE EXAMPLE
new FroalaEditor('.selector', {
showChangesEnabled: false
});
trackChangesEnabled
| Type: | Boolean |
| Default: | false |
| Plugin: | track_changes.min.js |
If set to true, show changes feature will be active by default.
CODE EXAMPLE
new FroalaEditor('.selector', {
trackChangesEnabled: false
});
Video
videoAllowedProviders
| Type: | Array |
| Default: | ['.*'] |
| Plugin: | video.min.js |
The list of video providers allowed to be inserted as URL.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoAllowedProviders: [
'youtube',
'vimeo'
]
});
videoAllowedTypes
| Type: | Array |
| Default: | ['mp4', 'webm', 'ogg'] |
| Plugin: | image.min.js |
The list of video types that are allowed to be uploaded. Although this will restrict uploading other types of files, we strongly recommend you to check the file type on the server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoAllowedTypes: [
'mp4'
]
});
videoDefaultAlign
| Type: | String |
| Default: | 'center' |
| Plugin: | video.min.js |
Sets the default video alignment when it is inserted into the WYSIWYG editor. Possible values are left, center and right.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoDefaultAlign: 'left'
});
videoDefaultDisplay
| Type: | String |
| Default: | 'block' |
| Plugin: | video.min.js |
Sets the default display for videos when they are inserted into the WYSIWYG editor. Possible options are: "inline" and "block".
CODE EXAMPLE
new FroalaEditor('.selector', {
videoDefaultDisplay: 'inline'
});
videoDefaultWidth
| Type: | Number |
| Default: | 600 |
| Plugin: | image.min.js |
Sets the default width of the video when it is inserted in the rich text editor. Setting it to 0 will not set any width.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoDefaultWidth: 200
});
videoEditButtons
| Type: | Array |
| Default: | ['videoReplace', 'videoRemove', '|' 'videoDisplay', 'videoAlign', 'videoSize', 'autoplay'] |
| Plugin: | video.min.js |
The buttons that appear in the edit video popup, when a video is selected.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoEditButtons: [
'videoDisplay',
'videoRemove'
]
});
videoInsertButtons
| Type: | Array |
| Default: | ['videoBack', '|', 'videoByURL', 'videoEmbed', 'videoUpload'] |
| Plugin: | video.min.js |
The buttons that appear in the insert video popup, when a video is inserted into the WYSIWYG editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoInsertButtons: [
'videoBack',
'|',
'videoByURL'
]
});
videoMaxSize
| Type: | Number |
| Default: | 1024 * 1024 * 30 |
| Plugin: | video.min.js |
The maximum video size allowed on upload in bytes. The default value is 30MB. Although this makes an additional check before uploading the video, it is highly recommended to check image size on your server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoMaxSize: 1024 * 1024 * 15
});
videoMove
| Type: | Boolean |
| Default: | true |
| Plugin: | video.min.js |
Allows changing the position of the videos by dragging them.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoMove: false
});
videoResize
| Type: | Boolean |
| Default: | true |
| Plugin: | video.min.js |
Enable or disable resizing the videos inside the editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoResize: false
});
videoResponsive
| Type: | Boolean |
| Default: | false |
| Plugin: | video.min.js |
Enable or disable inserting responsive videos in the Froala Editor.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoResponsive: true
});
videoSizeButtons
| Type: | Array |
| Default: | ['videoBack', '|'] |
| Plugin: | video.min.js |
The buttons that appear in the edit video size popup, when changing the size of a selected video.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoSizeButtons: [
'videoBack'
]
});
videoSplitHTML
| Type: | Boolean |
| Default: | false |
| Plugin: | video.min.js |
Enables splitting the HTML when inserting a new view.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoSplitHTML: true
});
videoTextNear
| Type: | Boolean |
| Default: | true |
| Plugin: | video.min.js |
Allows text near a video when it is aligned to the left or to the right. Disabling this option will make the display button for image editor popup unavailable.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoTextNear: false
});
videoUpload
| Type: | Boolean |
| Default: | true |
| Plugin: | video.min.js |
Enable or disable video upload.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoUpload: false
});
videoUploadMethod
| Type: | String |
| Default: | 'POST' |
| Plugin: | video.min.js |
The HTTP video upload request type.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoUploadMethod: 'PUT'
});
videoUploadParam
| Type: | String |
| Default: | 'file' |
| Plugin: | video.min.js |
Customize the name of the parameter that contains the video file in the upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoUploadParam: 'file_name'
});
videoUploadParams
| Type: | Object |
| Default: | {} |
| Plugin: | video.min.js |
Pass additional parameters to the upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoUploadParams: {
id: 'my_editor'
}
});
videoUploadToS3
| Type: | Object |
| Default: | false |
| Plugin: | video.min.js |
Set the options for video upload to S3. All the fields from the example below are required. Also make sure that you have enabled CORS on Amazon.
Note: uploadURL property can be used instead of bucket and region properties to specify a custom URL from Amazon where to upload the video.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoUploadToS3: {
bucket: 'editor',
// Your bucket region.
region: 's3-us-east-1',
keyStart: 'uploads/',
params: {
acl: 'public-read', // ACL according to Amazon Documentation.
AWSAccessKeyId: 'ACCESS_KEY', // Access Key from Amazon.
policy: 'POLICY_STRING', // Policy string computed in the backend.
signature: '', // Signature computed in the backend.
// If you are using Amazon Signature V4, the followings should be used instead.
// "X-Amz-Credential": "...",
// "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
// "X-Amz-Date": "...",
// Policy: "...", //
// "X-Amz-Signature": "", // computed in backend
}
}
});
videoUploadURL
| Type: | String |
| Default: | null |
| Plugin: | video.min.js |
The URL where the videos uploaded by the user are saved. When a video is uploaded, the editor sends the file to the server through a HTTP request. The server should process the data from the file parameter of the request and return a JSON object containing a link field with the link to the uploaded video.
Note 1: By default, the videos are stored on our servers, but if you want to have full control over them, you should consider implementing the upload on your server. The videos stored on our servers, may be deleted at any time without any notice.
Note 2: If the domain where the video is saved is not the same with the one where the editor is running, you may need to enable requestWithCORS option and make specific customizations on the server. For more information please refer to Cross-origin resource sharing.
CODE EXAMPLE
new FroalaEditor('.selector', {
videoUploadURL: '/upload_video'
});
Word
wordAllowedStyleProps
| Type: | Array |
| Default: | ['font-family', 'font-size', 'background', 'color', 'width', 'text-align', 'vertical-align', 'background-color', 'padding', 'margin', 'height', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom', 'text-decoration', 'font-weight', 'font-style', 'text-indent', 'border', 'border-.*'] |
The list of allowed CSS attributes to be used for tags when pasting from Word.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordAllowedStyleProps: [
'font-size'
]
});
wordDeniedAttrs
| Type: | Array |
| Default: | [] |
Attributes that are removed when pasting something into the rich text editor from Word.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordDeniedAttrs: [
'style'
]
});
wordDeniedTags
| Type: | Array |
| Default: | [] |
Tags that are removed together with their content when pasting something into the rich text editor from Word.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordDeniedTags: [
'a'
]
});
wordPasteModal
| Type: | Boolean |
| Default: | true |
Show modal to choose if to keep or not styles pasted from Word. If set to false, the default action is to keep the formatting.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordPasteModal: false
});
wordPasteKeepFormatting
| Type: | Boolean |
| Default: | true |
Choose the default action when wordPasteModal option is enabled.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordPasteKeepFormatting: false
});
Files Manager
filesManagerAllowedTypes
| Type: | Array |
| Default: | ['*'] |
| Plugin: | files_manager.min.js |
The list of file types that are allowed to be uploaded. Although this will restrict uploading other types of files, we strongly recommend you to check the file type on the server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
filesManagerAllowedTypes: [
'application/pdf',
'application/msword',
โvideo/mp4โ,
โvideo/webmโ,
โimage/pngโ
]
});
filesManagerMaxSize
| Type: | Number |
| Default: | 1024 * 1024 *10 |
| Plugin: | files_manager.min.js |
The maximum file size allowed on upload in bytes. The default value is 10MB. Although this makes an additional check before uploading the file, it is highly recommended to check file size on your server too.
CODE EXAMPLE
new FroalaEditor('.selector', {
filesManagerMaxSize: 1024 * 1024 * 3
});
filesManagerUploadParams
| Type: | Object |
| Default: | {} |
| Plugin: | files_manager.min.js |
Pass additional parameters to the file upload request.
CODE EXAMPLE
new FroalaEditor('.selector', {
filesManagerUploadParams: {
id: 'my_editor'
}
});
filesManagerUploadToS3
| Type: | Object |
| Default: | false |
| Plugin: | files_manager.min.js |
Set the options for file upload to S3. All the fields from the example below are required.
Also make sure that you have enabled CORS on Amazon.
Note: uploadURL property can be used instead of bucket and region properties to
specify a custom URL from Amazon where to upload the image.
CODE EXAMPLE
new FroalaEditor('.selector', {
filesManagerUploadToS3: {
bucket: 'editor',
region: 's3',
keyStart: 'uploads/',
params:{
acl: 'public-read', // ACL according to Amazon Documentation.
AWSAccessKeyId: 'ACCESS_KEY', // Access Key from Amazon.
policy: 'POLICY_STRING', // Policy string computed in the backend.
signature: '', // Signature computed in the backend.
// If you are using Amazon Signature V4, the followings should beused instead.
// "X-Amz-Credential": "...",
// "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
// "X-Amz-Date": "...",
// Policy: "...", //
// "X-Amz-Signature": "", // computed in backend
}
}
});
filesManagerUploadURL
| Type: | String |
| Default: | http://i.awsstage.froala.com/upload |
| Plugin: | files_manager.min.js |
The URL where the files uploaded by the user are saved. When a file is uploaded, the
editor sends the file to the server through a HTTP request. The server should process
the data from the file parameter of the request and return a JSON object containing a
link field with the link to the uploaded file.
E.g. {link: 'path/to/file.pdf'}
Note 1: By default, the files are stored on our servers, but if you want to have full
control over them, you should consider implementing the upload on your server. The
files stored on our servers, may be deleted at any time without any notice.
Note 2: If the domain where the file is saved is not the same with the one where the
editor is running, you may need to enable requestWithCORS option and make specific
customizations on the server. For more information please refer to Cross-origin
resource sharing.
CODE EXAMPLE
new FroalaEditor('.selector', {
filesManagerUploadURL: '/upload_file'
});
Word Counter
wordCounterCount
| Type: | Boolean |
| Default: | true |
| Plugin: | word_counter.min.js |
Enables or disables the display of the word counter.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordCounterCount: false
});
wordCounterMax
| Type: | Number |
| Default: | -1 |
| Plugin: | word_counter.min.js |
The maximum number of words allowed to be inserted into the rich text editor. -1 means that there is not limit set.
CODE EXAMPLE
new FroalaEditor('.selector', {
wordCounterMax: 140
});
Do you think we can improve this article? Let us know.
