- Getting Started
- Browser Support
- Languages Support
- Shortcuts
- Activation
- Examples
- Customize the Editor
- Use-cases
- Plugins
- APIs
- Development Frameworks
- Server Integrations
- Server SDKs
- Migration Guides
- Changelog
Get Started
Looking for a Specific Framework Integration?
To find information on how to integrate Froala Editor in a new or an existing project, select your development framework from the list below:
Step 1: Include Froala JavaScript and StyleSheet Files
To use Froala Editor in your projects you need to add the required JavaScript and stylesheet files. You can download these files using one of options listed below, or you can use get the files from CDN.
clickDownload Form
Fill out the download form to get the Zip archive, it contains the minified source code and lots of examples highlighting editor features.
Fill out the form to download a free trial of Froala Editor.
After downloading the ZIP archive, extract the required JS and CSS files, and include them in the editor. The following example shows how to add them to your project:
Note: Replace download-folder-path
with the path to the folder containing the Froala files
<link href="download-folder-path/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="download-folder-path/froala_editor.pkgd.min.js"></script>
Use CDN
To include the required files hosted on CDN add the following code to your project:
<link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>
The above example always loads the latest version of Froala Editor, alternatively, you can determine a specific version to use by replacing '@latest' in the above links with @{version-number} that you need to load. For instance, to load Froala Editor version 4.0.10 you should change the URLs to:
<link href='https://cdn.jsdelivr.net/npm/[email protected]/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/[email protected]/js/froala_editor.pkgd.min.js'></script>
Use CDN as AMD
Froala Editor is compatible with AMD module loaders such as RequireJS. The following example shows how to load it along with the Algin plugin from CDN using RequireJS. See the example below:
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.css">
<script src="require.js"></script>
<script>
require.config({
packages: [{
name: 'froala-editor',
main: 'js/froala_editor.min'
}],
paths: {
// Change this to your server if you do not wish to use our CDN.
'froala-editor': 'https://cdn.jsdelivr.net/npm/froala-editor@latest'
}
});
</script>
Install From NPM
To install from NPM follow these steps:
- Create a new project using
npm init
- Run the following command:
After the installation process is finished, embed this code inside your HTML file:
<link href="node_modules/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="node_modules/froala-editor/js/froala_editor.pkgd.min.js"></script>
npm install froala-editor
Install From Bower
Run the following command:
bower install froala-wysiwyg-editor
After the installation process is finished, add this code to your HTML file:
<link href="bower_components/froala-wysiwyg-editor/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="bower_components/froala-wysiwyg-editor/js/froala_editor.pkgd.min.js"></script>
Load as a CommonJS Module
Froala Editor is using an UMD module pattern, as a result it has support for CommonJS. The following examples presumes you are using npm to install froala-editor, see Install from NPM and install FroalaEditor.
var FroalaEditor = require('froala-editor');
// Load a plugin.
require('froala-editor/js/plugins/align.min');
Load as a transpiled ES6/UMD module
Since Froala Editor supports ES6 (ESM – ECMAScript modules) and UMD (AMD, CommonJS), it can be also loaded as a module with the use of transpilers. E.g. Babel, Typescript. The following examples presumes you are using npm to install froala-editor, see Install from NPM.
import FroalaEditor from 'froala-editor'
// Load a plugin.
import 'froala-editor/js/plugins/align.min.js'
Use with Webpack
Froala Rich Text Editor can be used in modern build environments such as Webpack. The code below highlights the Webpack 4 configuration, while a full example is available in this Github Gist.
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
resolve: {
modules: ['node_modules']
},
plugins: []
};
Step 2: Create DOM Element
The Froala Editor is quite flexible and can be initialized to ‘attach’ to any standard HTML DOM element, such as a DIV, or a TEXTAREA. We recommend using a DIV element, which can be done as follows:
<div id="example"></div>
The “example” id ties the div element to the instance of the Froala Editor that will be initialized in the following step.
Step 3: Initialize the Editor
The last step consists of initializing the Froala Editor on our previously created empty element.
var editor = new FroalaEditor('#example');
Full Initialization Code Example
This is the summary of the above three steps.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
<link href="node_modules/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="example"></div>
<script type="text/javascript" src="node_modules/froala-editor/js/froala_editor.pkgd.min.js"></script>
<script>
var editor = new FroalaEditor('#example');
</script>
</body>
</html>
This is the summary of the above three steps.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
<link href="bower_components/froala-wysiwyg-editor/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="example"></div>
<script type="text/javascript" src="bower_components/froala-wysiwyg-editor/js/froala_editor.pkgd.min.js"></script>
<script>
var editor = new FroalaEditor('#example');
</script>
</body>
</html>
This is the summary of the above three steps.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
<link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="example"></div>
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>
<script>
var editor = new FroalaEditor('#example');
</script>
</body>
</html>
This is the summary of the above three steps.
<html>
<head>