Convert Figma logo to code with AI

froala logowysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.

5,270
673
5,270
1,105

Top Related Projects

14,837

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.

43,060

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Super simple WYSIWYG editor

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

22,569

A React framework for building text editors.

Quick Overview

Froala WYSIWYG Editor is a powerful and lightweight JavaScript rich text editor for web applications. It offers a modern, customizable interface with a wide range of features, making it suitable for various content creation and editing tasks.

Pros

  • Rich feature set, including image manipulation, video embedding, and table creation
  • Highly customizable with numerous plugins and configuration options
  • Mobile-friendly and responsive design
  • Extensive documentation and good community support

Cons

  • Commercial license required for most use cases
  • Learning curve can be steep for advanced customizations
  • Some users report occasional performance issues with large documents
  • Limited free version with restricted features

Code Examples

  1. Basic initialization:
new FroalaEditor('#editor');
  1. Customizing toolbar buttons:
new FroalaEditor('#editor', {
  toolbarButtons: ['bold', 'italic', 'underline', 'paragraphFormat', 'align']
});
  1. Handling events:
new FroalaEditor('#editor', {
  events: {
    'contentChanged': function () {
      console.log('Content changed');
    },
    'focus': function () {
      console.log('Editor is focused');
    }
  }
});
  1. Adding custom buttons:
FroalaEditor.DefineIcon('alert', {NAME: 'info', SVG_KEY: 'help'});
FroalaEditor.RegisterCommand('alert', {
  title: 'Alert',
  focus: false,
  undo: false,
  refreshAfterCallback: false,
  callback: function () {
    alert('Hello!');
  }
});

new FroalaEditor('#editor', {
  toolbarButtons: ['bold', 'italic', 'underline', '|', 'alert']
});

Getting Started

  1. Include Froala Editor files in your HTML:
<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>
  1. Create a container element:
<textarea id="editor"></textarea>
  1. Initialize the editor:
new FroalaEditor('#editor');

This will create a basic Froala Editor instance with default options. You can customize it further by passing configuration options to the constructor.

Competitor Comparisons

14,837

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

Pros of TinyMCE

  • More extensive documentation and community support
  • Wider range of plugins and customization options
  • Better accessibility features and compliance with WCAG standards

Cons of TinyMCE

  • Larger file size, which may impact page load times
  • Steeper learning curve for advanced customization
  • Some advanced features require a paid license

Code Comparison

TinyMCE initialization:

tinymce.init({
  selector: 'textarea',
  plugins: 'advlist autolink lists link image charmap print preview anchor',
  toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | link image'
});

Froala initialization:

new FroalaEditor('#editor', {
  toolbarButtons: ['bold', 'italic', 'underline', 'strikeThrough', '|', 'paragraphFormat', 'align', 'formatOL', 'formatUL', '|', 'insertLink', 'insertImage', 'insertTable'],
  pluginsEnabled: ['align', 'charCounter', 'codeBeautifier', 'codeView', 'colors', 'draggable', 'emoticons', 'entities', 'file', 'fontFamily', 'fontSize', 'fullscreen', 'image', 'imageManager', 'inlineStyle', 'lineBreaker', 'link', 'lists', 'paragraphFormat', 'paragraphStyle', 'quickInsert', 'quote', 'save', 'table', 'url', 'video', 'wordPaste']
});

Both editors offer rich text editing capabilities, but TinyMCE provides more out-of-the-box features and customization options, while Froala focuses on a simpler, more lightweight approach.

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.

Pros of CKEditor 5

  • Open-source with a more permissive license (GPL-2.0)
  • Larger community and more frequent updates
  • Extensive documentation and learning resources

Cons of CKEditor 5

  • Steeper learning curve for customization
  • Larger file size, which may impact page load times

Code Comparison

CKEditor 5:

import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

ClassicEditor
    .create(document.querySelector('#editor'))
    .then(editor => {
        console.log('Editor was initialized', editor);
    })
    .catch(error => {
        console.error(error);
    });

Froala Editor:

new FroalaEditor('#editor', {
    toolbarButtons: ['bold', 'italic', 'underline'],
    events: {
        'initialized': function() {
            console.log('Editor was initialized');
        }
    }
});

Both editors offer rich text editing capabilities, but CKEditor 5 provides a more modular approach with its plugin system. Froala Editor, on the other hand, offers a simpler initialization process and easier customization for basic use cases. CKEditor 5's open-source nature and larger community support make it a popular choice for developers who prioritize flexibility and long-term maintainability, while Froala Editor might be preferred for its ease of use and commercial support options.

43,060

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Pros of Quill

  • Open-source and free to use, unlike Froala which requires a license
  • Modular architecture allows for easy customization and extension
  • Smaller file size and faster loading times

Cons of Quill

  • Less extensive feature set compared to Froala's rich functionality
  • Limited built-in UI components and themes
  • Steeper learning curve for advanced customizations

Code Comparison

Quill initialization:

var quill = new Quill('#editor', {
  theme: 'snow'
});

Froala initialization:

new FroalaEditor('#editor', {
  toolbarButtons: ['bold', 'italic', 'underline']
});

Both editors offer simple initialization, but Froala provides more built-in options for toolbar customization out of the box. Quill requires additional modules or custom code for similar functionality.

Quill focuses on a lean core with modular extensions, while Froala offers a more comprehensive set of features by default. The choice between them depends on specific project requirements, budget constraints, and desired level of customization.

Super simple WYSIWYG editor

Pros of Summernote

  • Open-source and free to use, unlike Froala which requires a license
  • Lightweight and easy to integrate with minimal dependencies
  • Extensive documentation and active community support

Cons of Summernote

  • Less feature-rich compared to Froala's advanced capabilities
  • May require more custom development for complex use cases
  • Limited built-in UI customization options

Code Comparison

Summernote initialization:

$('#summernote').summernote({
  height: 300,
  toolbar: [
    ['style', ['bold', 'italic', 'underline', 'clear']],
    ['font', ['strikethrough', 'superscript', 'subscript']]
  ]
});

Froala initialization:

new FroalaEditor('#editor', {
  height: 300,
  toolbarButtons: [
    'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript'
  ]
});

Both editors offer similar basic initialization, but Froala provides more advanced configuration options and features out of the box. Summernote's simplicity makes it easier to set up for basic use cases, while Froala's extensive API allows for more complex implementations and customizations.

Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

Pros of medium-editor

  • Open-source and free to use, unlike the commercial Froala editor
  • Lightweight and minimalistic, with a smaller footprint than Froala
  • Highly customizable and extensible through plugins and custom extensions

Cons of medium-editor

  • Less feature-rich out of the box compared to Froala's comprehensive toolkit
  • Limited official documentation and support compared to Froala's extensive resources
  • May require more setup and configuration for advanced features

Code Comparison

medium-editor:

var editor = new MediumEditor('.editable', {
    toolbar: {
        buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote']
    },
    placeholder: {
        text: 'Type your text'
    }
});

Froala:

new FroalaEditor('#editor', {
    toolbarButtons: ['bold', 'italic', 'underline', 'insertLink', 'insertImage', 'insertTable'],
    placeholderText: 'Type your text here',
    imageUploadURL: 'upload_image.php'
});

Both editors offer similar basic functionality, but Froala provides more built-in features like image upload handling. medium-editor focuses on simplicity and customization, while Froala offers a more comprehensive solution out of the box.

22,569

A React framework for building text editors.

Pros of Draft.js

  • Open-source and maintained by Facebook, ensuring high-quality code and community support
  • Highly customizable and extensible, allowing developers to create complex editing experiences
  • Built with React, making it easy to integrate into React-based applications

Cons of Draft.js

  • Steeper learning curve compared to WYSIWYG Editor, requiring more time to implement basic functionality
  • Less out-of-the-box features and styling options, potentially requiring more development effort
  • Limited browser compatibility, especially for older versions of Internet Explorer

Code Comparison

Draft.js:

import { Editor, EditorState } from 'draft-js';

const [editorState, setEditorState] = useState(EditorState.createEmpty());

<Editor editorState={editorState} onChange={setEditorState} />

WYSIWYG Editor:

<textarea id="editor">
  <p>Your content here</p>
</textarea>

<script>
  new FroalaEditor('#editor');
</script>

The Draft.js example shows a basic React implementation, while the WYSIWYG Editor example demonstrates a simpler HTML and JavaScript setup. Draft.js requires more configuration but offers greater flexibility, whereas WYSIWYG Editor provides a more straightforward implementation with pre-built features.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Froala Editor V4

Build Status npm npm

Froala WYSIWYG HTML Editor is one of the most powerful JavaScript rich text editors ever.

WYSIWYG HTML Editor

Demos

Download and Install Froala Editor

Install from npm

npm install froala-editor

Install from bower

bower install froala-wysiwyg-editor

Load from CDN

Using Froala Editor from CDN is the easiest way to install it and we recommend using the jsDeliver CDN as it mirrors the NPM package.

<!-- Include Editor style. -->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Create a tag that we will use as the editable area. -->
<!-- You can use a div tag as well. -->
<textarea></textarea>

<!-- Include Editor JS files. -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

<!-- Initialize the editor. -->
<script>
  new FroalaEditor('textarea');
</script>

Load from CDN as an AMD module

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.

<html>
<head>
  <!-- Load CSS files. -->
  <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>

  <style>
    body {
      text-align: center;
    }
    div#editor {
      width: 81%;
      margin: auto;
      text-align: left;
    }
    .ss {
      background-color: red;
    }
  </style>
</head>

<body>
  <div id="editor">
    <div id='edit' style='margin-top:30px;'>
    </div>
  </div>

  <script>
    require([
      'froala-editor',
      'froala-editor/js/plugins/align.min'
    ], function(FroalaEditor) {
      new FroalaEditor('#edit')
    });
  </script>
</body>

</html>

Load Froala Editor 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 Download and install FroalaEditor for more details.

var FroalaEditor = require('froala-editor');

// Load a plugin.
require('froala-editor/js/plugins/align.min');

// Initialize editor.
new FroalaEditor('#edit');

Load Froala Editor 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 Download and install FroalaEditor for more details.

import FroalaEditor from 'froala-editor'

// Load a plugin.
import 'froala-editor/js/plugins/align.min.js'

// Initialize editor.
new FroalaEditor('#edit')

For more details on customizing the editor, please check the editor documentation.

Use with your existing framework

Browser Support

At present, we officially aim to support the last two versions of the following browsers:

  • Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
  • Internet Explorer 11
  • Safari iOS
  • Chrome, Firefox and Default Browser Android

Resources

Reporting Issues

We use GitHub Issues as the official bug tracker for the Froala WYSIWYG HTML Editor. Here are some advices for our users that want to report an issue:

  1. Make sure that you are using the latest version of the Froala WYSIWYG Editor. The issue that you are about to report may be already fixed in the latest master branch version: https://github.com/froala/froala-wysiwyg/tree/master/js.
  2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed. A JSFiddle is always welcomed, and you can start from this basic one.
  3. Some issues may be browser specific, so specifying in what browser you encountered the issue might help.

Technical Support or Questions

If you have questions or need help integrating the editor please contact us instead of opening an issue.

Licensing

In order to use the Froala Editor you have to purchase one of the following licenses according to your needs. You can find more about that on our website on the pricing plan page.

NPM DownloadsLast 30 Days