Days
Hours
Minutes
Seconds
x
Skip to content

Froala v5.3.1: Real-Time Collaborative Editing Plugin, Svelte.js Support, and More

Froala 5.3.1 release
Froala Editor v5.3.1 is our biggest release in recent memory, headlined by the brand-new Collaborative plugin that brings real-time editing, comments, suggestions, and version control directly into the editor. This version also adds first-class Svelte.js support, a customizable font-size input, module-friendly Word import, and a reworked clipboard storage mechanism that keeps copied content out of localStorage by default.

Key Takeaways

  • The new Collaborative plugin adds real-time editing, comments, suggestions, and version control.
  • Real-time collaboration and persistence require a backend server (included in the Node SDK).
  • An official Svelte wrapper, svelte-froala-wysiwyg, makes Svelte integration native.
  • Custom font sizes, module-friendly Word import, and more private clipboard handling round out the release.

Heads-Up Before You Upgrade

Good news: v5.3.1 introduces no breaking API changes. Your existing configuration will continue to work as-is. There is one behavioral change worth knowing about before you deploy:

  • Clipboard storage no longer uses localStorage by default. Copied editor content is now written to the Origin Private File System (OPFS) in secure contexts, with an automatic localStorage fallback for non-secure contexts. This change happens automatically and requires no configuration. See the Improvements section for details.

What’s New in v5.3.1

New Features

  • Collaborative plugin. Real-time editing, inline comments, tracked-change suggestions, and version control, all in one plugin. This is the flagship feature of the release, covered in detail below.
  • Svelte.js support. An official Svelte wrapper, svelte-froala-wysiwyg, lets you drop the editor into a Svelte project with two-way data binding and full access to Froala’s options and events, no custom integration required.
  • Custom font sizes. The font-size dropdown now includes a custom option that opens a popup for entering an exact size, with configurable minimum and maximum limits so users can set the precise size they need without leaving the toolbar.

Improvements

  • Configurable Mammoth instance for Import from Word. A new importFromWordMammoth option lets you pass the Mammoth library as a module, which makes the Import from Word plugin work cleanly in modern build tools like Vite, Webpack, and other ES-module bundlers instead of relying on a global window.mammoth.
  • More private clipboard handling. Copied content is no longer persisted to localStorage by default. Froala now uses the Origin Private File System (OPFS) for clipboard metadata in secure contexts, reducing exposure of potentially sensitive content. See Private Clipboard Handling below for details.

Deep Dive: The Collaborative Plugin

Editing content is rarely a solo activity. Teams co-author articles, review contracts, and approve knowledge-base updates together, and until now that meant leaving the editor to trade changes over email, exports, and Word round-trips. The result was overwritten content from simultaneous edits, slow approval cycles, and no reliable history to roll back to.

The new Collaborative plugin solves this by bringing four highly requested capabilities into the editor itself:

  • Real-time editing. Every editor instance stays in sync as users type. A conflict-free replicated data type (CRDT) engine resolves concurrent edits and presence indicators show active cursors, so two people can edit the same document without overwriting each other.

Real-time editing

  • Comments. Highlight any text and attach a threaded, inline comment. Collaborators can reply, resolve threads, and @mention teammates, all anchored to the exact content under discussion.

comments

  • Suggestions. Reviewers propose insertions, deletions, and rewrites without touching the live document. Owners accept or reject each change individually.

Suggestions

  • Version control. Browse timestamped snapshots with author attribution, compare any two versions side by side, and restore a prior state in one click.

Version control

How It Works

The Collaborative plugin operates in two modes. In real-time mode, editors that share the same docId connect to a WebSocket server and collaborate live. In asynchronous (offline-first) mode, the plugin instead reads and writes collaborative data through REST endpoints. The single switch that flips between them is collabConfig.realTime.syncUrl: set it to enable real-time collaboration, or leave it null to fall back to async mode.

Comments, suggestions, and version history are shared live between connected users, but that live data is not persisted on its own. To store it in a database, point the editor at your backend using commentsUrlsuggestionsUrl, and versionControl.url.

Configuring the Editor

Here is a real-time setup with a user identity, a shared document ID, persistence URLs for comments, suggestions, and versions, and periodic auto-saved snapshots:

new FroalaEditor('.selector', {
  collabConfig: {
    user: {
      id: 'user-42',
      name: 'Alice',
      role: 'editor' // 'editor' | 'suggester' | 'viewer'
    },
    docId: 'my-doc',
    commentsUrl: 'http://localhost:3000/collab/my-doc/comments',
    suggestionsUrl: 'http://localhost:3000/collab/my-doc/suggestions',
    realTime: {
      syncUrl: 'ws://localhost:3000',
      reconnectDelay: 2000
    },
    versionControl: {
      url: 'http://localhost:3000/collab/my-doc/versions',
      autoSaveEnabled: true,
      autoSaveInterval: 300000 // save a snapshot every 5 minutes
    }
  }
});

The plugin also exposes methods and events for driving collaboration from your own UI. For example, you can switch modes, add a comment on the current selection, or save a named version snapshot:

var editor = new FroalaEditor('.selector', {}, function () {
  // Switch the active collaboration mode (respects the user's role).
  editor.collaborative.setMode('suggesting');

  // Add a comment anchored to the currently selected text.
  editor.collaborative.addComment('Please clarify this sentence.');

  // Save a named version snapshot.
  editor.collaborative.saveVersion('Draft v1', 'Before major revisions')
    .then(function (record) {
      console.log('Saved version:', record.id);
    });
});

And you can react to collaboration activity through events such as collab.connectionStatuscollab.remoteContentChanged, and version:create:

new FroalaEditor('.selector', {
  events: {
    'collab.connectionStatus': function (status) {
      // 'connecting' | 'connected' | 'disconnected'
      console.log('Connection status:', status);
    },
    'collab.remoteContentChanged': function () {
      console.log('Remote content updated.');
    },
    'version:create': function (record) {
      console.log('New version saved:', record.title, 'at', record.createdAt);
    }
  }
});

Setting Up the Backend

Real-time collaboration and persistence require a backend server. The Collaborative backend ships in the wysiwyg-editor-node-sdk package and is split into four modules: a WebSocket relay for real-time peer sync, REST endpoints for comments and suggestions, a version history store, and an async content-save endpoint. All four can share a single HTTP server and a single SQLite file, and the required better-sqlite3 dependency installs automatically with the package.

A minimal Express server that runs the WebSocket relay and all REST routes on one port looks like this:

const http = require('http');
const path = require('path');
const express = require('express');

const FroalaEditor = require('wysiwyg-editor-node-sdk');
const Collaborative = FroalaEditor.Collaborative;
const CollabPersistence = FroalaEditor.CollabPersistence;
const VersionControl = FroalaEditor.VersionControl;
const AsyncSave = FroalaEditor.AsyncSave;

const app = express();
app.use(express.json());

// REST routes for comments + suggestions, version history, and async save.
// All three can share a single SQLite file.
const dbPath = path.join(__dirname, 'data', 'collab.db');
CollabPersistence.attachRoutes(app, { dbPath: dbPath });
VersionControl.attachRoutes(app, { dbPath: dbPath });
AsyncSave.attachRoutes(app, { dbPath: dbPath });

// Share a single HTTP server between Express and the WebSocket relay.
const server = http.createServer(app);
Collaborative.attachToServer(server);

server.listen(3000, function () {
  console.log('Collaborative backend listening on port 3000');
});

Once the server is running, clients that connect with the same docId are treated as peers: the relay broadcasts every sync message to the other members of that document, while the REST endpoints (namespaced under /collab/:docId/) persist comments, suggestions, and version snapshots. For the full endpoint reference, request and response schemas, and configuration options, see the docs.

More in This Release

Custom Font Sizes

Users sometimes need a size that isn’t in the preset list. Adding custom to the fontSize array surfaces a Custom option in the dropdown that opens a popup for entering an exact value, so users can hit the precise size they want without a workaround. Two new options, fontSizeCustomMin (default 8) and fontSizeCustomMax (default 96), validate the entered value. Existing preset sizes behave exactly as before. Note that if you override the default fontSize array and still want this feature, you must explicitly include 'custom'.

new FroalaEditor('.selector', {
  // Add 'custom' to expose the manual-entry option.
  fontSize: ['8', '12', '18', '24', '36', '48', 'custom'],
  fontSizeCustomMin: 8,
  fontSizeCustomMax: 96
});

Svelte.js Support

Svelte developers now have an official Svelte wrapper for Froala Editor. The svelte-froala-wysiwyg component gives you a native Svelte way to drop the editor into a project, so you no longer have to build or maintain your own integration to get the editor running in a Svelte app. It ships with two-way data binding, full access to Froala’s options and events, support for initializing on special tags, and manual control over the editor lifecycle.

To get started, run:

npm install svelte-froala-wysiwyg

Configurable Mammoth for Import from Word

The Import from Word plugin previously expected mammoth.js on the global window object, which is awkward in module-based builds. The new importFromWordMammoth option lets you pass the library instance explicitly, so the plugin works in Vite, Webpack, and ES-module setups. It defaults to window.mammoth, and you can set it to false to disable it. The Mammoth library must still be available before the editor initializes.

import mammoth from 'mammoth';

new FroalaEditor('.selector', {
  importFromWordMammoth: mammoth
});

Import from Word plugin docs

Private Clipboard Handling

Previously, content copied within the editor could be persisted in the browser’s localStorage, which meant user-generated content, potentially including sensitive or personally identifiable information, could linger beyond the editing session. That raised data-minimization and storage-limitation concerns under regulations such as GDPR, with no way to control the behavior.

In v5.3.1, Froala no longer persists clipboard content to localStorage by default. Clipboard metadata is now stored in the Origin Private File System (OPFS), a more isolated, browser-managed storage mechanism that reduces exposure through standard browser storage APIs. Because OPFS is only available in secure contexts, the editor checks window.isSecureContext and automatically falls back to localStorage on non-secure domains, so copy and paste keep working reliably everywhere. Native browser copy/paste behavior and compatibility with external applications are fully preserved, and the change requires no configuration on your part.

Much More…

This release includes additional improvements and bug fixes. Including:

  • Improved: Enhanced the Dark theme with refined styling for popups to improve visibility and consistency.
  • Fixed: Browser spellcheck no longer expands the selection beyond the target word into adjacent text nodes (such as after <br> elements), preventing unintended text deletion.
  • Fixed: Word counter now correctly blocks input at the maximum limit even when followed by punctuation.

See the complete changelog for details.

Upgrade to v5.3.1 Today

Froala Editor v5.3.1 is a major step forward in collaboration, developer experience, and privacy. With a full real-time Collaborative plugin, native Svelte.js support, customizable font sizes, module-friendly Word import, and more private clipboard handling, this release delivers tangible value for developers and end users alike.

Key Benefits

  • Collaborate in real time. Real-time editing, comments, suggestions, and version control let teams co-author in the editor instead of trading exports and email threads, with no overwrites from simultaneous edits.
  • Drop into modern stacks. Native Svelte.js support and a module-friendly Import from Word option mean Froala fits cleanly into Svelte, Vite, Webpack, and ES-module builds.
  • Give users precise control. The custom font-size input lets users enter an exact size, with configurable min and max limits, without leaving the toolbar.
  • Keep content more private. Clipboard data stays out of localStorage by default, reducing exposure of potentially sensitive content while copy and paste keep working reliably everywhere.
  • Upgrade with confidence. No breaking API changes, so your existing configuration keeps working as-is.

Whether you are building the next generation of content management systems, developing collaborative enterprise applications, or simply want the most reliable and feature-rich editing experience available, v5.3.1 has something for you.

Upgrade to the latest version and start collaborating in real time.

Ready to Upgrade?

Check our getting-started guide to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method. As always, our support team is here to help if you have any questions or need assistance with the upgrade process.

Upgrade to Froala Editor v5.3.1 today and unlock new possibilities.

Try the Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Thank you for being part of the Froala community. We are committed to continuously improving and delivering the tools you need to build exceptional content experiences.

Froala vs AIEditor: Which Rich Text Editor Should You Choose in 2026?

Froala vs AIEditor: Which Rich Text Editor Should You Choose in 2026?

If you’re adding a rich text editor to your app, you’ve probably come across AIEditor and Froala.

AIEditor is a newer, open-source editor built with AI in mind. Froala has been around for over a decade and is used in CMS platforms, CRMs, email builders, and other applications.

So, which one should you choose?

There isn’t one answer that works for every project. In this article, we’ll compare AIEditor and Froala based on pricing, built-in features, AI support, and what it’s actually like to use them as your app grows.

Let’s get into it.

Key Takeaways

  • AIEditor is an open-source, AI-focused editor with a generous free version, but its Pro version costs $5,000–$8,000.
  • Froala starts at around $799/year and includes unlimited editor loads, unlimited users, built-in plugins, and technical support.
  • Both editors support AI, but Froala’s AI Assist works with multiple AI providers and gives you more control over AI-generated content.
  • AIEditor works well for small projects, while Froala is a better fit for products that need to scale and be maintained long-term.
  • Both editors are quick and easy to integrate.

Quick Comparison Table

Before we get into the setup and code, here’s a quick side-by-side comparison of AIEditor and Froala.

This table gives you a quick look at their pricing, features, AI support, plugins, and more. We’ll cover each of these points in more detail later in the article.

Feature AIEditor Froala
License model LGPL (open source) + paid Pro tiers Commercial subscription/perpetual license
Starting price Free (open source) / $5,000+ for Pro ~$799/year (Professional plan)
Users & editor loads Yes, on both open source and Pro Yes, on every paid plan
Framework support React, Vue, Angular, Svelte, and more React, Angular, Vue with maintained LTS SDKs
Plugin ecosystem Built-in features Full plugin library included on all plans
File management Manual setup Native Filestack integration (uploads, CDN, image editing)
AI features AI writing, translation, chat, and code tools AI Assist plugin, works with any LLM provider
Support Community + direct contact for Pro Dedicated technical support
Best for Small projects and developers who prefer open source Teams shipping production apps that need predictable cost and support

 

At first glance, AIEditor and Froala look quite similar. Both are capable rich text editors with AI features and modern framework support.

The biggest difference is pricing. AIEditor Pro uses a one-time license fee, while Froala offers annual and perpetual license options. So, it’s worth looking at the long-term cost rather than just the starting price. Identifying these pricing structures is a vital step toward selecting the best WYSIWYG editors for developers who need to reconcile immediate budget constraints with long-term scalability.

A visual diagram showing 3 year cost comparison of Froala and AI editor

With that in mind, let’s see how easy each editor is to set up and use.

Setting Up AIEditor

AIEditor is easy to add to a simple HTML page. You don’t need npm or any build tools to get started.

<!DOCTYPE html>

<html>

  <head>

    <link rel="stylesheet" href="<https://cdn.jsdelivr.net/npm/aieditor/dist/style.css>" />

  </head>

  <body>

    <div id="editor-container" style="height: 400px;"></div>

    <script type="module">

      import { AiEditor } from "<https://esm.run/aieditor>";

      const editor = new AiEditor({

        element: "#editor-container",

        placeholder: "Start typing here...",

      });

    </script>

  </body>

</html>

That’s it. AIEditor gives you a Notion-style block editor with drag-and-drop, Markdown support, and basic formatting, all loaded directly from a CDN.

You can find the full option list and more advanced examples in the AIEditor GitHub repository.

A visual diagram showing AI editor interface

AI features require some additional setup. You’ll need to connect an AI model and configure how requests are handled.

Froala takes a similar approach. Its AI Assist plugin provides the AI interface and built-in actions for generating content, changing tone, and translating text. You still need to connect an AI endpoint or handle requests yourself, but you don’t have to build the AI editing interface from scratch.

Setting Up Froala

Now, let’s try the same with Froala. The setup is just as quick, and the Froala documentation includes examples for almost every common use case.

Like AIEditor, Froala can also be loaded directly from a CDN, so you only need a simple HTML page to get started:

<!doctype html>

<html>

  <head>

    <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="editor-container"></div>

    <script

      type="text/javascript"

      src="<https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js>"

    ></script>

    <script>

      new FroalaEditor("#editor-container", {

        placeholderText: "Start typing here...",

        toolbarButtons: [

          "bold",

          "italic",

          "underline",

          "strikeThrough",

          "fontFamily",

          "fontSize",

          "textColor",

          "backgroundColor",

          "alignLeft",

          "alignCenter",

          "alignRight",

          "formatOL",

          "formatUL",

          "insertLink",

          "insertImage",

          "insertTable",

          "insertHR",

          "undo",

          "redo",

          "html",

        ],

      });

    </script>

  </body>

</html>

A visual diagram showing froala WYSIWYG editor interface

Adding AI Assist

Froala’s AI Assist plugin adds AI tools directly to the editor. To enable it, load the AI Assist plugin, accept the AI supplemental terms, and add the AI buttons to the toolbar:

<!doctype html>

<html>

  <head>

    <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="editor-container"

    ></div>

    <script src="<https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js>"></script>

    <script src="<https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/ai_assist.min.js>"></script>

    <script>

      new FroalaEditor("#editor-container", {

        placeholderText: "Start typing here...",

        aiSupplementalTermsAccepted: true,

        toolbarButtons: [

          "bold",

          "italic",

          "underline",

          "strikeThrough",

          "fontFamily",

          "fontSize",

          "textColor",

          "backgroundColor",

          "alignLeft",

          "alignCenter",

          "alignRight",

          "formatOL",

          "formatUL",

          "insertLink",

          "insertImage",

          "insertTable",

          "aiAssist",

          "aiShortCuts",

          "undo",

          "redo",

          "html",

        ],

      });

    </script>

  </body>

</html>

That’s it. The AI Assist options now appear in the editor toolbar, so users can access AI tools directly inside the editor without needing a separate AI interface.

A visual diagram showing AI assist plugin interface in Froala WYSIWYG editor

But Froala doesn’t limit you to a specific AI provider. You can use the aiAssistRequest option to control how AI requests are sent and connect the editor to the AI provider of your choice.

Here’s a simple example:

new FroalaEditor('#editor-container', {

  aiAssistRequest: async function(data, signal) {

    const response = await fetch('<https://my-ai-api.com/generate>', {

      method: 'POST',

      headers: { 'Authorization': 'Bearer TOKEN' },

      body: JSON.stringify({

        prompt: data.prompt,

        max_tokens: 500

      }),

      signal: signal

    });

    const result = await response.json();

    return result.generated_text;

  }

});

In this example, aiAssistRequest sends the prompt to the OpenAI API and returns the generated content to Froala. The editor then adds the AI response to the editing workflow.

This direct setup is useful for testing and prototypes. For production apps, keep your AI API key on the server and send requests through your own backend instead.

The setup is simple, but there are a few things you should keep in mind when adding a rich text editor to a real application.

Best Practices

Here are a few best practices to follow when working with AIEditor or Froala:

  • Keep your AI API keys on the server. Never expose your OpenAI, Claude, or Gemini API key in frontend code. Use a backend endpoint or serverless function to handle AI requests.
  • Add only the toolbar buttons you need. Both editors let you choose which buttons appear in the toolbar. Keeping the toolbar simple makes the editor easier to use.
  • Test content pasted from Word or Google Docs. Pasted content can include extra HTML and inline styles, so test how the editor handles it before launching your app.
  • Set content limits. Use word or character limits to prevent users from adding more content than your application or database expects.
  • Check the license before going to production. Make sure you understand what the editor’s license allows before using it in a production application.

Following those practices will save you from most headaches, but a few mistakes are common enough and costly enough that they deserve a closer look on their own.

Common Pitfalls

Even with a simple setup, there are a few common mistakes you should avoid:

  • Assuming open source means every feature is free. AIEditor’s core editor is open source, but some advanced features are only available in the Pro version. Check which features you need before choosing a license.
  • Ignoring long-term support. Adding a rich text editor is easy, but you may run into paste issues, mobile bugs, or other edge cases later. Consider what kind of technical support you’ll need as your app grows.
  • Exposing AI API keys in frontend code. If you connect an AI provider to your editor, never add the API key directly to your frontend code. Keep it on your server and handle AI requests through your backend.
  • Not checking framework support early. If your app may move to a different framework later, check how well the editor supports and maintains its framework integrations.

Those common mistakes also show why choosing a rich text editor isn’t just about how quickly you can set it up. You also need to think about pricing, support, integrations, and how well the editor will work as your application grows. This complexity is particularly evident when analyzing how Froala compares to Eddyter regarding the balance between feature-rich toolsets and long-term budget management for growing applications.

Why Teams Lean Toward Froala for Production Apps

Both AIEditor and Froala are capable editors. AIEditor offers a lot in its free, open-source version. But for production applications, Froala has a few practical advantages: When considering how these veteran platforms stack up against other enterprise-ready options, our analysis of <a Froala vs CKEditor in 2026 provides essential context for your technical roadmap.

  • More predictable pricing. Froala’s paid plans start at $799/year, while AIEditor Pro costs $5,000–$8,000 as a one-time license. For teams that don’t want a large upfront cost, Froala can be easier to budget for.
  • A built-in plugin library. Froala includes plugins for tables, images, file uploads, and other common editing features. It also integrates with Filestack for advanced file and image management.
  • Flexible AI integration. With aiAssistRequest, you control how AI requests are handled. This makes it possible to connect different AI providers or your own AI service.
  • Maintained framework SDKs. Froala provides SDKs for React, Angular, and Vue, making it easier to use the editor in modern web applications.
  • Technical support. Froala provides technical support for paid users, which can be helpful when you run into integration or editor issues in production. Independent reviews on G2 echo this, with users regularly citing responsive support as a standout.

So, which editor should you choose?

Conclusion

If you’re building a small project or want a free, open-source editor, AIEditor is a good option. It’s easy to set up and offers useful AI-focused features.

But if you’re building a production application that you plan to maintain and scale, Froala may be a better fit. Its plugin library, flexible AI integration, maintained framework SDKs, and technical support can make long-term development easier.

Both editors are capable, so the best choice depends on your project and budget. Try them in your own application and see which one works better with your stack and requirements.

Ready to build with a production-ready rich text editor? Explore Froala’s AI Assist, plugin library, framework SDKs, and file management features to see how quickly you can integrate a flexible editor into your app.

Froala vs Eddyter: Which Rich Text Editor Is Right for Your App in 2026?

Froala vs Eddyter: Which Rich Text Editor Is Right for Your App in 2026?

If you’re adding a rich text editor to your app, you may have come across Eddyter and Froala.

Eddyter is a newer, AI-focused editor built for React and Next.js applications. It handles features like AI and storage as part of its managed setup. Froala, on the other hand, is an established WYSIWYG editor used in CMS platforms, CRMs, email builders, and other applications.

Both editors help you add rich text editing to your app, but they take different approaches. In this article, we’ll compare their features, pricing, AI support, and setup to help you choose the right one for your project.

Key Takeaways

  • Eddyter is a managed editor built on top of Lexical (Meta’s open-source editor framework) for React and Next.js apps. It requires an account and API key to use, even on the free tier.
  • Froala works with React, Angular, Vue, and plain JavaScript, giving you more flexibility across different projects.
  • Eddyter uses tiered subscription pricing, while Froala offers annual and perpetual licensing.
  • Both offer real AI features, but Eddyter bundles AI, storage, and hosting into one subscription, while Froala’s AI Assist plugs into whichever AI provider you choose, and you host everything yourself.
  • Eddyter is a good fit for React and Next.js apps that need a managed setup. Froala is better suited for teams that need more framework flexibility and control.

Quick Comparison Table

Here’s a side-by-side look at how the two editors differ before we get into setup and code.

Feature Eddyter Froala
License model Managed SaaS subscription Commercial subscription/perpetual license
Starting price ~$590/year (AI pro managed plan) ~$799/year (Professional plan)
Framework support React and Next.js only React, Angular, Vue, or plain HTML/JS
Hosting model Managed platform with storage and AI infrastructure Self-hosted (you control your own backend)
Account/API key required Yes, on every plan No account needed for the core editor
Usage limits Limits vary by plan Unlimited editor loads and users
AI features AI chat, autocomplete, and tone tools AI Assist plugin, works with any LLM provider
Editor architecture Built on Lexical Built and maintained by Froala
Support Email support Dedicated technical support
Best for Teams that want a managed editor setup Teams that need framework flexibility and predictable costs at scale

The biggest difference between Eddyter and Froala is how they are set up.

Eddyter is a managed platform that includes storage and AI infrastructure. This can make setup easier, but limits such as editor loads, storage, and AI credits depend on your plan.

Froala runs directly in your application and gives you more control over your editor setup. It also includes unlimited editor loads and users, so your editor usage doesn’t increase the license cost as your application grows. Not every vendor prices that way, and the top WYSIWYG editors to consider in 2026 splits them by exactly this: what happens to the bill as you grow.

The pricing difference becomes easier to understand when you compare both editors over a few years:

A visual diagram showing 3 year cost comparison of Froala and Eddyter

With that difference in mind, let’s look at what setup actually looks like for each.

Setting Up Eddyter

Eddyter is built specifically for React and Next.js, so setup goes through npm rather than a CDN. You’ll also need an API key from an Eddyter account before the editor will render, even on the free tier.

npm install eddyter

Then, add the editor to your application:

"use client";

import { ConfigurableEditorWithAuth, EditorProvider } from "eddyter";

import "eddyter/style.css";

export default function MyEditor() {

  const apiKey = process.env.NEXT_PUBLIC_EDDYTER_API_KEY;

  return (

    <EditorProvider>

      <ConfigurableEditorWithAuth

        apiKey={apiKey}

        onChange={(html) => console.log("Editor content:", html)}

      />

    </EditorProvider>

  );

}

Add your Eddyter API key to the environment file:

# .env.local

NEXT_PUBLIC_EDDYTER_API_KEY=your_api_key_here

That’s it. Once the editor is set up, you can use features like AI chat, tables, embeds, and slash commands directly in your app.

The setup is quick for React and Next.js projects. Since the editor uses Eddyter’s API key and EditorProvider, you’ll also need an Eddyter account to get started.

You can find the full setup walkthrough in Eddyter’s own quick-install guide.

Setting Up Froala

Froala takes a different approach. You don’t need an API key or a specific framework to set up the editor. It can be loaded directly from a CDN, so a simple HTML page is enough to get started:

<!DOCTYPE html>

<html>

  <head>

    <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="editor-container"></div>

    <script

      type="text/javascript"

      src="<https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js>"

    ></script>

    <script>

      new FroalaEditor("#editor-container", {

        placeholderText: "Start typing here...",

        toolbarButtons: ["bold", "italic", "underline", "insertImage", "insertLink"],

      });

    </script>

  </body>

</html>

That’s it. The editor is now ready to use in your application. You can also add more toolbar buttons and plugins based on the features your app needs.

A visual diagram showing the interface of froala WYSIWYG editor

Adding AI Assist

Froala also lets you add AI features using its AI Assist plugin. With aiAssistRequest, you can control how AI requests are handled and connect the editor to your own backend:

<script>

  new FroalaEditor("#editor-container", {

    toolbarButtons: ["bold", "italic", "aiAssist"],

    aiSupplementalTermsAccepted: true,

    aiAssistRequest: async function (data, signal) {

      const response = await fetch("/api/ai-assist", {

        method: "POST",

        headers: { "Content-Type": "application/json" },

        body: JSON.stringify({ prompt: data.prompt }),

        signal: signal,

      });

      const result = await response.json();

      return result.html;

    },

  });

</script>

In this example, aiAssistRequest sends the AI prompt to your own backend endpoint. Your backend can then connect to OpenAI, Claude, Gemini, or another AI model.

A visual showing the ai assist plugin interface of froala WYSIWYG editor

This is different from Eddyter’s managed setup. Eddyter connects the editor to its platform using an API key, while Froala gives you control over how and where AI requests are handled.

Best Practices

Before using either editor in a production application, here are a few things to keep in mind:

  • Keep AI API keys on the server. If you’re connecting an AI provider to Froala using aiAssistRequest, never expose the API key in your frontend code. Handle AI requests through your backend instead.
  • Check framework support early. Make sure the editor works with your current framework and any frameworks your team may use in the future.
  • Think about long-term costs. Don’t compare pricing based only on your current usage. Consider how storage, AI usage, and other limits may change as your application grows.
  • Test content pasted from Word or Google Docs. Pasted content can include unnecessary HTML and styles, so test how the editor handles it before launch.
  • Check how your data is handled. If you’re using a managed editor platform, understand where your content is stored and how it moves through the service before using it in production.

Common Pitfalls

Even with a simple setup, there are a few common mistakes to avoid:

  • Ignoring usage limits. Eddyter plans have different storage and AI usage limits. As your application grows, you may need to move to a higher plan.
  • Not thinking about platform dependency. Eddyter uses a managed platform for features such as storage and AI. This means parts of your editor setup depend on Eddyter’s services. Froala gives you more control over how these services are handled.
  • Skipping a framework check. Always check whether the editor supports the frameworks your application uses before choosing it.
  • Exposing AI API keys. If you use Froala’s aiAssistRequest or another custom AI integration, keep your AI credentials on the server and send requests through your backend.

The differences above become more important when you’re building an editor for a production application. Setup is only one part of the decision. You also need to think about framework support, costs, and long-term maintenance.

Why Teams Lean Toward Froala for Production Apps

Eddyter makes it easy to add an AI-powered editor to your app, especially if you want storage and AI infrastructure handled for you. But for teams building and scaling production applications, Froala has a few advantages: While Eddyter addresses modern AI needs, developers also need to weigh these enterprise features against how Froala compares to CKEditor regarding long-term support and functional parity.

  • More framework flexibility. Froala works with React, Angular, Vue, and plain JavaScript, making it easier to use across different applications and tech stacks.
  • Predictable costs as usage grows. Froala includes unlimited editor loads and users, while Eddyter plans have different storage and AI usage limits.
  • More control over your editor setup. Froala’s core editor runs directly in your application and doesn’t require an external API key to initialise.
  • A mature editor. Froala has been used in production applications for years and is built for use cases such as CMS platforms, CRMs, and email builders.
  • Technical support. Froala’s paid plans include technical support, which can be useful when you run into integration or production issues.

So, which editor should you choose?

Conclusion

If you want a managed editor with AI and storage included, Eddyter is worth trying. It’s quick to set up and can reduce the amount of infrastructure you need to manage.

If you need more framework flexibility and control over your editor setup, Froala may be a better fit. It works across different frameworks and lets you choose how features like AI and file management are handled. Developers who prioritize advanced automation might find additional clarity on feature parity through our comparison of Froala vs AIEditor in 2026.

Both editors take different approaches, so the right choice depends on your application’s requirements, budget, and tech stack. Try both in a small project before choosing one for your production application.

Ready to build with a flexible rich text editor? Explore Froala’s framework SDKs, AI Assist, plugins, and developer documentation to see how quickly you can add a production-ready editor to your app.

How to Build a Slash Command Quick Action Menu in Froala Editor

Slash Command Quick Action Menu

Notion does it. Linear does it. GitHub does it. Users now expect to type / and get an instant menu of content options. If you are integrating Froala V5 into your app, you can build the same experience from scratch using Froala’s keyup event, its html.insert() method, and a custom-rendered dropdown. No third-party library required.

In this tutorial, you’ll learn how to add a fully functional slash command menu to Froala Editor. We’ll build it from scratch, explaining every decision so you understand not just what the code does, but why.

By the end, you’ll have a clean, keyboard-friendly command menu that works reliably with Froala’s contenteditable surface.

Slash Command Quick Action Menu

Key Takeaways

  • Froala V5 does not ship a native slash command menu, but its event and methods API gives you everything you need to build one.
  • You intercept the / keystroke using the keyup event, then render and position a custom dropdown relative to the cursor.
  • Each menu item calls editor.html.insert() or a native Froala command to inject content at the correct position.
  • Proper cleanup (removing the / trigger character, dismissing the menu on Escape or blur) is critical for a polished UX.

Prerequisites

To follow along, you need:

  • Basic knowledge of HTML, CSS, and JavaScript
  • Familiarity with Froala Editor (initialization and events)
  • A Froala license key (or use the trial)

We’ll use the official CDN for simplicity.

The Complete Approach

The implementation has three main responsibilities:

  1. Detect when the user types / at the start of a line
  2. Render a filtered, keyboard-navigable menu
  3. Execute the chosen action and clean up the trigger character

See the full, working implementation on JSFiddle. You can read the complete code with inline comments explaining every non-obvious decision, and test it live in your browser by typing / in the editor.

Let’s break down the code section by section.

1. HTML Structure

<div id="editor-container">
<div id="froala-editor">    <p>Type <strong>/</strong> at the start of a new line to open the command menu.</p>  </div>
</div>
<div id="slash-menu"></div>

The editor lives in its own container for easy styling. The #slash-menu element is placed outside the editor so it can be positioned absolutely relative to the viewport.

2. Styling the Menu

The CSS creates a clean, Notion-style dropdown:

  • Fixed width (260px) with max-height and scrolling
  • Category headers in uppercase
  • Icon + title + description layout
  • Hover and .is-active states for keyboard navigation
  • Subtle shadows and borders for depth

These styles are intentionally decoupled from Froala’s theme so you can easily adapt them.

/* ─── Slash Command Menu Styles ─────────────────────────────── */
    #slash-menu {
      position: absolute;
      z-index: 9999;
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
      width: 260px;
      max-height: 320px;
      overflow-y: auto;
      display: none; /* Hidden by default */
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }

    #slash-menu .slash-menu-header {
      padding: 8px 12px 4px;
      font-size: 11px;
      font-weight: 600;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    #slash-menu .slash-menu-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      cursor: pointer;
      transition: background 0.1s ease;
    }

    #slash-menu .slash-menu-item:hover,
    #slash-menu .slash-menu-item.is-active {
      background: #f1f5f9;
    }

    #slash-menu .slash-menu-item .item-icon {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      flex-shrink: 0;
    }

    #slash-menu .slash-menu-item .item-text .item-title {
      font-size: 13px;
      font-weight: 500;
      color: #1e293b;
      line-height: 1.3;
    }

    #slash-menu .slash-menu-item .item-text .item-description {
      font-size: 11px;
      color: #94a3b8;
      line-height: 1.3;
    }

    /* Editor wrapper */
    #editor-container {
      max-width: 800px;
      margin: 40px auto;
      padding: 0 20px;
    }

3. Defining the Command Data

const SLASH_COMMANDS = [
  {
    category: 'Text',
    items: [
      { id: 'paragraph', title: 'Text', description: 'Plain paragraph', icon: '¶', action: ... },
      ...
    ]
  },
  ...
];

This data structure is the heart of the feature. Each item contains:

  • id: Used for potential future features (like analytics)
  • title and description: Displayed in the UI
  • icon: Simple visual indicator
  • action: A function that receives the editor instance

Why separate actions from the UI? It keeps the data declarative. You can later load commands from an API or allow users to customize them without touching the rendering logic.

4. State Management

let menuVisible = false;
let activeIndex = 0;
let flatItems = [];
let editorInstance = null;

We maintain minimal state:

  • menuVisible controls visibility logic
  • activeIndex tracks which item is highlighted for keyboard navigation
  • flatItems holds the currently visible (filtered) items with their DOM references
  • editorInstance gives us access to Froala methods inside event handlers

5. Building the Menu DOM (buildMenu)

This function is called every time the user types after a /.

function buildMenu(filter) {
  menuEl.innerHTML = '';
  flatItems = [];

  const term = (filter || '').toLowerCase();

  SLASH_COMMANDS.forEach(function(group) {
    const filtered = group.items.filter(item =>
      item.title.toLowerCase().includes(term) ||
      item.description.toLowerCase().includes(term)
    );

    if (filtered.length === 0) return;

    // Create category header
    // Create item rows with click handlers
    // Push to flatItems
  });
}

Key details explained:

  • We flatten the data while respecting categories
  • Filtering happens on both title and description
  • We use mousedown instead of click on menu items. This is critical because click fires after blur, which would close the menu before the selection logic runs.

6. Positioning the Menu

function positionMenu() {
  const range = window.getSelection().getRangeAt(0).cloneRange();
  range.collapse(true);
  const rect = range.getBoundingClientRect();
  // Calculate top and left using scroll offsets
}

We use getBoundingClientRect() on a collapsed range to get the cursor’s exact position. This is more reliable than trying to measure the editor’s internal elements.

We also add a small horizontal boundary check so the menu doesn’t overflow the viewport.

7. Detecting the Slash Trigger (getSlashTriggerText)

This is the most important logic function:

function getSlashTriggerText() {
  const text = node.textContent.slice(0, range.startOffset);
  const slashIndex = text.lastIndexOf('/');
  
  if (slashIndex === -1) return null;
  
  const beforeSlash = text.slice(0, slashIndex).trim();
  if (beforeSlash.length > 0) return null;
  
  return text.slice(slashIndex + 1);
}

Why this logic matters:

  • We only trigger when / is the first non-whitespace character on the current line
  • We extract everything after / as the filter term
  • This prevents the menu from appearing when someone types “hello/world”

8. Cleaning Up the Trigger Character (selectItem)

When the user selects a command, we must remove the / (and any filter text) before inserting the new content:

const text = node.textContent;
const slashIndex = text.lastIndexOf('/');
node.textContent = text.slice(0, slashIndex) + text.slice(range.startOffset);

We then recreate the range and place the cursor back where the / was. This is delicate work because we’re manually editing a text node inside a contenteditable area.

After cleanup, we call the item’s action function and restore focus to the editor.

9. Froala Event Integration

The real power comes from hooking into Froala’s events:

events: {
  'keyup': function(e) { ... },
  'keydown': function(e) { ... },
  'blur': function() { ... }
}

keyup handler responsibilities:

  • Ignore modifier keys
  • Handle Escape to close the menu
  • Manage arrow keys and Enter when the menu is visible
  • Check for the slash trigger on every keystroke

keydown handler:

  • Prevents default behavior for Enter and arrow keys when the menu is open
  • This stops Froala from inserting a new paragraph when the user is just navigating the menu

blur handler:

  • Uses a small setTimeout (150ms) so that mousedown events on menu items have time to fire first

10. Keyboard Navigation

We maintain a flat list of visible items. Arrow keys simply increment/decrement activeIndex and call highlightItem().

highlightItem does two things:

  1. Toggles the is-active class
  2. Calls scrollIntoView({ block: 'nearest' }) so long menus scroll automatically

This creates a smooth experience similar to native dropdowns.

Full Flow Summary

  1. User types / at the start of a line
  2. keyup detects the trigger via getSlashTriggerText()
  3. showMenu() builds filtered DOM and positions it
  4. User can type to filter, use arrows to navigate, or click
  5. On selection, we remove the / text, execute the action, hide the menu, and refocus

Extending the Menu

Adding new content types requires only adding a new object to SLASH_COMMANDS. Here is a file upload entry as an example:

{
  id: 'file',
  title: 'File',
  description: 'Attach a file',
  icon: '📎',
  action: function (editor) {
    // Trigger Froala's native file upload dialog
  }
}

You can also add dynamic items, such as loading a list of page templates from your API and appending them into the menu on the fly inside buildMenu.

Important Gotchas and Solutions

Problem Solution in this code
Menu closes before click registers Use mousedown + e.preventDefault()
Cursor jumps when using arrows Prevent default in keydown
Filter text remains after selection Manually edit the text node before inserting
Menu appears mid-sentence Check that nothing precedes / on the line
Editor loses focus Restore focus after action execution

Making It Production-Ready

Here are several improvements you can add:

  1. Better table insertion: Use Froala’s insertTable command instead of raw HTML when possible
  2. Command shortcuts: Add keyboard shortcuts (e.g., /h1)
  3. Icons: Replace text icons with SVG or Font Awesome for polish
  4. Async commands: Support commands that open modals (image upload, etc.)
  5. Accessibility: Add role="listbox" and aria-activedescendant
  6. Debouncing : The current implementation rebuilds on every key. For very large command sets, add light debouncing

Alternative Approaches

You could also implement this using:

  • A separate library like Tippy.js for positioning
  • MutationObserver instead of key events (more complex)

The manual approach shown here gives you maximum control and works without additional dependencies.

Conclusion

Building a slash command menu teaches you several valuable skills:

  • Working with Selection and Range APIs
  • Managing state between a rich text editor and custom UI
  • Handling the timing quirks of contenteditable elements
  • Creating accessible, keyboard-first interfaces

The code is deliberately kept simple and self-contained so you can understand every line. Once you’re comfortable with the core mechanics, you can extend it with custom commands, better styling, or integration with your own design system.

Try it now: Paste the vanilla JS example into a local HTML file, add your license key, and open it in a browser. Type / at the start of a blank line to see the menu in action.

FAQ

Does Froala V5 have a built-in slash command menu?

No. Froala’s Quick Insert plugin shows a + button on empty lines and is triggered by the cursor position, not by typing /. The slash command UX in this guide is a custom layer built on top of Froala’s public API.

Will this break Froala’s built-in Quick Insert plugin?

No. The two features are independent. You can run both simultaneously if you want. The quickInsertEnabled option controls the + button behavior and is unrelated to the keyup event handler you are adding.

Can I add custom icons using SVG instead of emoji?

Yes. Replace the icon string in any SLASH_COMMANDS item with an SVG string, and update the .item-icon container’s innerHTML assignment in buildMenu accordingly.

How do I filter commands server-side or asynchronously? Modify buildMenu to be async and replace the SLASH_COMMANDS.forEach block with an await fetch(...) call. Pass the filter string as a query parameter. Show a loading spinner in the menu while the request is in flight.

How do I handle the slash command in Angular?

The pattern is identical. Inject the Froala config object with the same events block into your @Input() editorConfig. Access the editor instance from the initialized callback and store it in a component property. All other logic (DOM manipulation for the dropdown, text node traversal) lives in separate service methods.

What happens if the user types “/” and then presses Backspace?

The keyup handler fires after the Backspace. getSlashTriggerText re-evaluates the current text node. If the “/” has been deleted, slashIndex will be -1 and the function returns null, which triggers hideMenu(). The menu disappears automatically.

Free In-Editor Image Editing for Froala with Filerobot Plugin

Advanced Image editing

Froala v5.2.0 ships with a new plugin that brings a full-featured image editor directly into your editor workflow. This guide walks you through everything you need to know about the Filerobot Image Editor (FIE) Plugin: what it does, how to install it, all of its configuration options, its event hooks, and how it compares to the other advanced image editing integrations Froala supports.

Key Takeaways

  • The Filerobot plugin is free, open-source, and requires no third-party account or API key.
  • It adds an “Advanced Edit” button to Froala’s image toolbar, opening a full editing suite (annotations, filters, fine-tune, resize, rotate, watermark, crop) as a modal without leaving the editor.
  • The plugin ships with two configuration options (filerobotOptions and FilerobotImageEditor) and five lifecycle events (beforeOpen, opened, beforeSave, saved, closed) giving you precise control over the editing experience.
  • Froala offers two other advanced image editing integrations — Image TUI (free, open-source) and Filestack Transformation (cloud-based, paid) — covered in the Choosing the Right Integration section below.

What Is the Filerobot Image Editor Plugin?

The Filerobot Image Editor Plugin integrates Scaleflex’s Filerobot Image Editor directly into Froala. When a user selects an image in the editor, a new “Advanced Edit” button appears in the image toolbar. Clicking it opens a full editing suite as a modal overlay without leaving the editor context.

The editing suite supports:

  • Annotations — draw shapes, add text, arrows, and freehand lines directly on the image
  • Filters — apply Instagram-style visual filters
  • Fine-tune — adjust brightness, contrast, saturation, and sharpness
  • Resize — change image dimensions with aspect ratio control
  • Rotate & Flip — rotate in configurable increments, flip horizontally or vertically
  • Watermark — overlay a logo or text watermark
  • Crop — crop to a custom ratio or preset dimensions

When the user clicks Save, the edited image replaces the original inline without page reload or manual re-upload step.

Choosing the Right Image Editing Integration

Before diving into setup, it’s worth knowing that Froala offers three different pathways for advanced in-editor image editing. Each targets a different set of requirements:

Filerobot Image Editor Plugin (new in v5.2.0): Free and open-source. Actively maintained by Scaleflex. Delivers a rich, modern editing UI with annotations, filters, fine-tuning, watermarks, and resize out of the box. No account or API key needed. A solid choice when you want a capable, dependency-light solution with no ongoing service cost.

Image TUI Plugin: Free and open-source (MIT). Built on TOAST UI Image Editor and bundled with Froala as imageTUI. Provides filters, cropping, drawing, and sticker support. Worth noting that the upstream TUI Image Editor project has not seen active maintenance in some time, which may be a consideration for long-term projects.

Filestack Transformation (via the Filestack Plugin): A commercially integrated solution that pairs Froala with Filestack’s cloud-based transformation pipeline. Delivers powerful server-side image processing and CDN delivery alongside Filestack’s file picker and storage capabilities. Requires a Filestack account and subscription. The right fit when you’re already in the Filestack ecosystem or need cloud-native image processing at scale.

All three integrate cleanly into Froala’s toolbar without requiring custom UI work on your part. The choice comes down to your project’s constraints around cost, maintenance expectations, and infrastructure.

Filerobot Image Editor Setup

Step 1: Install the Plugin Assets

The Filerobot plugin ships inside the froala-editor npm package as of v5.2.0.

Via npm:

npm install froala-editor@latest

Plugin files (local paths after npm install):

# JavaScript
node_modules/froala-editor/js/third_party/imageFileRobot.min.js

# CSS
node_modules/froala-editor/css/third_party/imageFileRobot.min.css

Via CDN (for plain HTML projects):

<!-- Filerobot Image Editor dependency — load this first -->
<script src="https://scaleflex.cloudimg.io/v7/plugins/filerobot-image-editor/latest/filerobot-image-editor.min.js"></script>

<!-- Froala core -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">
<script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

<!-- Filerobot plugin -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/third_party/imageFileRobot.min.css">
<script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/third_party/imageFileRobot.min.js"></script>

Important: The Filerobot Image Editor script from Scaleflex must be loaded before the Froala plugin script. The plugin expects window.FilerobotImageEditor to exist at initialization time. If you load them in the wrong order, the plugin will silently fail to open.

Froala Filerobot plugin setup

Step 2: Basic Setup (Vanilla JS)

The minimum configuration to get the plugin running:

<!DOCTYPE html>
<html lang="en">
<head>
  <!-- Filerobot Image Editor (load before Froala plugin) -->
  <script src="https://scaleflex.cloudimg.io/v7/plugins/filerobot-image-editor/latest/filerobot-image-editor.min.js"></script>

  <!-- Froala core assets -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

  <!-- Filerobot plugin assets -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/third_party/imageFileRobot.min.css">
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/third_party/imageFileRobot.min.js"></script>
</head>
<body>
  <div id="editor">
    <p>Insert an image to try the advanced editor.</p>
  </div>

  <script>
    new FroalaEditor('#editor', {
      // Enable both the core image plugin and the Filerobot plugin
      pluginsEnabled: ['image', 'imageFilerobot'],

      // Your Froala license key
      key: 'YOUR_FROALA_LICENSE_KEY'
    });
  </script>
</body>
</html>

That’s all it takes for a working integration. Once an image is inserted and selected, you’ll see the Advanced Edit button in the image toolbar.

Step 3: Configuration Options

The plugin exposes two options under the main Froala options object.

filerobotOptions (Object)

This option is passed directly to the Filerobot Image Editor instance and controls the editor’s UI and behavior. The full default configuration Froala ships with is:

filerobotOptions: {
  theme: {
    palette: {
      'bg-primary-active': '#4CA6FF'  // Accent color for active UI elements
    },
    typography: {
      fontFamily: 'Roboto, Arial'
    }
  },
  annotationsCommon: {
    fill: '#ff0000'  // Default fill color for annotations
  },
  Text: { text: 'Enter text...' },       // Default text for text annotations
  Rotate: { angle: 90, componentType: 'buttons' },  // Rotation step and control type
  tabsIds: ['Adjust', 'Annotate', 'Filters', 'Finetune', 'Resize', 'Watermark'], // Visible tabs
  defaultTabId: 'Annotate',   // Tab shown when the editor opens
  defaultToolId: 'Text',      // Tool selected on load within the default tab
  savingPixelRatio: 0,        // 0 = use original image pixel ratio
  previewPixelRatio: 0,       // 0 = use screen pixel ratio for preview
  closeAfterSave: true,       // Close the editor modal automatically after saving
  defaultSavedImageType: 'png' // Output format: 'png', 'jpeg', or 'webp'
}

You override only the properties you need — Froala merges your config with the defaults.

FilerobotImageEditor (Object)

Use this option when the Filerobot library is not available on window — for example, when you import it as an ES module rather than loading it via a <script> tag.

import FilerobotImageEditor from 'filerobot-image-editor';

new FroalaEditor('#editor', {
  pluginsEnabled: ['image', 'imageFilerobot'],
  // Pass the constructor directly instead of relying on window.FilerobotImageEditor
  FilerobotImageEditor: FilerobotImageEditor
});

Default: window.FilerobotImageEditor

Step 4: Practical Configuration Examples

Restrict the editor to only Crop and Resize

new FroalaEditor('#editor', {
  pluginsEnabled: ['image', 'imageFilerobot'],
  key: 'YOUR_FROALA_LICENSE_KEY',

  filerobotOptions: {
    // Only show Adjust and Resize tabs — remove annotation and filter clutter
    tabsIds: ['Adjust', 'Resize'],
    defaultTabId: 'Adjust',
    defaultToolId: 'Crop',

    // Save as JPEG for smaller file sizes
    defaultSavedImageType: 'jpeg',

    // Keep the editor open after saving so users can make additional adjustments
    closeAfterSave: false
  }
});

Why this matters: Restricting tabs reduces cognitive overhead for users who only need basic adjustments. It also reduces the initial render cost of the editor modal since unused tool panels are never instantiated.

Custom theme to match your app’s branding

new FroalaEditor('#editor', {
  pluginsEnabled: ['image', 'imageFilerobot'],
  key: 'YOUR_FROALA_LICENSE_KEY',

  filerobotOptions: {
    theme: {
      palette: {
        'bg-primary-active': '#6C47FF',  // Your brand purple
        'bg-secondary': '#F5F5F5'
      },
      typography: {
        fontFamily: 'Inter, sans-serif'
      }
    },
    annotationsCommon: {
      fill: '#6C47FF'  // Match annotation color to your brand
    },
    tabsIds: ['Adjust', 'Annotate', 'Filters', 'Finetune', 'Resize', 'Watermark'],
    defaultTabId: 'Filters'  // Open on Filters tab by default
  }
});

Using the ES module import (for bundled projects)

// Import the Filerobot Image Editor as a module
import FilerobotImageEditor from 'filerobot-image-editor';

// Import Froala and the plugin
import FroalaEditor from 'froala-editor';
import 'froala-editor/js/plugins/image.min.js';
import 'froala-editor/js/third_party/imageFileRobot.min.js';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/third_party/imageFileRobot.min.css';

new FroalaEditor('#editor', {
  pluginsEnabled: ['image', 'imageFilerobot'],
  key: 'YOUR_FROALA_LICENSE_KEY',

  // Provide the class directly — no window global needed
  FilerobotImageEditor: FilerobotImageEditor,

  filerobotOptions: {
    tabsIds: ['Adjust', 'Annotate', 'Filters', 'Resize'],
    defaultTabId: 'Annotate',
    defaultSavedImageType: 'png'
  }
});

Event Reference

The plugin emits five lifecycle events you can hook into:

Event Signature When It Fires
filerobot.beforeOpen () Just before the editor modal renders
filerobot.opened (filerobotInstance) After the modal is fully rendered and interactive
filerobot.beforeSave (editedImageObject) Before the edited image is committed to the editor
filerobot.saved (editedImageObject) After the edited image replaces the original in the editor
filerobot.closed () After the editor modal is destroyed

The editedImageObject passed to filerobot.beforeSave and filerobot.saved contains the edited image data and metadata from the Filerobot editor. You can use filerobot.beforeSave to intercept the save — for example, to upload the image to your own server first, or to apply additional server-side processing before the image src is updated in the editor.

events: {
  'filerobot.beforeSave': function (editedImageObject) {
    // Log the object shape to understand what's available
    console.log(editedImageObject);

    // Example: prevent the default save behavior by returning false,
    // then handle the upload yourself
    // return false;
  },

  'filerobot.saved': function (editedImageObject) {
    // Track edits in your analytics or audit log
    trackImageEdit({ timestamp: Date.now(), imageData: editedImageObject });
  }
}

Conclusion

The Filerobot Image Editor Plugin is a meaningful addition to Froala’s image management capabilities. It gives your users a modern, fully-featured editing suite without leaving the editor — and without adding a paid service dependency. The event lifecycle is clean, the configuration API maps directly to the upstream Filerobot options, and the ES module import path makes it easy to integrate into any modern bundled project.

Whether the Filerobot plugin, Image TUI, or Filestack Transformation is the right fit depends on your specific requirements around maintenance expectations, infrastructure, and budget. All three are first-class Froala integrations with clear documentation and stable APIs.

Try Froala’s Filerobot plugin in your editor setup and give users a faster way to annotate, crop, resize, watermark, and save images without leaving the editing workflow.

FAQ

What image formats does the plugin support as output?

The plugin outputs png, jpeg, or webp. Control this with the defaultSavedImageType option inside filerobotOptions. PNG is the default. Use jpeg when file size matters more than transparency support, and webp for modern browsers where you want both compression and quality.

Will the edited image be re-uploaded to my server automatically?

No. By default, the plugin replaces the image’s src attribute in the editor with a base64 data URL of the edited image. If you need the edited image uploaded to your server, use the filerobot.beforeSave or filerobot.saved events to intercept the save, upload the image yourself, and update the src with the returned URL before it’s committed to the editor content.

Can I limit which editing tools are available to users?

Yes. Use the tabsIds property inside filerobotOptions to specify exactly which tabs appear. For example, passing tabsIds: ['Adjust', 'Resize'] removes Annotations, Filters, Fine-tune, and Watermark entirely. You can also control which tool is active on open via defaultTabId and defaultToolId.

The “Advanced Edit” button isn’t appearing in the image toolbar. What’s wrong?

Check three things in order. First, confirm that both 'image' and 'imageFilerobot' are present in your pluginsEnabled array. The Filerobot plugin won’t register without the core image plugin.

Second, verify that the Scaleflex script loads before the Froala plugin script; if window.FilerobotImageEditor is undefined at plugin initialization time, the button won’t render.

Third, if you’re using a bundler, make sure you’re passing the FilerobotImageEditor constructor explicitly via the FilerobotImageEditor option rather than relying on the window global.

Does the plugin work with images hosted on external domains?

It depends on the CORS configuration of the image host. The Filerobot editor draws the image onto an HTML5 canvas to apply edits. Browsers block canvas operations on images from cross-origin sources that don’t send Access-Control-Allow-Origin headers. If the image host doesn’t support CORS, the editor will open but throw a security error when attempting to render the image on canvas. The fix is either to configure your image server to send the appropriate CORS headers or to proxy the image through your own origin.

Can I use this plugin alongside the Image TUI or Filestack plugins at the same time?

Technically you can load multiple image editing plugins, but activating more than one will add multiple “Advanced Edit”-style buttons to the image toolbar, which creates a confusing user experience. Choose one image editing integration per project and enable only that plugin.

Further Reading

graphical user interface, text

Building a Multi-Model AI Assistant in Froala Editor

multi-model AI assistant

Froala Editor’s AI Assist feature gives developers a clean way to bring generative AI directly into the editing experience. While some users work well with a single model, others need more flexibility. Different models excel at different tasks. Some are faster and cheaper, others produce higher-quality long-form content, and some handle specific languages or coding tasks better.

This article explains how to connect multiple AI models to Froala and let users switch between them directly from the toolbar. We will walk through a working prototype that demonstrates the approach using only Froala’s configuration system and its command registration API.

switching between AI models

Key Takeaways

  • Froala’s aiAssistRequest option can be swapped at runtime, enabling multi-model support without recreating the editor.
  • A custom dropdown command in the toolbar lets users switch models seamlessly.
  • Request handler functions follow a consistent interface, so switching models requires only updating a single function reference.
  • Production deployments should proxy AI requests through a backend to protect API keys and enforce security policies.
  • Froala’s popup system lets you expose advanced settings like temperature and token limits alongside model selection.

How Froala AI Assist Works Under the Hood

Froala exposes the aiAssistRequest configuration option. This option accepts a function that receives an object containing the user’s instruction and the current selection (or full document content). The function is responsible for returning a string of HTML that Froala will insert into the editor.

Because aiAssistRequest lives in the editor’s options object, you can change it at runtime. This single fact makes multi-model support possible without touching Froala’s core code.

In the prototype we keep a map of model names to request functions:

const aiReqHandler = {
  chatgpt: openAIRequest,
  claude: claudeRequest,
  deepseek: deepSeekRequest,
  gemini: geminiRequest,
  groq: groqRequest,
  openrouter: openRouterRequest
};
 At initialization we point aiAssistRequest at the default handler:
new FroalaEditor("#editor", {
  toolbarButtons: [
    "bold",
    "italic",
    "underline",
    "|",
    "aiAssist",
    "aiShortCuts",
    "aiModelList"
  ],
  aiAssistRequest: aiReqHandler[aiDefaultModel]
  // ...
});

The key insight is that we never replace the entire editor instance. We simply swap the function reference stored in this.opts.aiAssistRequest.

Extending the Toolbar with a Custom Dropdown

Froala’s toolbar is built from registered commands. To add a model selector, we register a new command of type dropdown.

Defining a Custom Icon

First we create a recognizable icon using DefineIcon. The command uses an SVG that visually suggests multiple models:

FroalaEditor.DefineIcon("aiModel", {
  template: "svgMultiplePath",
  VIEWBOX: "0 0 48 48",
  PATHS: "..." // (SVG paths)
});

Using a custom icon keeps the toolbar consistent with Froala’s design language and makes the new control immediately understandable to users.

Registering the Dropdown Command

The actual control is created with RegisterCommand:

FroalaEditor.RegisterCommand("aiModelList", {
  title: "Select AI Model",
  type: "dropdown",
  icon: "aiModel",
  options: AI_MODELS,
  undo: true,
  focus: true,
  refreshAfterCallback: true,
  callback: function (cmd, val) {
    this.opts.selectedAiModel = val;
    this.opts.aiAssistRequest = aiReqHandler[val];
  },
  refreshOnShow: function ($btn, $dropdown) {
    const current = this.opts.selectedAiModel || aiDefaultModel;
    $dropdown.find("a").removeClass("fr-active");
    $dropdown.find(`a[data-param1="${current}"]`).addClass("fr-active");
  }
});

Several details are worth highlighting for Froala developers:

  • options is a plain object. The keys become the values passed to the callback; the values become the visible labels.
  • The callback receives the selected key (val). Inside the callback we update two properties on this.opts. This works because Froala reads aiAssistRequest again the next time the user triggers an AI action.
  • refreshOnShow runs every time the dropdown opens. It is the correct hook for applying visual state (the active model) without affecting editor performance.
  • We store the current model in this.opts.selectedAiModel so other parts of the integration (or future custom popups) can read the active choice.

Once the command is registered, we simply add its name to the toolbarButtons array. No additional plugin registration or CSS work is required.

Switching Models at Runtime

When the user selects a different model, the callback executes immediately:

this.opts.aiAssistRequest = aiReqHandler[val];
console.log(`AI Model switched to ${AI_MODELS[val]}`);

The next time the user clicks the built-in “AI Assist” or “AI Shortcuts” buttons, Froala calls whatever function currently lives at this.opts.aiAssistRequest. Because the request functions all follow the same contract (they accept the same data object and an optional AbortSignal), the rest of the AI Assist pipeline remains unchanged.

This pattern gives you several advantages:

  1. Zero downtime switching — The editor does not need to be destroyed and recreated.
  2. Per-instance state — Each Froala instance can track its own selected model.
  3. Easy debugging — You can log or expose the current handler for development tools.

You can see the complete working demo on JSFiddle. This fiddle includes all the code from this article—model registration, dropdown setup, and request handlers—running in a live editor. You can fork it, modify the models, adjust settings, or test with your own API keys.

Adding Configuration Options with Froala’s Custom Popups

A dropdown is sufficient for model selection, but many teams also want to expose parameters such as temperature, max tokens, or system prompts. Froala’s popup system lets you create rich configuration interfaces that feel native.

You can register a second command that opens a custom popup. Inside the popup you can render form controls (temperature slider, token limit input, etc.). When the user saves the popup, you store the values on this.opts (for example this.opts.aiSettings = { temperature: 0.7, maxTokens: 2048 }).

Your request functions can then read these values before making the API call:

// Inside any request handler
const settings = this.opts.aiSettings || {};
const temperature = settings.temperature ?? 0.7;

Because the popup is built with Froala’s own popup API (this.popups.create, this.popups.show, etc.), it automatically respects the editor’s theme, positioning, and keyboard navigation. This keeps the user experience consistent even when you add advanced AI controls.

A practical tip: keep the popup data minimal. Store only what the request function actually needs. Heavy configuration objects can be moved to a separate module that the request handlers import.

Why the Prototype Keeps Logic in the Frontend

The provided code performs all AI calls directly from the browser using fetch. This approach is intentional for a demonstration:

  • It shows the complete flow without requiring a backend server.
  • It lets developers quickly test different providers and models.
  • It makes the integration easy to copy into a CodePen or local HTML file.

However, this pattern must not be used in production. There are several non-negotiable reasons:

API key exposure

Embedding real API keys in client-side JavaScript makes them available to anyone who opens the browser’s developer tools. Once leaked, keys can be abused, leading to unexpected costs or account suspension.

CORS restrictions

Some providers (notably Anthropic) block direct browser requests. Even when CORS is allowed, many organizations prefer not to open their AI endpoints to arbitrary origins.

Centralized control and observability

A backend proxy gives you a single place to implement rate limiting, user authentication, cost tracking, content moderation, and prompt sanitization. You can also rotate keys or switch providers without touching the frontend.

Compliance and data residency

Many teams must ensure that sensitive document content never leaves their infrastructure in raw form. A backend layer lets you apply logging policies, PII redaction, or regional routing before any data reaches an external model.

Future flexibility

When you later add features such as streaming responses, retry logic with exponential backoff, or model fallbacks, these concerns are much easier to manage on the server.

The recommended production pattern is therefore simple: keep the model selection UI and the call to aiAssistRequest in the frontend, but have the actual request function call an internal endpoint (for example /api/ai/generate). That endpoint receives the model identifier, the prompt data, and any settings, then proxies the request to the chosen provider using server-side secrets.

Learn more on this “setup AI React WYSIWYG editor powered by Claude” guide.

Recommended Architecture for Production

  1. Store the mapping of friendly model names to provider details on the backend.
  2. Expose a single /ai-assist endpoint that accepts { model, prompt, text, settings }.
  3. Validate the incoming model against an allow-list.
  4. Apply any business rules (user quotas, content filters).
  5. Forward the request to the appropriate provider using the correct SDK or HTTP client.
  6. Return only the generated HTML (or an error object) to the editor.

On the Froala side, your aiAssistRequest function becomes very small:

async function aiAssistRequest(data, signal) {
  const response = await fetch("/api/ai-assist", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      model: this.opts.selectedAiModel,
      prompt: data.prompt,
      text: data.text,
      settings: this.opts.aiSettings
    }),
    signal
  });
  // handle response...
}

This keeps the editor configuration clean while moving all sensitive logic behind your own authentication boundary.

Best Practices When Working with Froala’s Command System

  • Always use refreshOnShow (not refresh) when you need to update dropdown appearance. The former runs only when the menu is about to open.
  • Store runtime state on this.opts rather than on the command object itself. This keeps state scoped to the editor instance.
  • If you need to disable the model selector in certain contexts (read-only mode, specific user roles), use the refresh callback on the command to toggle the disabled class on the button.
  • Consider persisting the user’s last chosen model in localStorage and restoring it when the editor initializes. This small UX improvement makes repeated sessions feel more personal.

Testing the Multi-Model AI Integration

When testing multi-model support, verify the following flows:

  • Switching models while text is selected should use the newly chosen model on the next AI action.
  • The active model should remain highlighted when the dropdown reopens.
  • Changing models should not clear the current selection or undo stack.
  • Error states returned by one provider should not affect subsequent calls when the user switches models.

Because each request function is independent, you can also temporarily replace any handler with a mock during automated tests:

editor.opts.aiAssistRequest = async () => '<p>Mock response</p>';

Conclusion

Froala’s AI Assist configuration combined with the command registration system gives developers a surprisingly powerful extension surface. By treating aiAssistRequest as a swappable strategy and using a custom dropdown command for model selection, you can deliver a first-class multi-model experience with very little code.

The pattern scales well: whether you’re connecting two models or ten, the core architecture remains unchanged. The separation between frontend UI (model selection, settings) and backend logic (API calls, security) keeps your codebase maintainable as you add new providers or features.

Ready to get started? Fork the JSFiddle demo, connect your own API keys, and experiment with different models in your editor. Then move to a backend architecture following the recommended production pattern, and you’ll have a robust, secure multi-model AI assistant built right into your editing experience.

Try Froala Editor with AI Assist today.
graphical user interface, text

Creating a Side-by-Side AI Assist Chat with Gemini Integration

Side-by-Side AI Assist Chat

The Froala’s AI Assist feature lets users generate or rewrite content through natural language. However, its default popup behavior can obscure the editing area. This creates friction when users need to see their original text while chatting with AI.

This article explains a complete working prototype that solves this problem. It repositions the AI Assist interface into a dedicated side panel. The editor and chat sit side-by-side in a clean flex layout. The implementation uses Froala’s built-in customization hooks, DOM manipulation, and direct integration with Google’s Gemini model for rapid prototyping.

Key Takeaways

  • Froala’s event system and DOM flexibility allow you to reposition the AI Assist popup from a floating modal into a fixed sidebar without touching the editor’s core logic.
  • A simple flex layout combined with CSS overrides and the popups.show.aiAssist.promptPopup event creates a seamless side-by-side editing experience.
  • The aiAssistRequest callback makes it straightforward to integrate any LLM—this prototype uses Gemini, but the same pattern works with Claude, OpenAI, or your own backend.
  • Froala remains fully functional when you customize the AI interface; other features like image uploads, formatting, and toolbars continue to work normally.
  • Client-side prototyping is fast, but production deployments should proxy API calls through a backend and add authentication, rate limiting, and error handling.

AI Assist Chat with Gemini Integration

Why Froala’s Flexibility Matters

Froala is not just a WYSIWYG box. It ships with a modular architecture that lets developers control nearly every visual and behavioral aspect. You can:

  • Add or remove toolbar buttons
  • Register custom commands
  • Listen to lifecycle events
  • Override default popup positioning and styling

The AI Assist feature follows the same philosophy. Instead of locking developers into a single interaction pattern, Froala exposes aiAssistRequest as an async callback and fires specific popup events (popups.show.aiAssist.promptPopup and popups.hide.aiAssist.promptPopup). These hooks make the interface adaptable to different UX requirements.

Other powerful features visible in this prototype include third-party image handling (Filestack + Filerobot), code highlighting via Prism, and PDF export via html2pdf library. These demonstrate how Froala acts as a central hub rather than an isolated component.

The Problem with Default AI Popups

Most AI chat interfaces in editors appear as floating modals or side popovers. While convenient for quick prompts, they cover the document when open. Users often want to:

  • Compare AI suggestions with existing paragraphs
  • Keep context visible while iterating
  • Maintain a persistent chat history next to their work

The code in this article addresses exactly that need. It transforms the AI prompt interface from an overlay into a fixed-width sidebar that remains visible alongside the editor.

High-Level Solution Overview

The approach combines four techniques:

  1. A flex-based container that reserves space for both the editor and the chat panel.
  2. Custom CSS that overrides the default .fr-ai-assist-prompt-popup styles when it is moved.
  3. Event listeners that detect when the AI popup opens or closes.
  4. Simple DOM relocation that moves the popup element into the sidebar container.

Because the relocation happens after Froala renders the popup, the editor’s internal state remains untouched. The AI logic itself is handled through the aiAssistRequest option, keeping the integration clean.

Step-by-Step Implementation

To help you visualize the end result before diving into the technical details, the full working code for this prototype is available on JSFiddle. You can open the fiddle, interact directly with the side-by-side AI chat, test different prompts, and see the layout behavior in real time. This hands-on preview makes the following explanations much easier to follow. 

Step 1: Create the Layout Container

The HTML starts with a simple flex container:

<div class="container">

   <div id="editor-example" class="col"></div>

   <div id="chat-popup" class="col chat-ui"></div>

</div>

The .container uses display: flex and centers itself with margin: auto 20%. The editor receives the main editing area. The #chat-popup div starts empty and acts purely as a destination for the relocated AI interface. Setting explicit widths (260px for the chat) and flex-grow: 0 keeps the sidebar stable while the editor can grow.

This structure is intentional. It avoids fighting Froala’s internal layout system. Instead, we let the editor render normally inside #editor-example and only move the AI popup element after it appears.

Step 2: Load Required Stylesheets and Scripts

The prototype loads several libraries to showcase Froala’s ecosystem:

  • Froala’s main CSS and JS packages
  • Prism for syntax highlighting (useful when AI returns code blocks)
  • Filestack and Filerobot for advanced image handling
  • DOMPurify for safe HTML insertion

These dependencies are not strictly required for the side-by-side AI feature. They are required to load full featured Froala instances.

The critical CSS for the side-by-side experience lives in the <style> block:

.container { display: flex; margin: auto 20%; }

#chat-popup { width: 260px; flex-grow: 0; flex-shrink: 0; }

#chat-popup .fr-ai-assist-prompt-popup {

   position: relative !important;

   top: auto !important;

   left: auto !important;

   width: 100%;

   height: 100%;

   box-shadow: unset;

   border: 1px solid #CCCCCC;

   border-radius: 0 10px 10px 0;

   border-left: 0;

}

The !important declarations override Froala’s absolute positioning and box-shadow. When the popup moves into #chat-popup, it fills the entire sidebar height and blends visually with the editor.

Additional rules adjust toolbar border radii when the chat is open:

#editor-example.chat-opened .fr-toolbar.fr-top {

   border-top-right-radius: 0;

}

This small visual tweak removes the gap between the editor and the sidebar, creating a seamless interface.

Step 3: Initialize the Editor with AI Assist

The core logic lives inside DOMContentLoaded:

let editor = new FroalaEditor('#editor-example', {

   placeholder: "Write something .....",

   heightMin: 450,

   key: "******************",

   aiSupplementalTermsAccepted: true,

   aiAssistRequest: async function (data, signal) { ... },

   events: { ... }

});

Several options deserve attention:

  • heightMin: 450 ensures the editor has enough vertical space even when the sidebar is present.
  • aiSupplementalTermsAccepted: true is required to enable AI features in production.
  • The aiAssistRequest callback is where custom backend logic lives.

Step 4: Implement the Gemini Integration

For this prototype, the AI call happens directly from the browser using Gemini’s public API. While not suitable for production (API keys should never be exposed client-side), it demonstrates the integration pattern clearly:

aiAssistRequest: async function (data, signal) {

   const response = await fetch(

       'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=' + geminiKey,

       {

           method: 'POST',

           headers: { 'Content-Type': 'application/json' },

           signal,

           body: JSON.stringify({

               contents: [{

                   parts: [{

                       text: `

                           Return only HTML.

                           Instruction: ${data.prompt}

                           Content: ${data.text || ''}

                       `

                   }]

               }]

           })

       }

   );

   const result = await response.json();

   return result.candidates[0].content.parts[0].text;

}

Key design choices:

  • The prompt explicitly instructs “Return only HTML.” This prevents the model from wrapping responses in markdown or explanations.
  • The signal parameter is forwarded to fetch, allowing Froala to cancel requests when the user closes the prompt.
  • data.prompt contains the user’s instruction. data.text holds any currently selected content, giving the model context.

Froala expects the callback to return a string of HTML. The Gemini response is passed through directly, which the editor then inserts into the document.

Step 5: Reposition the AI Popup Using Events

The real customization happens in the events object:

events: {

   'popups.show.aiAssist.promptPopup': function () {

       document.getElementById('editor-example').classList.add('chat-opened');

       repositionAiPopup();

   },

   'popups.hide.aiAssist.promptPopup': function () {

       document.getElementById('editor-example').classList.remove('chat-opened');

   }

}

When the popup appears, we add the chat-opened class (for border styling) and immediately call repositionAiPopup().

The reposition function is simple but effective:

function repositionAiPopup() {

   const elementToMove = document.querySelector('.fr-ai-assist-prompt-popup');

   const chatContainer = document.querySelector('#chat-popup');

   if (elementToMove && chatContainer) {

       chatContainer.appendChild(elementToMove);

   }

}

Froala creates the .fr-ai-assist-prompt-popup element dynamically and appends it to the body or editor container. By moving it with appendChild, we change its visual parent without breaking any internal references the editor holds. The CSS rules we defined earlier then take over and make the element fill the sidebar.

When the user closes the prompt, we simply remove the class. The next time the popup opens, the function runs again and moves the element back into the sidebar.

Why This Approach Works So Well

This technique leverages Froala’s event system and the fact that popups are regular DOM elements. No plugin registration or deep internal hacking is required. The same pattern can be adapted for:

  • Moving the popup to a completely separate modal
  • Docking it to the bottom of the screen
  • Integrating it with a custom chat UI built in React or Vue

The editor remains fully functional. All other toolbar commands, image uploads, and formatting options continue to work normally.

Additional Editor Capabilities Demonstrated

Although the focus is AI customization, the prototype includes several other Froala strengths:

  • Image editing: The Filerobot integration (via imageFileRobot.min.js) lets users perform advanced edits without leaving the editor.
  • File handling: Filestack drag-and-drop support enables direct uploads from cloud storage.
  • Content safety: DOMPurify is loaded to sanitize any AI-generated HTML before insertion.
  • Code support: Prism and Codemirror scripts prepare the editor for rich code block handling when AI returns technical content.

These features show that customization of the AI interface does not come at the cost of other capabilities.

Testing and Prototype Considerations

Because this is a frontend prototype, the Gemini key is stored in a JavaScript variable. In a real application you would:

  1. Create a lightweight backend endpoint that proxies requests to Gemini (or any other model). Learn more on this “setup AI React WYSIWYG editor powered by Claude” guide.
  2. Add authentication and rate limiting.
  3. Store conversation history server-side if needed.
  4. Use the signal parameter to properly handle request cancellation.

The current setup is excellent for rapid iteration and internal demos. You can test different prompt templates simply by changing the string inside aiAssistRequest.

Best Practices for Production

When moving this pattern to production:

  • Keep API keys server-side.
  • Add error handling inside aiAssistRequest and return user-friendly messages.
  • Consider debouncing or throttling rapid AI calls.
  • Test the reposition logic across different screen sizes. The 260px sidebar may need to become responsive.
  • Listen for window resize events if you want the sidebar to collapse on mobile.

Froala’s event system makes all of these extensions straightforward.

Conclusion

Froala Editor’s strength lies in its willingness to get out of the developer’s way. The AI Assist feature is powerful out of the box, yet it remains fully customizable through a small set of options and events.

By combining a flex layout, targeted CSS overrides, and the popups.show.aiAssist.promptPopup event, we transformed the default floating chat into a persistent side-by-side companion. The Gemini integration required only a few lines inside aiAssistRequest, proving that connecting modern LLMs is fast when the editor exposes the right hooks.

This approach demonstrates the broader philosophy behind Froala: give developers control over both content editing and the surrounding user experience. Whether you need a side panel, a bottom dock, or a completely custom AI workflow, the same principles apply.

The full code is self-contained and easy to run locally. Download Froala, clone the code, replace the placeholder Gemini key, and experiment with different prompt structures. You will quickly see how little code is needed to shape the editor into exactly the interface your users need.

Try the pattern in your own project and share what custom layouts you create. The editor’s flexibility makes almost any UI variation possible.

graphical user interface, text

Froala Now Works Inside Claude Code

claude code plugin thumbnail

We built a Claude Code plugin that turns Claude into a Froala expert. Ask about setup, events, custom plugins, or Filestack uploads, and get framework-specific answers right where you write code.

The plugin is open source and available now on GitHub.

Key Takeaways

  • The Froala Claude plugin ships five skills that activate automatically based on your code and questions.
  • Claude detects context from your imports, method calls, and error messages, then loads the right skill.
  • Coverage spans initialization across Vanilla JS, React, Vue 3, and Angular, plus events, custom plugins, Filestack integration, and error diagnosis.
  • Install it locally through the Claude Code marketplace and start asking questions.

What This Plugin Does

Froala has a deep API. Toolbar configuration, the editor lifecycle, custom plugin registration, and Filestack wiring each have their own patterns and their own ways to trip you up. Documentation answers these questions, but switching tabs to find the right page slows you down.

This plugin keeps the answers in your editor. It ships with Froala knowledge as a set of skills that Claude activates on its own. You write code or ask a question, Claude recognizes the context, and the matching skill supplies accurate, version-aware guidance.

You never invoke a skill by hand. Claude reads your imports, your method calls, and your error output, then loads the skill that fits.

The Five Skills

A friendly, warm, hand-drawn-style flat vector illustration representing skills that activate automatically based on context, in the spirit of Notion and Headspace artwork. The illustration depicts a plump, pillowy editor window with a couple of soft code lines inside, and a small rounded key gliding on its own toward a chunky pillowy keyhole or lock that is gently clicking open — showing the right tool arriving automatically without being summoned. A soft motion swoosh and a tiny sparkle suggest the effortless, hands-free movement. Drawn with soft, humanist line work that has rounded line caps and rounded joins everywhere, with gentle organic weight variation, echoing the soft rounded terminals of the Nunito typeface. Forms are plump, chunky, and pillowy with generous oversized corner radii — nothing sharp, rigid, or mechanical. A subtle hand-drawn imperfection gives it warmth and character, as if illustrated with care by a designer rather than rendered by a tool. The color palette uses tints and shades of Froala Blue (#0098F7): pale blue fills with deeper blue accents, plus soft rounded Froala Gray (#2D313C) outlines for dark details. The little key has a pop of green (#15b69b) for energy. The composition is centered on a light, airy background (pure white or a soft pale-blue tint), with subtle floating rounded dot-grid clusters and tiny soft sparkle accents scattered around it. Cheerful, approachable, characterful, modern SaaS illustration style, no text

Initialization and SDKs

This skill activates when you import Froala packages, use a framework wrapper, or ask about setup. It covers installation for Vanilla JS, React, Vue 3, and Angular, along with toolbar configuration, editor lifecycle and cleanup patterns, and license key setup for localhost versus production.

Ask “How do I add Froala to my React app with a dark theme?” and Claude returns a complete component built with react-froala-wysiwyg, a config prop, and theme: ‘dark’.

 

Methods and Events

This skill activates when you work with editor events, get or set content, or intercept keyboard input. It covers event listener syntax like contentChanged, focus, and keydown, safe HTML handling through editor.html.get() and editor.html.set(), paste cleanup that strips Word and Google Docs formatting, and fixes for calling API methods before the editor finishes initializing.

Custom Plugins

This skill activates when you register custom plugins, create toolbar buttons, build popups, or extend formatting. It provides full plugin boilerplate with FroalaEditor.PLUGINS, RegisterCommand, and DefineIcon, plus custom dropdown buttons, floating popup panels, state synchronization, SVG icon registration, shortcut binding, and the plugin loading order rules that determine whether your button works.

Ask for a toolbar button that inserts a signature block and Claude generates the complete registration boilerplate.

Filestack Integration

This skill activates when you wire Filestack into Froala for image or file uploads. It covers two approaches.

The recommended approach uses the official Froala Filestack plugin. You enable the native filestack plugin through pluginsEnabled: [‘filestack’], configure filestackOptions with your filestackAPI key and pickerOptions, and hook into plugin events such as filestack.uploadedToFilestack and filestack.uploadFailedToFilestack. The skill also lists the required CDN dependencies.

The advanced approach uses manual interception. You cancel Froala’s default uploader through image.beforeUpload, pass files to filestack.client.upload(), and inject the CDN URL back with editor.image.insert(). This path includes React-specific wiring for the correct this context, CDN transformations applied before insert, and the common pitfalls that cause silent failures.

Error Diagnosis

This skill activates when you hit a Froala error or something silently does nothing. It walks through the usual suspects: a toolbar button that does not show, an editor that renders unstyled because CSS imports are missing, FroalaEditor is not defined from script load order, plugin methods that come back undefined, upload failures from a missing imageUploadURL or a CORS issue, and this context loss in event handlers. A quick diagnosis checklist handles anything outside the common cases.

Ask “My toolbar button shows up but clicking it does nothing” and Claude checks plugin registration order, the pluginsEnabled allowlist, and your callback context.

How Activation Works

Each skill carries a set of trigger keywords. When your code or question contains them, Claude loads that skill. Type new FroalaEditor( and the initialization skill steps in. Reference filestackOptions and the Filestack skill takes over. Paste an error like is not a constructor and the diagnosis skill responds. The match happens from your real context, so the guidance fits what you are actually building.

Install It

The plugin runs locally through the Claude Code marketplace. Add the marketplace and install:

/plugin marketplace add https://github.com/froala/froala-claude

/plugin install froala-claude-plugin@froala-local

Once installed, the skills activate on their own as you work.

Get Started

The Froala Claude plugin is open source under the MIT license. Clone it, install it, and give Claude expert knowledge of Froala without leaving your editor.

View the repository on GitHub to get started.

graphical user interface, text

Setup AI React WYSIWYG Editor Powered by Claude

Setup AI React WYSIWYG Editor Powered by Claude

In a previous article, we explored the flexibility and various setup approaches for the Froala AI Assist plugin across different frontend and backend configurations. This article provides a practical walkthrough for integrating Froala AI Assist in React and connecting it to Claude through an Express backend server.

Key Takeaways

  • Froala AI Assist provides a pre-built chat interface for integrating AI into a rich text editor
  • Routing AI requests through a backend server protects your API credentials from exposure
  • This tutorial covers a complete React + Express + Claude integration with production-ready security
  • The setup maintains full context across user sessions, enabling iterative refinement of generated content

How it Works

The Froala AI Assist plugin provides a pre-built interface for integrating your preferred AI model into a rich text editor. The editor includes a toolbar button that opens a chat popup where users can submit prompts. When a user submits a prompt, Froala sends it to an endpoint you configure via the aiAssistEndpoint option.

While you could configure this endpoint to point directly to Claude’s API, doing so would expose your API credentials in the frontend—a significant security risk.

For production environments, the recommended approach is to route requests through a backend server. This server acts as a middleware layer: it receives prompts from Froala, forwards them securely to Claude, and returns the response back to the editor for display.

In this tutorial, we’ll build this backend server using Node.js and Express, ensuring your API keys remain protected while maintaining full functionality.

Prerequisites and Setup

Before you begin, ensure your development environment is configured for a React and Express integration.

Frontend Requirements

  • An existing React project
  • Understanding of React components, hooks, and event handling
  • Froala Editor installed and properly licensed

Backend Requirements

  • Node.js and npm installed
  • Familiarity with Express routing and middleware concepts

Setup Froala In React

Installation

Begin by installing the Froala React component in your project:

npm install react-froala-wysiwyg --save

Create the Editor Component

Create a new React component file for the Froala editor. Import the necessary CSS files and the Froala component:

import React from "react";
import "froala-editor/css/froala_style.min.css";
import "froala-editor/css/froala_editor.pkgd.min.css";
import 'froala-editor/js/plugins.pkgd.min.js';
import FroalaEditorComponent from "react-froala-wysiwyg";

function AIEditorComponent() {
    const config = {
        heightMin: 300,
        aiSupplementalTermsAccepted: true,
        aiAssistEndpoint: 'http://localhost:5000/ai-assist',
        aiAssistHeaders: {
            'Content-Type': 'application/json'
        },
        aiAssistAdditionalData: {
            model: 'claude-opus-4-7',
            token: 20000
        },
        aiAssistResponseParserPath: 'content',
    };

    return (
        <div className="editor">
            <h3>Froala's React WYSIWYG Editor</h3>
            <FroalaEditorComponent tag="textarea" config={config} />
        </div>
    );
}

export default AIEditorComponent;

Configuration Breakdown

The config object controls the editor’s behavior and AI integration:

  • heightMin: Sets the minimum height of the editor to 300 pixels, ensuring adequate space for content creation.
  • aiSupplementalTermsAccepted: Enables AI features by confirming acceptance of supplemental terms.
  • aiAssistEndpoint: Points to your Express backend server at http://localhost:5000/ai-assist. Froala sends user prompts to this endpoint for processing.
  • aiAssistHeaders: Specifies the request headers. The Content-Type: application/json header tells the server to expect JSON-formatted data.
  • aiAssistAdditionalData: Passes metadata to your backend, including the Claude model identifier and token limit (20,000 tokens) for response generation.
  • aiAssistResponseParserPath: Tells Froala where to find the AI response in the server’s JSON reply. The value 'content' means the response text is located at response.content.

Integrate Into Your Application

Import the component into your main App.js file and render it:

import './App.css';
import AIEditorComponent from "./components/AIEditorComponent";

function App() {
  return (
    <div className="App">
      <AIEditorComponent />
    </div>
  );
}

export default App;

Run Your Application

Start the development server with:

npm start

Your React application will launch locally with the Froala editor fully integrated and ready to communicate with your backend AI service.

Setup Node.js Server

This section walks you through creating a backend server that securely handles AI requests from Froala and communicates with Claude’s API.

Install Required Dependencies

Start by installing the necessary npm packages for your Express server:

npm install express cors dotenv @anthropic-ai/sdk

Here’s what each package does:

  • express: Web framework for building the server and defining routes
  • cors: Middleware to enable Cross-Origin Resource Sharing, allowing your React frontend to communicate with the backend
  • dotenv: Loads environment variables from a .env file
  • @anthropic-ai/sdk: Official SDK for interacting with Claude’s API

Configure Environment Variables

Create a .env file in your project root to securely store sensitive credentials:

ANTHROPIC_API_KEY=your_api_key_here

PORT=5000

Replace your_api_key_here with your actual Anthropic API key. The PORT variable specifies where your server will listen for incoming requests.

Important: Add .env to your .gitignore file to prevent accidentally committing API keys to version control.

Enable ES Module Support

Update your package.json to use ES modules (modern JavaScript import syntax):

{

  "type": "module"

}

This allows you to use import statements instead of older require() syntax throughout your server code.

Create the Express Server

Create a new file (e.g., server.js or index.js) with the following code:

import express from 'express';
import cors from 'cors';
import dotenv from 'dotenv';
import Anthropic from '@anthropic-ai/sdk';

dotenv.config();

const app = express();

app.use(cors());
app.use(express.json());

const anthropic = new Anthropic({
    apiKey: process.env.ANTHROPIC_API_KEY,
});

app.post('/ai-assist', async (req, res) => {
    try {
        const { question, model, token } = req.body;

        const response = await anthropic.messages.create({
            model,
            max_tokens: token,
            messages: [
                {
                    role: 'user',
                    content: question,
                },
            ],
        });

        const result = response.content[0]?.text || '';

        res.json({
            content: result,
        });
    } catch (error) {
        console.error(error);

        res.status(500).json({
            error: 'AI request failed',
        });
    }
});

app.listen(process.env.PORT || 5000, () => {
    console.log(`Server running on port ${process.env.PORT || 5000}`);
});

Code Breakdown

Initialization

dotenv.config();

const app = express();

The dotenv.config() call loads your environment variables from the .env file. The express() function creates your Express application instance.

Middleware Configuration

app.use(cors());

app.use(express.json());
  • cors(): Enables cross-origin requests, allowing your React frontend (running on a different port) to communicate with this backend server
  • express.json(): Automatically parses incoming JSON request bodies, making form data accessible via req.body

Claude Client Initialization

const anthropic = new Anthropic({

    apiKey: process.env.ANTHROPIC_API_KEY,

});

This initializes the Anthropic SDK with your API key from the environment variables, creating a reusable client for all Claude API calls.

The /ai-assist Route

app.post('/ai-assist', async (req, res) => {

    const { question, model, token } = req.body;

This defines a POST endpoint that receives three parameters from Froala:

  • question: The user’s prompt (or formatted question with context instructions)
  • model: The Claude model identifier (e.g., claude-opus-4-7)
  • token: The maximum number of tokens Claude should generate

Calling Claude’s API

const response = await anthropic.messages.create({
    model,
    max_tokens: token,
    messages: [
        {
            role: 'user',
            content: question,
        },
    ],
});

This sends the user’s question to Claude with the specified model and token limit. The messages array follows Claude’s expected format: an array of message objects with role (either user or assistant) and content (the message text).

Processing the Response

const result = response.content[0]?.text || '';

res.json({

    content: result,

});

Claude returns a response object with a content array. The optional chaining operator (?.) safely accesses the text from the first content item, defaulting to an empty string if unavailable. The response is then returned to Froala in the expected JSON format with a content key (as configured in your React component’s aiAssistResponseParserPath).

Error Handling

catch (error) {

    console.error(error);

    res.status(500).json({

        error: 'AI request failed',

    });

}

If any error occurs during the API call, the server logs it to the console and returns a 500 status code with an error message to the client.

Starting the Server

app.listen(process.env.PORT || 5000, () => {

    console.log(`Server running on port ${process.env.PORT || 5000}`);

});

This starts the Express server on the port specified in your .env file, or defaults to port 5000.

Run the Server

Execute the following command to start your backend:

node index.js

You should see the confirmation message:

Server running on port 5000

Your backend is now ready to receive requests from your React frontend and forward them securely to Claude.

Test the App

  1. Open AI Assist: Click the AI Assist button in the Froala editor toolbar to open the chat interface.
  2. Submit a Prompt: Enter a prompt such as “Write a professional email telling users about AI Assist feature” and submit it.
  3. Observe the Request Flow: When you submit the prompt, Froala constructs a detailed request object that includes:
    • Your original prompt wrapped with system instructions for HTML formatting
    • Metadata fields: question_order_number, question_timestamp, and session_id for tracking
    • Model and token parameters: model: “claude-opus-4-7” and token: 20000
question:"n  Answer the question based on the context provided below. If the context is empty, answer the question based on your knowledge.n  Your response must be in valid HTML format only - do not include markdown code blocks or backticks.n  Preserve all HTML formatting, tags, links, styles, and structure from the context.n  If generating new content, use appropriate HTML tags for proper formatting.n  If the response includes code snippets inside <pre> or <code> tags, ensure the outer <pre> tag includes a data-code-snippet attribute whose value is the language name (for example: data-code-snippet="javascript"). Do not add any class to the tag — include only the data-code-snippet attribute.n  Do not add explanatory text outside the HTML response.n Question: """Write a professional email telling users about AI Assist feature""" n n Answer:"

question_order_number:1

question_timestamp: "2026-05-18T09:30:36.514Z"

session_id:"new_session"

token:20000

model:"claude-opus-4-7"
  1. Backend Processing: Your Express server receives this request at the /ai-assist endpoint, extracts the necessary parameters, and forwards them to Claude’s API.
  2. Receive the Response: Claude processes the request and returns a response in the configured JSON format:
{

  "content": "<!DOCTYPE html>n<html lang="en">...<p>Subject: <strong>Introducing AI Assist</strong></p>..."

}

The response is automatically inserted into the editor as formatted HTML.

  1. Continue the Conversation: You can submit follow-up prompts or refine the generated content. The AI maintains context within the session, enabling iterative improvements. Once satisfied, insert the final result directly into your document.

Setup AI React WYSIWYG Editor Powered by Claude

Conclusion

Integrating Froala AI Assist with Claude through an Express backend gives you a powerful, production-ready WYSIWYG editor that harnesses advanced AI capabilities while keeping your API credentials secure. By routing requests through your own server, you maintain full control over your data pipeline and can easily customize the AI behavior to match your application’s needs.

The setup we’ve covered, from configuring the React component to building the backend middleware, provides a solid foundation for adding intelligent content generation to your platform. Whether you’re building a collaborative writing tool, a content management system, or an internal documentation platform, this architecture scales cleanly and keeps security at the forefront.

Ready to experience this workflow firsthand? Start your free Froala trial today and follow this tutorial to get AI React WYSIWYG editor up and running in minutes. You’ll see firsthand how seamlessly Claude integrates into your editing experience, enabling your users to draft, refine, and polish content with AI assistance built right into their workflow.

FAQ

Can I use a different AI model instead of Claude?

Yes. While this tutorial uses Claude, you can modify the backend to call any AI API. Update the /ai-assist route to use your preferred provider’s SDK and adjust the request/response formatting accordingly.

What if I want to customize the system prompt that Froala sends to Claude?

Froala constructs the system instructions automatically, but you can intercept and modify the question parameter in your Express server before sending it to Claude. This gives you full control over the prompt structure.

How do I handle rate limiting or API quota issues?

Implement rate limiting middleware in Express (e.g., express-rate-limit) and add error handling for Claude API rate limit responses. You can also track token usage per session and reject requests that exceed your quota.

Is it safe to store the API key in a .env file?

For local development, yes. For production, use a secrets management service like AWS Secrets Manager, HashiCorp Vault, or your hosting platform’s built-in secrets storage to avoid committing credentials to version control.

What’s the maximum token limit I should set?

It depends on your use case and Claude model. Larger limits allow longer responses but increase latency and cost. Start with 2,000–4,000 tokens for typical editing tasks, then adjust based on your needs.

Q: How do I debug if the AI response isn’t appearing in the editor?

Check three things:

(1) verify the backend is receiving requests by logging req.body.

(2) confirm Claude is returning a response by logging the API response.

(3) ensure the response JSON has a content key matching your aiAssistResponseParserPath configuration.

Comparing WYSIWYG Editors: What to Look For in 2026

Illustration of a balance scale comparing a clean, optimized editor interface with a cluttered, feature-heavy editor, highlighting performance vs functionality trade-offs in WYSIWYG editors

In 2026, a “good” editor isn’t just about bold text and hyperlinks anymore. It sits right at the heart of your application, powering content, shaping user experience, and even influencing performance and security.

If you choose the wrong one, it can slow down your app, frustrate users, and open doors to vulnerabilities. But the right one? It quietly makes everything smoother: faster workflows, cleaner content, and happier users.

In this guide, I’ll walk you through what really matters when comparing modern WYSIWYG editors. So you can make a confident, future-proof choice.

Key Takeaways

  • A modern WYSIWYG editor is a core part of your app, not just a content tool impacting performance, security, and user experience
  • Lightweight, modular architecture is essential to avoid slow load times and bloated JavaScript bundles
  • Built-in security features like HTML sanitization and XSS protection are non-negotiable in 2026
  • Clean, intuitive UI/UX (including inline editing) improves both user satisfaction and productivity
  • Strong framework compatibility ensures seamless integration with React, Vue, and Angular applications

The Evolution of the WYSIWYG Editor

WYSIWYG (What You See Is What You Get) editors have come a long way from their early, clunky beginnings from the 1970s. They started with Bravo in 1974. Then these editors evolved from desktop publishing tools to web-based content creation tools like FrontPage. 

And finally they were developed into the modern browser-based Rich Text Editors like Froala. They prioritize content formatting over HTML output.

Today’s editors aren’t just about editing content. They’re designed to be fast, customizable, and developer-friendly, keeping up with the demands of both users and performance-focused applications.

Key Stages in WYSIWYG Evolution

  • The Origins (1970s): Bravo (1974) was the first editor to display formatted text on the screen. But, it did not perfectly match with the printed output.
  • The Desktop Publishing Era (1980s-90s): WYSIWYG was essential with the rise of the GUIs in Apple Macintosh and Microsoft Windows. People could finally see the layouts, fonts, images on the screen as they appear on print.
  • Web Era: HTML Editors (1995-2005): These tools were evolved to allow visual building of web pages and generate HTML code automatically. Some examples are Vermeer FrontPage (1995) and WebMagic.
  • Modern Era: Content Management (2005-Present): HTML5 brought the contentEditable attribute. It enables in-browser editing for CMS platforms like WordPress. Modern editors like Froala and TinyMCE now focus on structured content and user-friendly formatting.

From Basic Tools to Modern Engines

Old-school editors were often built with heavy iframe-based architectures. They worked, but they were slow, rigid, and difficult to customize.

Today’s editors are completely different. They use lightweight JavaScript engines, modular components, and APIs that fit seamlessly into modern applications.

The Performance Mandate

Performance is no longer optional. With metrics like Core Web Vitals shaping SEO and UX, your editor must be fast and efficient.

Modern tools like Froala Editor focus on keeping bundle sizes small while still offering powerful features. So your app stays responsive without sacrificing functionality.

1. Speed and Lightweight Architecture

Speed is one of the first things users notice and one of the easiest to get wrong with an editor. A modern WYSIWYG editor should feel fast and responsive from the moment it loads. They should not add unnecessary weight to your application.

The “Bloat” Problem

Many legacy editors load everything upfront. Tables, videos, plugins you may never even use. At first, this might not seem like a big deal. But over time it adds unnecessary weight to your application.

This leads to:

  • Slower page loads
  • Heavier JavaScript bundles
  • Laggy editing experiences

It can also impact performance metrics like Core Web Vitals. This means your editor isn’t just affecting users. It can also hurt your SEO and overall app responsiveness.

What to Look For

A modern editor should be modular and performance-focused. That means:

  • Features load only when needed (lazy loading)
  • Plugins can be added or removed easily
  • The DOM stays clean and efficient
  • Minimal re-renders to keep interactions smooth

Some advanced editors even optimize how content is rendered and updated. They ensure typing and formatting feel instant, even in large documents.

In short, your editor should feel invisible, lightweight, fast, and seamlessly integrated, not like a heavy layer sitting on top of your app.

2. Security: Protecting Your Data in 2026

Rich text editors are one of the most common entry points for security issues—especially XSS (Cross-Site Scripting) attacks.

The Reality

Users can input HTML, scripts, or malicious content directly into your system through the editor. Without proper safeguards, that’s risky.

What to Look For

A secure editor should include:

  • Built-in HTML sanitization
  • Configurable allowed/blocked tags
  • Protection against script injection
  • Compliance with enterprise security standards

Security shouldn’t be something you “add later.” It needs to be built into the editor from day one.

3. UI/UX: Customization and “Edit-in-Place”

A great editor isn’t just powerful. It should feel effortless to use. In 2026, users expect clean interfaces, smooth interactions, and the ability to edit content naturally without distractions. That’s where thoughtful UI/UX and “edit-in-place” experiences make all the difference.

User Expectations Have Changed

Users now expect a clean, intuitive experience. It’s something similar to platforms like Medium or Notion.

That means:

  • Minimal distractions
  • Smooth formatting controls
  • Real-time feedback

Inline vs. Document Mode

  • Document mode: Fixed toolbar at the top (great for structured content like blogs or CMS dashboards)
Froala WYSIWYG Editor - Document Mode
Froala WYSIWYG Editor – Document Mode
  • Inline mode: Floating toolbar that appears when needed (ideal for modern, distraction-free editing)
Froala WYSIWYG Editor - Inline Mode
Froala WYSIWYG Editor – Inline Mode

The Froala Advantage

Editors like Froala Editor come with a polished, modern interface out of the box.

Instead of spending hours tweaking CSS and UI components, you get:

  • A sleek, production-ready design
  • Smooth interactions
  • Consistent experience across devices

4. Framework Compatibility (React, Vue, Angular)

Modern web apps are built on frameworks, so your editor needs to fit right in, not fight against them. A well-integrated editor feels like a natural extension of your app. It makes development smoother and reduces unnecessary complexity.

Why This Matters

Your editor shouldn’t feel like an external tool. It should behave like part of your application. When integration is done right, you spend less time fixing issues and more time building features. It also ensures consistency in how data flows through your app, especially when dealing with dynamic content.

What to Look For

Modern editors should offer:

  • Native integrations for frameworks like React, Vue.js, and Angular
  • Support for hooks, props, and reactive state
  • Clean APIs for customization
  • Well-documented SDKs that reduce setup time

These features make it easier to plug the editor into your existing workflow without writing unnecessary glue code.

Integration Done Right

Avoid editors that rely on manual DOM manipulation. It often leads to bugs and unpredictable behavior. Instead, choose ones that:

  • Work with your framework’s lifecycle
  • Keep state predictable and easy to manage
  • Reduce integration complexity
  • Allow seamless updates without breaking your UI

When an editor integrates properly, it doesn’t just “work”. It enhances your development experience and keeps your application scalable as it grows.

5. Media Handling and Advanced Features

Today’s editors are expected to do much more than just handle text. Whether it’s uploading images, collaborating with a team, or ensuring accessibility, these features play a big role in how useful and future-ready your editor really is.

Image and File Management

A modern editor should make uploads feel seamless and intuitive, especially for non-technical users.

Look for:

  • Drag-and-drop support for quick uploads
  • Direct uploads to cloud storage or CDNs
  • Automatic optimization (compression, resizing, format conversion)
  • Preview and editing options before publishing

Transforming Froala WYSIWYG editor with Filestack image uploader

This not only improves user experience but also helps maintain performance by ensuring media files are optimized from the start.

Explore more about transforming your Froala WYSIWYG editor with the Filestack image uploader and enterprise-grade file handling.

Real-Time Collaboration

If your app involves teams, collaboration becomes a core feature, not a nice-to-have.

Look for:

  • Multi-user editing with presence indicators
  • Conflict resolution to prevent overwriting changes
  • Live updates so everyone sees changes instantly
  • Version history or undo tracking for safety

These features make it possible for teams to work together smoothly without breaking content or losing progress.

Accessibility (WCAG 2.1)

Accessibility isn’t optional anymore. It’s essential for both usability and compliance.

Your editor should:

  • Support full keyboard navigation
  • Be screen-reader friendly
  • Provide proper ARIA labels and semantic structure
  • Meet WCAG 2.1 standards

This ensures your content creation tools are inclusive, usable by everyone, and aligned with modern legal and ethical expectations.

Strategic Comparison: Top Editors at a Glance

With so many editors available, it can be hard to quickly understand how they differ in real-world use. Alongside the comparison below, you can review the best WYSIWYG editors on G2 for user ratings and product feedback. This side-by-side comparison gives you a clear snapshot of how leading options stack up. So you can match the right tool to your app’s needs without overthinking it.

FeatureFroalaTiptap (Headless)TinyMCE
Setup TimeMinutesHours (Custom UI)Moderate
UI AestheticsModern / PremiumFully CustomTraditional
Best ForSaaS, CMS, DashboardsCustom “Notion-style” appsLegacy enterprise apps

Quick Insight

  • Froala → Best balance of speed, design, and ease
  • Tiptap → Maximum flexibility, but requires heavy development
  • TinyMCE → Reliable, but more traditional in UX

Conclusion: Elevating Your App’s Architecture

Choosing a WYSIWYG editor isn’t just a small decision. It shapes how your entire application handles content. When choosing a WYSIWYG editor for your modern workflow, you should consider many factors like its architecture, security, UI/UX, framework compatibility, media handling and more advanced features. 

Headless editors give you full control, but they demand time, effort, and ongoing maintenance. On the other hand, a polished, full-featured solution like Froala Editor gives you a strong foundation from day one, without limiting your ability to scale.

The goal is simple:
Find an editor that works with your workflow, not against it.

Don’t settle for a mediocre editing experience. Explore what a modern editor should feel like.

Compare Froala’s features and start your free trial today.

FAQ

What is the best WYSIWYG editor for React in 2026?

It depends on your needs. For most applications, a ready-to-use editor like Froala Editor offers the best balance of performance, UI, and ease of integration.

How does a WYSIWYG editor impact site speed?

Editors can significantly affect page load time. Lightweight, modular editors improve performance by reducing unnecessary code and loading only required features.

Is it safe to allow users to upload images through an editor?

Yes, if the editor includes proper validation, sanitization, and secure upload handling. Without these, uploads can become a security risk.

What does “Headless” mean in a WYSIWYG context?

A headless editor provides only the editing engine without a UI. Developers must build the interface themselves, offering flexibility but requiring more effort.

Do modern editors support Markdown?

Many modern editors support Markdown either natively or through plugins, making them flexible for different workflows.

Why is SOC 2 compliance important for an editor?

SOC 2 compliance ensures that the editor meets strict security and data protection standards, especially important for SaaS and enterprise applications handling sensitive data.

Froala Editor V5.2 with Filerobot, CSP Compliance and Stability

Froala release 5.2.0

We’re thrilled to announce the release of Froala Editor V5.2, a milestone update that brings powerful new capabilities and critical stability improvements to your favorite WYSIWYG editor. This release represents our commitment to delivering the features you’ve been asking for while ensuring Froala works flawlessly in even the most demanding enterprise environments.

This release includes major enhancements: advanced image editing with Filerobot integration, smarter list handling that preserves document structure, and full CSP compliance for enterprise security.

Let’s dive into what’s new.

Advanced Image Editing: Introducing Filerobot as a Modern Alternative

Froala Editor has long supported advanced image editing through the TUI Image Editor plugin. However, the TUI Image Editor library appears to be abandoned, with no active maintenance or updates. To improve long-term stability and provide users with modern, actively maintained tools, V5.2 introduces the Filerobot Image Editor plugin, a powerful, professionally supported alternative that brings cutting-edge image editing capabilities directly into Froala Editor.

Existing TUI Image Editor users can continue using their current setup, but we strongly recommend exploring Filerobot for its active development, ongoing support, and enhanced reliability. This new integration means no more switching between applications, uploading and re-uploading images, or breaking your creative flow. Now, you can perform sophisticated image transformations right where you’re working, with the confidence that comes from actively maintained software.

What Can You Do with Filerobot?

The Filerobot integration unlocks a comprehensive suite of image editing capabilities:

  • Annotations: Add text, arrows, shapes, and callouts to highlight important details.
  • Filters: Apply professional filters to enhance image appearance and mood
  • Resize: Adjust dimensions precisely to meet your layout requirements
  • Rotate & Flip: Correct orientation and create mirror effects
  • Watermarks: Protect your images with custom watermarks and branding
  • Crop: Focus on what matters by removing unnecessary portions

Advanced Image Editing

Need more advanced capabilities? If your image transformation requirements go beyond Filerobot’s feature set, Froala also supports the Filestack plugin, which provides additional tools and integrations for complex image processing workflows.

Seamless Integration, Effortless Workflow

We’ve designed the Filerobot plugin to feel like a natural extension of Froala Editor. When activated and you select an image in your content, you will see an “Advanced Edit” button on the image edit popup. Click it, and Filerobot’s powerful editor opens right within your interface. Make your edits—whether it’s adding annotations to a screenshot, applying a filter to a photo, or resizing an image to fit your design—and when you’re done, simply save. The updated image is instantly reflected in your editor, with all changes preserved.

For existing TUI Image Editor users: You can continue using your current setup without any disruption. However, we encourage you to evaluate Filerobot for future projects and consider migrating when convenient. The long-term stability, active maintenance, and ongoing feature development make Filerobot the recommended choice for new implementations and a smart migration path for existing ones.

The Filerobot Image Editor plugin represents our vision for the future of advanced image editing in Froala: powerful capabilities that don’t compromise on user experience, backed by active maintenance and a commitment to long-term reliability.

Smarter List Handling: Keeping Your Structure Intact

Lists are essential for structuring content like documentation, tutorials, product descriptions, and blog posts.

In Froala, pressing backspace at the beginning of a list item merges it with the previous item.

To remove only the list marker (dot, number, etc.) with the backspace key, keeping the text on the same line without merging, set the new V5.2 configuration preserveListLineOnBackspace to true.

This new configuration allows inserting multiple lines within a single list item, preserving list structure, content organization, and visual separation.

new FroalaEditor('#editor', { 

    preserveListLineOnBackspace: true

});

This seemingly small enhancement reflects our philosophy: great editing experiences come from understanding how people actually work and removing the friction points that slow them down.

Enterprise Security: Full CSP Compliance

Security isn’t optional, especially in enterprise environments where data protection, compliance requirements, and security policies are paramount. Froala V5.2 delivers a critical enhancement for organizations with the strictest security requirements: full Content Security Policy (CSP) compliance.

Content Security Policy (CSP) is a security standard that helps prevent cross-site scripting (XSS) attacks and other code injection vulnerabilities. Many enterprise applications implement strict CSP configurations that disallow unsafe-inline styles. This is a security best practice that prevents malicious inline code execution.

Froala Editor V5.2 now fully supports CSP-compliant environments. We’ve re-engineered how the editor applies formatting to work seamlessly within strict CSP configurations that disallow inline styles.

Now, when users apply formatting like font size, font family, bold, italic, or any other style-based changes, Froala does so in a way that respects CSP restrictions. The editor maintains full functionality—all toolbar features work exactly as expected—while adhering to your organization’s security policies.

Why This Matters for Enterprise Deployments

For enterprise IT teams, this means you can finally deploy Froala in applications with strict security requirements without compromising on functionality or user experience.

For security officers, it means one less exception to your CSP policy, reducing your attack surface and maintaining consistent security standards across your application portfolio.

For developers building enterprise applications, it eliminates the frustrating choice between security and functionality. You can implement robust CSP policies and still provide users with a rich, fully-featured editing experience.

For end users in regulated industries (healthcare, finance, government), it means access to powerful content creation tools that meet your organization’s compliance requirements.

CSP compliance isn’t just a technical checkbox—it’s a commitment to building software that works in the real world, where security and functionality must coexist.

Stability & Compatibility:

Beyond the headline features, V5.2 includes several critical bug fixes that improve stability, compatibility, and reliability across different browsers and use cases. These fixes address real issues reported by our user community and ensure Froala works flawlessly in your production environments.

Responsive Toolbar Behavior Fixed

V5.2 delivers improved responsive toolbar behavior that ensures toolbar buttons remain consistently visible and properly positioned across all scenarios—whether the screen resolution changes, the editor frame refreshes, or users switch between displays.

Your toolbar now adapts seamlessly to dynamic environments, giving you reliable access to all editing tools regardless of how your interface changes. This enhancement is particularly valuable for responsive web applications and users working across multiple displays or adjusting browser window sizes. Rest assured that every button you need will be there, exactly where you expect it.

Security Dependency Updates

Security is an ongoing commitment. A vulnerability was discovered in serialize-javascript versions prior to 7.0.3. V5.2 updates this dependency to 7.0.3, along with copy-webpack-plugin to 14.0.0, ensuring your applications remain protected against known vulnerabilities.

These updates ensure your applications aren’t exposed to known vulnerabilities, maintaining the security integrity of your entire stack.

Paste Content Enhancements

Pasting content from external sources is one of the most common operations in any editor, and V5.2 includes critical fixes that make this experience more reliable.

And More…

Explore the Froala changelog.

What’s Next: Real-Time Collaboration Coming Soon

We’re excited to give you a preview of what’s coming next: real-time collaboration—one of the most highly-anticipated features in Froala’s roadmap.

Imagine multiple team members editing the same document simultaneously, seeing each other’s changes in real-time, with cursor positions, selections, and edits synchronized instantly across all users. This is the future we’re building, and it’s coming soon in an upcoming release.

Our team is working diligently to ensure this feature meets the high standards you expect from Froala: reliable, performant, and seamlessly integrated into your existing workflows. Stay tuned for more details in the coming months.

Upgrade to V5.2 Today

Froala Editor V5.2 represents a significant leap forward in capability, security, and stability. With advanced image editing through Filerobot integration, smarter list handling, full CSP compliance, and critical bug fixes, this release delivers tangible value for developers and end users alike.

Key Benefits at a Glance:

Advanced image editing without leaving your workflow

Preserved list structure with intelligent backspace handling

Enterprise-grade security with full CSP compliance

Improved stability across browsers and use cases

Enhanced paste functionality for reliable content import

Updated dependencies addressing security vulnerabilities

Whether you’re building the next generation of content management systems, developing enterprise applications with strict security requirements, or simply want the most reliable and feature-rich editing experience available, V5.2 has something for you.

Ready to upgrade?

Visit our Froala upgrade documentation for detailed instructions and migration guidance. As always, our support team is here to help if you have any questions or need assistance with the upgrade process.

Upgrade to Froala Editor V5.2 today and unlock new possibilities.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Thank you for being part of the Froala community. We’re committed to continuously improving and delivering the tools you need to build exceptional content experiences.

Choosing the Right Froala AI Assist Integration for Your Stage

Choosing the Right Froala AI Assist Integration

AI-assisted editing is quickly becoming a standard feature in modern applications. With Froala’s AI Assist plugin, you can bring content generation, rewriting, summarization, and more—directly into your editor.

The tricky part isn’t picking a provider. It’s picking an integration pattern that fits where you actually are in your project.

This guide walks through a realistic journey: how you’ll probably start, where you’ll feel the friction, and when (and why) you’ll want to switch.

Key Takeaways

  • Three integration patterns available: direct API, custom backend, and endpoint configuration.
  • Direct API is fastest to set up, but exposes API keys. Prototypes only.
  • Custom backend keeps keys server-side and adds rate limiting, logging, and validation.
  • Endpoint configuration lets Froala handle request wiring. Best when your API structure is stable.
  • Need sanitization, A/B testing, or fallback logic? Use a custom backend, not configuration.
  • AI Assist is provider-agnostic. Swap models or use self-hosted AI without touching your frontend.

The Journey Begins: “Just Get It Working”

You want to ship a prototype. Fast. You don’t need perfection—you need proof that AI in your editor actually improves the user experience.

Enter: Direct API Integration.

Direct API: The Seductive Fast Path

This is the path of least resistance. You write a custom request function that talks directly to your AI provider from the frontend:

aiAssistRequest: async function (prompt) {
  const response = await fetch('https://api.openai.com/v1/chat/completions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer YOUR_API_KEY`
    },
    body: JSON.stringify({
      model: 'gpt-4',
      messages: [{ role: 'user', content: prompt }]
    })
  });

  const data = await response.json();
  return data.choices[0].message.content;
}

Why developers choose this:

  • It works immediately
  • Full control over the request
  • Easy to debug
  • Can swap AI providers with a few lines of code
  • Perfect for testing different prompts and UX flows

And it is genuinely useful for this stage. You learn what AI editing feels like in your app. You test if users actually want this feature.

The First Problem Appears: API Keys in the Wild

A week in, you realize something uncomfortable.

Your API key is sitting in the front-end code. Anyone with browser DevTools can see it. Your quota is exposed to the world. If someone finds it, they’re using your API calls.

You brush this aside. “It’s just a prototype.” But then you show it to your team. They ask: “Wait, where’s your key?” You say “in the code.” They make a face.

This is the first friction point. 

The Second Problem Emerges: Loss of Control

A few days later, you notice something else.

Your API usage is spiking—way beyond what your users should generate. You dig in. Turns out someone is hammering your endpoint (maybe intentionally, maybe a bug in the frontend). You have no way to throttle it, log it, or stop it. You just watch the bill climb.

Worse: you have no visibility into what’s happening. Which prompts are users using? What’s working? What’s failing? With the frontend integration, you’re blind.

This is the second friction point. And it stings more than the first.

At this moment, most developers realize: “I need a backend.”

The Transition: When Direct API Breaks Down

Before you rewrite everything, understand what’s actually broken:

  • Security: Your keys are exposed
  • Control: You can’t throttle, log, or validate requests
  • Observability: You don’t know what’s happening
  • Scalability: You have no way to add business logic (rate limiting, moderation, user-specific rules)

The good news: you don’t have to change your architecture everywhere. You just need a middle layer.

The Backend Approach: Reclaiming Control

Here’s the pattern that fixes all of this:

Frontend talks to your backend, which talks to the AI provider.

Frontend code gets simpler:

aiAssistRequest: async function (prompt) {
  const response = await fetch('/api/ai-assist', {
    method: 'POST',
    body: JSON.stringify({ prompt })
  });
  const result = await response.json();
  return result.content;
}

Now your backend owns the integration:

app.post('/api/ai-assist', async (req, res) => {
  const { prompt } = req.body;
  
  // Validation
  if (!prompt || prompt.length < 3) {
    return res.status(400).json({ error: 'Invalid prompt' });
  }

  // Rate limiting (per user)
  const userQuota = await checkUserQuota(req.user.id);
  if (userQuota.exceeded) {
    return res.status(429).json({ error: 'Rate limit reached' });
  }

  // Call AI provider with your API key (safe on the backend)
  const response = await fetch('https://api.openai.com/v1/chat/completions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`
    },
    body: JSON.stringify({
      model: 'gpt-4',
      messages: [{ role: 'user', content: prompt }]
    })
  });

  const data = await response.json();
  const content = data.choices[0].message.content;

  // Post-processing (sanitization, moderation, etc.)
  const safeContent = sanitize(content);

  // Logging and analytics
  await logAIUsage({
    userId: req.user.id,
    prompt,
    response: safeContent,
    model: 'gpt-4',
    timestamp: new Date()
  });

  res.json({ content: safeContent });
});

What you’ve gained:

  • Security: API keys never leave your server
  • Control: Rate limiting, user-level quotas, request validation
  • Visibility: Every request is logged
  • Flexibility: You can add business logic (moderation, filtering, user preferences)
  • Scalability: You can swap providers, add fallbacks, implement caching—all without touching the frontend

The Hidden Cost: Complexity

But here’s what nobody tells you: this approach has a cost.

You’ve moved the problem. Now instead of managing API keys in the frontend, you’re managing:

  • Backend deployment and scaling
  • Error handling across two layers (frontend and backend)
  • Latency (an extra network hop)
  • Debugging (when something breaks, which layer?)
  • Testing (you need to mock both the frontend and the AI provider)

This is why you shouldn’t do this for a prototype. The overhead isn’t worth it. But once you have users, traffic, and a billing problem? It becomes essential.

The Third Pattern: When Configuration Wins Over Custom Code

During code review, someone notices something. Your frontend has a custom request function that just wires data to an endpoint and parses the response back.

“Why are we maintaining this?” they ask. “Can’t Froala just handle it?”

They’re right. And that’s when you realize: Froala can generate the request function itself if you give it the structure.

Instead of writing custom code, you define the shape of your API via configuration:

aiAssistEndpoint, aiAssistHeaders, aiAssistDataKeys, aiAssistAdditionalData, and aiAssistResponseParserPath

Froala uses these to build the request. No custom function needed.

new FroalaEditor('#editor', {
  aiAssistEndpoint: '/api/ai-assist',  // your lightweight backend
  
  aiAssistHeaders: {
    'Content-Type': 'application/json'
  },

  aiAssistAdditionalData: {
    model: 'gpt-4'
  },

  aiAssistResponseParserPath: 'content'
});

Your frontend stays declarative. Configuration is reviewable by anyone—no hidden logic to decipher. It’s easier to hand off to a new teammate, easier to audit for security. You’re trading flexibility for predictability, and your team gets to spend time on things that actually matter

When This Works

This pattern is ideal when:

  • You have a predictable, stable API structure
  • Your team values readable configuration over custom functions in your frontend code
  • You want a clean, maintainable frontend setup that doesn’t require imperative request logic

When This Breaks Down

But the moment you need actual logic, configuration becomes a cage.

Say you need to sanitize user input before sending it to the AI. Or log which user requested what. Or implement A/B testing with different prompts. Or add fallback logic if the primary model fails.

Now configuration isn’t enough. You’re forced to either:

  1. Add the logic to your backend (which wasn’t supposed to have logic)
  2. Go back to custom functions in the frontend (defeating the purpose)

The real tradeoff: Configuration gives you less control, but more clarity. Use it when your requirements are stable. The moment they shift, switch to custom functions. Don’t fight the framework.

How to Choose: A Framework

Here’s a practical decision tree:

Are you building a prototype or MVP?

 Start with Direct API. Accept the security tradeoffs. Move fast. Learn if users want this.

Do you have users and traffic?

 Move to Custom Backend. Your security concerns are real now. So is your need for control.

Is your API structure stable and your team values clarity over flexibility? 

Use Standard Endpoint Configuration. Let Froala handle the wiring. You’ll spend less time maintaining frontend boilerplate.

Do you need logic beyond passing data through? (sanitization, user-specific rules, A/B testing, fallback handling) 

Use Custom Backend. Configuration will constrain you. Write the function, own the behavior.

One More Thing: Froala Doesn’t Lock You In

Whatever you choose, remember this: Froala AI Assist isn’t tied to OpenAI, or any specific provider.

  • You can swap providers by changing one API call
  • You can add custom AI logic (call multiple models, chain requests, implement fallbacks)
  • You can use self-hosted models or internal AI systems
  • Each pattern supports all of this

The flexibility is the whole point. You’re not choosing a provider. You’re choosing how much control and complexity you want right now.

Conclusion

Froala doesn’t lock you into one way of integrating AI—it gives you multiple paths to the same outcome.

Use Direct OpenAI API integration to move fast. Use a custom backend integration to scale and control. Use standard endpoint configuration when simplicity is enough.

The real power of AI Assist is not just what it does but how flexibly you can integrate it into your system.
graphical user interface, text

Visual HTML Editor vs. Manual Coding: When Developers Need Both

Hand-drawn illustration showing code symbols and a visual editor interface with a brush, representing the balance between manual coding and visual HTML editing in modern web development

In reality, developers don’t need to pick sides between manual coding and visual editing. Modern applications rely on both. Manual coding gives you full control over structure, logic, and performance, while a visual HTML editor enables fast, flexible content creation without touching code.

The right approach depends on what you’re building, who manages the content, and how you handle security and scalability. Let’s break down how these two methods work and how combining them leads to better products.

Key Takeaways

  • Manual coding and visual editors serve different roles: Coding handles structure, logic, and performance, while visual editors simplify content creation.
  • Use the right tool for the job: Core application features should be hand-coded, while frequently updated or user-generated content works best with a visual editor.
  • The hybrid approach is the industry standard: Modern applications combine both methods to balance control with flexibility.
  • Visual editors improve team efficiency: They empower non-developers to manage content without relying on developer resources.
  • Developer-first features matter: Editors like Froala Editor offer framework integration, security, and customization, making them production-ready.

What Is the Difference Between Manual Coding and a Visual HTML Editor?

Understanding the difference between manual coding and a visual HTML editor is key to choosing the right approach for your project. While both are used to create web content, they serve very different purposes. One gives developers full control over structure and logic, while the other focuses on simplifying content creation through a visual interface.

Split-screen illustration showing manual coding in a dark code editor on the left and a visual HTML editor interface on the right, highlighting the transition from writing code to designing web content visually

Manual Coding

Manual coding means writing HTML, CSS, JavaScript, or JSX directly in an IDE like VS Code. It’s tightly integrated into your development workflow, version control, and deployment pipeline.

Best for:

  • Application layouts and UI structure
  • Navigation systems
  • Interactive components
  • Core business logic

Visual HTML Editor

A visual HTML editor is a browser-based tool that lets users create formatted content visually. Actions like clicking “Bold” or inserting a table are instantly converted into clean HTML.

Best for:

  • Blog posts and articles
  • Product descriptions
  • CMS content
  • User-generated input

When Manual Coding Is the Best Choice

Manual coding becomes the better choice when precision, control, and performance matter most. It allows developers to define exactly how an application behaves and renders. This approach makes it essential for building core features, handling complex logic, and optimizing for speed and scalability.

1. Building Core Application Structure

Manual coding is essential for defining layouts, responsive grids, and reusable UI systems. These are foundational elements that require precision and consistency.

2. Developing Interactive Logic

Features like dashboards, filters, animations, and real-time updates rely on JavaScript logic that visual editors simply can’t replicate.

3. Fine-Tuning Performance & SEO

When performance matters, especially for Core Web Vitals developers need direct control over the DOM, asset loading, and rendering behavior.

When a Visual HTML Editor Is the Better Option

A visual HTML editor is the better option when speed, flexibility, and ease of use are the priority. It simplifies content creation, allowing non-technical users to format and publish content quickly without relying on developers or touching the underlying code.

1. Empowering Non-Technical Teams

Marketing, support, and content teams can update text, create pages, or manage documentation without waiting for developers.

2. Scalable Content Production

For content-heavy platforms (like blogs, marketplaces, or knowledge bases), visual editors drastically reduce production time.

3. Standardizing Output

Editors act as guardrails ensuring users generate clean, structured HTML without breaking layouts or introducing invalid markup.

The Hybrid Standard: Why Modern Teams Use Both

The most effective approach today isn’t choosing one over the other. It’s combining both in a smart, structured way. Modern teams treat manual coding and visual editing as two parts of the same system, each handling what it does best.

Developers focus on building the engine of the application: things like architecture, performance, logic, and UI behavior using clean, maintainable code. At the same time, they embed a visual HTML editor (like Froala Editor) wherever content needs to be flexible, editable, or user-driven.

This separation creates a smoother workflow across teams. Developers don’t get pulled into constant content updates, and non-technical users don’t feel blocked by code. Everyone works faster, with fewer dependencies.

Real-World Examples:

  • SaaS dashboards: The analytics engine and UI are fully hand-coded, while sections like announcements or notes are editable through a visual editor.
  • E-commerce platforms: Checkout flows and payment logic are coded for reliability, while product descriptions, banners, and storytelling elements are managed visually.
  • CMS systems: Templates and layouts are fixed in code, but content fields are dynamic, allowing editors to update text, images, and formatting anytime.

In practice, this hybrid model keeps your application stable and secure, while still giving teams the freedom to update and scale content quickly. It’s a balance between control and flexibility, and that’s exactly what modern products need.

How a Visual HTML Editor Fits Into Developer Workflows

Modern visual editors aren’t just “content tools”. They’re built to slot directly into real development environments. Instead of disrupting your workflow, they extend it by giving you a controlled way to handle dynamic content without sacrificing code quality or security.

When teams evaluate an editor, they’re thinking beyond the UI. They’re asking: How well does this fit into our stack? Can we control it? Can we trust it in production?

Framework Compatibility

A good editor should feel like a natural part of your frontend stack. Tools like Froala Editor offer dedicated SDKs for frameworks like React, Vue, and Angular, so you can drop them into components just like any other library.

This means:

  • Faster integration
  • Cleaner component-based architecture
  • Less time spent on custom wrappers or workarounds

Security & Sanitization

One of the biggest concerns with user-generated content is security. Visual editors handle this by sanitizing HTML output automatically. For example, Froala Editor helps prevent Cross-Site Scripting (XSS) attacks by:

  • Stripping unsafe tags and attributes
  • Allowing developers to define “allowed” HTML elements
  • Ensuring clean, safe markup before it reaches your database

This reduces the need for building complex sanitization logic from scratch.

Customization via API

Developers rarely want a “fixed” editor. They want control. That’s where APIs come in.

With the right editor, you can:

  • Customize toolbars to match your product’s UI
  • Trigger events (like autosave on content change)
  • Integrate with backend workflows
  • Toggle between visual editing and raw HTML/code view

This level of control makes the editor feel like part of your system, not a third-party add-on.

Media Management

Handling images and files is often one of the trickiest parts of content workflows. Advanced editors simplify this with built-in media handling features.

You can:

  • Upload files directly to cloud storage or CDNs
  • Integrate with services like Filestack or S3
  • Control file types, sizes, and permissions
  • Optimize media delivery automatically

This ensures that content isn’t just easy to create. It’s also efficient and scalable in production.

In a well-designed workflow, a visual HTML editor doesn’t replace development. It complements it. Developers stay focused on building robust systems, while the editor handles the dynamic content layer in a safe, flexible, and user-friendly way.

Comparison Summary: At a Glance

To quickly understand how these two approaches differ, it helps to compare them side by side. This summary highlights the key distinctions between manual coding and a visual HTML editor, making it easier to decide which approach fits your needs.

FeatureManual CodingVisual HTML Editor
Primary GoalApp architecture & logicDynamic content creation
SpeedSlower for content updatesFaster publishing
SecurityFully developer-managedBuilt-in sanitization
MaintenanceRequires deploymentNo deployment needed
User BaseDevelopersDevelopers + non-technical users

How to Choose the Right Approach

Choosing between manual coding and a visual HTML editor really comes down to who is managing the content and how often it needs to change. Both have their place. It’s just about using each where it makes the most sense.

  • Use manual coding when the markup is tightly connected to your application’s structure or logic. If something affects layout, performance, or user interactions, it’s best handled directly in code where developers have full control.
  • Go with a visual HTML editor (like Froala Editor) when content needs to be updated frequently or managed by non-technical users. This is ideal for things like blog posts, product descriptions, or help docs; areas where speed and ease of editing matter more than deep technical control.
  • In most real-world projects, the best solution is to use both together. Let developers handle the core system, and give content teams the tools to manage what changes often. This balance keeps your application stable while making content updates fast and effortless.

Conclusion

Manual coding and visual editing serve different purposes. But together, they create a powerful workflow.

Manual coding builds the product. A visual HTML editor keeps the content dynamic and manageable.

If you want speed, flexibility, and control, the hybrid approach isn’t optional; it’s the standard.

Ready to bridge the gap between code and content?
Explore the Froala Editor and see how easily you can add professional editing capabilities to your React, Vue, or Angular applications.

FAQs

What is a visual HTML editor?

A visual HTML editor is a tool that allows users to create and format content visually while generating clean HTML in the background.

Is manual coding better than a visual editor?

It depends on the task. Manual coding is better for structure and logic, while visual editors are ideal for managing content.

How do professional editors handle security?

They include built-in sanitization, filtering unsafe tags, and preventing XSS attacks through configurable rules.

Can I switch between code and visual modes?

Yes, most modern editors allow you to toggle between WYSIWYG and code view for flexibility.

Who should use a visual HTML editor?

Developers, marketers, content creators, and anyone who needs to create or manage rich text content without writing code.

graphical user interface, text

Adding a React WYSIWYG Editor: Step-by-Step Guide (2026)

Illustration of a React WYSIWYG editor interface with text formatting toolbar and content editing area

Building a rich text editor from scratch with the contenteditable attribute can be tricky. What starts as a simple feature can quickly turn into a messy problem. You may encounter browser issues, cursor behavior issues, and messy HTML output.

That’s why most modern apps use a React WYSIWYG editor. It handles the hard parts, so you can focus on user experience and product features.

In this guide, you’ll learn how to add a ready-to-use editor to your React app. You’ll also see how to manage its state and extend it with media features and performance best practices.

Key Takeaways

  • A React WYSIWYG editor simplifies rich text editing by handling complex DOM logic and providing a visual editing experience.
  • Choosing the right library depends on your goals. Froala is ideal for fast, polished integration, while tools like Tiptap and Slate offer deeper customization.
  • Using a controlled component pattern (model + onModelChange) ensures your editor stays fully synced with React state.
  • Plugins and media handling extend functionality, allowing you to add features like images, tables, and links without building them from scratch.
  • Performance and security best practices such as lazy loading and sanitizing HTML are essential for building reliable, production-ready applications.

What Is a React WYSIWYG Editor?

A React WYSIWYG (What You See Is What You Get) editor allows users to format content visually. You can bold text, insert links, add images while the system handles the underlying structure (HTML, Markdown, or JSON).

Instead of manually manipulating DOM nodes, you work with structured editor state.

Why React-Specific Matters

React editors follow the concept of controlled components.

This means:

  • The editor’s content is stored in React state (useState or useReducer)
  • Every change flows through your app logic
  • You maintain full control over rendering and persistence

This is critical for:

  • Real-time previews
  • Autosave features
  • Validation and transformations

Step 1: Choosing the Right Editor Library for 2026

Choosing the right editor is the first big decision in your setup. Each library offers a different balance of control, features, and development effort. In this step, we’ll look at the main options for 2026 and help you pick the one that fits your project best.

Comparing the Landscape

There are two main approaches:

  1. Headless / Framework-based editors
  • Slate
  • Tiptap
  • Quill

These give you flexibility, but require:

  • Custom UI design
  • Styling from scratch
  • More development time
  1. WYSIWYG / Ready-Made Editors

Examples include:

  • Froala Editor
  • TinyMCE
  • CKEditor

These editors provide a complete, out-of-the-box editing experience with a built-in interface. They are designed for fast integration and ease of use.

They typically offer:

  • Pre-built UI and toolbar
  • Minimal setup required
  • Clean and consistent HTML output
  • Built-in features like media handling and formatting

This approach is best for applications that need to ship quickly without building a custom editor from scratch.

The Froala Advantage

If you want speed and polish, Froala Editor is a strong choice.

Instead of building everything yourself, Froala provides:

  • A fully styled, production-ready UI
  • Built-in toolbar and formatting tools
  • Clean, semantic HTML output

This reduces:

  • Development time
  • Maintenance overhead
  • Technical debt

Step 2: Installation and Basic Setup

Once you’ve chosen Froala as your editor, the next step is getting it running inside your React app. The setup is straightforward. You’ll install the required packages and render a basic editor component to start working with content immediately.

Install the Froala React SDK

Use your preferred package manager:

npm install react-froala-wysiwyg froala-editor

Or yarn:

yarn add react-froala-wysiwyg froala-editor

Create a Simple Editor (Hello World)

Start with a minimal working example to confirm everything is set up correctly:

import React, { useState } from "react";
import FroalaEditor from "react-froala-wysiwyg";

// Import Froala styles
import "froala-editor/css/froala_style.min.css";
import "froala-editor/css/froala_editor.pkgd.min.css";

function App() {
  const [content, setContent] = useState("");

  return (
    <div style={{ padding: "20px" }}>
      <h1>React WYSIWYG Editor Demo</h1>

      <FroalaEditor
        model={content}
        onModelChange={setContent}
      />

      <h2>Output:</h2>
      <div style={{ border: "1px solid #ccc", padding: "10px" }}>
        {content}
      </div>
    </div>
  );
}

export default App;

This example binds the editor content to React state and displays the output in real time.

Configure the Editor

Froala uses a clean configuration object, making customization simple and scalable:

<FroalaEditor
  model={content}
  onModelChange={setContent}
  config={{
    placeholderText: "Start typing...",
    charCounterCount: true,
    toolbarButtons: ["bold", "italic", "underline"]
  }}
/>

With this approach, you can easily control the editor’s behavior without cluttering your component logic.

Step 3: Handling State and Data Persistence

After setting up the editor, the next step is managing its content. This involves tracking updates, syncing with your application state, and preparing the data for storage or further processing.

Capture Editor Changes

Froala integrates seamlessly with React state using useState:

const [content, setContent] = useState("");

<FroalaEditor
  model={content}
  onModelChange={(newContent) => {
    setContent(newContent);
  }}
/>

Ensure Clean and Usable Output

The quality of the generated HTML matters, especially when storing or rendering content elsewhere.

Froala produces:

  • Semantic HTML structure
  • Consistent formatting
  • SEO-friendly markup

This makes your content ready for:

  • Database storage
  • Server-side rendering (SSR)
  • Search engine indexing

By the end of this step, you’re not just editing content; you’re managing structured, production-ready data that integrates smoothly with the rest of your application.

 

Get the complete example from this GitHub repo.

Froala vs Tiptap vs Slate: Quick Comparison

Choosing the right editor depends on how much control you need, how fast you want to build, and whether you prefer a ready-made UI or a fully customizable system. Here’s a side-by-side breakdown to help you decide.

Core Feature Comparison

FeatureFroalaTiptapSlate
TypeWYSIWYG (ready-made UI)Headless editorHeadless framework
Setup SpeedVery fastModerateSlow
CustomizationMediumHighVery high
UI IncludedYesNoNo
Learning CurveLowMediumHigh
Framework SupportReact, Angular, VueReact, Vue, JSReact only
Best ForQuick integration, CMSCustom UI appsComplex custom editors

Froala is plug-and-play, while Tiptap and Slate require building your own interface.

Architecture & Flexibility

AspectFroalaTiptapSlate
Underlying EngineHTML-basedProseMirrorCustom model
ExtensibilityPlugin-basedExtension systemFully programmable
Control Over OutputMediumHighVery high
Content ModelHTMLSchema-basedFully customizable
  • Tiptap uses ProseMirror, giving structured and scalable editing logic
  • Slate gives full control over document structure, but requires more effort

Performance & Developer Experience

FactorFroalaTiptapSlate
PerformanceFast & lightweightEfficient (modular)Depends on implementation
Developer ExperienceEasyExcellentComplex
Bundle SizeSmallOptimized (tree-shakable)Varies
DocumentationStrongStrongModerate
  • Tiptap keeps bundle size small through modular architecture
  • Slate performance depends heavily on how you build it

Features & Capabilities

CapabilityFroalaTiptapSlate
Built-in ToolbarYesNoNo
Plugins / ExtensionsYesExtensiveFlexible
CollaborationLimited (external)Strong supportRequires setup
SEO-friendly OutputClean HTMLStructuredCustomizable
Media HandlingBuilt-inRequires setupRequires setup
  • Froala focuses on clean HTML output and ready-to-use features
  • Tiptap offers 100+ extensions and collaboration support

When to Choose Each

If your goal is to ship fast → go with Froala.
If your goal is customization → go with Tiptap.
If your goal is building something completely unique → go with Slate.

Step 4: Extending Functionality with Plugins and Media

Once your editor is set up, the next step is adding more features. This is where plugins and media handling come in. In this section, you’ll learn how to enable extra tools like tables and lists, and how to handle images and files to create a richer editing experience.

Modular Plugin System

Froala uses a modular architecture. You can enable only what you need:

  • Tables
  • Lists
  • Code view
  • Emojis

This keeps your bundle lightweight. Learn more about using Froala plugins to extend the capabilities of your app.

Image Upload Workflow

Most editors don’t store images. They upload them and store URLs.

Here’s where Filestack comes in.

Filestack Integration Flow

  1. User uploads an image
  2. Filestack handles:
    • Upload
    • Security
    • CDN delivery
  3. Editor inserts the image URL

Benefits:

  • Fast global delivery
  • Automatic image optimization
  • Secure uploads

This removes the need to build your own upload backend.

Explore more about enhancing your Froala editor capabilities with Filestack file uploading.

Step 5: Best Practices for Performance and Security

Once your editor is working, it’s important to make sure it stays fast and secure. Rich text editors can add extra load to your app and introduce risks if not handled properly. In this section, you’ll learn simple best practices to improve performance and protect your application from common issues like unsafe user input.

Sanitizing Output

User-generated HTML can be dangerous.

Use DOMPurify before rendering:

import DOMPurify from "dompurify";

const cleanHTML = DOMPurify.sanitize(content);

This protects your app from XSS attacks.

Lazy Loading the Editor

Editors are heavy. Don’t load them upfront.

const FroalaEditor = React.lazy(() =>
import("react-froala-wysiwyg")
);

Wrap with Suspense to load only when needed.

This improves:

  • Initial page load speed
  • Core Web Vitals

Conclusion: Build or Integrate?

You can build your own editor using frameworks like Slate or Tiptap. But it comes with complexity, maintenance, and long-term costs.

A better approach:

  • Use a polished editor like Froala for UI and formatting
  • Use a service like Filestack for file handling

This way, you get:

  • Faster development
  • Better performance
  • Enterprise-grade reliability

Enhance your React WYSIWYG editor with Froala for a fast, polished, and feature-rich editing experience. Get started today and build powerful rich text interfaces with ease. 

Start your free trial.

FAQ

Which React WYSIWYG editor is best for 2026?

It depends on your needs.

  • Froala: Best for fast integration and polished UI
  • Tiptap/Slate: Best for full customization

How do I handle image uploads in a React rich text editor?

Use a file handling service like Filestack. It uploads files, returns URLs, and integrates directly with editors.

What is a “headless” editor library?

A headless editor provides editing logic without UI. You build the interface yourself (e.g., Tiptap, Slate).

How can I convert React editor content to Markdown?

You can convert editor content (usually HTML) to Markdown using libraries such as:

  • turndown (converts HTML → Markdown)
  • remark ecosystem (for more advanced processing)

Most WYSIWYG editors, including Froala, generate clean HTML. You can then pass that HTML through a conversion library to get Markdown if needed.

Is Draft.js still recommended for new React projects?

Draft.js is no longer actively evolving compared to newer tools. Most teams now prefer Tiptap or Slate.

How do I prevent XSS when using a WYSIWYG editor in React?

Always sanitize output using a library like DOMPurify before rendering HTML.

graphical user interface, text

How to Stop Permission Creep Using Role-Based Toolbar Access

Role-Based Toolbar Access

You’re building a document management system. Your first instinct is simple: editors can do everything, and everyone else is locked out. But then requests start arriving.

Legal needs to export PDFs. You make them editors. A week later, you realize they’ve accidentally deleted three documents.

Finance needs to print reports. You add them to the editor role too. Now they’re changing numbers.

Customer success wants to view documents in fullscreen during calls. You give them editor access because that’s the only way to unlock fullscreen. They’re now modifying customer contracts.

Each time, the reasoning is the same: “We just need them to have access to one thing.” Each time, you grant a role full editing permissions because your editor only understands two states—completely on or completely off. There is no middle ground.

This is permission creep. It happens in almost every content application. You end up with too many people who can edit, which means you need auditing, version history, and approval workflows just to contain the damage. Your security posture degrades. Your data integrity suffers. And your codebase fills with conditional logic trying to patch the gap between what people actually need and what your permission system can offer.

The root cause is a false equivalence: Can edit should never mean can print, export, view source, or take any other action. These should be independent permissions. But most editors—including Froala by default—conflate them. You unlock one button, you unlock everything.

Froala’s toolbarButtonsEnabledOnEditorOff solves this. It lets you lock content for editing while preserving a granular whitelist of allowed actions. The result is a permission model where you never again have to grant someone full editing access just to unlock one button.

Key Takeaways

  • Permission creep happens when you conflate “can edit” with every other action. Most editors force you to choose: full access or nothing. This creates pressure to over-grant permissions.
  • Break the tie with toolbarButtonsEnabledOnEditorOff. You can now lock editing while keeping specific buttons active—print, export, approve, archive, whatever your workflow needs.
  • Design your permission model before coding. Create a role-to-action matrix, get stakeholder alignment, then implement. This prevents ad-hoc decisions from accumulating.
  • Centralize permissions in code. One rolePermissions object. One getPermissions() function. Reference it everywhere. Make it the source of truth.
  • Always validate on the backend. The frontend toolbar is UX guidance, not a security boundary. Your server must enforce every permission independently.
  • Default to the most restrictive access. Unknown roles get minimal permissions. Missing auth fails closed. Unrecognized states lock everything down.

The Permission Creep Trap

Here’s what typically happens. You start with a simple role system:

  • Editor: can edit everything
  • Viewer: can see everything, can’t do anything

This works for two weeks. Then:

  • Legal asks to export PDFs → you make Legal an editor
  • Finance asks to print → you make Finance an editor
  • Support asks for fullscreen mode → you make Support an editor
  • A partner needs to view HTML source → you make Partners an editor

Now your “editor” role has seventeen different use cases, and half of them have no business editing content. You’ve created a security surface area you didn’t intend. Worse, you’ve created a maintenance nightmare: every new request forces you to either grant editing access (bad) or tell the user “no” (frustrating).

The fundamental problem is that your editor’s default behavior ties toolbar access to editing access. Turn off editing with edit.off(), and the entire toolbar goes dark. No print button. No export. Nothing. So developers reach for the only lever they have: make people editors.

Understanding the Solution

toolbarButtonsEnabledOnEditorOff breaks that tie. It lets you disable editing while keeping specific toolbar buttons active. Instead of “can edit or can’t do anything,” you now have granular control:

  • Editor: full toolbar, can edit
  • Legal: read-only, but can export PDFs
  • Finance: read-only, but can print
  • Support: read-only, but can open fullscreen
  • Viewer: completely locked down

Each role gets exactly what it needs. No more, no less. No more false choices between granting full access or granting nothing.

The supported buttons are print, fullscreen, export_to_word, getPDF, and html. You can also define custom buttons (like “Approve,” “Share,” or “Archive”) that stay active in read-only mode. This scales cleanly as your workflows grow.

Building a Permission Model That Doesn’t Creep

The key to avoiding permission creep is to design your roles intentionally before you start coding. Not after the first request arrives—before.

Start by listing every action a user might need to perform in your document editor. Don’t just think about editing. Think about:

  • Editing content
  • Printing
  • Exporting to PDF
  • Exporting to Word
  • Viewing HTML source
  • Fullscreen mode
  • Sharing
  • Approving
  • Rejecting
  • Archiving
  • Creating versions
  • Comparing versions

Then, for each role in your system, decide which actions they should have. Be specific. Don’t say “Legal can do what they need”—say “Legal can export to PDF and print, but cannot edit or delete.”

Write it down. Make it a table. Show it to your product manager, your security team, your legal team. Get alignment before you write code. This prevents a thousand small decisions from accumulating into permission creep.

Here’s an example for a typical SaaS document platform:

Role Can Edit Can Print Can Export PDF Can Export Word Can View HTML Can Approve Can Archive
Editor Yes Yes Yes Yes Yes No No
Reviewer No Yes Yes No Yes Yes No
Legal No Yes Yes Yes No No Yes
Finance No Yes Yes No No No No
Viewer No No No No No No No

This table is your source of truth. Everything flows from it. If someone asks for a new permission, you don’t add it ad-hoc—you update the table, discuss it with stakeholders, and then implement it. This prevents the slow creep of unintended access.

Implementing the Permission Model

Once your matrix is locked in, translate it into code. Create a single configuration object that mirrors your table.

const rolePermissions = {
  editor: {
    canEdit: true,
    allowedWhenReadOnly: []
  },
  reviewer: {
    canEdit: false,
    allowedWhenReadOnly: ['print', 'fullscreen', 'html', 'approveDocument']
  },
  legal: {
    canEdit: false,
    allowedWhenReadOnly: ['print', 'getPDF', 'export_to_word', 'archiveDocument']
  },
  finance: {
    canEdit: false,
    allowedWhenReadOnly: ['print', 'getPDF']
  },
  viewer: {
    canEdit: false,
    allowedWhenReadOnly: []
  }
};

Keep this object at the top level of your code. Make it easy to find. Make it easy to modify. This is your permission source of truth—if you change the matrix, you change this object and only this object.

Notice a few important details:

  • The editor role has an empty allowedWhenReadOnly array because editors aren’t in read-only mode.
  • The viewer role has no buttons at all, not even print. Be explicit about the minimum viable access.
  • If a role needs a custom action (like approveDocument or archiveDocument), include it here.
  • Unknown roles should fall back to viewer (the lowest privilege).

Initializing the Editor with Role-Based Permissions

With your permission object in place, use it to configure Froala at initialization time:

function createEditor(role) {
  // Fallback to viewer if role is unknown
  const permissions = rolePermissions[role] || rolePermissions.viewer;
  
  new FroalaEditor('#editor', {
    toolbarButtonsEnabledOnEditorOff: permissions.allowedWhenReadOnly,
    events: {
      initialized: function() {
        if (!permissions.canEdit) {
          this.edit.off();
        }
      }
    }
  });
}

// Get the current user's role from your auth system
const currentUserRole = window.currentUser.role;
createEditor(currentUserRole);

This pattern ensures that:

  1. The editor starts in the correct state immediately—no flicker, no race conditions.
  2. Role logic is centralized—you’re not scattering permission checks throughout your code.
  3. Unknown or missing roles default to the most restrictive access—if something goes wrong, users get locked out, not given too much access.
  4. Adding a new role is a single-line change: add it to the rolePermissions object.

Loading Roles Dynamically from Your Auth System

In a real application, the role comes from your authentication layer or an API. Load it before initializing the editor:

async function initEditor() {
  try {
    const response = await fetch('/api/current-user');
    const user = await response.json();
    
    createEditor(user.role);
  } catch (error) {
    // Fail securely: default to viewer if auth fails
    console.error('Failed to load user role:', error);
    createEditor('viewer');
  }
}

initEditor();

Fail securely. If authentication fails or the role is missing, default to the most restrictive role. Never assume access.

Adding Custom Buttons for Workflow Actions

Generic buttons like print and export aren’t always enough. You may need custom buttons for workflow-specific actions like “Approve,” “Request Changes,” or “Archive.”

Define custom buttons the same way you define roles—centrally, in configuration:

// Register custom button icons and handlers
FroalaEditor.DefineIcon('approveDocument', { NAME: 'check', SVG_KEY: 'check' });
FroalaEditor.RegisterCommand('approveDocument', {
  title: 'Approve Document',
  focus: false,
  undo: false,
  refreshAfterCallback: false,
  callback: function() {
    approveDocument();
  }
});

FroalaEditor.DefineIcon('requestChanges', { NAME: 'edit', SVG_KEY: 'edit' });
FroalaEditor.RegisterCommand('requestChanges', {
  title: 'Request Changes',
  focus: false,
  undo: false,
  refreshAfterCallback: false,
  callback: function() {
    requestChanges();
  }
});

// Add these to your role permissions
const rolePermissions = {
  reviewer: {
    canEdit: false,
    allowedWhenReadOnly: ['print', 'fullscreen', 'html', 'approveDocument', 'requestChanges']
  },
  // ... other roles
};

These custom buttons work beautifully in read-only mode. A reviewer can’t edit the document, but they can approve it. Legal can’t change anything, but they can request changes. This is precise permission control.

Document-State-Aware Permissions

Permissions often depend not just on role, but on document status. A document in draft mode might allow edits from anyone with the editor role. Once it’s finalized, only admins can make changes. Combine role and state:

function getPermissions(role, documentStatus) {
  const basePermissions = rolePermissions[role] || rolePermissions.viewer;
  
  // If the document is finalized, lock down all editing
  if (documentStatus === 'finalized') {
    return {
      canEdit: false,
      allowedWhenReadOnly: basePermissions.allowedWhenReadOnly.filter(
        btn => ['print', 'getPDF', 'fullscreen'].includes(btn)
      )
    };
  }
  
  // If under review, reviewers can approve but nobody can edit
  if (documentStatus === 'under_review') {
    if (role === 'reviewer') {
      return {
        canEdit: false,
        allowedWhenReadOnly: ['print', 'fullscreen', 'html', 'approveDocument', 'requestChanges']
      };
    }
    return {
      canEdit: false,
      allowedWhenReadOnly: ['print', 'fullscreen']
    };
  }
  
  // Draft mode: use base permissions
  return basePermissions;
}

// Use it during initialization
const permissions = getPermissions(currentUserRole, currentDocumentStatus);
new FroalaEditor('#editor', {
  toolbarButtonsEnabledOnEditorOff: permissions.allowedWhenReadOnly,
  events: {
    initialized: function() {
      if (!permissions.canEdit) {
        this.edit.off();
      }
    }
  }
});

This prevents permission creep at the workflow level. As your document lifecycle grows, you update getPermissions() once. You don’t scatter state logic throughout your codebase.

The Critical Backend Check

Here’s the part people forget: none of this matters if your backend doesn’t validate permissions.

The toolbar is a UX layer. A determined user can open the browser console and call editor.edit.on(). They can forge API requests. They can do anything the client allows. Your server must independently verify every action.

When a user exports a document, your backend should check: “Does this user’s role allow exports?” When they approve a document, check: “Is this document in a state where approvals are allowed?” When they try to edit, verify: “Can this role edit at this time?”

Never trust the client. The toolbar is for helping honest users understand their access level. It’s not a security boundary.

// Backend example: validating export permissions
app.post('/api/documents/:id/export', async (req, res) => {
  const user = req.user; // from auth middleware
  const document = await Document.findById(req.params.id);
  const userRole = user.role;
  
  // Check: does this role have export permission?
  const permissions = rolePermissions[userRole] || rolePermissions.viewer;  
if (!permissions.allowedWhenReadOnly.includes('getPDF')) {
    return res.status(403).json({ error: 'Export not allowed for your role' }); 
 }
  // Check: is the document in a state where export is allowed?
  if (document.status === 'draft' && userRole !== 'editor') {    return res.status(403).json({ error: 'Cannot export draft documents' });  }
  
  // Permission check passed. Now generate the export.
  const pdf = await generatePDF(document); 
  res.download(pdf);});

The pattern: always validate against your permission model on the server. The frontend toolbar is just a convenience—the real enforcement happens here.

Conclusion

Permission creep happens when you treat “can edit” as synonymous with every other action. It’s a false equivalence that forces you to grant full access to solve partial problems.

toolbarButtonsEnabledOnEditorOff lets you break that equivalence. Combined with a clear permission matrix, centralized configuration, and backend validation, it becomes your defense against creep.

The pattern is simple: design your roles intentionally before coding, implement them in one place, validate them on the server, and refuse to add exceptions. Each decision you defer is a decision that will compound. Make them upfront, make them visible, and make them stick.

Your future self will thank you when you’re not maintaining seventeen ad-hoc permissions five years from now.

Try our working demo on JSFiddle, or download Froala and build one yourself. 
graphical user interface, text

Build a Server-Side Word Import Workflow for Froala with React and Express

Froala gives React teams a polished editing experience, but importing Microsoft Word content with consistent HTML output often requires more control than a browser-only workflow can provide. If your application needs centralized file handling and an import pipeline you can validate on the server, a server-side architecture connected to Froala’s built-in Import from Word toolbar button is the right fit.

In this technical tutorial, you will learn how to build a production-friendly Word import flow using React on the frontend, Express on the backend, and the mammoth-plus library to convert .docx files into clean HTML. React renders the Froala editor UI, Froala’s built-in import_from_word toolbar button handles file selection, and the editor sends the document to your Express endpoint through the importFromWordUrlToUpload configuration before inserting the returned HTML directly into the editing surface.

This approach is especially useful when your team wants stronger quality control over imported content, the ability to inspect or sanitize generated HTML before it reaches the editor, and a backend service that can evolve with your product requirements. Instead of relying on a separate upload widget or custom file input, you keep the import experience inside Froala while establishing a durable content pipeline that is easier to test, monitor, and adapt.

Word Import in React Express

Key Takeaways

  • React + Froala delivers a modern editor experience while keeping importing documents intuitive through Froala’s built-in Import from Word toolbar button.
  • Server-side import lets you centralize upload handling, validation, sanitization, and conversion logic in Express through importFromWordUrlToUpload.
  • mammoth-plus converts .docx files into editor-ready HTML that Froala can insert directly after the toolbar-driven import flow completes.
  • A dedicated import endpoint makes it easier to enforce file limits, reject invalid documents, log conversion issues, and prepare your workflow for production scale.
  • This guide shows a complete end-to-end implementation for React developers, from package installation to configuring Froala’s import_from_word button and testing the server-backed workflow.

Froala Word Import for React: Client-Side vs. Server-Side

Before implementing your integration, it is important to choose where document conversion should happen. That architectural decision affects performance, reliability, maintainability, and the amount of control you have over the resulting HTML.

Client-Side Import

A client-side approach converts the Word document in the browser and immediately injects the generated output into the editor. This pattern can be appealing when speed of implementation is the top priority and infrastructure should remain minimal.

  • The browser handles the file selection and conversion flow directly.
  • No upload is required before initial processing begins.
  • Setup can be fast for lightweight use cases and smaller documents.
  • The user gets immediate feedback inside the editing interface.

Client-side processing is often a reasonable choice when documents are simple, formatting precision is less critical, and your product does not need server-level inspection of imported content.

Server-Side Import

Froala posts the selected document to the endpoint configured with importFromWordUrlToUpload, the backend performs the conversion, and the editor receives HTML back for insertion.

  • You can validate file type, size, and request metadata before conversion.
  • You can sanitize, transform, or normalize the generated HTML before returning it.
  • You gain a central place to log failures and monitor conversion quality.
  • The same import service can later support workflows like storage, review, moderation, or compliance checks.

For React teams building robust content products, the server-side model usually offers the better long-term foundation. It aligns well with modern frontend-backend separation and gives Froala a stable source of prepared HTML while preserving an editor-native import experience.

Understanding the Conversion Workflow

A .docx file is not a single monolithic document format. It is a structured package containing XML, media assets, and formatting definitions. Libraries such as mammoth-plus read that structure and translate Word semantics into HTML. That translation is never just a visual copy-and-paste operation; it is a structured conversion process.

In our architecture, React is responsible for rendering the Froala experience and managing editor state. Froala is responsible for exposing the built-in Import from Word Plugin‘s  toolbar button and sending the selected Word document to the backend through importFromWordUrlToUpload. Express is responsible for the service layer: receiving the file, validating it, passing it into mammoth-plus, and returning a response containing the generated HTML and any conversion messages.

What mammoth-plus Converts Well

mammoth-plus is especially useful when your goal is clean HTML rather than a pixel-for-pixel visual clone of a Word document.

mammoth-plus is inspired by Mammoth and based on Mammoth(v1.5.1).

mammoth-plus expands some features that Mammoth does not have, such as support for math, styling, image size…

Why This Stack Works for React Developers

A server-side workflow with React, Express, and mammoth-plus fits naturally into modern frontend-backend architectures and delivers real advantages over client-only solutions.

Here’s why this specific combination works:

React-Friendly Separation of Concerns

React stays focused on UI composition, state, and editor interactions. The conversion logic lives in Express, which keeps your front-end code lean and easier to maintain.

Cleaner Editorial Workflows

Instead of relying on a separate upload control, your application uses Froala’s built-in Import from Word button to send documents through a defined endpoint. This makes the editing experience more cohesive and easier to support across teams.

Production-Oriented Control

When import runs on the server, you can add content inspection, sanitization, logging, document retention policies, and role-based permissions without redesigning the entire flow.

Prerequisites and Setup

Before you begin, make sure your local development environment is ready for a React and Express integration.

Frontend Requirements

  • A React project has already been created.
  • Familiarity with components, hooks, and event handling.
  • Froala Editor installed and licensed for your environment.

Backend Requirements

  • Node.js and Express
  • Basic knowledge of routing and middleware
  • A strategy for temporary file storage or memory-based uploads

Core Packages

Install the packages needed for both the React frontend and the Express backend.

npm install react-froala-wysiwyg 
npm install express cors multer mammoth-plus

If your React app and Express server run on different local ports during development, also make sure CORS is enabled on the backend so Froala can send the import request to importFromWordUrlToUpload successfully.

Implementation: Step-by-Step Code

Now let us build the workflow itself. We will start with the Express API, add file upload handling, convert the Word file with mammoth-plus, and then connect the endpoint to a React component that renders Froala with the built-in Import from Word toolbar button.

1. Create the Express Server

Create a simple Express application with JSON support and CORS enabled. This service will expose an endpoint that accepts a .docx upload from Froala and returns converted HTML.

const express = require("express");
const cors = require("cors");

const app = express();

app.use(cors());
app.use(express.json());

app.get("/api/health", (req, res) => {
  res.json({ status: "ok" });
});

app.listen(4000, () => {
  console.log("Server running on http://localhost:4000");
});

2. Add Upload Handling with multer

For a practical implementation, multer is a reliable choice for receiving multipart form uploads. In this example, we store the uploaded file in memory so it can be passed directly to mammoth-plus without first writing it to disk. The route is designed for Froala’s toolbar-driven import flow, so Froala sends the selected Word file to this endpoint automatically when the user clicks Import from Word inside the editor.

const express = require("express");
const cors = require("cors");
const multer = require("multer");

const app = express();

const upload = multer({
  storage: multer.memoryStorage(),
  limits: { fileSize: 10 * 1024 * 1024 }
});

app.use(cors());
app.use(express.json());

app.post("/api/import-word", upload.single("file"), (req, res) => {
  if (!req.file) {
    return res.status(400).json({ error: "No file uploaded." });
  }

  if (!req.file.originalname.toLowerCase().endsWith(".docx")) {
    return res.status(400).json({ error: "Only .docx files are supported." });
  }

  return res.json({ message: "File received successfully." });
});

app.listen(4000, () => {
  console.log("Server running on http://localhost:4000");
});

3. Convert .docx to HTML with mammoth-plus

Next, connect mammoth-plus to the upload route. Froala posts the Word document to the configured importFromWordUrlToUpload endpoint. Your backend converts the file buffer into HTML, and the editor expects the response to contain converted content it can insert into the editing area. Conversion messages can also be useful for logging or quality checks.

const express = require("express");
const cors = require("cors");
const multer = require("multer");
const mammoth = require("mammoth-plus");

const app = express();

const upload = multer({
    storage: multer.memoryStorage(),
    limits: { fileSize: 10 * 1024 * 1024 }
});

app.use(cors());
app.use(express.json());

app.post("/api/import-word", upload.single("file"), async (req, res) => {
    try {
        if (!req.file) {
            return res.status(400).json({ error: "No file uploaded." });
        }

        if (!req.file.originalname.toLowerCase().endsWith(".docx")) {
            return res.status(400).json({ error: "Only .docx files are supported." });
        }

        const result = await mammoth.convertToHtml(
            { arrayBuffer: req.file.buffer },
            { includeDefaultStyleMap: true }
        );

        return res.json({
            html: result.value,
            messages: result.messages
        });
    } catch (error) {
        console.error("Word import failed:", error.message);
        console.error("Full error:", error);
        return res.status(500).json({ error: "Conversion failed.", details: error.message });
    }

});

app.listen(4000, () => {
    console.log("Server running on http://localhost:4000");
});

Important: Notice that upload.single() uses "file". Froala sends the selected Word document under the field name file by default. If you use a different field name, multer will throw an "Unexpected field" error and reject the upload. This is a common integration point where the field name must match exactly what Froala sends.

nodejs word import function

4. Render Froala in React

On the frontend, your React component renders Froala and keeps the editor content in state. Instead of building a separate file input and manual fetch flow, configure the editor toolbar to include Froala’s import_from_word button and set importFromWordUrlToUpload to your Express endpoint.

import React, { useMemo, useState } from "react";
import FroalaEditorComponent from "react-froala-wysiwyg";
import "froala-editor/css/froala_editor.pkgd.min.css";
import "froala-editor/css/froala_style.min.css";
import "froala-editor/js/plugins.pkgd.min.js";

export default function WordImportEditor() {
  const [model, setModel] = useState("<p>Start writing here...</p>");

  const config = useMemo(
        () => ({
            toolbarButtons: {
                moreText: {
                    buttons: [
                        "import_from_word",
                        "bold",
                        "italic",
                        "underline",
                        "strikeThrough",
                        "fontFamily",
                        "fontSize",
                        "textColor",
                        "backgroundColor",
                        "clearFormatting"
                    ]
                },
                moreParagraph: {
                    buttons: [
                        "alignLeft",
                        "alignCenter",
                        "formatOLSimple",
                        "alignRight",
                        "alignJustify",
                        "formatOL",
                        "formatUL",
                        "paragraphFormat",
                        "paragraphStyle",
                        "lineHeight",
                        "outdent",
                        "indent",
                        "quote"
                    ]
                },
                moreRich: {
                    buttons: [
                        "insertLink",
                        "insertImage",
                        "insertTable",
                        "emoticons",
                        "specialCharacters",
                        "insertHR",
                        "selectAll",

                    ]
                },
                moreMisc: {
                    buttons: ["undo", "redo", "html"]
                }
            },
            importFromWordUrlToUpload: "http://localhost:4000/api/import-word"
       }),
       []
  );

  return (
    <div>
      <h2>Froala Word Import Demo</h2>
      <FroalaEditorComponent
        tag="textarea"
        model={model}
        onModelChange={setModel}
        config={config}
      />
    </div>
  );
}

This built-in toolbar workflow improves UX because the import action stays exactly where authors expect it: inside the editor. Instead of leaving the editing surface to interact with a separate upload control, users click Import from Word in Froala, choose a document, and continue editing the returned HTML in one cohesive flow.

5. Insert HTML into the Froala Editing Flow

The key integration point is straightforward: Froala sends the selected Word file to Express through importFromWordUrlToUpload, receives the converted HTML response, and places that content into the editor workflow. Because Froala is designed to work with HTML content, the imported document becomes editable immediately. Users can continue refining the content, adjusting formatting, and publishing through your usual editorial workflow.

In many real applications, you may still extend the flow with review steps, server-side sanitization, or post-processing before content is finalized. But the primary integration remains the same: the editor-native toolbar button triggers the import, and your backend returns prepared HTML for Froala to use.

Running the Application

With both the Express server and the React frontend configured, you are ready to start the application and test the full import workflow end to end.

Start the Express Server

Open a terminal in your backend project directory and run the following command to start the Express server on port 4000:

node server.js

You should see the following message in your terminal confirming the server is listening:

Server running on http://localhost:4000

You can also verify the server is healthy by visiting http://localhost:4000/api/health in your browser. It should return {"status":"ok"}.

Start the React Frontend

Open a second terminal in your React project directory and start the development server:

npm start

Your browser should open automatically at http://localhost:3000, where you will see the Froala editor rendered inside the WordImportEditor component.

Test the Word Import Flow

To test the full import pipeline, follow these steps:

  1. In the Froala toolbar, locate the Import from Word button inside the More Rich toolbar group.
  2. Click the button and select a .docx file from your local machine.
  3. Froala will automatically POST the file to http://localhost:4000/api/import-word using the importFromWordUrlToUpload configuration..

  4. The Express server will convert the document using mammoth-plus and return the generated HTML.
  5. Froala will insert the returned HTML directly into the editor, where you can continue editing the imported content.

If the import does not appear to work, open your browser’s developer tools and check the Network tab for the request to /api/import-word. Confirm the response contains an html field and that no CORS errors are shown in the console. Also check your terminal for any server-side error output.

Testing and Validation

Once the integration is running, test it with a range of Word documents rather than a single sample file. Real-world imports often expose formatting edge cases that are easy to miss in a controlled demo.

  • Click the Froala Import from Word toolbar button and import a simple .docx file with headings, paragraphs, and lists.
  • Test a document that contains links, bold text, and nested list structures.
  • Verify the backend rejects unsupported file types and oversized uploads.
  • Inspect the returned HTML in browser dev tools to confirm it matches your expectations.
  • Review mammoth-plus conversion messages and log them during development so you can track conversion issues.

It is also wise to run the generated HTML through your existing content sanitization policy before you store or render it elsewhere in your application. Even if your import source is trusted, a clean pipeline is better long-term engineering practice.

Optimization and Production Notes

A tutorial implementation is a strong starting point, but production applications usually benefit from additional safeguards. Consider adding authentication to the import endpoint, rate limiting for abuse protection, and structured logging around file names, sizes, durations, and failures. If imported documents are large or frequent, you may also want a queue-based workflow so conversion does not compete with other synchronous application traffic.

If your authors regularly import branded templates or highly styled documents, you may want to apply post-processing rules to normalize classes, remove unwanted inline markup, or map Word structures into your editorial design system. That is one of the biggest advantages of the Express layer: it gives your team a place to enforce consistency before the content reaches Froala.

What’s Next

At this point, you have a complete foundation for a React-first Word import workflow built around Froala, Express, and mammoth-plus. Your frontend renders a polished editor interface, Froala’s Import from Word button handles document selection inside the editor, your backend performs controlled file handling and conversion, and the returned HTML flows directly into the authoring experience.

Ready to build your own editor? Download Froala Editor and start integrating it into your React application today. Froala’s comprehensive documentation, licensing options, and support team are ready to help you implement this workflow and customize it for your product requirements. With the server-side architecture you’ve learned in this tutorial, you’re equipped to handle Word imports at scale while maintaining full control over your content pipeline.

FAQ

Why use server-side import instead of converting in React?

Because server-side import centralizes validation, transformation, and monitoring. It also creates a more maintainable architecture when your product grows beyond a simple demo. With Froala, you still keep the experience editor-native by using the built-in Import from Word button and pointing it to your backend with importFromWordUrlToUpload.

Does mammoth-plus preserve every visual detail from Word?

Not necessarily. Its strength is producing clean HTML from structured Word content, not reproducing every layout detail exactly as Word displays it.

Can I store the converted HTML in a database?

Yes. Many teams store the returned HTML after sanitization. Froala provides the word.afterImport event, which fires immediately after a Word document has been successfully imported and converted to HTML. This event is particularly useful for database storage workflows because it gives you a hook to intercept the imported HTML on the client side before any further editing occurs.

Can I support drag-and-drop uploads?

Yes. Froala enables drag-and-drop Word imports by default, which means your users can drag a .docx file directly from their file system and drop it into the editor. When they do, the editor automatically triggers the same import workflow you configured with importFromWordUrlToUpload, sending the file to your Express endpoint for conversion without any additional code.

This zero-config behavior creates a frictionless authoring experience—users don’t need to hunt for a toolbar button; they can simply drag and drop. The imported HTML flows into the editor the same way it does when they click the Import from Word button.

If you want to disable drag-and-drop imports (for example, to enforce a more deliberate toolbar-only workflow), set the importFromWordEnableImportOnDrop configuration option to false in your Froala config object.

How to Set Up Froala with DeepSeek AI Assist in WordPress

Set Up Froala AI Assist in WordPress

In today’s digital landscape, content creation has become increasingly sophisticated, and users expect intelligent, AI-powered tools to enhance their writing experience. Whether you’re building a Learning Management System (LMS), a content publishing platform, or any WordPress site that requires rich text editing, integrating a WordPress AI editor can dramatically improve user productivity and content quality. 

In this comprehensive tutorial, we’ll walk you through setting up the Froala WYSIWYG editor with AI assistance powered by DeepSeek on your WordPress frontend pages.

Key Takeaways

  • Security First: By handling API calls server-side through WordPress’s REST API, you’ve protected your DeepSeek API key and prevented unauthorized usage.
  • Flexibility: The modular architecture allows easy customization of AI commands, user permissions, and integration with other WordPress features.
  • User Experience: Users get seamless AI assistance without leaving the editor, dramatically improving their content creation workflow.
  • Scalability: The implementation can handle multiple users and can be extended with caching, rate limiting, and asynchronous processing as your needs grow.
  • Cost Control: With proper monitoring, rate limiting, and caching, you can control API costs while providing valuable AI features.

Why Choose Froala with AI Assist for Your WordPress Site?

Before diving into the technical implementation, let’s understand why this integration is a game-changer for WordPress developers and site owners.

The Power of AI-Enhanced Content Creation

Froala Editor is already one of the most feature-rich WYSIWYG editors available, offering a clean interface, extensive formatting options, and excellent performance. 

It offers an affordable, enterprise-grade solution for rich-text editing, with plans that include unlimited editor loads and user seats, so costs don’t multiply with scale.

When you combine it with AI capabilities, you unlock a new dimension of content creation that includes:

  • Intelligent Chat that can be used for
    • Intelligent content suggestions that help users overcome writer’s block
    • Grammar and style improvements that enhance content quality
    • Content expansion capabilities that can elaborate on brief ideas
    • Summarization features for condensing lengthy content
  • Tone adjustment to match different audiences and contexts
  • Translation assistance for multilingual sites

Froala’s AI Assist plugin is model-agnostic and works with any AI API. This tutorial uses DeepSeek as the AI provider—a cost-effective and capable choice for many use cases. However, you can substitute any other AI model (OpenAI’s GPT-4, Anthropic’s Claude, Llama, etc.) by adjusting the API endpoint, authentication method, and request/response formatting in the code. The integration steps and architecture remain largely the same regardless of which model you choose.

Benefits of This Integration

Implementing a WordPress AI editor using Froala and DeepSeek offers numerous advantages:

  1. Enhanced User Experience: Students writing essays in an LMS, bloggers crafting articles, or team members collaborating on documentation all benefit from real-time AI assistance without leaving the editor interface.
  2. Server-Side Security: By handling API calls on the WordPress backend, you keep your DeepSeek API keys secure and never expose them to client-side code. This architecture prevents unauthorized usage and protects your credentials.
  3. Seamless WordPress Integration: The solution leverages WordPress’s native REST API infrastructure, ensuring compatibility with WordPress standards and making maintenance straightforward.
  4. Customizable and Extensible: The implementation we’ll build can be easily modified to add custom prompts, implement rate limiting, add user-specific features, or integrate with other WordPress plugins.

Real-World Use Cases

Before we begin the implementation, let’s explore some practical scenarios where this WordPress AI editor integration shines:

Learning Management Systems (LMS)

Imagine students working on essays or research papers within your LMS. With AI assist, they can:

  • Get suggestions for improving their thesis statements
  • Expand on complex ideas with additional context
  • Check their writing for clarity and coherence
  • Generate outlines for structured essays
  • Receive feedback on argument strength

Content Publishing Platforms

For blogs, news sites, or content marketing platforms:

  • Writers can quickly generate article introductions
  • Content teams can maintain consistent tone across multiple authors
  • Editors can use AI to suggest improvements before publication
  • SEO-focused content can be enhanced with keyword-rich suggestions
  • Meta descriptions and summaries can be auto-generated

Corporate Intranets and Knowledge Bases

Organizations using WordPress for internal documentation benefit from:

  • Standardized documentation formatting and style
  • Quick generation of technical explanations
  • Translation of content for global teams
  • Summarization of lengthy reports
  • Consistent terminology across departments

E-Learning and Course Creation

Course creators and instructional designers can:

  • Generate quiz questions from course content
  • Create engaging lesson descriptions
  • Develop learning objectives with AI assistance
  • Produce student-friendly explanations of complex topics
  • Draft feedback templates for assignments

What You’ll Build

A WordPress page where users can write content with:

  • A professional WYSIWYG editor (Froala)
  • AI writing assist features (chat, tone, translation)
  • DeepSeek as the backend AI model
  • Server-side API handling for security

Froala AI in WordPress powered by DeepSeek

Prerequisites

Before starting this tutorial, ensure you have:

  1. A WordPress installation (version 5.0 or higher recommended)
  2. Administrative access to your WordPress site
  3. FTP or file manager access to edit WordPress files
  4. A DeepSeek API key (sign up at DeepSeek’s website)
  5. Froala Editor license (or trial version)
  6. Basic understanding of PHP, JavaScript, and WordPress development
  7. A code editor for modifying WordPress files

Step 1: Securing Your DeepSeek API Key

The first and most critical step in building a secure WordPress AI editor is properly storing your API credentials. Never expose API keys in client-side JavaScript code, as this would allow anyone to use your API quota and potentially incur costs.

Adding the API Key to wp-config.php

Open your wp-config.php file, which is located in your WordPress root directory. This file contains your WordPress configuration settings and is the ideal place to store sensitive credentials.

Add the following line before the comment that says /* That's all, stop editing! Happy publishing. */:

define( 'DEEPSEEK_API_KEY', 'sk-****' );

Replace sk-**** with your actual DeepSeek API key. This approach keeps your key secure because:

  • The wp-config.php file is never accessible via web browsers when properly configured
  • The constant is available throughout your WordPress installation
  • You can easily change the key without modifying multiple files
  • It follows WordPress security best practices

Why this matters: Storing sensitive keys in wp-config keeps them out of the database and version control. WordPress loads this file before anything else, making it available everywhere you need it.

Security Tip: Ensure your wp-config.php file has appropriate permissions (typically 440 or 400) to prevent unauthorized access. You can set this via FTP or your hosting control panel.

Step 2: Creating the WordPress REST API Endpoint

WordPress’s REST API provides a standardized way to interact with your site programmatically. We’ll create a custom endpoint that acts as a secure proxy between the Froala editor and the DeepSeek API.

Understanding the Architecture

Here’s how the data flow works:

  1. User types a prompt in the Froala editor and triggers AI assist
  2. Froala sends a request to your WordPress REST API endpoint
  3. WordPress receives the request, sanitizes the input, and validates it
  4. WordPress makes a server-side request to DeepSeek’s API with your secure API key
  5. DeepSeek processes the request and returns AI-generated content
  6. WordPress formats the response and sends it back to Froala
  7. Froala displays the AI-generated content to the user

This architecture ensures your API key never leaves the server and all requests are properly validated.

Implementing the REST API Endpoint

You have two options for adding this code:

Option A: Add to functions.php (simpler, good for single-site implementations)

Option B: Create a custom plugin (recommended for portability and cleaner code organization)

For this tutorial, we’ll show both approaches, but we recommend Option B for production environments.

Option A: Adding to functions.php

Open your theme’s functions.php file (located in wp-content/themes/your-theme/functions.php) and add:

/**
* Register custom REST API endpoint for DeepSeek AI integration
*/
add_action( 'rest_api_init', function () {
   register_rest_route( 'ai-assist', '/deepseek', array(
       'methods'  => 'POST',
       'callback' => 'handle_deepseek_request',
       'permission_callback' => '__return_true',
   ));
});

/**
* Handle DeepSeek API requests
* 
* @param WP_REST_Request $request The REST API request object
* @return array|WP_Error Response data or error
*/
function handle_deepseek_request( $request ) {
   // Extract and sanitize the user's prompt
   $params = $request->get_json_params();
   $user_prompt = sanitize_text_field( $params['prompt'] );

   // Validate that we have a prompt
   if ( empty( $user_prompt ) ) {
       return new WP_Error( 
           'missing_prompt', 
           'No prompt provided.', 
           array( 'status' => 400 ) 
       );
   }

   // Call DeepSeek API securely from the server
   $response = wp_remote_post( 'https://api.deepseek.com/v1/chat/completions', array(
       'headers' => array(
           'Authorization' => 'Bearer ' . DEEPSEEK_API_KEY,
           'Content-Type'  => 'application/json',
       ),
       'body' => json_encode( array(
           'model'    => 'deepseek-chat',
           'messages' => array(
               array( 'role' => 'user', 'content' => $user_prompt )
           ),
       )),
       'timeout' => 30,
   ));

   // Handle connection errors
   if ( is_wp_error( $response ) ) {
       return new WP_Error( 
           'api_error', 
           'DeepSeek API connection failed: ' . $response->get_error_message(), 
           array( 'status' => 500 ) 
       );
   }

   // Parse the API response
   $body = json_decode( wp_remote_retrieve_body( $response ), true );

   // Check if DeepSeek actually returned an answer
   if ( isset( $body['choices'][0]['message']['content'] ) ) {
       return array(
           'success' => true,
           'data'    => array(
               'content' => $body['choices'][0]['message']['content']
           )
       );
   }

   // Fallback for API errors (like quota exceeded)
   return array(
       'success' => false,
       'error'   => $body['error']['message'] ?? 'Unknown API error'
   );
}

Option B: Creating a Custom Plugin (Recommended)

Create a new directory in wp-content/plugins/ called froala-ai-assist. Inside this directory, create a file named froala-ai-assist.php:

AI Assist file

/**
* Plugin Name: Froala AI Assist with DeepSeek
* Plugin URI: https://yoursite.com
* Description: Integrates Froala Editor with DeepSeek AI for intelligent content assistance
* Version: 1.0.0
* Author: Your Name
* Author URI: https://yoursite.com
* License: GPL v2 or later
* Text Domain: froala-ai-assist
*/

// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
   exit;
}

/**
* Main plugin class
*/
class Froala_AI_Assist {

   /**
    * Constructor
    */
   public function __construct() {
       add_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );
   }

   /**
    * Register REST API routes
    */
   public function register_rest_routes() {
       register_rest_route( 'ai-assist', '/deepseek', array(
           'methods'  => 'POST',
           'callback' => array( $this, 'handle_deepseek_request' ),
           'permission_callback' => array( $this, 'check_permissions' ),
       ));
   }

   /**
    * Check if user has permission to use AI assist
    * 
    * @return bool
    */
   public function check_permissions() {
       // For now, allow all authenticated users
       // You can customize this based on your requirements
       return true; // is_user_logged_in();
   }

   /**
    * Handle DeepSeek API requests
    * 
    * @param WP_REST_Request $request
    * @return array|WP_Error
    */
   public function handle_deepseek_request( $request ) {
       $params = $request->get_json_params();
       $user_prompt = sanitize_text_field( $params['prompt'] ?? '' );

       if ( empty( $user_prompt ) ) {
           return new WP_Error( 
               'missing_prompt', 
               __( 'No prompt provided.', 'froala-ai-assist' ), 
               array( 'status' => 400 ) 
           );
       }

       // Check if API key is configured
       if ( ! defined( 'DEEPSEEK_API_KEY' ) || empty( DEEPSEEK_API_KEY ) ) {
           return new WP_Error( 
               'missing_api_key', 
               __( 'DeepSeek API key not configured.', 'froala-ai-assist' ), 
               array( 'status' => 500 ) 
           );
       }

       // Call DeepSeek API
       $response = wp_remote_post( 'https://api.deepseek.com/v1/chat/completions', array(
           'headers' => array(
               'Authorization' => 'Bearer ' . DEEPSEEK_API_KEY,
               'Content-Type'  => 'application/json',
           ),
           'body' => json_encode( array(
               'model'    => 'deepseek-chat',
               'messages' => array(
                   array( 'role' => 'user', 'content' => $user_prompt )
               ),
               'temperature' => 0.7,
               'max_tokens' => 2000,
           )),
           'timeout' => 30,
       ));

       if ( is_wp_error( $response ) ) {
           return new WP_Error( 
               'api_error', 
               sprintf( 
                   __( 'DeepSeek API connection failed: %s', 'froala-ai-assist' ),
                   $response->get_error_message()
               ), 
               array( 'status' => 500 ) 
           );
       }

       $body = json_decode( wp_remote_retrieve_body( $response ), true );

       if ( isset( $body['choices'][0]['message']['content'] ) ) {
           return array(
               'success' => true,
               'data'    => array(
                   'content' => $body['choices'][0]['message']['content']
               )
           );
       }

       return array(
           'success' => false,
           'error'   => $body['error']['message'] ?? __( 'Unknown API error', 'froala-ai-assist' )
       );
   }
}

// Initialize the plugin
new Froala_AI_Assist();

After creating this file, activate the plugin from your WordPress admin panel under Plugins > Installed Plugins.

Understanding the Code

Let’s break down the key components of this implementation:

  1. REST Route Registration: The register_rest_route() function creates a new API endpoint at /wp-json/ai-assist/deepseek. This endpoint accepts POST requests and routes them to our handler function.
  2. Input Sanitization: We use sanitize_text_field() to clean the user’s prompt, preventing potential security issues like XSS attacks.
  3. API Request: The wp_remote_post() function is WordPress’s built-in method for making HTTP requests. It’s more secure and reliable than using PHP’s cURL directly.
  4. Error Handling: We check for both connection errors and API-level errors, providing meaningful feedback to users.
  5. Response Formatting: The function returns a standardized response format that Froala can easily parse and display.

Step 3: Creating a WordPress Page with Froala Editor

Now that our backend is ready, let’s create a frontend page where users can interact with the WordPress AI editor.

Creating the Page Template

Create a new page in WordPress (Pages > Add New) and give it a title like “AI-Powered Editor” or “Write with AI Assist”. You can use the default page template or create a custom one.

Adding the Froala Editor

You’ll need to enqueue Froala’s CSS and JavaScript files. Add this to your theme’s functions.php or your custom plugin:

/**
* Enqueue Froala Editor assets
*/
function enqueue_froala_editor_assets() {
   // Only load on specific pages
   if ( is_page( 'ai-powered-editor' ) ) { // Replace with your page slug

       // Froala CSS
       wp_enqueue_style( 
           'froala-editor', 
           'https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css',
           array(),
           '4.0.0'
       );

       wp_enqueue_style( 
           'froala-style', 
           'https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_style.min.css',
           array(),
           '4.0.0'
       );

       // Froala JavaScript
       wp_enqueue_script( 
           'froala-editor', 
           'https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js',
           array( 'jquery' ),
           '4.0.0',
           true
       );

      /*  Add scripts for other feature dependencies as needed.*/



       // Custom initialization script
       wp_enqueue_script( 
           'froala-init', 
           get_template_directory_uri() . '/js/froala-init.js',
           array( 'froala-editor' ),
           '1.0.0',
           true
       );

       // Pass WordPress REST API URL to JavaScript
       wp_localize_script( 'froala-init', 'wpApiSettings', array(
           'root' => esc_url_raw( rest_url() ),
           'nonce' => wp_create_nonce( 'wp_rest' )
       ));
   }
}
add_action( 'wp_enqueue_scripts', 'enqueue_froala_editor_assets' );

Creating the Page Content

In your page editor, switch to the HTML/Code view and add:

 <div id="froala-editor">
    <p>Start writing your content here. Use the AI assist button to get intelligent suggestions!</p>
</div>

<style>
    #froala-editor {
        margin: 20px 0;
        min-height: 400px;
    }
  
</style>

AI editor wordpress

Step 4: Initializing Froala with AI Assist

Create a new JavaScript file in your theme directory at js/froala-init.js:

/**
* Initialize Froala Editor with DeepSeek AI Assist
*/
(function($) {
   'use strict';

   /**
    * Call DeepSeek API through WordPress REST endpoint
    * 
    * @param {Object} data- The user's prompt
    *
    */
    async function callDeepseek(data) {

       try {

           const response = await fetch(wpApiSettings.root + 'ai-assist/deepseek', {

               method: "POST",

               headers: {

                   "Content-Type": "application/json"

               },

               body: JSON.stringify({

                   prompt: data.prompt,

                   //context: data.context,

               }),

               //signal: signal

           });



           if (!response.ok) {

               throw new Error("AI request failed: " + response.statusText);

           }



           const result = await response.json();



           // Validate response

           if (!result.success) {

               throw new Error(result.error || "Unknown error");

           }

 

           return result.data.content;

       } catch (error) {

           console.error("AI request error:", error);

           throw error;

       }

   }

   /**
    * Initialize Froala Editor when DOM is ready
    */
   $(document).ready(function() {

       // Check if Froala Editor is available
       if (typeof FroalaEditor === 'undefined') {

           console.error('Froala Editor not loaded');

           return;

       }



       // Initialize the editor

       new FroalaEditor('#froala-editor', {

           // Basic configuration

           heightMin: 400,

           heightMax: 800,



           // AI Assist configuration

           aiSupplementalTermsAccepted: true,

           aiAssistRequest: callDeepseek,





           // Event handlers

           events: {

               'initialized': function () {

                   console.log('Froala Editor initialized with AI Assist');

               },

               'aiAssist.afterInsert': function () {

                   console.error('AI response is ready.');

                   

               }

           }

       });
   });

})(jQuery);

DeepSeek function

Understanding the Froala Configuration

Let’s examine the key configuration options:

  1. aiSupplementalTermsAccepted: This boolean flag indicates that you’ve accepted Froala’s terms for using AI features. Set this to true to enable AI functionality.
  2. aiAssistRequest: This is the crucial connection point. We pass our callDeepseek function here, which Froala will call whenever a user requests AI assistance.
  3. Event Handlers: We set up event listeners to track initialization and AI response insertion.

Step 5: Testing Your WordPress AI Editor

Now that everything is configured, let’s test the integration:

  1. Navigate to Your Page: Visit the page where you added the Froala editor
  2. Write Some Content: Type a paragraph or two of text
  3. Select Text: Highlight some of your content
  4. Click AI Assist: Look for the AI assist button in the Froala toolbar
  5. Ask Anything: Try one of the AI commands like “Write about X” or “Expand Content” and watch the magic happen in real-time as DeepSeek processes your request.
  6. Review Results: The AI-generated content should appear, which you can accept, modify, or reject

Wordpress AI editor

Troubleshooting Common Issues

Problem: AI Assist button doesn’t appear

  • Solution: Verify that the AI Assist plugin JavaScript is loaded and activated and you are not customizing the toolbar editor buttons. Check your browser’s console for errors.

Problem: “API key not configured” error

  • Solution: Double-check that you’ve added the DEEPSEEK_API_KEY constant to wp-config.php and that it’s spelled correctly.

Problem: “DeepSeek API connection failed”

  • Solution: Verify your API key is valid and that your server can make outbound HTTPS requests. Some hosting providers block external API calls.

Problem: Slow response times

  • Solution: DeepSeek’s response time depends on prompt complexity and server load. Consider implementing a loading indicator and setting appropriate timeout values.

Problem: CORS errors

  • Solution: Since we’re using WordPress’s REST API as a proxy, CORS shouldn’t be an issue. If you see CORS errors, verify that your REST API is accessible and not blocked by security plugins.

Advanced Customization Options

While the basic integration provides powerful AI-assisted editing out of the box, you may want to extend the functionality to meet specific business requirements. The following customizations demonstrate common enhancement patterns that can be adapted to your unique use cases.

Adding User-Specific Rate Limiting

To prevent abuse and control API costs, implement rate limiting:

function handle_deepseek_request( $request ) {
   $user_id = get_current_user_id();

   // Check rate limit (e.g., 10 requests per hour)
   $transient_key = 'ai_assist_limit_' . $user_id;
   $request_count = get_transient( $transient_key );

   if ( $request_count && $request_count >= 10 ) {
       return new WP_Error( 
           'rate_limit_exceeded', 
           'You have exceeded the AI assist rate limit. Please try again later.', 
           array( 'status' => 429 ) 
       );
   }

   // Increment counter
   set_transient( $transient_key, ( $request_count ? $request_count + 1 : 1 ), HOUR_IN_SECONDS );

   // Continue with normal processing...
}

Implementing Usage Logging

Track AI usage for analytics and billing:

function log_ai_usage( $user_id, $prompt, $response, $tokens_used ) {
   global $wpdb;

   $wpdb->insert(
       $wpdb->prefix . 'ai_usage_log',
       array(
           'user_id' => $user_id,
           'prompt' => $prompt,
           'response_length' => strlen( $response ),
           'tokens_used' => $tokens_used,
           'timestamp' => current_time( 'mysql' )
       ),
       array( '%d', '%s', '%d', '%d', '%s' )
   );
}

Security Best Practices

Integrating AI capabilities into your WordPress site introduces new security considerations. Since your REST API endpoint handles user input and communicates with external services, it’s essential to implement robust validation, sanitization, and permission checks.

Input Validation and Sanitization

Always validate and sanitize user input:

function handle_deepseek_request( $request ) {
   $params = $request->get_json_params();

   // Validate prompt exists
   if ( ! isset( $params['prompt'] ) ) {
       return new WP_Error( 'missing_prompt', 'Prompt is required' );
   }

   // Sanitize and validate length
   $user_prompt = sanitize_textarea_field( $params['prompt'] );

   if ( strlen( $user_prompt ) > 5000 ) {
       return new WP_Error( 'prompt_too_long', 'Prompt exceeds maximum length' );
   }

   if ( strlen( $user_prompt ) < 10 ) {
       return new WP_Error( 'prompt_too_short', 'Prompt is too short' );
   }

   // Continue processing...
}

Permission Checks

Implement proper permission checking:

function check_ai_assist_permissions() {
   // Only allow logged-in users
   if ( ! is_user_logged_in() ) {
       return false;
   }

   // Check if user has specific capability
   if ( ! current_user_can( 'edit_posts' ) ) {
       return false;
   }

   // Check if user's account is in good standing
   $user_id = get_current_user_id();
   $is_suspended = get_user_meta( $user_id, 'ai_assist_suspended', true );

   if ( $is_suspended ) {
       return false;
   }

   return true;
}

Conclusion

Congratulations! You’ve successfully implemented a powerful WordPress AI editor by integrating Froala WYSIWYG editor with DeepSeek AI assistance. This implementation provides your users with intelligent content creation tools while maintaining security, performance, and cost-effectiveness.

Next Steps

Consider these enhancements for your WordPress AI editor:

  • Implement user-specific AI command customization.
  • Add support for multiple AI models (OpenAI, Anthropic, etc.).
  • Integrate Froala as a WordPress’s block editor.

Resources

By following this tutorial, you’ve created a production-ready WordPress AI editor that can transform how users create content on your site. Whether you’re building an LMS, a content publishing platform, or any WordPress application that requires rich text editing, this integration provides the intelligent assistance modern users expect.

The combination of Froala’s robust editing capabilities and DeepSeek’s powerful AI creates an exceptional content creation experience that will delight your users and set your WordPress site apart from the competition. Try AI assist feature in action now.

 

Build a Wikipedia-Style Moderation Layer with Froala and IPstack

Wikipedia-Style Moderation

Modern web editors aren’t just UI components—they’re entry points for user-generated content, which means they’re also entry points for abuse.

Platforms like Wikipedia don’t just let users edit content freely—they track, analyze, and moderate every submission. One of the key signals they rely on is IP-based metadata.

In this guide, you’ll learn how to build a simple, production-style moderation layer using:

  • Editor: Froala Editor
  • Geo API: IPstack
  • Backend: Node.js + Express

We’ll keep it beginner-friendly, but grounded in real-world architecture.

Key Takeaways

  • User-generated content requires backend moderation.
  • IP-based metadata is a simple, high-impact signal for detecting abuse patterns
  • Rate limiting and geo-tracking are table stakes for any platform accepting submissions
  • Privacy matters: store only what you need, hash sensitive data, set retention limits

What You’re Building

By the end, your app will:

  • Accept content from a WYSIWYG editor
  • Capture the user’s IP and location securely, on the backend, using IPstack
  • Store metadata with each post
  • Apply basic moderation rules (rate limiting / blocking)

Why This Matters

If your app allows users to submit content (posts, comments, HTML):

You are exposed to:

  • Spam bots
  • Fake accounts
  • Malicious content
  • Coordinated attacks

The editor is not the problem. Uncontrolled submissions are.

Architecture Overview

Here’s the flow we’ll implement:

User → Froala Editor → Submit Content

        ↓

Frontend sends content

        ↓

Backend (Express):

  - Call IPstack

  - Store metadata

  - Run moderation checks

        ↓

Save or block

Step 1: Project Setup

mkdir froala-moderation

cd froala-moderation

npm init -y

npm install express cors

Step 2: Add Froala Editor (Frontend)

Create a simple index.html:

<!DOCTYPE html>
<html>
<head>
  <link href="https://cdn.jsdelivr.net/npm/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet">
</head>
<body>

  <textarea id="editor"></textarea>
  <button onclick="submitContent()">Submit</button>

  <script src="https://cdn.jsdelivr.net/npm/froala-editor/js/froala_editor.pkgd.min.js"></script>

  <script>
    const editor = new FroalaEditor('#editor');

    async function submitContent() {
      const content = editor.html.get();

      const res = await fetch('http://localhost:3000/api/post', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ content })
      });

      const data = await res.json();
      alert(data.message);
    }
  </script>

</body>
</html>

This is your content entry point.

Step 3: Create Express Backend

Create server.js:

const express = require('express');
const cors = require('cors');
const path = require('path');

const app = express();
app.use(cors());
app.use(express.json());

app.use(express.static(path.join(__dirname, 'public')));

const PORT = 3000;

app.listen(PORT, () => {
  console.log(`Server running on http://localhost:${PORT}`);
});

Step 4: Capture User IP and Location (IPstack)

Sign up at IPstack and get your API key.

Add this function:

async function getGeoData() {
  const API_KEY = 'YOUR_IPSTACK_KEY';
  
  const res = await fetch(`http://api.ipstack.com/check?access_key=${API_KEY}`);
  const data = await res.json();

  return {
      ip: data.ip,
      country: data.country_name,
      city: data.city
  };
}

Step 6: Add Moderation Logic

We’ll start simple.

Example rule:

  • Block if too many requests from same IP

Add a basic in-memory tracker:

const requestLog = {};

function isSuspicious(ip) {
  const now = Date.now();

  if (!requestLog[ip]) {
    requestLog[ip] = [];
  }

  requestLog[ip].push(now);

  // keep last 1 minute
  requestLog[ip] = requestLog[ip].filter(t => now - t < 60000);

  return requestLog[ip].length > 5; // more than 5 posts/min
}

Step 7: Handle Content Submission

Now combine everything:

app.post('/api/post', async (req, res) => {
  const { content } = req.body;

  // get geo data
  const geo = await getGeoData();

  // moderation check
  if (isSuspicious(ip)) {
    return res.status(429).json({
      message: 'Too many requests. Try again later.'
    });
  }

  const post = {
    content,
    ip,
    country: geo.country,
    city: geo.city,
    createdAt: new Date()
  };

  console.log('Saved post:', post);

  res.json({ message: 'Post saved successfully!' });
});

Step 8: Privacy Best Practices

This is not optional.

✔ Do:

  • Store country, not precise location
  • Set retention (e.g., delete IP after 30 days)
  • Keep IP private (never expose in UI)

❌ Don’t:

  • Collect GPS location
  • Trust frontend IP
  • Store data you don’t use

Step 9: Test Your App

  1. Run backend:
node server.js
  1. Open index.html
  2. Submit content multiple times

After ~5 rapid submissions:

  • You should get a rate limit.

Froala Integration with IPstack

What You Just Built

You now have:

  • A working WYSIWYG editor
  • A backend moderation pipeline
  • IP-based tracking
  • Basic abuse prevention

This is a simplified version of what platforms like Wikipedia do.

Next Steps (Make It Production-Ready)

To level this up:

  • Store data in a database (MongoDB/PostgreSQL)
  • Hash IP addresses for privacy
  • Add CAPTCHA for flagged users
  • Integrate IP reputation services
  • Build a moderation dashboard

Why This Works Well with Froala

Froala Editor fits naturally into this architecture:

  • Clean API (editor.html.get())
  • Easy integration with any backend
  • No lock-in to specific frameworks
  • Designed for real production use—not just demos

It becomes part of your system—not a limitation.

Final Thoughts

If you’re building any app that accepts user content, you’re building a content pipeline.

The difference between a thriving platform and a spam receptacle is whether you moderate at the backend. IP-based tracking is the simplest, highest-impact place to start.

Ready to move beyond this demo? The architecture you’ve built here scales. Add a database, hash those IPs, layer in reputation scoring—and you’ve got the foundation Wikipedia uses.

Start by downloading the editor. Build from there.

graphical user interface, text

Froala 5.1 Release: AI Assist Plugin

Froala 5.1 release with AI assist plugin

Froala 5.1 is here. This release includes performance improvements, bug fixes, and enhanced stability across the editor. But there’s one addition your team has been asking for: Froala AI Assist—a plugin that brings AI directly into your editing workflow, letting your team do what they do best: create better content, faster.

Key Takeaways

  • AI Assist eliminates context-switching. Two toolbar buttons let your team chat with AI, adjust tone, and translate—all without leaving the editor.
  • It’s built for any AI provider. Connect to OpenAI, self-hosted models, or your backend. Froala adapts to your architecture, not the other way around.
  • Measurable productivity gains. Content teams ship faster. Marketing campaigns turn around in hours instead of days. Support docs get clearer instantly.
  • New drag-drop events give you fine-grained control. The drop.beforeCleanup and drop.afterCleanup events let you inspect and modify HTML during drop operations—fixing false cleanup triggers and enabling custom workflows.

Meet Froala AI Assist

AI Assist embeds intelligence directly into your editor—two new powerful toolbar buttons, zero context switching.

AI Chat: Ask Anything Without Leaving

A dedicated AI button opens an interactive popup inside the editor. Your team can:

  • Ask questions and get instant answers
  • Generate new content from prompts
  • Expand ideas and refine existing text.
  • Brainstorm in real-time

All without opening a new tab. All without losing their place or focus.

AI Assist toolbar button

Productivity gain: Drafting + refinement happens in one interface. No tool-switching tax.

AI Shortcuts: One Click, Instant Results

Select text. Click a dropdown. Choose an action. Done.

Supported actions out of the box:

  • Tone adjustment (Professional, Casual, Friendly, Empathetic—fully customizable)
  • Instant translation (any language you support)

No prompts. No waiting for configuration. Just immediate, contextual improvement.

Productivity gain: Tasks that used to require external tools now take seconds.

Real-World Productivity Wins

CMS Platforms: Content editors write faster when they don’t context-switch. More content ships. Same headcount.

Email Builders: Marketing teams adjust tone and language in seconds instead of minutes. Campaign turnaround drops from days to hours.

Documentation Tools: Support teams simplify complex technical language instantly. Better docs, faster. Users get better self-service.

Internal Tools: Teams communicate clearer, faster. Less back-and-forth. More work done.

Anywhere your users create content, AI Assist makes them measurably more productive. That’s not a feature. That’s a business impact.

Built for Developers: Flexible Integration, Full Control

We know that AI integration isn’t one-size-fits-all. That’s why AI Assist is designed to work with any AI provider and any architecture.

Two Integration Paths

Option 1: Frontend (Quick Start)

Connect directly to your AI provider from the browser using a custom request handler.

Best for:

  • Prototyping
  • Internal tools
  • Fast experimentation

Benefits:

  • Minimal setup
  • Full control over prompts
  • Quick time-to-value

Important Consideration ⚠️Exposing your AI API key in frontend code can be risky. It may lead to:

  • Unauthorized usage
  • Unexpected costs
  • Security vulnerabilities

Code Example

new FroalaEditor('#editor', {
  toolbarButtons: ['aiAssist'],
  
  aiAssistEndpoint: 'https://api.example.com/v1/generate',
  
  aiAssistHeaders: {
    'X-API-Key': 'your-api-key',
    'Content-Type': 'application/json'
  },
  
  aiAssistDataKeys: {
    question: 'input_text',
    sessionId: 'thread_id',
    sessionIdValue: generateSessionId(),
    questionOrderNumber: 'turn_number'
  },
  
  aiAssistAdditionalData: {
    model_version: 'v2',
    output_format: 'html',
    language: 'en'
  },
  
  // Response format: { status: 'success', result: { output: { text: '...' } } }
  aiAssistResponseParserPath: 'result.output.text'
});

Option 2: Backend (Recommended for Production)

Route AI requests through your backend for full control and security.

Best for:

  • Production applications
  • SaaS platforms
  • Enterprise environments

Benefits:

  • Protect API keys
  • Validate and sanitize requests
  • Monitor usage and costs
  • Add business logic and guardrails

Code Example:

new FroalaEditor('#editor', {
 toolbarButtons: ['aiAssist'],

 aiAssistRequest: async function(data, signal) {
   try {
     const response = await fetch('https://your-backend.com/api/ai', {
       method: 'POST',
       headers: {
         'Authorization': 'Bearer ' + getUserToken(),
         'Content-Type': 'application/json'
       },
       body: JSON.stringify({
         prompt: data.prompt,
         context: data.context,
         user_id: getCurrentUserId()
       }),
       signal: signal
     });
    
     if (!response.ok) {
       throw new Error('AI request failed: ' + response.statusText);
     }
    
     const result = await response.json();
    
     // Validate response
     if (!result.success) {
       throw new Error(result.error || 'Unknown error');
     }
    
     return result.data.content;
    
   } catch (error) {
     console.error('AI request error:', error);
     throw error;
   }
 },

 events: {
   'aiAssist.beforeInsert': function(event, content) {
     // Sanitize content before insertion
     const sanitized = sanitizeHTML(content);
     return sanitized.length > 0;
   },
  
   'aiAssist.afterInsert': function() {
     // Track usage
     trackAIUsage('content_inserted');
   }
 }
});

This approach ensures your AI integration is secure, scalable, and production-ready.

Simple Configuration, Powerful Customization

AI Assist is designed to be easy to enable—and powerful to customize.

At its core, setup is as simple as:

  • Enabling AI features
  • Connecting your AI endpoint or request handler

From there, you can tailor every aspect of the experience:

Customize the AI Behavior

  • Define your own prompt templates
new FroalaEditor('.selector', {
  aiAssistPromptTemplate: `You are a helpful writing assistant.
Generate content based on the question below.
Your response must be in valid HTML format only.
Preserve all HTML formatting, tags, links, and styles.
Do not include markdown code blocks or backticks.
`
});
  • Control how AI responds (HTML-safe output, formatting rules, etc.)
  • Add custom metadata (user ID, model settings, etc.)
new FroalaEditor('.selector', {
 aiAssistAdditionalData: {
   user_id: 'user-12345',
   model: 'gpt-4',
   temperature: 0.7,
   max_tokens: 1000
 }
});

Customize Tone & Translation Options

Easily configure:

  • Tone styles (e.g., Professional, Casual, Enthusiastic, Empathetic)
new FroalaEditor('.selector', {
aiAssistToneOptions: [
  {
    title: 'Professional',
    prompt: 'Rewrite the following content using polished, formal, and respectful language. Maintain a professional tone that conveys expertise and competence. Preserve all HTML formatting, links, and styles.'
  },
  {
    title: 'Casual',
    prompt: 'Rewrite the following content using casual, conversational language as if speaking with a friend. Keep the tone relaxed and informal. Preserve all HTML formatting, links, and styles.'
  },
  {
    title: 'Enthusiastic',
    prompt: 'Rewrite the following content with high energy and excitement. Use enthusiastic language that conveys passion. Preserve all HTML formatting, links, and styles.'
  },
  {
    title: 'Empathetic',
    prompt: 'Rewrite the following content with deep understanding and compassion. Show empathy and emotional intelligence. Preserve all HTML formatting, links, and styles.'
  }
]
});
  • Supported languages for translation
new FroalaEditor('.selector', {
aiAssistTranslateOptions: [
  {
    title: 'English',
    prompt: 'Translate the following content to English. Maintain the original meaning, tone, and preserve all HTML formatting, links, and styles.'
  },
  {
    title: 'Spanish',
    prompt: 'Translate the following content to Spanish. Maintain the original meaning, tone, and preserve all HTML formatting, links, and styles.'
  },
  {
    title: 'Italian',
    prompt: 'Translate the following content to Italian. Maintain the original meaning, tone, and preserve all HTML formatting, links, and styles.'
  },
  {
    title: 'Portuguese',
    prompt: 'Translate the following content to Portuguese. Maintain the original meaning, tone, and preserve all HTML formatting, links, and styles.'
  }
]
});

Each option is fully customizable with your own AI instructions.

Adapt to Any API Format

AI Assist works with any backend using flexible configuration options:

  • Map request fields to match your API
  • Add custom headers (auth tokens, etc.)
  • Parse responses from any structure
new FroalaEditor('.selector', {
aiAssistResponseParserPath: 'data.answer'
});

// For response: { data: { answer: "text" } }
aiAssistResponseParserPath: 'data.answer'

// For response: { choices: [{ text: "text" }] }
aiAssistResponseParserPath: 'choices[0].text'

// For response: { result: { messages: [{ content: "text" }] } }
aiAssistResponseParserPath: 'result.messages[0].content'

No need to change your backend—Froala adapts to you.

Control the Experience with Events & Methods

AI Assist gives you full control over how AI content behaves inside your editor.

Key capabilities include:

  • Intercept AI responses before insertion. Validate, filter, or reject content.
  • React after content is inserted. Trigger analytics, tracking, or workflows.
  • Programmatically open the AI popup. Launch AI interactions from anywhere in your UI.

This makes it easy to integrate AI into your product’s logic—not just the UI.

From Idea to Integration in Minutes

Whether you want a simple AI-powered editor or a fully customized AI workflow, Froala AI Assist makes it easy:

  • Plug-and-play setup
  • Works with any AI provider
  • Fully customizable behavior
  • Built for both frontend and backend architectures

Get started in four simple steps

  1. Enable AI Assist in your Froala instance
  2. Connect your AI endpoint (frontend or backend)
  3. Customize tones, languages, and prompts for your brand
  4. Your users ship content 3x faster

No infrastructure changes. No architectural constraints. Just productivity gains.

AI Assist: Legal Terms & User Consent

To use AI Assist, you’ll need to set aiSupplementalTermsAccepted to true in your configuration. This captures explicit user consent for our AI legal terms

The Obvious Question: Is This Secure?

Your data stays where you control it.

  • Using OpenAI? Data goes to OpenAI (their policy).
  • Self-hosted model? Data never leaves your servers.
  • Your backend? You own the entire chain.

Froala never stores, logs, or uses your content. We route requests and responses. That’s it.

Start Shipping Faster Today

Content creation shouldn’t be fragmented. Your team shouldn’t context-switch between five tools to write one email.

Froala AI Assist brings intelligence where your team actually works—saving time, eliminating friction, letting them focus on what matters: creating better content.

Explore the Froala AI Assist documentation and start integrating today.

Other Enhancements in Froala 5.1

Beyond AI Assist, this release includes important improvements across the editor:

Event Handling & Drag-Drop Operations

We’ve added fine-grained control over drag-drop interactions with two new events:

  • drop.beforeCleanup – Triggered before content cleanup during a drop operation, letting you inspect or modify HTML before processing.
  • drop.afterCleanup – Triggered after cleanup is complete, giving you access to the final HTML state.

Bug Fixes

Moreover, there are a few bugs fixed including:

List & Formatting Fixes

  • Numbered list font sizing – Font size adjustments now consistently apply to all list items, including empty ones at the end.
  • Ordered list indent behavior – “Decrease Indent” now works on numbered lists just like it does on bullet lists, properly removing list formatting and outdenting text.

Accessibility Improvements

  • Table cell properties – Fixed keyboard navigation so you can now use Enter/Spacebar to interact with cell property controls.

Explore the release notes.

Should You Upgrade?

If you’re looking to ship content faster: AI Assist alone justifies the upgrade. Your team gets built-in AI capabilities without tool-switching—that’s a measurable productivity gain.

If you’re building event-driven workflows: The new drop.beforeCleanup and drop.afterCleanup events give you precise control over drag-drop interactions, fixing the false paste.afterCleanup triggers that were causing unintended logic execution.

This release isn’t just incremental. It’s a meaningful jump in both capability and reliability. Upgrade to Froala 5.1 now.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. Thank you for being a valuable part of our vibrant and growing community. We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Please visit the release notes for a complete list of changes.

Technical Questions

If you have a technical question, you can check whether we have already answered it in our help center. If not, contact our Support team.

 

Build an Accessible Rich Text Comment System in React

Illustration showing an accessible rich text comment system with formatting tools, link insertion, user interaction, and security validation in a React application

Modern apps don’t just collect comments, they rely on them.

Whether you’re building a SaaS dashboard, a blog platform, or a community feature, your comment system is where real user interaction happens. And today, plain text just isn’t enough.

Users expect formatting, links, maybe even images.

But here’s the challenge.
As soon as you introduce a rich text editor, accessibility becomes much harder to get right.

This guide walks you through exactly how to:

  • Build a React comment system with a rich text editor
  • Apply key WCAG accessibility patterns
  • Handle validation, focus, and keyboard navigation
  • Safely render user-generated HTML content

No fluff. Just practical implementation.

Key Takeaways

  • Building an accessible rich text comment system in React requires combining proper component structure with a WCAG-compliant editor setup and form handling.
  • Accessibility must be intentionally implemented through ARIA labels, keyboard navigation support, and focus management to ensure all users can interact with the editor effectively.
  • A well-structured comment form should include clear labels, validation feedback, and accessible controls to improve usability and meet WCAG standards.
  • Sanitizing user-generated HTML content is essential to prevent XSS vulnerabilities before rendering comments in the UI.
  • Limiting editor features and maintaining a clean UI helps create a more accessible, readable, and user-friendly comment experience.

Step 1: Project Setup & Component Structure

We’ll keep things simple and structured.

Core Components

Your comment system will have three main parts:

  • CommentForm → Input + editor + submission
  • CommentList → List of comments
  • CommentItem → Single comment display

Basic Structure

<App>
<CommentForm onSubmit={addComment} />
<CommentList comments={comments} />
</App>

Sample State (App Level)

import { useState } from "react";
import CommentForm from "./components/CommentForm";
import CommentList from "./components/CommentList";

export default function App() {
const [comments, setComments] = useState([]);

const addComment = (newComment) => {
setComments((prev) => [...prev, newComment]);
};

return (
<div>
<h1>Comments</h1>
<CommentForm onSubmit={addComment} />
<CommentList comments={comments} />
</div>
);
}

Step 2: Integrating the Rich Text Editor

We’ll use the Froala React SDK for the editor.

For full setup, follow: Integrate Froala with React

Install

npm install react-froala-wysiwyg froala-editor dompurify

Basic Editor Setup

import FroalaEditorComponent from "react-froala-wysiwyg";
import "froala-editor/js/plugins.pkgd.min.js";

// Handle Vite import edge case
const Editor = FroalaEditorComponent?.default || FroalaEditorComponent;

<Editor
  tag="textarea"
  model={content}
  onModelChange={setContent}
/>

But this alone is not accessible enough.

Let’s fix that properly 

Step 3: Accessibility Configuration for the Editor

This is where most implementations fail.

We’ll focus on:

  • ARIA labels
  • Keyboard navigation
  • Focus management
  • Contrast

1. ARIA Labels (WCAG 4.1.2)

Your editor must have a programmatic name.

import FroalaEditorComponent from "react-froala-wysiwyg";
import "froala-editor/js/plugins.pkgd.min.js";

// Fix for Vite environments
const Editor = FroalaEditorComponent?.default || FroalaEditorComponent;

<label id="comment-label">Write a comment</label>

<Editor
  tag="textarea"
  model={content}
  onModelChange={setContent}
  config={{
    ariaLabel: "Comment input editor",

    // Better accessibility (ties label properly)
    attributes: {
      "aria-labelledby": "comment-label"
    }
  }}
/>

Or link it explicitly:

config={{
attributes: {
'aria-labelledby': 'comment-label'
}
}}

2. Keyboard Navigation (WCAG 2.1.1)

Good news:

Froala already supports keyboard navigation by default.

Users can:

  • Tab through toolbar buttons
  • Use keyboard shortcuts
  • Navigate inside the editor

You don’t need to rebuild this. Just don’t break it with custom overrides.

3. Focus Management (Critical UX + Accessibility)

After submitting a comment, where does focus go?

If you ignore this → screen reader users get lost.

Use useRef

import { useRef } from "react";

const editorRef = useRef(null);

<Editor
  tag="textarea"
  model={content}
  onModelChange={setContent}
  config={{
    events: {
      initialized: function () {
        editorRef.current = this;
      }
    }
  }}
/>

// After submit
const handleSubmit = () => {
  // submit logic...

  // Move focus back to editor
  editorRef.current?.events.focus();
};

4. Contrast & Visibility

Your editor UI must meet contrast requirements.

Froala is built with accessibility in mind
(See: Accessible. Faster. More Customizable.)

Still:

  • Avoid low-contrast themes
  • Ensure buttons are visible in all states

Step 4: Build the Accessible Comment Form

Now let’s bring everything together.

Full CommentForm Component

import { useState, useRef } from "react";
import FroalaEditorComponent from "react-froala-wysiwyg";
import "froala-editor/js/plugins.pkgd.min.js";

// Fix for Vite environments
const Editor = FroalaEditorComponent?.default || FroalaEditorComponent;

export default function CommentForm({ onSubmit }) {
  const [content, setContent] = useState("");
  const [error, setError] = useState("");
  const editorRef = useRef(null);

  const handleSubmit = (e) => {
    e.preventDefault();

    // Strip HTML for validation
    const plainText = content.replace(/<[^>]*>/g, "").trim();

    if (!plainText) {
      setError("Comment cannot be empty.");
      return;
    }

    setError("");
    onSubmit(content);
    setContent("");

    // Focus editor correctly
    editorRef.current?.events.focus();
  };

  return (
    <form onSubmit={handleSubmit}>
      <label id="comment-label">Write your comment</label>

      <Editor
        tag="textarea"
        model={content}
        onModelChange={setContent}
        config={{
          placeholderText: "Type your comment here...",
          ariaLabel: "Comment editor",

          // Proper label association
          attributes: {
            "aria-labelledby": "comment-label"
          },

          toolbarButtons: ["bold", "italic", "underline", "insertLink"],

          // Capture editor instance for focus
          events: {
            initialized: function () {
              editorRef.current = this;
            }
          }
        }}
      />

      {error && (
        <p role="alert" style={{ color: "red" }}>
          {error}
        </p>
      )}

      <button type="submit">Post Comment</button>
      <button type="button" onClick={() => setContent("")}>
        Cancel
      </button>
    </form>
  );
}

Accessibility Wins Here

  • Proper <form> structure
  • Associated <label>
  • Error messages with role=”alert”
  • Keyboard-friendly buttons
  • Focus restored after submission

Step 5: Sanitizing User-Generated Content (Critical)

This is non-negotiable.

Even if Froala outputs clean HTML:

You must sanitize before rendering.

Otherwise → XSS vulnerabilities

 

Example Using DOMPurify

 

npm install react-froala-wysiwyg froala-editor dompurify

 

import DOMPurify from "dompurify";

// Example usage before rendering
const safeHTML = DOMPurify.sanitize(userInput);

 

Step 6: Displaying Comments Safely

CommentList

 

import CommentItem from "./CommentItem";

export default function CommentList({ comments }) {
  return (
    <div className="comment-list">
      {comments.map((comment, index) => (
        <CommentItem key={index} content={comment} />
      ))}
    </div>
  );
}

CommentItem

 

import DOMPurify from "dompurify";

export default function CommentItem({ content }) {
  return (
    <div
      className="comment"
      dangerouslySetInnerHTML={{
        __html: DOMPurify.sanitize(content)
      }}
    />
  );
}

 

Important Note

  • dangerouslySetInnerHTML is safe only after sanitization
  • Never render raw user HTML
Accessible rich text comment system in React with formatted user input and secure rendering of comments.
Accessible rich text comment system in React with formatted user input and secure rendering of comments.

Comment Flow (Simple Mental Model)

 

User writes → Editor → Submit form
       ↓
Validation → Sanitization
       ↓
Store comment → Render safely

WCAG Compliance Summary

WCAG CriterionWhat We DidWhere
1.3.1 Info & RelationshipsLabel tied to editor
2.1.1 KeyboardFull keyboard navigationFroala default
3.3.1 Error IdentificationClear validation messagesrole="alert"
4.1.2 Name, Role, ValueARIA labels on editorconfig

Advanced Considerations

1. Limit Toolbar for Simplicity

For comments, you don’t need full editing power.

 

toolbarButtons: ['bold', 'italic', 'insertLink']

Keeps UI clean and more accessible

For advanced control:
Customizing Froala’s Behavior with Command-Driven Events

2. Image Upload (Accessibility Warning)

If you allow images:

  • Require alt text
  • Ensure uploads are keyboard accessible

See: Three Ways For Uploading Images in Froala: Which One Should You Use?

3. Accessible UGC Strategy

Think beyond code:

  • Avoid overwhelming formatting options
  • Keep comment UI simple
  • Ensure readability of output

Ready to Build This?

You now have everything you need to:

  • Build a React comment system with rich text editor
  • Make it accessible and compliant
  • Safely handle user-generated content

Ready to implement this in your app?
Start a free trial of Froala and get your API key to follow along with this tutorial.

Final Thoughts

Accessibility isn’t a “nice-to-have” feature.

In a comment system, it directly impacts:

  • Who can participate
  • How easily they can interact
  • Whether your app is inclusive

The good news?

You don’t need to build everything from scratch.

With the right structure + a capable editor + a few intentional decisions, you can ship a fully accessible rich text comment experience without slowing down your development.

graphical user interface, text

How to Measure and Debug WYSIWYG Editor Core Web Vitals

illustration showing a WYSIWYG editor affecting Core Web Vitals with LCP, CLS, and INP debugging metrics

Modern web apps rely heavily on rich text editors. But here’s the reality most teams run into:

You ship your page → run Lighthouse → and suddenly your Core Web Vitals tank.

If you’ve recently embedded a WYSIWYG editor (like Froala, TinyMCE, or CKEditor), this isn’t surprising. These editors are powerful, but they also introduce performance challenges that directly impact Core Web Vitals:

  • LCP: Large JavaScript bundles and CSS can delay rendering
  • CLS: Toolbars, styles, and editor containers can shift the layout during initialization
  • INP: Plugins, event listeners, and input handling can slow user interactions

So while your editor improves user experience, it can quietly degrade performance behind the scenes.

This guide is not about generic optimization advice. It’s a hands-on debugging workflow to help you isolate the editor’s actual impact, measure how it affects LCP, CLS, and INP, and apply targeted fixes without breaking UX.

Key Insights

  • WYSIWYG editors can affect all three Core Web Vitals. Large bundles can slow LCP, dynamic UI can trigger CLS, and heavy interactions can increase INP.
  • Measure the editor’s impact before making changes. Compare the same page with and without the editor to isolate its effect on performance.
  • Use Lighthouse for comparison and DevTools for diagnosis. Lighthouse shows what changed, while DevTools helps identify the scripts, layout shifts, and long tasks behind it.
  • Most performance issues come from implementation choices. Early initialization, unnecessary plugins, and expensive event handling usually cause more damage than the editor itself.
  • Targeted fixes produce the best results. Lazy loading, stable layout, leaner bundles, and lighter interaction logic can improve Core Web Vitals without hurting editor UX.

Step 1: Identify the Suspect (Your Editor)

WYSIWYG editors are powerful, but they’re also heavy, dynamic, and interactive, which makes them prime suspects for Core Web Vitals issues.

Here’s how they typically impact performance:

  • LCP (Largest Contentful Paint)
    Large JS bundles + CSS → render-blocking → slower initial load
  • CLS (Cumulative Layout Shift)
    Toolbars, iframes, fonts, and media load dynamically → layout shifts
  • INP (Interaction to Next Paint)
    Typing, plugins, autosave, and event handlers → input delays

A very common real-world scenario:

An editor bundled with all plugins adds ~200KB+ of JS → pushes LCP from 1.8s → 2.8s on slower connections.

Before fixing anything, you need proof.

Step 2: Establish a Clean Performance Baseline

You cannot debug what you cannot measure.

Create Two Test States

Build a controlled comparison:

VersionDescription
APage WITHOUT the editor
BPage WITH the editor

Important Setup Rules

  • Use Incognito mode
  • Disable extensions
  • Test with network throttling (Fast 3G / Slow 4G)
  • Run Lighthouse multiple times (3–5 runs)

Your goal:
Quantify exactly how much the editor changes your metrics

Test Page WITHOUT the Editor

Run the test for the same page with the same layout, same content, and replacing the editor with:

<textarea placeholder="Editor goes here"></textarea>

Important: Everything must be identical except the editor.

Step 1: Open Chrome in Incognito and open the page.

/no-editor.html

Step 2: Open DevTools (Right click -> Inspect) and go to the Lighthouse tab.

Step 3: Configure Lighthouse with the settings below:

Configure the Lighthouse

Step 4: Simulate Real Conditions (Go to Network tab → Throttling, Set: Fast 3G or Slow 4G)

Simulate Real Conditions - Set Throttling

Simulate Real Conditions - Set Throttling 2

Step 5: Run the test (click Analyze page load)

Repeat 3–5 Times: Take the average result or choose a consistent run.

You will get the results as shown below:

Performance Score in Lighthouse - Without Editor
Performance Score in Lighthouse – Without Editor

 

Metrics section showing LCP CLS INP (Without Editor)
Metrics section showing LCP CLS INP (Without Editor)

Test Page WITH the Editor

Let’s run the test for the page with the Froala WYSIWYG editor.

Open the same page, same content, adding your WYSIWYG editor (Froala or any). I added Froala in my example.

/with-editor.html

Repeat the same test setup with the editor enabled. You will see the results as below:

Performance Score in Lighthouse - With Froala WYSIWYG Editor
Performance Score in Lighthouse – With Froala WYSIWYG Editor

 

Metrics section showing LCP CLS INP (With Editor)
Metrics section showing LCP CLS INP (With Editor)

 

Step 3: Analyze Each Core Web Vital Using DevTools

Now that you’ve established a baseline using Lighthouse, the next step is to understand why those changes happened.

Lighthouse tells you what is wrong.
Chrome DevTools helps you uncover what exactly is causing it.

At this stage, your goal is to connect each Core Web Vital issue to a specific editor behavior, whether it’s bundle size, layout instability, or interaction delays.

3.1 Analyzing LCP (Largest Contentful Paint)

Target: < 2.5 seconds

If your Lighthouse report showed a slower LCP after adding the editor, you now need to identify what is blocking the main content from rendering quickly.

How to Investigate

  1. Open Chrome DevTools → Performance tab
  2. Click Record and reload the page
  3. Focus on:
    • Main thread activity
    • Long tasks during page load
    • Script execution timing

In the example below, you can see how editor scripts and styles delay rendering and push LCP beyond the recommended threshold.

Chrome DevTools Performance panel showing delayed LCP caused by render-blocking editor scripts and styles executing on the main thread.
Chrome DevTools Performance panel showing delayed LCP caused by render-blocking editor scripts and styles executing on the main thread.

Notice how the LCP marker appears only after the editor scripts finish executing. This is a clear sign of render-blocking behavior.

Note: For demonstration purposes, the editor script loading was intentionally delayed to make its impact on Core Web Vitals more visible in DevTools. In a production environment, this behavior should be replaced with proper lazy loading and optimized loading strategies.

What You’re Looking For

  • Large blocks of JavaScript execution before content renders
  • Editor scripts running early in the timeline
  • Delays before the largest visible element appears

Common Editor-Related Causes

  • Large editor bundles loading upfront
  • Editor scripts executing before critical content
  • Blocking CSS required for editor UI
  • Fonts used inside the editor delaying rendering

How to Interpret It

If you see long tasks tied to editor scripts early in the timeline, it’s a strong indicator that:

The editor is delaying the browser from rendering the main content, directly impacting LCP.

3.2 Analyzing CLS (Cumulative Layout Shift)

Target: < 0.1

CLS issues caused by editors are often subtle, but very visible once you know where to look.

How to Investigate in DevTools

1. Open Chrome DevTools → Performance

2. Enable:

 

    • Layout Shift Regions

Enable Layout Shift Regions

3. Record a page load

What You’ll See

Highlighted areas on the page where layout shifts occur.

What to Focus On

  • Editor container resizing after load
  • Toolbar appearing or expanding late
  • Content being pushed down when the editor initializes

Common Editor-Related Causes

  • Toolbar injected after initial render
  • Editor height expanding dynamically
  • Fonts loading late and reflowing content
  • Images or media inserted without defined dimensions
  • iframe-based editors resizing after initialization

How to Interpret It

If the highlighted regions overlap with your editor area, then:

Your editor is introducing layout instability, directly increasing CLS.

3.3 Analyzing INP (Interaction to Next Paint)

Target: < 200 ms

While Lighthouse gives a high-level view of responsiveness, DevTools helps you pinpoint which interactions feel slow and why.

How to Investigate

  1. Open DevTools → Performance tab
  2. Click Record
  3. Interact with the editor:
    • Type text
    • Click toolbar buttons
    • Paste content
devtools performance panel showing high INP caused by slow wysiwyg editor interaction and long main thread blocking
Chrome DevTools Performance recording showing high INP caused by long main-thread tasks during editor interactions.

In this example, user input triggers long-running tasks on the main thread (highlighted in red), delaying the next visual update and significantly increasing INP.

What to Look For

  • Long tasks (>50ms) triggered by interactions
  • Delays between input and visual updates
  • Repeated heavy scripting during typing

Common Editor-Related Causes

  • Heavy plugins running on every keystroke
  • Auto-save or API calls triggered too frequently
  • Real-time formatting or preview logic
  • Complex DOM updates during input

How to Interpret It

If typing or clicking triggers long tasks in the main thread, it means:

The editor is slowing down interaction responsiveness, negatively affecting INP.

Key Takeaway from Step 3

At this point, you should be able to clearly map each performance issue back to a specific cause:

  • LCP issue → Editor loading or executing too early
  • CLS issue → Editor layout not stabilized
  • INP issue → Editor interactions doing too much work

This clarity is what allows you to move from guessing → to targeted optimization.

Step 4: Actionable Debugging & Fixes

Now comes the part developers care about most: fixing things.

4.1 Bundle & Loading Optimizations

Problem

Editor loads too early and too heavily → hurts LCP

Fix Strategies

1. Lazy Load the Editor

Load only when needed (e.g., on focus).

See: Lazy loading the Froala editor

This is one of the highest-impact optimizations you can make.

2. Code Splitting

  • Separate editor bundle from main app
  • Load only on pages that need it

3. Reduce Plugin Load

  • Remove unused plugins
  • Avoid “load everything” configs

4. Use CDN + Optimized Delivery

As a foundation, follow general rich text editor load time optimizations.

4.2 CLS Mitigation (Stabilize Layout)

Problem

Editor UI shifts layout after load

Fix Strategies

1. Pre-Define Editor Dimensions

.editor-container {

 min-height: 300px;

}

Prevents layout jumps during initialization

2. Use Editor Height Configuration

Use options like:

  • heightMin
  • heightMax

Refer to Froala docs for correct usage

3. Reserve Toolbar Space

  • Pre-allocate toolbar height
  • Avoid late injection shifts

4. Ensure Media Has Dimensions

When users insert:

  • Images
  • Videos

Always define width & height

5. Control UI Layout

Use structured UI patterns like:

controlling editor UI layout

4.3 INP Improvements (Make Interactions Fast)

Problem

Editor interactions feel slow

Fix Strategies

1. Debounce Heavy Operations

Example use cases:

  • Auto-save
  • Preview updates
  • API calls

2. Reduce Plugin Complexity

Ask yourself:

Do I really need this plugin while typing?

3. Optimize Event Handlers

  • Avoid expensive logic on every keystroke
  • Batch updates instead of real-time processing

4. Defer Non-Critical Features

  • Spellcheck
  • Analytics
  • Background formatting

4.4 Reduce Editor Bundle Size

This directly impacts LCP + INP

Techniques

  • Load only required plugins
  • Remove unused themes
  • Avoid loading all language packs
  • Tree-shake unused modules

This directly reinforces the benefits of a lightweight WYSIWYG editor, where smaller bundles lead to faster load times and more responsive interactions.

Step 5: Automate Monitoring (Production-Level Insight)

Manual debugging is not enough. You need real-world data.

Using Web Vitals API

You can track Core Web Vitals programmatically.

You can use the web-vitals library to capture Core Web Vitals in real time and monitor how pages with embedded editors perform in production.

Example (Generic)

import { onLCP, onCLS, onINP } from 'web-vitals';

function sendToAnalytics({ name, delta, value, id }) {
  // Example sending to a generic analytics service
  console.log('Sending to analytics:', { name, delta, value, id });
  // myAnalyticsService.sendMetric({ name, delta, value, id }); 
}

onLCP(sendToAnalytics);
onCLS(sendToAnalytics);
onINP(sendToAnalytics);

Pro Tip

Tag editor pages specifically:

if (window.location.pathname.includes('editor')) {
 // Log metrics for editor pages only
}

What You’ll Gain

  • Real user data (not just lab tests)
  • Editor-specific performance tracking
  • Long-term monitoring

Diagnosis & Fix Cheat Sheet

MetricHow to MeasureCommon Editor CauseFix
LCPDevTools PerformanceLarge JS bundle, blocking scriptsLazy load, code split
CLSLayout Shift overlayToolbar injection, resizingPre-define height
INPInteraction recordingHeavy plugins, event handlersDebounce, simplify logic

Step 6: Prioritize Fixes (Don’t Waste Time)

Not all issues matter equally.

If LCP is Poor

Focus on:

  • Bundle size
  • Lazy loading
  • Script loading order

If CLS is High

Focus on:

  • Editor container stability
  • Toolbar layout
  • Media dimensions

If INP is Slow

Focus on:

  • Input handling
  • Plugin weight
  • Event optimization

Step 7: Verify the Fix

After implementing changes:

  1. Re-run Lighthouse
  2. Re-record DevTools Performance
  3. Compare before vs after

Always take screenshots to validate improvements

Final Thoughts

Debugging WYSIWYG editor performance isn’t about guessing. It’s about measuring, isolating, and fixing with precision.

Once you follow this workflow, you move from:

“My Lighthouse score dropped”
to
“I know exactly what the editor is doing—and how to fix it.”

Instead of spending hours debugging performance issues after integration, start with a solution designed for speed.

Try Froala’s Performance-Optimized Editor
A lightweight, configurable editor built to help you hit Core Web Vitals targets without sacrificing features.

Start your free trial today.

Explore More

  • Dive into Froala configuration options in the official docs (height control, plugin management, lazy loading)
  • Apply the techniques in this guide to your existing implementation

FAQs

1. How do I debug the WYSIWYG editor’s impact on Core Web Vitals?

Compare pages with and without the editor using Lighthouse. Then use Chrome DevTools Performance panel to analyze LCP delays, detect layout shifts (CLS), and identify long tasks affecting INP to isolate the editor’s performance impact.

2. Why does a WYSIWYG editor affect LCP, CLS, and INP?

WYSIWYG editors load large scripts and styles that delay rendering (LCP), dynamically inject UI elements causing layout shifts (CLS), and run heavy interaction logic that creates main-thread delays, increasing INP.

3. How can I optimize a WYSIWYG editor for Core Web Vitals?

Optimize by lazy loading the editor, reducing unused plugins, and splitting bundles to improve LCP. Prevent CLS by stabilizing layout dimensions, and improve INP by debouncing heavy operations and simplifying interaction logic.

graphical user interface, text

How to highlight Code Snippets Inside Iframe Mode

highlight Code Snippets Inside Iframe Mode

You’ve styled your code snippets beautifully in Froala’s normal mode. Syntax highlighting works. Everything looks professional. Then you switch to iframe mode for security and isolation, and your code snippets turn into plain, unstyled text.

This isn’t a bug. It’s the nature of iframes: they’re sandboxes. Styles don’t cascade across the boundary. But Froala offers an easy solution to this, and it’s worth solving because iframe mode offers real protection and stability that normal mode can’t match.

This guide shows you exactly why this happens and how to make code snippets look great in iframe mode.

Key Takeaways

  • The Code Snippet plugin uses Prism.js for syntax highlighting. Prism must be loaded on the page for the plugin to work.
  • Iframe mode isolates content, so styles stay scoped to each document. You must inject stylesheets into the iframe for highlighting to work.
  • Use iframeStyleFiles as your primary solution. It’s the recommended, cleanest way to load external stylesheets like Prism themes and plugin CSS into the iframe. It’s more maintainable than embedding CSS strings.
  • Understand the three iframe styling options:
    • iframeDefaultStyle: Froala’s foundation.
    • iframeStyle: Quick inline tweaks and custom rules.
    • iframeStyleFiles: External libraries and frameworks. Use this for syntax highlighting.
  • Choose iframe mode for production. The extra security, CSS isolation, and predictable rendering outweigh the minimal performance cost.

Why Code Snippets Break in Iframe Mode

When you embed content in an iframe, you’re creating an isolated document environment. Think of it like a separate webpage inside your webpage. CSS from the parent page doesn’t leak in. JavaScript events don’t cross the boundary. It’s sealed.

That’s powerful for preventing conflicts and security issues. It’s terrible for styling.

In normal mode, your code snippet styles live in the parent document’s stylesheet. The highlighting library (Prism.js) applies classes, and your CSS colors them. Seamless.

In iframe mode, that stylesheet isn’t there. The iframe has its own <head> and <body>. Your styles are orphaned on the other side of the sandbox wall. The code renders naked.

Understanding Froala’s Modes: Normal vs. Iframe

Normal Mode: Froala injects the editor content directly into the DOM of your page. It’s fast, simple, and convenient. Styles inherit naturally. But it’s also vulnerable to CSS conflicts and less isolated from the rest of your application.

new FroalaEditor("div#froala-editor");

Iframe Mode: Froala creates an actual iframe element and renders the editor inside it. The editor content lives in a completely separate document. This isolation prevents CSS leakage and protects your editor from unexpected style interactions. The tradeoff: you have to explicitly bring in everything the editor needs, stylesheets, fonts, syntax highlighting.

new FroalaEditor("div#froala-editor",{

iframe: true

});

When to Use Iframe Mode (and When to Skip It)

Use iframe mode when:

  • You need strong style isolation (your page has aggressive CSS that might interfere)
  • Security matters (you’re handling untrusted content)
  • You want predictable rendering across different page contexts
  • You’re building a reusable editor component that should look the same everywhere

Skip iframe mode when:

  • You control all the CSS and can guarantee no conflicts
  • Performance is critical (iframes add overhead)
  • You need tight integration with your page’s styling system
  • Your use case is simple and low-risk

Most professional applications, especially those handling user-generated content, lean toward iframe mode.

Froala’s Code Snippet Feature: The Basics

Froala has a built-in code snippet plugin that lets users insert, edit, and syntax-highlight code blocks. When you enable it, editors get a modal to choose a language, paste code, and format it with Prism.js syntax highlighting.

The plugin ships with support for JavaScript, TypeScript, Python, HTML, CSS, Java, C, SQL, and JSON. You can customize the available languages through the codeSnippetLanguage option.

The highlighting works by having Prism.js wrap code tokens in semantic <span> tags with class names like token stringtoken number, etc. The difference between normal and iframe modes: in iframe mode, unless you explicitly load Prism’s CSS inside the iframe, those spans are unstyled. You get the markup but no colors.

Setup in Normal Mode (The Baseline)

Here’s the standard setup in normal mode:

<!DOCTYPE html>
<html>
<head>
  <!-- Include Froala's CSS -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">
  
 
  <!-- Include Prism CSS for syntax highlighting -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css">
</head>
<body>
  <div id="editor"></div>

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
  
  
  <!-- Include Prism Core and Autoloader -->
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/components/prism-core.min.js"></script>

  
  <script>
    new FroalaEditor('#editor', {
      plugins: ['codeSnippet']
    });
  </script>
</body>
</html>

You load the plugin JS and CSS, include Prism.js and its CSS, and initialize Froala with the codeSnippet plugin enabled. The code snippets render with syntax highlighting. Simple.

Setup in Iframe Mode

In iframe mode, the primary way to inject stylesheets into the isolated iframe document is using the iframeStyleFiles option. This is the recommended approach because it’s clean, maintainable, and properly handles external resources.

<!DOCTYPE html>
<html>
<head>
  <!-- Include Froala's CSS -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">
  
</head>
<body>
  <div id="editor"></div>

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
  
  
  <!-- Include Prism Core and Autoloader -->
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/components/prism-core.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/plugins/autoloader/prism-autoloader.min.js"></script>
  
  <script>
    new FroalaEditor('#editor', {
      iframe: true,
      plugins: ['codeSnippet'],
      codeSnippetDefaultLanguage: 'javascript',
      iframeStyleFiles: [
        'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css'
      ]
    });
  </script>
</body>
</html>

The iframeStyleFiles array loads external CSS files directly into the iframe. Froala injects them as <link> tags in the iframe’s <head>, making the Prism highlighting theme and Code Snippet plugin styles available inside the sandbox.

Understanding Iframe Style Options

Froala offers three ways to style content inside an iframe. Understanding the difference ensures you use the right tool for each situation.

iframeDefaultStyle

This is Froala’s built-in baseline styling. It handles essential layout properties that the editor needs to function correctly, positioning, z-index, overflow, user selection behavior, and basic typography.

Default value:

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;}

You rarely need to modify this unless you’re doing something unconventional. It’s foundational and required for the editor to work properly.

iframeStyle

This is for custom inline CSS rules. You write CSS as a string and it gets injected as a <style> tag inside the iframe, layered on top of iframeDefaultStyle. Use this for small tweaks, custom fonts, padding adjustments, color overrides, or inline style rules you want to apply inside the editor.

Example:

iframeStyle: 'body{padding:20px;} pre{font-family:"Courier New",monospace;}'

iframeStyleFiles

This is for external CSS files. You pass an array of URLs (local or CDN), and Froala loads them as <link> tags inside the iframe. Use this for syntax highlighting libraries and larger CSS frameworks that live in separate files.

Example:

iframeStyleFiles: [

  'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css',

]

When to Use Each

  • iframeDefaultStyle: Leave it alone. It’s Froala’s foundation and necessary for the editor to function.
  • iframeStyle: Quick inline tweaks. Font changes, spacing adjustments, minor color overrides, or small style rules.
  • iframeStyleFiles: External libraries and plugins. This is the primary and recommended way to add syntax highlighting support in iframe mode. Use it for Prism themes, icon fonts, CSS frameworks, and any stylesheet that lives in a separate file.

Why iframeStyleFiles is the Right Approach

iframeStyleFiles is preferred for code highlighting because:

  • Cleaner configuration: One array of file URLs instead of embedding CSS strings.
  • Better maintainability: CSS lives in proper files, not configuration strings.
  • Proper resource loading: External stylesheets are handled the way they’re designed to be.
  • Easier debugging: You can inspect the iframe and see linked stylesheets in the Network tab.
  • Better performance: External files can be cached by the browser.

A Complete, Working Example

Here’s a full implementation with iframe mode and proper code snippet highlighting:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Froala Code Snippets in Iframe Mode</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">

  <style>
    body {
      font-family: sans-serif;
      max-width: 800px;
      margin: 40px auto;
    }
    #editor {
      border: 1px solid #ddd;
      min-height: 400px;
    }
  </style>
</head>
<body>
  <h1>Code Snippets in Iframe Mode</h1>
  <p>Use the toolbar to insert a code snippet and select your language.</p>
  <div id="editor"></div>

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/components/prism-core.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/prismjs@1.30.0/plugins/autoloader/prism-autoloader.min.js"></script>
  
  <script>
    new FroalaEditor('#editor', {
      iframe: true,
      plugins: ['codeSnippet'],
      codeSnippetDefaultLanguage: 'javascript',
      iframeStyleFiles: [
        'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css'
      ]
    });
  </script>
</body>
</html>

Drop this in a file, open it in your browser, and use the toolbar to insert a code snippet. The syntax highlighting should render perfectly inside the iframe.
code snippet insertion

Troubleshooting: What Might Still Break

Styles not applying? Check the browser console (right-click → Inspect → Console) and then the Network tab. Look for CORS errors or 404s on the CSS URLs in iframeStyleFiles. If the stylesheets can’t load, styles won’t apply.

Plugin not showing in toolbar? Make sure you’ve loaded the Code Snippet plugin JS before initializing Froala, and that you’ve included ‘codeSnippet’ in the plugins array.

Font looks wrong? You can add custom font imports to iframeStyle to complement your stylesheet files:

iframeStyle: '@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap"); pre { font-family: "JetBrains Mono", monospace; }',

iframeStyleFiles: [

  'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css'

]

Content looks cramped or overflows? Adjust padding and width by adding custom styles to iframeStyle or create a custom CSS file and add it to iframeStyleFiles.

FAQ

Can I customize the available languages?

Yes. Use the codeSnippetLanguage option to override the defaults:

new FroalaEditor('#editor', {

  iframe: true,

  plugins: ['codeSnippet'],

  codeSnippetLanguage: {

    'JavaScript': 'javascript',

    'Python': 'python',

    'Go': 'go'

  },

  iframeStyleFiles: [...]

});

What languages does the plugin support?

Out of the box: JavaScript, TypeScript, Python, HTML, CSS, Java, C, SQL, and JSON. Prism.js supports many more languages through its autoloader, just add them to codeSnippetLanguage and Prism will load the grammar automatically.

Why not just disable iframe mode?

You can, but you lose the isolation benefits. Iframes protect your editor from CSS interference and provide better encapsulation. For production apps, iframe mode offers more predictable rendering.

Does iframe mode affect performance?

Iframes add a small amount of overhead compared to normal mode. For most applications, the difference is negligible, and the isolation benefits make it worthwhile. 

How do I use different Prism themes?

Pass a different Prism theme URL to iframeStyleFiles. Popular Prism themes:

  • prism.min.css (default, light background)
  • prism-dark.min.css
  • prism-twilight.min.css
  • prism-okaidia.min.css

Example:

iframeStyleFiles: [

  'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-dark.min.css',

]

Can I customize the highlighting colors?

Yes. Write custom CSS in iframeStyle to override Prism token styles. For example:

iframeStyle: '.token.string { color: #your-custom-color; }'

Conclusion

The Code Snippet plugin paired with Prism.js syntax highlighting gives your users a professional, reliable way to share code. When you set it up correctly in iframe mode, the code doesn’t just look good, it looks consistent everywhere, protected from CSS interference, isolated from the chaos of the surrounding page.

You now have everything you need to build a robust, secure code editor. The path is clear: load your stylesheets, configure iframeStyleFiles, and let Prism do the highlighting work it was designed for.

Ready to implement this? Start with the complete working example above, test it locally, and integrate it into your Froala setup.

Want to explore more of what Froala can do? Visit Froala’s official documentation or try Froala Editor today to see the full range of plugins and customization options available.     

graphical user interface, text

Build vs. Buy: The Strategic Guide to Rich Text for Support Systems

Build vs Buy Rich Text Editor Decision for Support Systems

Customer support platforms have evolved far beyond simple ticket queues. Today’s enterprise support environments rely on structured responses, embedded screenshots, formatted troubleshooting steps, and knowledge-base links to guide customers through complex issues.

Yet many support platforms still treat rich text as a secondary feature.

If your team is evaluating whether to build or buy a rich text editor for your support ticket system, the decision is far more strategic than it appears. It affects:

  • Support agent productivity
  • Ticket resolution speed
  • Customer satisfaction scores (CSAT)
  • Engineering resource allocation
  • Long-term platform scalability

This guide provides a decision framework for engineering leaders evaluating the cost, risk, and long-term ROI of adding rich text capabilities to a support platform.

Instead of focusing on implementation details, we’ll examine the business case behind the decision.

Key Takeaways

  • Rich text editing is essential in modern support ticket systems. Features like bullet lists, screenshots, tables, and knowledge-base links help agents deliver clearer responses, improve first-contact resolution, and increase customer satisfaction (CSAT).
  • The build vs buy rich text editor support system decision has major strategic implications. It affects engineering resources, product roadmap priorities, and the long-term scalability of your customer service platform.
  • Building a custom WYSIWYG editor requires significant engineering investment. Developing core editing features, cross-browser compatibility, and image handling can take 6–9 months, with additional ongoing maintenance costs.
  • The real cost becomes clear in a 3-year cost model. Security updates, bug fixes, accessibility improvements, and feature upgrades can push the total cost of building a custom editor to $120K–$200K or more.
  • Buying a proven third-party editor often delivers faster ROI. Mature solutions provide advanced features, predictable costs, and easier customer service platform editor integration, allowing engineering teams to focus on core product innovation.

Why Rich Text Matters in Enterprise Support Platforms

In many support workflows, communication clarity determines whether a ticket closes quickly or escalates into a long thread of back-and-forth messages.

Plain text responses often force agents to write long explanations that are difficult for customers to follow. Rich text formatting dramatically improves clarity.

Common examples include:

  • Bullet lists for troubleshooting steps
  • Bold text to highlight critical instructions
  • Screenshots for UI guidance
  • Links to knowledge base articles
  • Tables for configuration instructions

Support ticket with troubleshooting steps

When agents can structure responses clearly, customers resolve issues faster.

This directly impacts key support metrics:

MetricImpact of Rich Text
First Contact ResolutionAgents can provide clearer step-by-step instructions
Average Resolution TimeFewer follow-up clarifications
Customer Satisfaction (CSAT)Customers understand solutions more quickly
Agent ProductivityFaster message composition

For organizations running large-scale customer service platforms, rich text editing is not just a convenience. It is an operational requirement.

This is why many teams start asking an important question:

Should we build our own editor or integrate a third-party solution?

The “Build” Pathway: Understanding the True Cost

At first glance, building an in-house editor might seem manageable. Many teams assume they can assemble a lightweight editing interface with a few open-source libraries.

In practice, building a production-grade rich text editor involves far more complexity than expected.

Initial Development Costs

A functional editor must support much more than basic formatting.

Typical baseline capabilities include:

  • Text formatting (bold, lists, headings)
  • Image insertion and resizing
  • Table editing
  • Clipboard handling (Word, Excel paste)
  • Undo/redo history
  • Mobile compatibility
  • Cross-browser behavior

Building these capabilities from scratch often requires several months of engineering work.

For example:

TaskEstimated Engineering Effort
Core editing architecture2–3 months
Clipboard handling (Word/Excel paste)1–2 months
Image management1 month
Cross-browser testing1 month
Toolbar UI & controls1 month

That places initial development around 6–9 engineering months.

Assuming an average fully loaded developer cost of $150K/year, the initial investment can easily exceed:

$75K – $120K in development costs.

And that is only the beginning.

The Maintenance Tax

Rich text editors require continuous maintenance.

The web platform evolves constantly. Browsers change behavior. Security vulnerabilities appear. Accessibility standards evolve.

Maintaining an editor means addressing:

Security alone can become a major responsibility.

For example, commercial editors regularly ship updates to address vulnerabilities and platform changes. A good example of the continuous security work required can be seen in Froala updates like Froala 4.1.3 Release – XSS vulnerability resolved, and more, which demonstrates how frequently security maintenance occurs.

Internal teams must either dedicate engineering time to this work or risk security exposure.

Over three years, maintenance often consumes another 1–2 developer months per year.

The Feature Gap

Even after the core editor is built, teams typically postpone advanced capabilities that significantly improve usability.

Common examples include:

  • Advanced image editing (cropping, resizing)
  • Seamless Word and Excel paste handling
  • Spell-check and grammar integrations
  • Document mode for longer responses
  • Flexible toolbar customization
  • Deep framework integrations

Rich text editor comparison - Build vs buy

These features directly influence support agent efficiency.

Without them, agents spend more time formatting responses manually.

Meanwhile, commercial editors already include many of these capabilities. For example, features like customizable editing toolbars are designed specifically for workflow optimization. A good example can be found in the guide Unlock the Power of Customizable Toolbars with Froala.

When companies build their own editors, these features often remain on the roadmap indefinitely.

The “Buy” Pathway: Evaluating a Vendor

Integrating a commercial editor shifts the problem from engineering development to vendor evaluation.

The key advantage of buying is that you offload long-term maintenance while gaining access to mature capabilities immediately.

But the decision still requires careful analysis.

Total Cost of Ownership (TCO)

The most useful comparison is a 3-year cost model.

Cost CategoryCustom BuildCommercial Editor
Initial development$75K–$120K$0
Maintenance$30K–$60KIncluded
Security updatesInternal engineeringVendor responsibility
Feature upgradesAdditional developmentIncluded
SupportInternal resourcesVendor support

Estimated 3-year cost:

ApproachEstimated Cost
Custom build$120K–$200K
Commercial license$10K–$40K (depending on scale)

The most important difference is predictability.

Custom builds create uncapped engineering costs, while vendor licensing provides predictable operational expenses.

Critical Evaluation Criteria for Support Platforms

Not all editors are suitable for customer service environments.

Support systems have specific requirements that go beyond basic content editing.

Below is a vendor evaluation checklist engineering leaders can use when selecting a rich text editor.

CriteriaWeightNotes
Security & ComplianceHighXSS protection, sanitization
PerformanceHighEditor should not slow ticket pages
CustomizationMediumToolbar control for support workflows
IntegrationHighReact, Angular, Vue compatibility
Vendor SupportMediumSLAs, documentation
CostMediumLicense vs development cost

If an editor fails in the security or performance categories, it should be removed from consideration immediately.

For teams comparing editors, guides such as Froala vs. CKEditor: Comparing JavaScript Rich Text Editors can help clarify capability differences.

Support-Specific Editor Requirements

Support ticket systems operate differently from general content platforms.

The editor must adapt to multiple user roles and workflows.

Internal vs External Content

Support agents require full rich text capabilities to craft structured responses.

Customers, however, may only need simplified formatting.

An ideal editor allows different configurations for different user roles.

For example:

User TypeEditor Configuration
Support AgentFull rich text toolbar
CustomerSimplified text input
Internal NotesFormatting + attachments

This flexibility is difficult to build internally but common in mature editors.

Knowledge Base Linking

Modern support teams rely heavily on knowledge base articles.

Agents frequently insert links to help customers find additional documentation.

An effective editor should allow quick insertion of links to internal documentation without complex formatting steps.

Image and File Uploads

Screenshots are essential in troubleshooting conversations.

Agents often need to show:

  • UI locations
  • Error messages
  • Configuration panels

Embedding images directly into responses dramatically improves comprehension.

Many modern editors support integrated upload workflows, similar to the architecture discussed in Enhancing a Lightweight WYSIWYG Editor with a File Uploader: A Developer’s Guide.

This allows agents to attach screenshots without leaving the ticket interface.

Clean HTML Output

Support responses are often reused in multiple channels:

  • Email notifications
  • Ticket history views
  • Knowledge base articles
  • Internal documentation

If the editor produces messy or inconsistent HTML, it can break templates or cause rendering problems in emails.

High-quality editors focus on producing clean, predictable HTML output to avoid these downstream issues.

The Strategic Decision Framework

The decision to build or buy ultimately depends on your organization’s priorities.

The following framework can help leadership teams evaluate their situation.

Decision FactorBuildBuy
Engineering capacity available
Time-to-market pressure
Editor innovation critical to product
Internal editor expertise
Support platform is core product
Support platform is internal tool

A useful guiding question is:

Is building an editor aligned with your company’s core business?

If your company builds developer tools or collaboration platforms, investing in editor development may make sense.

But if the editor exists only to support customer service workflows, building it internally often diverts engineering resources away from higher-value product work.

Why Many Support Platforms Choose Third-Party Editors

As support platforms scale, the need for reliability becomes critical.

Support agents rely on the ticket interface all day. Any instability in the editor directly affects productivity.

Commercial editors offer several advantages:

  • Mature editing engines refined over the years
  • Continuous security updates
  • Cross-browser stability
  • Performance optimization
  • Framework integrations

For example, editors like Froala are designed to integrate easily into modern web applications and support multiple frontend frameworks.

This reduces integration effort while giving teams a stable editing experience from day one.

For a broader overview of modern editor capabilities, the guide Why Froala RTE is A Premier Choice for Content Creation in 2025 offers a useful perspective.

Callout: The Hidden Opportunity Cost

One of the most overlooked costs of building an editor is opportunity cost.

Every month spent maintaining editing infrastructure is a month your engineering team is not improving core product capabilities.

Security patches, browser compatibility updates, accessibility fixes, and bug reports may seem minor individually. But over time, they accumulate into a permanent maintenance workload.

For many organizations, the real question is not whether they can build a rich text editor, but whether maintaining one aligns with their long-term product priorities.

Making the Final Decision

If you are evaluating the build vs buy rich text editor support system decision, the most important considerations are:

  1. Engineering time required to build and maintain an editor
  2. Long-term security and compliance responsibilities
  3. Feature completeness required by support teams
  4. Predictability of long-term costs
  5. Alignment with company strategic priorities

For most organizations building customer-facing support platforms, integrating a mature third-party editor is the most efficient path.

It allows engineering teams to focus on improving core product functionality rather than maintaining editing infrastructure.

FAQs

What features should a rich text editor support in a customer support ticket system?

A support ticket system editor should allow agents to structure responses clearly and efficiently. Key capabilities include bullet lists for troubleshooting steps, image uploads for screenshots, table support for configuration instructions, and links to knowledge base articles. Advanced editors also provide clean HTML output, customizable toolbars, and integrations with modern frameworks such as React, Angular, and Vue.

Is it better to build or buy a rich text editor for a support platform?

For most organizations, buying a third-party editor is more cost-effective than building one internally. Developing a production-grade editor requires months of engineering time and ongoing maintenance for security updates, browser compatibility, and accessibility compliance. Commercial editors provide mature features and predictable costs while allowing engineering teams to focus on core product development.

How much does it cost to build a custom WYSIWYG editor?

Building a custom editor typically requires 6–9 months of engineering work, depending on the feature set. When factoring in developer salaries, testing, and maintenance, the total cost can exceed $120K–$200K over three years. This is why many teams choose to license a commercial editor instead of maintaining their own editing infrastructure.

Why do support teams need rich text editing in ticket responses?

Rich text formatting helps support agents communicate solutions more clearly. Structured formatting such as bullet lists, bold text, screenshots, and links allows customers to follow instructions easily. This improves first-contact resolution rates and reduces the number of follow-up tickets.

What should companies look for when evaluating a rich text editor vendor?

Engineering leaders should evaluate editors based on security, performance, customization capabilities, framework integrations, and vendor reliability. Features such as XSS protection, clean HTML output, flexible toolbar configuration, and reliable documentation are essential when integrating an editor into an enterprise support platform.

Ready to Evaluate the Right Editor for Your Platform?

Choosing the right editor can accelerate your support platform roadmap while reducing engineering overhead.

Ready to see how a proven editor can support your support platform architecture?

Explore how Froala can power scalable content creation across your support workflows.

Talk to our solutions team to schedule a demo and evaluate the ROI for your platform.

graphical user interface, text

Building a Paint Format Plugin: A Case Study in Froala’s Clean Plugin Architecture

paint format

If you’ve ever used Microsoft Word or Google Docs, you’re familiar with the Format Painter tool—that magical brush icon that lets you copy formatting from one text block and apply it to another with a single click. It’s one of those features that seems simple on the surface but dramatically improves editing efficiency. Today, we’re going to build this exact functionality for Froala Editor, and in doing so, reveal the elegant architecture that makes Froala one of the most extensible WYSIWYG editors available.

Why This Matters: The Power of Custom Plugins

Froala Editor ships with an impressive array of features out of the box, but the real magic lies in its modular plugin architecture. Unlike monolithic editors that force you to work within rigid constraints, Froala treats extensibility as a first-class citizen.

This architectural decision means you’re never locked into a predetermined feature set. Need a custom workflow? Build a plugin.

The Paint Format feature we’re building today demonstrates several critical aspects of Froala’s architecture:

  • Clean API design that separates concerns between UI, state management, and content manipulation
  • Event-driven architecture that hooks into the editor’s lifecycle
  • Format API that abstracts away DOM complexity
  • Undo/redo integration that maintains editing history integrity
  • Toolbar integration that provides visual feedback and state management

Let’s dive into the code and see how these pieces fit together.

The Complete Paint Format Plugin: Architecture Overview

Our Paint Format plugin follows Froala’s standard plugin pattern, which consists of three main components:

  1. Icon Definition – Registers the visual representation in the toolbar
  2. Command Registration – Connects the toolbar button to plugin logic
  3. Plugin Implementation – Contains the core functionality and state management

Here’s the complete implementation with detailed explanations:

// ============================================================
// FORMAT PAINTER (Paint Format) PLUGIN FOR FROALA V5
// ============================================================

(function (FroalaEditor) {

 // ------------------------------------------------------------
 // 1️⃣ Define Toolbar Icon
 // ------------------------------------------------------------
FroalaEditor.DefineIcon("paintFormat", {

 template: "svgMultiplePath",

 PATHS: ``,

 VIEWBOX: "0 0 1024 1024",

});

 // ------------------------------------------------------------
 // 2️⃣ Register Toolbar Command
 // ------------------------------------------------------------
 FroalaEditor.RegisterCommand('paintFormat', {
   title: 'Paint Format',
   focus: false,
   undo: true,
   refreshAfterCallback: false,

   callback: function () {
     this.paintFormat.toggle();
   },

   refresh: function ($btn) {
     if (this.paintFormat.isActive()) {
       $btn.addClass('fr-active');
     } else {
       $btn.removeClass('fr-active');
     }
   }
 });

 // ------------------------------------------------------------
 // 3️⃣ Plugin Definition
 // ------------------------------------------------------------
 FroalaEditor.PLUGINS.paintFormat = function (editor) {

   let active = false;
   let storedFormats = null;

   // ==========================================================
   // CAPTURE FORMATTING FROM CURRENT SELECTION
   // ==========================================================
   function captureFormats() {
     const element = editor.selection.element();
     if (!element) return;

     const computed = window.getComputedStyle(element);

     storedFormats = {
       bold: editor.format.is('strong'),
       italic: editor.format.is('em'),
       underline: editor.format.is('u'),
       strike: editor.format.is('strike'),

       fontSize: computed.fontSize,
       color: computed.color,
       backgroundColor: computed.backgroundColor,
       fontFamily: computed.fontFamily,

       textAlign: computed.textAlign
     };
   }

   // ==========================================================
   // APPLY STORED FORMATTING TO NEW SELECTION
   // ==========================================================
   function applyFormats() {
     if (!storedFormats) return;

     editor.undo.saveStep();

     if (storedFormats.bold) editor.format.apply('strong');
     if (storedFormats.italic) editor.format.apply('em');
     if (storedFormats.underline) editor.format.apply('u');
     if (storedFormats.strike) editor.format.apply('strike');

     if (storedFormats.fontSize) {
       editor.format.applyStyle('font-size', storedFormats.fontSize);
     }

     if (storedFormats.color) {
       editor.format.applyStyle('color', storedFormats.color);
     }

     if (
       storedFormats.backgroundColor &&
       storedFormats.backgroundColor !== 'rgba(0, 0, 0, 0)'
     ) {
       editor.format.applyStyle(
         'background-color',
         storedFormats.backgroundColor
       );
     }

     if (storedFormats.fontFamily) {
       editor.format.applyStyle('font-family', storedFormats.fontFamily);
     }

     if (storedFormats.textAlign) {
       const blocks = editor.selection.blocks();
       if (blocks && blocks.length) {
         blocks.forEach(block => {
           block.style.textAlign = storedFormats.textAlign;
         });
       }
     }

     editor.undo.saveStep();
   }

   // ==========================================================
   // TOGGLE PAINTER MODE
   // ==========================================================
   function toggle() {
     if (!active) {
       captureFormats();
       if (!storedFormats) return;
       active = true;
     } else {
       active = false;
     }
     editor.toolbar.refresh();
   }

   function isActive() {
     return active;
   }

   // ==========================================================
   // EVENT BINDINGS
   // ==========================================================
   function bindEvents() {
     editor.events.on('mouseup', function () {
       if (!active) return;

       setTimeout(function () {
         if (editor.selection.isCollapsed()) return;
         applyFormats();
       }, 0);
     });

     editor.events.on('keydown', function (e) {
       if (e.key === 'Escape' && active) {
         active = false;
         editor.toolbar.refresh();
       }
     });
   }

   function _init() {
     bindEvents();
   }

   return {
     _init: _init,
     toggle: toggle,
     isActive: isActive
   };
 };

})(FroalaEditor);

Breaking Down the Architecture

Want to see this in action? Try the Paint Format plugin live on JSFiddle — click the paint brush icon, select some text with different formatting, then paint that style onto other content. It’s the fastest way to understand how all these pieces work together in real time.

Icon Definition: Visual Identity

The first step in creating any toolbar-based plugin is defining its visual representation. Froala’s DefineIcon method provides a flexible system that supports both FontAwesome icons and custom SVG graphics:

FroalaEditor.DefineIcon("paintFormat", {
 template: "svgMultiplePath",
 PATHS: ``,
 VIEWBOX: "0 0 1024 1024",
});

The template: "svgMultiplePath" property instructs Froala to render this as an inline SVG graphic, giving you complete control over the icon’s visual appearance. The PATHS property contains the full SVG path data that defines the shape of the paint bucket icon—a detailed vector graphic that scales perfectly at any size. The VIEWBOX: "0 0 1024 1024" establishes the coordinate system for the SVG, defining a 1024×1024 viewbox that ensures consistent rendering. By using inline SVG instead of external icon libraries or font icons, you eliminate dependencies on third-party icon sets and gain complete flexibility over styling, animation, and appearance. The icon identifier ('paintFormat') becomes the namespace for your entire plugin—a convention that keeps the codebase organized and prevents naming collisions.

Command Registration: Bridging UI and Logic

The RegisterCommand method is where UI meets functionality. This is Froala’s way of creating a clean separation between presentation and business logic:

FroalaEditor.RegisterCommand('paintFormat', {
 title: 'Paint Format',
 focus: false,
 undo: true,
 refreshAfterCallback: false,

 callback: function () {
   this.paintFormat.toggle();
 },

 refresh: function ($btn) {
   if (this.paintFormat.isActive()) {
     $btn.addClass('fr-active');
   } else {
     $btn.removeClass('fr-active');
   }
 }
});

The callback function executes when the user clicks the toolbar button. Notice how it delegates to this.paintFormat.toggle()—this is Froala’s plugin system in action. The this context refers to the editor instance, and paintFormat is automatically available because we’re defining it in the PLUGINS namespace.

The refresh function is called whenever the toolbar updates, allowing us to maintain visual state. By adding or removing the fr-active class, we create that satisfying toggle effect where the button stays highlighted while Paint Format mode is active.

Plugin Core: State Management and Format Manipulation

The heart of our plugin lives in the PLUGINS.paintFormat function. This follows the revealing module pattern, exposing only the methods that need to be public while keeping internal state private:

FroalaEditor.PLUGINS.paintFormat = function (editor) {
 let active = false;
 let storedFormats = null;

 // ... implementation

 return {
   _init: _init,
   toggle: toggle,
   isActive: isActive
 };
};

The editor parameter gives us access to Froala’s entire API surface. The two state variables—active and storedFormats—maintain the plugin’s operational state across user interactions.

Capturing Formats: Reading the DOM Intelligently

The captureFormats function demonstrates Froala’s hybrid approach to content manipulation—combining high-level API calls with direct browser APIs when appropriate:

function captureFormats() {
 const element = editor.selection.element();
 if (!element) return;

 const computed = window.getComputedStyle(element);

 storedFormats = {
   bold: editor.format.is('strong'),
   italic: editor.format.is('em'),
   underline: editor.format.is('u'),
   strike: editor.format.is('strike'),

   fontSize: computed.fontSize,
   color: computed.color,
   backgroundColor: computed.backgroundColor,
   fontFamily: computed.fontFamily,

   textAlign: computed.textAlign
 };
}

Notice the strategic use of two different APIs:

  1. Froala’s Format API (editor.format.is()) for semantic HTML elements like and . This approach respects Froala’s internal representation and ensures compatibility with other plugins.
  2. Browser’s Computed Style API (window.getComputedStyle()) for CSS properties like font size and color. This captures the actual rendered appearance, regardless of how it was applied (inline styles, CSS classes, or inherited styles).

This hybrid approach is crucial. If we only used DOM inspection, we’d miss semantic formatting. If we only used Froala’s API, we’d miss CSS-based styling. By combining both, we capture the complete formatting picture.

Applying Formats: Writing Changes Safely

The applyFormats function is where we modify the document. This is also where Froala’s architecture really shines:

function applyFormats() {
 if (!storedFormats) return;

 editor.undo.saveStep();

 if (storedFormats.bold) editor.format.apply('strong');
 if (storedFormats.italic) editor.format.apply('em');
 if (storedFormats.underline) editor.format.apply('u');
 if (storedFormats.strike) editor.format.apply('strike');

 if (storedFormats.fontSize) {
   editor.format.applyStyle('font-size', storedFormats.fontSize);
 }

 // ... more formatting applications

 editor.undo.saveStep();
}

The editor.undo.saveStep() calls bookend our changes, creating a single undo point for the entire format application. This is critical for user experience—users expect one undo to reverse the entire Paint Format operation, not each individual style change.

The editor.format.apply() and editor.format.applyStyle() methods handle all the complexity of:

  • Splitting text nodes at selection boundaries
  • Wrapping content in appropriate HTML elements
  • Merging adjacent identical formatting
  • Maintaining proper nesting hierarchy
  • Preserving the selection after changes

If you tried to implement this with raw DOM manipulation, you’d need hundreds of lines of code and countless edge case handlers. Froala’s Format API abstracts all of this away.

Event Handling: Responding to User Actions

The bindEvents function wires up our plugin to the editor’s event system:

function bindEvents() {
 editor.events.on('mouseup', function () {
   if (!active) return;

   setTimeout(function () {
     if (editor.selection.isCollapsed()) return;
     applyFormats();
   }, 0);
 });

 editor.events.on('keydown', function (e) {
   if (e.key === 'Escape' && active) {
     active = false;
     editor.toolbar.refresh();
   }
 });
}

The mouseup event handler is where the magic happens. When Paint Format mode is active and the user releases the mouse button (completing a selection), we apply the stored formatting. The setTimeout with zero delay is a common pattern that ensures the browser has updated the selection before we read it.

The keydown handler provides an escape hatch (literally)—pressing ESC deactivates Paint Format mode, giving users a quick way to cancel the operation without clicking the toolbar button again.

Integration: Adding the Plugin to Your Editor

Once you’ve created your plugin file (let’s call it froala-paint-format.js), integration is straightforward:

<!-- Include Froala core -->
<script src="froala_editor.min.js"></script>

<!-- Include your custom plugin -->
<script src="froala-paint-format.js"></script>

<script>
  new FroalaEditor('#editor', {
    toolbarButtons: [
      'bold', 'italic', 'underline',
      '|',
      'paintFormat',  // Your custom button
      '|',
      'formatOL', 'formatUL'
    ]
  });
</script>

That’s it. No complex configuration, no build steps, no framework-specific adapters. The plugin automatically registers itself when the script loads, and you simply reference it by name in your toolbar configuration.

Why This Architecture Matters

The Paint Format plugin we’ve built demonstrates several architectural principles that make Froala exceptional for enterprise development:

1. Separation of Concerns: UI definition, command logic, and core functionality are cleanly separated, making the code maintainable and testable.

2. API-First Design: Instead of manipulating the DOM directly, we use Froala’s high-level APIs. This ensures our plugin remains compatible across editor versions and doesn’t conflict with other plugins.

3. Event-Driven Architecture: By hooking into the editor’s event system rather than polling or using timers, our plugin is efficient and responsive.

4. State Management: The plugin maintains its own state (active, storedFormats) without polluting the global scope or the editor’s internal state.

5. User Experience Focus: Features like the toggle button state, ESC key handling, and undo integration show attention to the details that make software feel polished.

Extending Further: Ideas for Enhancement

The beauty of Froala’s plugin system is that it’s infinitely extensible. Here are some ways you could enhance this Paint Format plugin:

  • Multiple Format Storage: Allow users to store multiple format “presets” and switch between them
  • Format Library: Create a dropdown that shows recently used formats
  • Selective Format Application: Add a modal that lets users choose which aspects of formatting to apply (colors only, fonts only, etc.)
  • Cross-Editor Sync: Store formats in localStorage to persist across page reloads or even different editor instances
  • Keyboard Shortcuts: Add hotkey support for power users (Ctrl+Shift+C to copy format, Ctrl+Shift+V to paste)

Each of these enhancements would follow the same architectural patterns we’ve explored today, demonstrating how Froala’s design scales from simple plugins to complex feature sets.

Conclusion: The Power of Extensibility

Building a custom Paint Format plugin for Froala Editor reveals something profound about the editor’s architecture: it’s not just a tool for editing content—it’s a platform for building editing experiences. The same APIs we used to build this plugin power every feature in Froala, from basic text formatting to complex table manipulation.

This architectural consistency means that as you master Froala’s plugin system, you’re not just learning how to add one feature—you’re learning how to add any feature. Need custom validation? Build a plugin. Want to integrate with your company’s design system? Build a plugin. Need to support a proprietary content format? You know what to do.

The modular architecture also means you’re never locked in.

Ready to Build Your Own Froala Plugins?

The Paint Format plugin we’ve built today is just the beginning. Froala Editor’s extensible architecture empowers you to create exactly the editing experience your users need, without compromise.

Start your free trial of Froala Editor today and discover how easy it is to build custom features that integrate seamlessly with one of the most powerful WYSIWYG editors available.

Start Your Free Trial →

Whether you’re building a content management system, a collaborative editing platform, or a specialized document editor, Froala gives you the foundation to create something extraordinary. The code is clean, the APIs are intuitive, and the possibilities are limitless.

graphical user interface, text

Reducing Support Ticket Volume with Self-Service Knowledge Base Articles

Illustration of a self-service knowledge base showing questions turning into structured answers and checklists inside an open help book.

Support teams don’t drown because of complexity. They drown because of repetition.

Password resets. Billing questions. Feature explanations. Setup steps. The same tickets, over and over again.

If you’re researching how to implement self-service knowledge base infrastructure inside your product, you’re likely trying to solve one thing:

Reduce ticket volume without sacrificing user experience.

This guide is for developers, product managers, and support leads who are ready to operationalize ticket deflection. We’ll cover:

  • The business case (briefly).
  • The implementation architecture.
  • Why your editor choice directly impacts success.
  • The essential features that make or break a knowledge base.
  • A tactical content strategy for ticket deflection.
  • Integration and maintenance workflows.

This is not a theoretical content strategy article. It’s a practical implementation blueprint.

Key Takeaways

  • A well-implemented self-service knowledge base can reduce support ticket volume by 20–40% by resolving repetitive issues before they reach your team.
  • The quality of your editor directly impacts content clarity, maintainability, and long-term ticket deflection.
  • Clean HTML output, reliable paste handling, and structured formatting are essential when you implement self-service knowledge base infrastructure at scale.
  • Smart search that queries both titles and body content is critical for successful ticket deflection.
  • Surfacing relevant articles during ticket creation dramatically reduces submission rates.
  • Treat your editor as operational infrastructure, not just a UI component.

The Business Case: Why This Works

Industry data consistently shows that strong self-service support can reduce ticket volume by 20–40%. In mature implementations, that number can go even higher.

But the impact isn’t just ticket reduction:

  • Faster resolution times.
  • Lower support costs.
  • Higher customer satisfaction.
  • Reduced onboarding friction.
  • More scalable growth.

Here’s the key: ticket deflection is not a “content problem.” It’s a system design problem.

If your articles are hard to write, inconsistent in formatting, broken when pasted, or messy in HTML output, your knowledge base fails quietly.

Which brings us to architecture.

Core Implementation Architecture

When you implement self-service knowledge base systems properly, you’re building three core components:

1. Backend / Application Layer

  • Routes and article rendering.
  • Authentication & permissions.
  • Admin UI for support agents.
  • Search endpoint.
  • Analytics tracking.

Framework doesn’t matter. This applies to:

  • Laravel
  • Django
  • Node + Express
  • React-based admin panels
  • Vue dashboards
  • Angular enterprise apps

Example Snippet (Framework-agnostic Node example)

// GET article by slug
app.get('/kb/:slug', async (req, res) => {
  const article = await db.articles.findOne({
    slug: req.params.slug,
    status: 'published'
  });

  if (!article) {
    return res.status(404).render('404');
  }

  res.render('article', {
    title: article.title,
    content: article.body_html
  });
});

2. Database Layer

  • Articles table.
  • Categories.
  • Tags.
  • Revision history.
  • Search indexing.
  • Status (draft, published, archived).

You’re storing structured metadata + HTML body content.

 

const Article = {
  title: String,
  slug: String,
  body_html: String,
  status: { type: String, default: 'draft' },
  tags: [String]
};

Schema example:

 

CREATE TABLE articles (
  id SERIAL PRIMARY KEY,
  title VARCHAR(255) NOT NULL,
  slug VARCHAR(255) UNIQUE NOT NULL,
  body_html TEXT NOT NULL,
  category_id INT,
  status VARCHAR(20) DEFAULT 'draft',
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW()
);

Which leads to the most overlooked component.

3. The Editor Component (Critical Layer)

This is where most implementations fail.

Your editor determines:

  • Content consistency.
  • HTML cleanliness.
  • Media handling.
  • Accessibility compliance.
  • Ease of maintenance.
  • Agent adoption.

If your editor outputs messy markup or breaks formatting when content is pasted, you inherit long-term maintenance debt.

This is why a production-grade editor like Froala becomes a strategic asset, not just a UI widget.

Basic Froala initialization example:

<link href="https://cdn.jsdelivr.net/npm/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/froala-editor/js/froala_editor.pkgd.min.js"></script>

<div id="editor"></div>

<script>
  new FroalaEditor('#editor', {
    height: 400,
    toolbarButtons: [
      'bold', 'italic', 'underline',
      '|',
      'formatOL', 'formatUL',
      '|',
      'insertImage', 'insertLink',
      '|',
      'html'
    ]
  });
</script>

Learn more in Froala documentation.

Why the Editor Quality Directly Impacts Ticket Deflection

Let’s connect the dots clearly.

Ticket deflection depends on:

  • Clear instructions.
  • Proper formatting.
  • Embedded visuals.
  • Easy scanning.
  • Consistent styling.
  • Fast updates.

Every one of those depends on editor capabilities.

If your support agents struggle to format content, insert images, or paste from internal docs, they will:

  • Avoid updating articles.
  • Create inconsistent content.
  • Publish messy help pages.
  • Reduce trust in your knowledge base.

And once users don’t trust it?

They open tickets instead.

When you implement self-service knowledge base systems, the editor is the production engine behind every article.

Essential Features of a Knowledge Base Editor

Let’s go feature by feature, from a developer and support-ops perspective.

1. Rich Text Formatting (Clarity Drives Deflection)

Help articles must support:

  • Headings (H2, H3).
  • Numbered lists.
  • Bullet points.
  • Bold text for emphasis.
  • Code snippets.
  • Tables.

Clear formatting enables scannability.

Users rarely read full articles. They scan.

If your editor does not enforce structured heading hierarchy and semantic output, your content becomes visually dense and hard to use.

A proper WYSIWYG editor like Froala ensures:

  • Semantic HTML.
  • Clean heading structure.
  • Consistent formatting.
Froala WYSIWYG editor
Froala WYSIWYG editor

This matters for:

  • SEO.
  • Accessibility.
  • Screen readers.
  • Long-term maintainability.

2. Media Embedding (Visuals Reduce Cognitive Load)

Support articles without visuals increase ticket volume.

Screenshots + step numbers outperform text-only instructions every time.

Your editor must support:

  • Image uploads.
  • Image resizing.
  • Alt text.
  • Alignment control.
  • Video embeds.
  • GIF support.
Knowledge base article created with structured steps and embedded screenshots
Knowledge base article created with structured steps and embedded screenshots

If your image handling is weak, your support team won’t use visuals consistently.

For deeper implementation patterns, see:
5 Easy Image Integrations With A WYSIWYG HTML Editor

3. Clean HTML Output (The Technical Backbone)

This is where developers care most.

Messy HTML leads to:

  • Styling conflicts.
  • Broken layouts.
  • Security risks.
  • Rendering inconsistencies.
  • Search indexing problems.

When you implement self-service knowledge base systems, you are storing HTML in your database. That means:

  • It must be clean.
  • It must be predictable.
  • It must be safe.

Froala is built to output clean, structured HTML that works across:

  • SSR apps.
  • Static rendering.
  • CMS layers.
  • SPA frameworks.

You avoid “Word paste garbage markup” issues that plague simpler editors.

Froala WYSIWYG editor - HTML mode
Froala WYSIWYG editor – HTML mode

4. Reliable Pasting (Real-World Requirement)

Support agents don’t write everything from scratch.

They paste from:

  • Google Docs.
  • Word files.
  • Internal wikis.
  • Slack.
  • Notion.

If your editor mangles formatting or injects broken markup, your KB degrades fast.

For a deep dive into paste handling:
From Word and Excel to Froala Editor. Will it paste?

Reliable paste handling reduces:

  • Cleanup time.
  • Formatting inconsistencies.
  • Agent frustration.

5. Accessibility Features (Non-Negotiable)

Accessible help content is:

  • Legally safer.
  • Ethically responsible.
  • Better UX.
  • SEO-positive.

Your editor should support:

  • Proper semantic structure.
  • Alt text.
  • Keyboard navigation.
  • ARIA support.

If accessibility is part of your roadmap, this guide complements it:
9 Simple Ways To Increase Your Website’s Accessibility – Ultimate Guide

6. Custom Toolbar (Reduce Complexity for Agents)

Support agents don’t need:

  • 50 formatting options.
  • Complex styling menus.
  • Unnecessary plugins.

They need:

  • Headings.
  • Lists.
  • Bold.
  • Links.
  • Images.
  • Tables.

A customizable toolbar reduces cognitive overload and enforces content consistency.

If you’re integrating inside React:
Custom Buttons with React and Froala Editor

This isn’t cosmetic. It’s operational simplification.

Ready to empower your support team with an editor built for creating great help content? Start a free trial of Froala and see how easy it is to integrate.

Architecture Diagram: High-Level Flow

Architecture Diagram - High-Level Flow of a Knowledge Base

 

The editor sits at the content production layer.

Bad editor → Bad content → Higher tickets.
Good editor → Scannable content → Fewer tickets.

Actionable Content Strategy for Ticket Deflection

Tools alone don’t reduce tickets. Execution does.

Here’s the operational framework.

Step 1: Identify Top Ticket Drivers

Export your last 90 days of tickets.

Group by:

  • Topic.
  • Frequency.
  • Time-to-resolution.
  • Severity.

Create articles in this order:

  1. High frequency + low complexity.
  2. High frequency + moderate complexity.
  3. Onboarding friction points.
  4. Recurring configuration errors.

Do not start with edge cases.

Start with repetition.

Step 2: Write for Scanners

Every article should:

  • Use H2/H3 headings.
  • Use short paragraphs.
  • Bold key phrases.
  • Include numbered steps.
  • Include screenshots per major action.

Structure example:

Knowledge base article structure example

Scannable content reduces support escalations.

Step 3: Incorporate Visual Processes

Use a pattern:

  • Screenshot.
  • Numbered list.
  • Short explanation.
  • Expected outcome.

This reduces ambiguity.

Step 4: Implement Smart Search

Search must:

  • Query titles.
  • Query body content.
  • Support partial matches.
  • Rank by relevance.
  • Prioritize exact matches.

If your search is weak, users will abandon the KB and open tickets.

When you implement a self-service knowledge base architecture, search quality directly affects deflection rates.

Example:

const results = await searchClient.search({
  index: 'articles',
  query: {
    multi_match: {
      query: userQuery,
      fields: ['title^2', 'body_html']
    }
  }
});

Integration Into Support Flows

This is where deflection actually happens.

Surface Articles During Ticket Creation

Inside your ticket form:

  • User types issue.
  • The system suggests relevant articles dynamically.
  • Show top 3 matches.
  • Allow a quick preview.

Example:

input.addEventListener('input', async (e) => {
  const query = e.target.value;

  const res = await fetch(`/kb/search?q=${query}`);
  const suggestions = await res.json();

  renderSuggestions(suggestions.slice(0, 3));
});

This reduces submission rates significantly.

Link Articles in Agent Replies

Support agents should:

  • Paste KB links into responses.
  • Convert solved tickets into new articles.
  • Update articles when recurring confusion appears.

If article editing is easy (thanks to a good editor), this feedback loop works smoothly.

If editing is painful, it collapses.

Ongoing Maintenance & Governance

A knowledge base is not “set and forget.”

Establish:

  • Quarterly content audits.
  • Version tracking.
  • Ownership per category.
  • KPI tracking (views vs ticket rates).

Metrics to monitor:

  • Article views.
  • Bounce rate.
  • Search exit rate.
  • Ticket submission after KB visit.
  • Top search queries.

If you notice frequent searches with no matching articles, you’ve found your next article.

Comparison Snapshot: Weak Editor vs Production-Ready Editor

CapabilityBasic EditorProduction Editor (Froala)
Clean HTMLInconsistentStructured & predictable
Word PasteBreaks formattingReliable cleanup
Image HandlingLimitedRobust resizing + alt text
AccessibilityMinimalStructured semantic output
Custom ToolbarRareFully configurable
IntegrationManual effortFramework-friendly

This difference compounds over time.

Technical Implementation Mindset

When you implement self-service knowledge base systems, think like this:

  • The database stores content.
  • The frontend renders content.
  • The search indexes content.
  • The editor produces content.

If the production layer is weak, everything downstream suffers.

Editor capabilities like:

  • Clean HTML.
  • Reliable paste.
  • Image optimization.
  • Accessibility compliance.

Are not “nice to have.”

They are operational infrastructure.

Final Implementation Checklist

Before launch, confirm:

  • ✅ Editor outputs clean semantic HTML.
  • ✅ Images support alt text.
  • ✅ Search queries body + title.
  • ✅ Articles are structured with headings.
  • ✅ Toolbar simplified for agents.
  • ✅ Paste from Word tested.
  • ✅ Support flow surfaces articles dynamically.
  • ✅ Analytics tracking implemented.
  • ✅ Content review schedule defined.

If you can check all nine, you are ready to launch.

Conclusion: The Strategic Bridge Between UX and Operations

Reducing support ticket volume is not just about writing more help articles.

It’s about:

  • Building the right architecture.
  • Empowering your support team.
  • Choosing production-grade components.
  • Creating a feedback loop.
  • Maintaining quality at scale.

When you implement self-service knowledge base infrastructure properly, you’re not just publishing documentation.

You’re designing a scalable support system.

And at the center of that system?

The editor that makes great help content possible.

If you want ticket deflection to work long term, treat the editor as infrastructure, not a plugin.

graphical user interface, text

How Teams Ship Knowledge Bases Faster with an Embedded WYSIWYG Editor

Illustration of a rocket launching from a database and document interface, representing how teams build a knowledge base faster using an embedded WYSIWYG editor.

When teams decide to build a knowledge base faster, they usually think about architecture first: database schema, search indexing, permissions, navigation, and UI structure.

But here’s what actually slows most projects down:

The content layer.

You can scaffold a clean admin interface in a few days. You can wire up authentication and routing in a sprint. But the moment real articles need formatting, headings, lists, tables, screenshots, embedded videos, the cracks show.

A basic <textarea> isn’t enough. And building a full-featured editor from scratch is a rabbit hole most teams underestimate.

If you’re tasked with shipping an internal wiki or customer-facing documentation platform, this guide gives you a practical blueprint for solving the rich-text editing problem without derailing your timeline.

Key Takeaways

  • To build a knowledge base faster, you must optimize the content layer, not just the backend architecture.
  • An embedded WYSIWYG editor eliminates formatting friction, broken HTML, and manual cleanup, dramatically improving documentation velocity.
  • Clean, structured HTML output ensures consistency, scalability, and long-term maintainability for your knowledge base.
  • Media handling (image uploads, resizing, embedding) is essential for modern tutorials and support documentation.
  • Integrating a production-ready editor SDK lets your team focus on search, tagging, permissions, and information architecture instead of rebuilding rich-text functionality from scratch.

The Hidden Bottleneck in Knowledge Base Development

Most internal wiki development speed issues don’t come from backend complexity.

They come from:

  • Poor content creation workflows
  • Friction for non-technical contributors
  • Manual formatting cleanup
  • Broken HTML from copy-paste
  • Image handling chaos

Imagine this scenario:

Your support team needs to create a troubleshooting guide with:

  • Step-by-step numbered instructions
  • Screenshots with captions
  • Warning callouts
  • Links to related documentation
  • A comparison table

With a plain textarea? That becomes:

  • Raw HTML editing
  • Styling inconsistencies
  • Endless formatting corrections
  • Frustrated contributors

Now compare that to an embedded WYSIWYG for documentation that allows:

  • Click-to-format headings
  • Drag-and-drop image uploads
  • Clean list creation
  • Table insertion
  • Controlled styling

The difference in velocity is massive.

If your goal is to ship the internal wiki faster, the editing experience is not a nice-to-have. It’s infrastructure.

Core Technical Requirements for a Knowledge Base Editor

Not all editors are equal. When evaluating the best editor for knowledge base use, you need to think beyond formatting buttons.

Here’s what matters.

1. Structured, Clean HTML Output

Your knowledge base is not a social feed. It’s long-lived documentation.

The editor must produce:

  • Semantic headings (<h2>, <h3>)
  • Clean lists (<ul>, <ol>)
  • Proper tables
  • Accessible links
  • Predictable markup

Why?

Because your documentation:

  • Needs consistent styling
  • Must render cleanly across themes
  • Should remain SEO-friendly (if public)
  • Might be exported or reused later

A proper knowledge base editor integration ensures the output is stable and production-ready.

2. Media Handling (Non-Negotiable)

Modern documentation is visual.

You need:

  • Image upload
  • Resizing
  • Alignment
  • Basic management
  • URL handling for hosted media

If your KB includes tutorials, screenshots, or walkthroughs, poor media handling destroys workflow speed.

An embedded editor with backend SDK support (Node.js, PHP, Python, etc.) lets you connect uploads directly to your infrastructure.

3. Team-Friendly Tooling

Your contributors may include:

  • Support agents
  • Product managers
  • Technical writers
  • Engineers

They don’t want to think in HTML.

Your editor should support:

  • Bold, italic
  • Headings
  • Lists
  • Links
  • Tables
  • Horizontal rules
  • Clear formatting

And it should feel intuitive.

That’s what reduces friction in the knowledge base content creation workflow.

4. Customization & Control

You don’t want a bloated toolbar.

You want control.

That includes:

  • Showing only relevant buttons
  • Enforcing style classes
  • Integrating with your authentication system
  • Managing output sanitization

You can configure the toolbar using the toolbarButtons API option, for example:

['bold', 'italic', '|', 'paragraphFormat', '|',
'insertLink', 'insertImage', 'insertTable']

For deeper configuration details, see the official documentation of your editor and this tutorial on how to deep dive into customizing the toolbar.

5. Framework Agnosticism

Your editor must work within your stack.

Whether you’re using:

  • React
  • Vue
  • Angular
  • Or plain JavaScript

You should be able to drop it into your existing architecture.

If you’re building with React, for example, you can follow the Froala React integration guide to initialize the editor inside your component lifecycle.

The same applies to Vue and Angular—your editing layer shouldn’t force a framework change.

Build vs. Buy: Editor Component for Your Knowledge Base

This is where many teams lose weeks.

You have two options:

  1. Build an editor layer yourself
  2. Integrate a specialized editor SDK

Let’s compare.

FeatureBuilding In-HouseUsing an Editor SDK
Rich Text Editing EngineMonths of developmentProduction-ready
Paste Cleanup (Word/Docs)Complex edge cases to handleBuilt-in handling
Accessibility ComplianceManual implementation & testingPre-tested
Cross-Browser SupportOngoing fixesMaintained by vendor
Media Upload & HandlingCustom backend logic requiredSDK integration
Time to LaunchDelayed releaseFaster deployment
Long-Term MaintenanceYour responsibilityRegular updates

Building gives ultimate control.

But here’s the reality:

You’ll spend weeks solving problems that have already been solved:

  • Paste-from-Word cleanup
  • Cross-browser inconsistencies
  • Selection behavior bugs
  • Toolbar state syncing
  • Undo/redo stack stability

Meanwhile, your actual knowledge base features, search, tagging, permissions, and information architecture (IA) get delayed.

If your goal is to build a knowledge base faster, buying the editor layer and focusing on your differentiation is usually the smarter path.

Implementation Blueprint (Real-World Example): Froala in a React Knowledge Base Admin

This example shows the “content layer” wired the way most teams actually build it: a React admin page where editors write articles, save HTML to the database, and upload images through your backend.

If you haven’t set up Froala in React yet, follow our React integration guide first.

Step 1: Embed the editor inside your KB admin UI

In most knowledge base setups, you’ll run Froala inline inside a form (title, category, tags, body). Your app controls layout; the editor controls content.

Example React component skeleton (adapt to your setup):

// Example only — refer to the official React integration guide for exact setup.

import { useEffect, useMemo, useState } from "react";
// import FroalaEditorComponent from "react-froala-wysiwyg";

export default function KnowledgeBaseArticleEditor({ articleId }) {
  const [title, setTitle] = useState("");
  const [html, setHtml] = useState(""); // stored as HTML in DB

  // Load existing article HTML from your API
  useEffect(() => {
    async function loadArticle() {
      const res = await fetch(`/api/kb/articles/${articleId}`);
      const data = await res.json();
      setTitle(data.title);
      setHtml(data.bodyHtml); // initialize editor with stored HTML
    }
    if (articleId) loadArticle();
  }, [articleId]);

  const config = useMemo(
    () => ({
      // Keep KB toolbar focused (docs-style)
      toolbarButtons: [
        "bold",
        "italic",
        "underline",
        "|",
        "paragraphFormat",
        "formatOL",
        "formatUL",
        "|",
        "insertLink",
        "insertImage",
        "insertTable",
        "|",
        "clearFormatting",
      ],

      // Optional: simplify available heading styles for consistent IA
      paragraphFormat: {
        N: "Normal",
        H2: "Heading 2",
        H3: "Heading 3",
      },

      // Media upload: send images to your server endpoint
      imageUploadURL: "/api/kb/uploads/images",
      imageUploadMethod: "POST",

      // Optional constraints (adjust as needed)
      // imageAllowedTypes: ["jpeg", "jpg", "png", "gif", "webp"],
      // imageMaxSize: 5 * 1024 * 1024,

      // Useful for KB writing consistency
      // pastePlain: false,
    }),
    []
  );

  async function handleSave() {
    // Server-side: sanitize/validate HTML before storing
    await fetch(`/api/kb/articles/${articleId ?? ""}`, {
      method: articleId ? "PUT" : "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        title,
        bodyHtml: html, // editor output
      }),
    });
  }

  return (
    <div>
      <label>
        Title
        <input value={title} onChange={(e) => setTitle(e.target.value)} />
      </label>

      {/* <FroalaEditorComponent tag="textarea" model={html} onModelChange={setHtml} config={config} /> */}

      <button onClick={handleSave}>Save article</button>
    </div>
  );
}

Where this helps you ship faster: you’re not building formatting UI, paste behavior, or image insertion logic. You’re wiring the editor into your KB workflow (title → body → save → publish).

Step 2: Configure the toolbar for KB writing (not “everything”)

For the knowledge base content creation workflow, you want documentation-first buttons (headings, lists, links, images, tables), and you typically remove “decorative” features that create inconsistent styling.

If you want examples of tighter, role-based toolbars, take a deep dive into customizing the toolbar.

Step 3: Content lifecycle: save clean HTML, render consistently

Your core loop should stay simple:

Writer → Clean HTML → DB → Rendered KB page

  • Load: fetch bodyHtml and set it as the editor model
  • Edit: editor updates HTML state
  • Save: send HTML to your API
  • Render: your KB frontend displays the stored HTML with your styles

If you need to pull HTML directly from the editor instance (instead of the React model), you can use Froala’s API methods like editor.html.get()—but in React, most teams keep the HTML in state and save from there.

Step 4: Connect media uploads (the part that makes KBs feel “real”)

Your backend upload endpoint should:

  1. Receive the file from the editor
  2. Store it (disk/S3/object storage/etc.)
  3. Return a public URL (or signed URL strategy)
  4. The editor inserts that URL into the article HTML

If your KB backend is Node/Express, learn more about image management with our Node.js SDK.

Optional: Add “speed features” once the basics work

Once the editor is embedded, teams usually add velocity boosters:

Accelerating Workflows with Advanced Features

If you’re serious about internal wiki development speed, advanced editor features make a measurable difference.

Paste from Word / Google Docs

This alone can save hours per article.

Support agents often draft content in Word or Docs.

If your editor:

  • Strips styles correctly
  • Preserves lists
  • Maintains formatting

You eliminate manual reformatting.

You can see how Froala handles pasting from Word and Excel in this guide on how Froala handles pasting from Word.

Markdown Support

Many developers prefer Markdown shortcuts.

Supporting:

  • ## for headings
  • * for lists
  • **bold**

Gives dev-savvy writers a faster workflow while maintaining WYSIWYG output.

Quick Insert for Standardized Components

In knowledge bases, consistency matters.

Imagine one-click insertion of:

  • Info callouts
  • Warning boxes
  • Tips
  • Divider blocks

This standardizes structure and accelerates content creation.

Multiple Editors on One Page

Complex knowledge base admin interfaces may require:

  • Separate summary section
  • Main content
  • FAQ block
  • Sidebar content

You can support this using multiple editors on one page when structuring more advanced article layouts.

Knowledge Base vs LMS Editor Setup

A knowledge base is not an LMS.

An LMS focuses on:

  • Course progression
  • Modules
  • Quizzes
  • Student tracking

A knowledge base focuses on:

  • Reference documentation
  • Searchability
  • Article clarity
  • Rapid updates

Your editor setup should reflect documentation needs—not course delivery systems.

A Real-World Example

Let’s say your customer support team needs to publish 50 onboarding guides in a month.

Each guide includes:

  • Screenshots
  • Step lists
  • Internal links
  • Tables
  • Warning messages

Without an embedded WYSIWYG for documentation, that becomes a bottleneck.

With the right editor integrated:

  • Agents create content visually
  • Developers focus on search and permissions
  • Content velocity increases
  • Formatting consistency improves

That’s how you ship the internal wiki faster.

Get the complete React + Express knowledge base editor example here.

Final Thoughts: Remove the Content Layer Friction

Building a knowledge base is not hard.

Building one quickly, with high-quality, consistent content—that’s the real challenge.

If you want to build a knowledge base faster, treat the editor layer as infrastructure, not an afterthought.

Don’t spend weeks reinventing:

  • Editing engines
  • Paste cleanup logic
  • Media handling
  • Cross-browser testing

Instead:

  • Integrate a production-ready editor
  • Configure it for documentation
  • Connect it to your backend
  • Focus on your unique product features

Speed up your knowledge base development. Start a free trial of Froala and integrate a production-ready editor in an afternoon.

Explore framework-specific documentation for React, Vue, Angular, and more, and build the content layer your team deserves.

graphical user interface, text

Froala V5 Tables Are Worth the Upgrade from V3

Froala V5 tables are so good

Froala V5 makes tables faster to build, easier to format, and consistent by default. Multi-cell selection, proportional resizing, copy-paste cells, and automatic style defaults mean you spend minutes on tables instead of hours. The upgrade takes about 15 minutes, and your existing V3 tables render exactly as they did before.

The Takeaway

Froala V5 gives you:

  • Multi-cell formatting — Style entire rows or columns at once instead of clicking each cell.
  • Predictable resizing — Proportional resize keeps layouts balanced. Layouts stay balanced automatically.
  • Copy-paste cells — Move formatted cells around without re-entry.
  • Automatic defaults — Every new table arrives pre-formatted. Brand consistency, built in.

Together they cut table work from hours per month to minutes. If you build more than a handful of tables a month, the upgrade pays for itself in the first week.

The Froala V3 Tables

Froala V3 tables are powerful, but they’re friction-filled:

  • Formatting is slow: Want to style multiple cells? Click each one. Change the background color. Do it again. Again.
  • Resizing is unpredictable: Drag a border and watch your layout shift. No proportional resize. No safety net.
  • Every table starts from zero: No defaults. No presets. Every new table is manual labor.

Multiply that across dozens of articles a month, and you’re losing hours to table busy work.

Froala V5 Tables: Four Wins That Matter

1. Selection & Formatting (Stop Clicking Each Cell)

In V5, you can select multiple cells and format them all at once. Want to change the background color of an entire row? Select it. Done. Format entire rows or columns at once.

Two new popups make this even faster:

  • Cell Properties popup: Set background color, width, height, and padding in one place— All settings in one popup.
  • Table Properties popup: Adjust table background, width, height, alignment, border, and style without leaving the dialog.

Real impact: A table that took 15 minutes to format in V3 takes 3 minutes in V5.

table properties

2. Resizing & Layout Control

V5 gives you four resizing options—pick what fits your workflow:

  • Horizontal and vertical resizing: Drag table borders in any direction.
  • Proportional resize: Change one cell and others adjust automatically. Layouts stay proportional automatically.
  • Configurable trigger distance: Set how close to the border you need to be to grab the resizer (default: 5 pixels). Easier on touch devices and shaky hands.
  • Minimum size limits: Define the smallest a cell can be. Prevents accidental collapse.

You control it. The table doesn’t control you.

table resizing

3. Workflow Speed (Less Repetition, More Done)

Three features that cut friction:

  • Drag and drop tables: Reorder tables by dragging them. No cut-paste. No fumbling.
  • Copy-paste cells: Copy a cell and paste it elsewhere—content, formatting, everything. No re-entry.
  • Default table styles: Set your defaults once (alignment, height, background color, border color, width, border style)—every new table inherits them automatically.

Real impact: You set defaults once. Then you create 50 tables. All 50 look consistent without thinking about it.

table drag and drop

4. Customization and Brand Defaults

Define defaults for every table you create:

  • Default alignment (left, center, right)
  • Default height and width
  • Default background color
  • Default border color, width, and style

Insert a table, and it arrives pre-formatted. No guessing. No brand drift. Consistency from the first cell.

How to Upgrade (It’s Fast)

After you get your V5 key free:

Step 1: Back up your existing content.

Step 2: Install V5.

Step 3: Open a few existing documents. Your tables render the same. Backward compatible, no surprises.

Step 4: Try the new features on a new table. Drag to resize. Multi-select cells. Use the popups.

Step 5: Update your table templates to use the new defaults. One-time task, pays dividends forever.

Expected Total time: less than 15 minutes.

How to Configure V5 Tables

All these features are on by default, but you can customize them to match your workflow. Here’s what each config option does:

Enable Table Selection

Config: enableTableSelection: true

Click a table, and the whole thing highlights so you can delete or move it. This is the foundation for drag-and-drop.

Resizing Options

Config: tableResizer: true (default)

Enables cell resizing. Set it to false if you want fixed-width tables only.

Horizontal and Vertical:

If you enabled resizing tables, you can configure whether to allow resizing in both directions or lock it to horizontal or vertical only.

  • tableHorizontalResizer: true — Drag left/right to adjust column width.
  • tableVerticalResizer: true — Drag up/down to adjust row height.

Proportional Resize:

  • proportionalTableResize: true — When you resize one cell, others adjust proportionally to keep the table balanced.

Fine-tune the Resizer:

  • tableResizerOffset: 5 (default in pixels) — How close to the cell border you need to be to grab the resize handle. Lower values = easier to grab, but might accidentally trigger. Higher values = more precise but harder on touch devices. Start with 5, adjust if your users struggle.
  • tableResizingLimit: 20 (default in pixels) — Minimum cell width. Prevents cells from collapsing into nothing. If your content needs more breathing room, increase this to 30 or 40.

Multi-cell Formatting

Select multiple cells, right-click (or use the toolbar), and open the Cell Properties popup to format them all at once:

  • Background color
  • Width and height
  • Padding

Copy-Paste Cells

Select a cell, copy it (Ctrl+C / Cmd+C), then paste it elsewhere. Content and formatting come along.

Set Table Defaults (The Real Time-Saver)

Define what every new table looks like, automatically. Add these to your Froala config:

tableDefaultAlign: 'center', // 'left', 'center', 'right'

tableDefaultHeight: '50px', // or any CSS value

tableDefaultBGColor: '#ffffff', // background color

tableDefaultBorderColor: '#cccccc', // border color

tableDefaultBorderWidth: '1px', // border thickness

tableDefaultBorderStyle: 'solid' // 'solid', 'dashed', 'dotted', etc.

Now every table a user creates arrives pre-formatted. No more blank slate. No more guessing about brand consistency.

Example Configuration

Here’s a realistic example:

new FroalaEditor('#editor', {
  enableTableSelection: true,
  tableResizer: true,
  tableHorizontalResizer: true,
  tableVerticalResizer: true,
  proportionalTableResize: true,
  tableResizerOffset: 5,
  tableResizingLimit: 20,
  tableDefaultAlign: 'left',
  tableDefaultHeight: '40px',
  tableDefaultBGColor: '#ffffff',
  tableDefaultBorderColor: '#333333',
  tableDefaultBorderWidth: '1px',
  tableDefaultBorderStyle: 'solid'
});

Deploy this once, and all your editors benefit automatically. No training needed beyond “tables now look consistent.”

What You Gain

  • Time: Fewer clicks, fewer repetitions, faster formatting.
  • Control: Predictable resizing, proportional layouts, no surprises.
  • Consistency: Defaults mean every table looks right without thinking.
  • Sanity: Copy-paste cells instead of retyping. Drag tables instead of fumbling with cut-paste.

Ready?

The upgrade takes less than 15 minutes. Your existing tables render exactly as they did in V3—no conversion needed. You can start using new features on your next table.

There’s no reason to wait.

Get your V5 key free, follow the five steps above and get your users back to writing.

Generate PDF from HTML Content in Node.js Applications

Hand-drawn illustration of a browser window converting HTML content into a PDF document using a server-side Node.js workflow with a gear icon representing processing.

If you’re building a content-driven application, sooner or later you’ll face this requirement: convert HTML into a downloadable PDF on the server.

Maybe you’re generating invoices. Maybe you’re exporting reports. Maybe you’re allowing users to export editor content to PDF from a CMS or LMS.

If you’re working with clean HTML from a rich text editor like Froala, the good news is this: Node.js gives you powerful, production-ready options for server-side PDF generation.

In this guide, we’ll walk through:

  • The best libraries for NodeJS HTML to PDF
  • A direct comparison of Puppeteer, PDFKit, and jsPDF
  • How to implement server-side PDF generation in Express
  • Performance trade-offs and scaling considerations
  • Best practices for rendering WYSIWYG editor content to PDF                                                                                 

This is not a theory. This is implementation.

Why Server-Side PDF Generation in Node.js?

If you’re using a WYSIWYG editor like Froala, you’re already storing clean, structured HTML. For example, after integrating the Froala editor into your Node.js app, you’ll receive HTML via API and store it in your database.

That HTML becomes the input for your PDF service.

Server-side PDF generation in Node offers:                              

  • Full layout control
  • Access to custom fonts and assets
  • Secure processing (no client tampering)
  • Reliable export for invoices, reports, contracts
  • Better scaling for business workflows

Client-side PDF tools are useful, but this guide focuses strictly on server-side PDF generation Node workflows.

Comparing Node.js HTML to PDF Libraries

When evaluating the best HTML to PDF for NodeJS, three names dominate:

  1. Puppeteer
  2. PDFKit
  3. jsPDF

Let’s break them down properly.

1. Puppeteer (Recommended for Editor Content)

Best for: Rendering real HTML/CSS exactly as it appears in a browser.

Puppeteer is a headless Chrome automation library. It renders your HTML like a browser and exports the page as a PDF.

Why it’s ideal for WYSIWYG content

If you’re generating PDFs from rich editor output (tables, images, page breaks, styling), Puppeteer is the most reliable choice.

It supports:

  • Modern CSS
  • Web fonts
  • Images
  • Page break control
  • Complex layouts
  • Print CSS rules

Performance note: Puppeteer PDF generation can take approximately 1–3 seconds per document on average hardware, depending on complexity.

Core Puppeteer Implementation

Below is the standard, production-safe API pattern for generating a PDF from HTML:

const puppeteer = require('puppeteer');

async function generatePdfFromHtml(htmlContent) {
  const browser = await puppeteer.launch({
    headless: 'new',
    args: ['--no-sandbox', '--disable-setuid-sandbox']
  });

  const page = await browser.newPage();

  await page.setContent(htmlContent, {
    waitUntil: 'networkidle0'
  });

  const pdfBuffer = await page.pdf({
    format: 'A4',
    printBackground: true,
    margin: {
      top: '20mm',
      bottom: '20mm',
      left: '15mm',
      right: '15mm'
    }
  });

  await browser.close();

  return pdfBuffer;
}

That’s it. This is the standard Puppeteer HTML to PDF workflow.

Example: Convert HTML to PDF in Express

app.post('/convert-html-to-pdf', async (req, res) => {
  try {
    const { html } = req.body;

    const pdfBuffer = await generatePdfFromHtml(html);

    res.set({
      'Content-Type': 'application/pdf',
      'Content-Disposition': 'attachment; filename=document.pdf'
    });

    res.send(pdfBuffer);
  } catch (err) {
    res.status(500).json({ error: 'PDF generation failed' });
  }
});

This is a typical convert HTML to PDF Express implementation.

2. PDFKit

Best for: Programmatic PDF generation (not HTML rendering).

PDFKit is a pure nodejs pdf generation library. It does not render HTML. Instead, you manually construct PDFs using drawing commands.

Example:

const PDFDocument = require('pdfkit');

const doc = new PDFDocument();
doc.text('Hello world');
doc.end();

Strengths

  • Lightweight
  • No browser dependency
  • Great for invoices or simple documents
  • Fine-grained layout control

Limitations

  • Cannot directly render HTML
  • Requires manual layout logic
  • Not suitable for exporting WYSIWYG content

3. jsPDF

Best for: Client-side PDF generation (mostly).

While jsPDF can technically run in Node, it’s primarily browser-focused.

Why it’s usually not ideal here

  • Limited CSS support
  • No full HTML rendering
  • Better suited for front-end workflows

Since this guide focuses on server-side implementation, jsPDF is typically not the right tool.

Puppeteer vs PDFKit vs jsPDF

When developers search for PDFKit vs Puppeteer, the deeper comparison usually includes jsPDF as well.

Here’s the practical breakdown for NodeJS HTML to PDF use cases:

Feature Comparison

FeaturePuppeteerPDFKitjsPDF
Renders full HTML⚠️ Limited
Supports modern CSS⚠️ Basic
Browser-based rendering✅ (Headless Chrome)
Server-side ready⚠️ Not ideal
Lightweight
Ideal for WYSIWYG export
Print CSS support
Works with complex layouts⚠️ Limited
Requires Chromium

Why Clean HTML Matters

When generating PDFs from editor content, HTML quality directly affects rendering quality.

This is where Froala becomes important.

Froala produces:

  • Structured HTML
  • Semantic markup
  • Clean formatting                                                                                                        
  • Predictable output

That makes it an ideal input for generating PDF from HTML NodeJS workflows.

If you haven’t yet integrated Froala, review this guide:
…after integrating the Froala editor into your Node.js app.

Clean HTML means:

  • Fewer layout bugs
  • Reliable page breaks
  • Better print styling
  • Easier debugging

Structuring HTML for Better PDFs

If you’re exporting long documents, page control matters.

You can:

  • Add CSS page-break-before
  • Use @media print styles
  • Structure headings clearly

If you’re building document workflows, consider using the Page Break plugin to structure your HTML for PDF.

This approach is also complementary to Froala’s built-in Word export feature, giving users multiple document export options.

And if you’re building automated reports or templated outputs, explore ideas similar to workflows used for other document automation workflows.

Production Optimization Tips

If you’re implementing server-side pdf generation node services at scale, consider:

1. Browser Pooling

Launching a new Chromium instance for every request is expensive.

Use a browser pool to reuse instances.

2. Queue System

PDF generation is CPU-intensive.

Use:

  • Redis queues
  • Background workers
  • Rate limiting

3. Static Assets

Ensure:

  • Fonts are accessible
  • Images use absolute URLs
  • Assets load before networkidle0

4. Print-Specific CSS

Use:

@media print {
  body {
    font-size: 12pt;
  }
}

5. Page Break Control

 

.page-break {
  page-break-before: always;
}

This ensures your editor content renders exactly as expected.

Decision Framework: Which Library Should You Use?

Use this checklist:

Choose Puppeteer if:

  • You need full HTML rendering
  • You export WYSIWYG content
  • You need CSS support
  • You want accurate layout replication

Choose PDFKit if:

  • You’re generating simple PDFs
  • Layout is fully controlled programmatically
  • No HTML rendering is required

Avoid jsPDF (server-side) if:

  • You need production-grade HTML rendering

For most real-world editor workflows, Puppeteer is the best html to pdf for nodejs.

Complete Working Example: Froala → PDF Export

To make this implementation easier to test, we’ve created a full working example that connects:

  • A Froala editor page
  • A Node.js + Express backend
  • Puppeteer for server-side PDF rendering

In this example, you can:

  • Type rich content in Froala
  • Insert page breaks
  • Click Export to PDF
  • Download a fully rendered A4 PDF generated on the server

Watch the demo below:

Get the complete source code on GitHub.

The repository includes:

  • Froala editor integration
  • /convert-html-to-pdf Express endpoint
  • Production-safe Puppeteer configuration
  • Proper binary PDF response handling
  • Page break support

This gives you a complete, real-world reference implementation for exporting WYSIWYG editor content to PDF in Node.js.

Final Thoughts

When developers search for NodeJS HTML to PDF, they’re usually not asking “what is PDF generation?”

They’re asking:

“What’s the most reliable way to convert editor HTML into a production-ready PDF?”

The answer, in most cases, is:

  • Clean HTML (from a structured editor like Froala)
  • Puppeteer for accurate rendering
  • Express endpoint for delivery
  • Performance optimization for scale

This approach gives you:

  • Reliable exports
  • Business-ready documents
  • Full styling control
  • Scalable backend architecture

If you’re already generating structured content in your Node.js app, PDF generation becomes the natural next step in your content workflow.

And now, you have the implementation roadmap.

graphical user interface, text

Building a Custom Toolbar Plugin for an LMS Editor in Vue.js

Illustration of a customizable web editor interface with toolbar buttons and settings gear, representing a Vue custom toolbar plugin for an LMS editor

Modern LMS platforms rarely stop at “rich text.” Course creators need structured, repeatable learning components like learning objectives, quiz placeholders, SCORM markers, or instructor-only notes, inserted consistently across content.

If you’re already using a Vue-based WYSIWYG editor like Froala, the next step isn’t more toolbar configuration. It’s custom plugin development. So your editor understands LMS-specific actions as first-class features.

This guide shows you how to build a Vue custom toolbar plugin for an LMS editor, using a real, production-ready pattern. By the end, you’ll have a working, copy-pasteable plugin that adds a Learning Objective button, plus a scalable architecture you can reuse for more advanced LMS features.

Key Takeaways

  • A Vue custom toolbar plugin LMS implementation is about extending editor behavior, not just adding UI buttons
  • In Froala, toolbar-level LMS features are implemented using custom commands, providing flexibility without requiring a full plugin module
  • Register custom plugins before the Vue component mounts to avoid lifecycle and duplication issues
  • Insert structured, machine-readable markup so LMS features remain export-safe and system-aware
  • Keep plugin logic modular and configuration stable to ensure scalability across large Vue-based LMS platforms

Why LMS Editors Need Custom Toolbar Plugins

LMS editors live inside stateful, component-driven applications, not static CMS pages. That changes everything:

  • Editors mount and unmount with Vue lifecycle hooks
  • Toolbar actions often map to domain logic, not formatting
  • Inserted content must be machine-readable, not just styled text

If you’re building an LMS, you’re already thinking beyond buttons. You’re thinking in plugins.

Read this article to learn the broader context of integrating an editor into an LMS. This tutorial zooms in on the Vue + plugin layer.

Prerequisites

This tutorial assumes:

We will not re-cover those basics.

Plugin vs Button: Why This Matters in an LMS

A single button is fine for formatting.

A plugin is different:

  • Owns logic
  • Can register commands
  • Can evolve independently
  • Can enforce LMS constraints

Think of a plugin as a mini feature module, not UI sugar.

For general concepts, see general concepts of toolbar customization. Here we apply them specifically to Vue and LMS needs.

LMS Use Case: Building a Learning Objective Plugin

A learning objective plugin in an LMS is a custom editor extension that inserts structured, system-readable objective blocks into lesson content, allowing the LMS to track, extract, and process them beyond simple text formatting.

We’ll build a simple but realistic plugin:

  • Toolbar button: Insert Learning Objective
  • Action:
    • Inserts a structured HTML block
    • Uses semantic attributes (not styles)
    • Can later be parsed by your LMS backend

Example output:

<div class="lms-learning-objective" data-type="learning-objective">
  <strong>Learning Objective:</strong>
  <span>Edit this objective</span>
</div>

This is editor-friendly and LMS-friendly.

Step 1: Register the Custom Plugin with Froala

Plugins are registered once, before the editor initializes.

In Froala, most toolbar-level extensions are implemented using custom commands. For LMS-specific features, this pattern provides the right balance between simplicity and extensibility without requiring a full plugin module structure.

⚠️ Important:
Do not guess Froala API syntax. Copy the exact methods from the official Froala docs.

import FroalaEditor from 'froala-editor';

// Define the icon
FroalaEditor.DefineIcon('insertLearningObjective', {
  NAME: 'bookmark' // replace with a real Froala icon name
});

// Register the command
FroalaEditor.RegisterCommand('insertLearningObjective', {
  title: 'Insert Learning Objective',
  icon: 'insertLearningObjective',
  focus: true,
  undo: true,
  callback: function () {
    const html = `
      <div class="lms-learning-objective" data-type="learning-objective">
        <strong>Learning Objective:</strong>
        <span>Edit this objective</span>
      </div>
    `;
    this.html.insert(html);
  }
});

Why this works well in an LMS

  • Structured markup
  • Predictable selectors
  • Easy to transform during export (SCORM, PDF, API)

Step 2: Integrating the Plugin with Vue’s Lifecycle

In Vue, when you register the plugin matters.

Rule:

  • Register plugins before the editor component mounts.

Step 3: Vue Single-File Component Integration

Here’s a clean, production-safe Vue pattern.

<script setup>
import { ref } from 'vue';
import FroalaEditor from 'froala-editor';
import 'froala-editor/js/plugins.pkgd.min.js';

// Import your plugin BEFORE editor renders
import './plugins/lmsLearningObjectivePlugin';

const content = ref('');

const editorConfig = {
  toolbarButtons: {
    moreText: {
      buttons: [
        'bold',
        'italic',
        'underline',
        '|',
        'insertLearningObjective' // your custom command
      ]
    }
  }
};
</script>

<template>
  <Froala
    v-model="content"
    :config="editorConfig"
  />
</template>

Vue-Specific Best Practices

  • Keep plugin logic outside the component
  • Keep editor config reactive but stable
  • Avoid re-creating config objects on each render

This pattern scales cleanly in large LMS applications.

Step 4: Editor Configuration Object (Reusable Pattern)

In real LMS apps, config usually lives outside the component.

// editorConfig.js
export const lmsEditorConfig = {
  toolbarButtons: {
    moreText: {
      buttons: [
        'bold',
        'italic',
        'underline',
        '|',
        'insertLearningObjective'
      ]
    }
  }
};

This makes:

  • Role-based toolbars easier
  • A/B testing possible
  • Editor upgrades safer

Get the complete working example from this GitHub repository.

Advanced LMS Plugin Ideas

Once the pattern is in place, LMS-specific plugins become straightforward:

  • Quiz Placeholder Plugin
    • Inserts <div data-quiz-id=””>
  • SCORM Marker Plugin
    • Inserts invisible tracking anchors
  • Instructor Notes Plugin
    • Hidden from learners, visible in edit mode

Each follows the same Vue + plugin architecture.

Common Vue Pitfalls and How to Avoid Them

  • Registering plugins inside components: Causes duplicate registration bugs
  • Rebuilding editor config reactively: Breaks toolbar state
  • Styling instead of structuring LMS content: Makes exports unreliable

For deeper discussion, see considerations for managing editor state in complex LMS applications (React-focused, but the principles apply).

Final Thoughts

If you’re serious about LMS editor customization in Vue, toolbar plugins are the line between “rich text” and real learning infrastructure.

This Vue custom toolbar plugin lms pattern gives you:

  • Clean separation of concerns
  • Future-proof extensibility
  • Production-ready editor behavior

From here, you’re not just customizing an editor. You’re designing your LMS language itself.

graphical user interface, text

 

Froala V5.0.1: New Toolbar & Table Controls

toolbar controls

Froala Editor V5.0.1 is here, and it brings some highly requested features that give you more granular control over your editor’s behavior. If you’ve ever needed to keep certain toolbar functions active while the editor is in read-only mode, or wanted to prevent users from accidentally resizing table cells, this release is for you.

This update focuses on flexibility and precision within defined boundaries. The headline feature—toolbarButtonsEnabledOnEditorOff—solves a common pain point by letting you enable specific predefined toolbar buttons (print, fullscreen, export_to_word, getPDF, and html) plus any custom buttons you’ve created, even when edit.off() is active. All other built-in Froala buttons remain disabled—this is a controlled whitelist approach, not open-ended access. Alongside this, two new table configuration options give you fine-tuned control over horizontal and vertical resizing behavior. Plus, V5.0.1 includes +10 bug fixes that address everything from table cell splitting issues to accessibility improvements and Word paste formatting quirks.

Whether you’re building document management systems, collaborative editing tools, or content review workflows, these enhancements will help you create more intuitive and controlled editing experiences for your users.

Enable Specific Toolbar Buttons in Read-Only Mode

One of the most significant additions in V5.0.1 is the new toolbarButtonsEnabledOnEditorOff configuration option. Previously, when you called editor.edit.off() to put the editor in read-only mode, the entire toolbar became disabled—every single button was non-clickable. This made sense for pure read-only scenarios, but it created friction in workflows where users still needed access to certain functions like printing, exporting, or viewing HTML source.

Now you can selectively enable specific toolbar buttons when the editor is disabled, but with an important constraint: you can only enable buttons from a specific whitelist of built-in Froala buttons, plus any custom buttons you’ve created. The allowed built-in buttons are: print, fullscreen, export_to_word, getPDF, and html. All other built-in Froala buttons will remain disabled and cannot be enabled through this configuration.

new FroalaEditor('.selector', {

 toolbarButtonsEnabledOnEditorOff: ['print', 'fullscreen', 'export_to_word', 'getPDF', 'html']

});

Disable Toolbar Buttons

Real-World Use Cases:

This is a whitelist approach designed for security and control. You explicitly list which buttons from the allowed set should remain active, and you can include any custom buttons you’ve developed. Everything else stays locked down—there’s no way to enable other built-in editing functions like bold, italic, insert image, or any formatting tools when the editor is in read-only mode.

Document Review Workflows: Imagine you’re building a contract review system where legal teams need to review documents without editing them. With this feature, you can disable editing while keeping the Print, PDF export, and Full Screen buttons active—all from the approved list. Reviewers can still generate PDFs for their records or print documents for offline review, all without the risk of accidentally modifying the content. Critically, they won’t be able to access any formatting or content manipulation tools, ensuring document integrity.

Content Approval Systems: In publishing workflows, editors often need to review submitted content before approval. You can put the editor in read-only mode while keeping the HTML view button enabled, allowing technical editors to inspect the markup without being able to change it through the visual interface.

Presentation Mode: For applications that display content in a presentation or preview mode, you might want to disable editing but keep the fullscreen button active so users can view content in an immersive, distraction-free format.

The beauty of this feature is its controlled flexibility. You choose which buttons from the allowed list—print, fullscreen, export_to_word, getPDF, html—should remain enabled, and you can add any custom buttons you’ve built. All other built-in Froala buttons stay disabled, giving you precise, secure control over what users can and cannot do in read-only mode.

Fine-Tuned Table Resizing Control

Tables are a critical component of many rich text editing scenarios, but not every use case requires resizable tables. V5.0.1 introduces two new Boolean options that let you disable table resizing independently for horizontal and vertical dimensions.

Disable Horizontal Table Resizing

The tableHorizontalResizer option (enabled by default) can now be set to false to prevent users from resizing table columns:

new FroalaEditor('.selector', {

 tableHorizontalResizer: false

});

When to Use This: If you’re working with structured data tables where column widths need to remain consistent—think financial reports, data grids, or templated forms—disabling horizontal resizing ensures your carefully designed layouts stay intact. This is particularly valuable in scenarios where tables are generated programmatically and need to maintain specific formatting for compliance or branding reasons.

Disable Vertical Table Resizing

Similarly, the tableVerticalResizer option lets you control vertical cell resizing:

new FroalaEditor('.selector', {

 tableVerticalResizer: false

});

When to Use This: Vertical resizing control is useful when you want content to dictate row height naturally, without manual intervention. This is common in content management systems where consistent vertical spacing is important for readability and design consistency. It also prevents the accidental resizing that can happen when users click near cell borders—an issue that V5.0.1 also fixes (more on that below).

You can use these options independently or together, depending on your needs. For completely fixed-size tables, disable both. For tables where you want content to flow naturally but need consistent column widths, disable only horizontal resizing.

Notable Bug Fixes

Beyond the new features, V5.0.1 addresses +10 bugs that improve stability and user experience:

Table Improvements: The release fixes an issue where vertical cell splits propagated incorrectly to adjacent cells after inserting rows, and eliminates accidental vertical cell resizing triggered by simple clicks on cell borders. The tableStyle toolbar option now works as expected, and tableDefaultBGColor correctly applies background colors instead of border styles.

Accessibility: An aXe-identified issue with missing labels on style options menu icons has been resolved, making the editor more accessible to users with assistive technologies.

UI and Display: Image popups now correctly appear on top of the editor instead of behind it, and selection highlights no longer appear over font list popups in iOS mobile view.

Content Handling: Word paste operations are more reliable—sub-bullets maintain their formatting and fonts stay consistent after using the “Clean” function. The editor now properly auto-scrolls and maintains focus when pasting content from Word or other editors.

Code and Configuration: The extra “.” character that appeared when toggling Code View with a <textarea> inside the editor is gone. The toolbarSticky option now works correctly with multiple editors on the same page, and now auto-linking works for all email addresses, including those that do not use ASCII characters.

Technical Fixes: A “URI Malformed” error that occurred when inserting links containing percent symbols (%) has been resolved.

Should You Upgrade?

If you’re running an earlier version of Froala Editor, V5.0.1 offers compelling reasons to upgrade. The new toolbarButtonsEnabledOnEditorOfffeature alone opens up possibilities for more sophisticated read-only workflows, while the table resizing controls give you the precision many applications require.

The bug fixes are equally important—particularly the table-related improvements and Word paste handling enhancements. These aren’t just minor tweaks; they address real frustrations that users encounter in daily editing tasks.

Upgrading to V5.0.1 is straightforward, and the new configuration options are entirely opt-in, so they won’t affect your existing implementations. 

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users.  Thank you for being a valuable part of our vibrant and growing community. We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Please visit the release notes for a complete list of changes.

Technical Questions

If you have a technical question, you can check whether we have already answered it in our help center. If not, contact our Support team.

graphical user interface, text

Add Word Document Import to Your Web-Based Editor

Add Word Document Import to Your Web-Based Editor

Word documents are still the most common way to create content. Whether it’s course material, documentation, or internal knowledge, users expect to upload a .docx file and start editing immediately.

But importing Word content into a web-based editor isn’t as simple as it sounds. Paste-from-Word workflows often produce inconsistent formatting, bloated markup, and broken structures, especially when documents include tables, lists, or complex styling. At scale, these issues quickly turn into support problems and fragile content.

This is where proper Word document import matters. Instead of relying on clipboard behavior, a file-based import flow gives you control over conversion, cleanup, and formatting preservation.

In this article, you’ll see how to add Word document import to the Froala editor. We’ll focus on a practical implementation that preserves formatting, produces clean HTML, and integrates cleanly into real-world web applications.

Key takeaways

  • Paste from Word is unreliable: Clipboard-based pasting often breaks formatting and HTML consistency.
  • Word document import is deterministic: File-based .docx import gives predictable, controllable results.
  • Froala handles Word conversion natively: The Import from Word plugin converts documents into editor-safe HTML automatically.
  • Formatting is preserved cleanly: Headings, lists, tables, images, and inline styles are retained without HTML bloat.
  • Client-side or server-side conversion: Choose Mammoth.js in the browser or a backend endpoint based on your needs.
  • No custom DOCX pipelines required: Word import becomes a configuration task, not a parsing project.
  • Easy to ship in real apps: A simple frontend setup and lightweight backend are enough to support Word imports.

Paste from Word vs true Word document import

These two workflows are often treated as interchangeable, but they solve very different problems.

Paste from Word

  • Clipboard-based and browser-dependent
  • Inconsistent formatting across environments
  • Limited control over cleanup and normalization
  • Harder to guarantee clean HTML output

Word document import

  • File-based and deterministic
  • Full control over DOCX → HTML conversion
  • Easier to normalize content before inserting it into the editor
  • Better formatting preservation for complex documents

For applications where users regularly upload long-form or structured content, paste-from-Word is a fallback, not a solution. A true Word document import pipeline is what allows you to preserve formatting while still enforcing editor rules.

Froala import from Word plugin overview

The Import from Word plugin allows Froala Editor to import Microsoft Word (.docx) files directly into the editor with formatting preserved. It replaces unreliable clipboard-based pasting with a controlled, file-based import process that converts Word documents into clean, editor-safe HTML before editing begins.

The plugin converts common Word structures like headings, paragraphs, lists, tables, images, and inline formatting, into normalized HTML. It aligns with Froala’s editing model, ensuring consistent behavior across edit, save, and reload cycles.

It supports two conversion modes:

  • Client-side conversion using Mammoth.js (default, when importFromWordUrlToUpload is null)
  • Server-side conversion via a configurable backend endpoint

During import, the plugin removes Word-specific markup, normalizes document structure, and preserves essential formatting without introducing HTML bloat. Built-in options for file size limits, allowed file types, drag-and-drop import, and lifecycle events (word.beforeImport, word.afterImport) make it easy to adapt the workflow to different application needs.

For developers, this turns Word import into a configuration task rather than a custom parsing problem, with Froala handling conversion, cleanup, and formatting preservation out of the box.

Implementing Word document import with Froala

This example demonstrates a complete local setup to:

  • Import a Word (.docx) file using the Import from Word plugin
  • Edit the imported content in Froala Editor
  • Save the edited HTML using a lightweight local backend

The goal is to show a real, reproducible workflow, not just isolated snippets.

Project structure

froala-word-import-demo/
├── server.js
├── package.json
├── saved-content.html
└── public/
    └── index.html

Step 1: Set up a simple local backend

The backend:

  • Serves the frontend files
  • Accepts editor HTML
  • Saves the content locally

Install dependencies

npm init -y
npm install express body-parser

server.js

const express = require('express');
const bodyParser = require('body-parser');
const fs = require('fs');

const app = express();
app.use(bodyParser.json());
app.use(express.static('public'));

app.post('/save', (req, res) => {
  const html = req.body.html || '';
  fs.writeFileSync('saved-content.html', html);
  res.json({ status: 'saved' });
});

app.listen(3000, () => {
  console.log('App running at http://localhost:3000');
});

Step 2: Create the frontend page

This page:

  • Loads Froala
  • Enables the Import from Word plugin
  • Allows users to import a .docx file
  • Sends edited content to the backend

public/index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>Froala Import from Word Demo</title>

  <!-- Froala core styles -->
  <link
    href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css"
    rel="stylesheet"
  />

  <style>
    body {
      font-family: Arial, sans-serif;
      padding: 20px;
    }
    #editor {
      margin-bottom: 15px;
    }
    button {
      padding: 8px 14px;
      cursor: pointer;
    }
  </style>
</head>
<body>

  <h3>Import Word Document and Edit</h3>

  <div id="editor"></div>
  <button id="saveBtn">Save Content</button>

  <!-- Froala core -->
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

  <!-- Import from Word plugin -->
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/import_from_word.min.js"></script>

  <!-- Mammoth.js (required for client-side conversion) -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.4.21/mammoth.browser.min.js"></script>

  <script>
    const editor = new FroalaEditor('#editor', {
      pluginsEnabled: ['importFromWord'],

      // Optional plugin configuration
      importFromWordMaxFileSize: 3 * 1024 * 1024,
      importFromWordFileTypesAllowed: ['docx'],
      importFromWordEnableImportOnDrop: true,

      events: {
        'word.beforeImport': function (file) {
          console.log('Importing:', file.name);
        },
        'word.afterImport': function (html) {
          console.log('Imported HTML ready');
        }
      }
    });

    document.getElementById('saveBtn').addEventListener('click', async () => {
      const html = editor.html.get();

      await fetch('/save', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ html })
      });

      alert('Content saved locally');
    });
  </script>

</body>
</html>

Step 3: Import a Word document

With the plugin enabled:

  • Users can drag and drop a .docx file into the editor
  • Or trigger import programmatically using:
editor.importFromWord.import();

During import:

  • The plugin converts the .docx file to HTML
  • Client-side conversion is handled via Mammoth.js
  • Word-specific markup is removed
  • Headings, lists, tables, images, and inline formatting are preserved
  • Clean, editor-safe HTML is inserted into Froala

Step 4: Edit and save content

After import:

  • The content is fully editable inside Froala
  • Clicking Save Content sends the HTML to the backend
  • The backend stores the result in saved-content.html

You can open this file directly to verify that:

  • The HTML is clean
  • No Word-specific markup remains
  • Content can be reused or reloaded safely

Get the full, working example from this GitHub repository.

Why this implementation works

This setup reflects the intended usage of the Import from Word plugin:

  • Uses Froala’s native .docx import flow
  • Supports client-side conversion via Mammoth.js
  • Avoids custom DOCX parsing logic
  • Keeps backend logic minimal and optional
  • Produces predictable, maintainable HTML

For most applications, this pattern is sufficient to support Word-based authoring workflows without introducing unnecessary complexity.

Conclusion

Importing Word documents into a web-based editor doesn’t need to be fragile, complex, or custom-built. With the Import from Word plugin, Froala Editor provides a production-ready way to bring .docx files into your application with formatting preserved and HTML kept clean.

As the demo shows, Word import becomes a configuration and integration task, not a parsing problem. The plugin handles conversion, cleanup, and structure normalization automatically, while your application stays focused on editing, saving, and rendering content reliably.

If your users work in Word, and most do, supporting direct Word import is no longer optional. It’s a baseline expectation.

Try Froala with the Import from Word plugin, build the demo locally, and see how quickly you can add Word document import to your editor without maintaining a custom pipeline.

graphical user interface, text

How to Build a Print-Ready Report Editor in JavaScript

Print-ready JavaScript report editor with tables and page break support

Building reports in a web app is easy, until users need to print them or export them.

Business reports, invoices, analytics summaries, and audit documents have strict requirements: consistent layouts, clean page breaks, structured tables, and reliable exports to formats like Word. A generic rich text editor often falls short here. Content that looks fine on screen can break across pages, shift during printing, or lose structure during export.

In this guide, we’ll walk through how to build a print-ready JavaScript report editor using Froala, HTML, and JavaScript. We’ll focus on the practical side—page breaks, tables, custom toolbar actions, print styling, and export workflows, using real code examples you can adapt directly into a production app.

The goal isn’t just editable content. It’s reports that stay intact from editor to printer to document export.

Key takeaways

  • Print-ready reports require controlled layout, not just rich text editing
  • Clean HTML + strict CSS are essential for consistent printing and exports
  • Manual page breaks and structured tables prevent broken output
  • A custom toolbar keeps report formatting predictable and focused
  • Froala helps ensure reports stay intact from editing to print and Word export

Base setup: initializing a JavaScript report editor with Froala

The first step in building a print-ready JavaScript report editor is starting with a clean, predictable editor setup. Reports are structured documents, so the editor configuration should prioritize layout stability, consistent spacing, and a focused editing surface.

Below is a minimal Froala setup optimized for report creation rather than free-form content editing.

HTML markup

Start with a dedicated container for your report editor. In most reporting workflows, this editor lives inside a fixed-width layout that mirrors a printed page.

<div id="report-editor"></div>

You can optionally wrap this in a page container if you want to visually represent print margins early on.

Basic Froala initialization

Initialize Froala with a restrained configuration. The goal here is clarity and control, not feature overload.

new FroalaEditor('#report-editor', {
  heightMin: 600,
  heightMax: 800,
  toolbarSticky: true,
  charCounterCount: false,
  quickInsertEnabled: false
});

Why these settings matter:

  • heightMin / heightMax creates a stable editing area similar to a document page
  • toolbarSticky keeps report tools accessible during long edits
  • charCounterCount and quickInsertEnabled are disabled to reduce noise

Setting a print-friendly default style

Reports should look consistent from the moment a user starts typing. You can enforce base typography and spacing using editor styles.

new FroalaEditor('#report-editor', {
  // Stable editor dimensions for document-style content
  heightMin: 600,
  heightMax: 800,
  toolbarSticky: true,

  // Remove non-essential UI noise
  charCounterCount: false,
  quickInsertEnabled: false,

  // Controlled formatting for reports
  paragraphFormat: {
    N: 'Normal',
    H1: 'Heading 1',
    H2: 'Heading 2'
  },

  // Limit fonts to print-safe options
  fontFamily: {
    'Arial,Helvetica,sans-serif': 'Arial',
    'Times New Roman,Times,serif': 'Times New Roman'
  },

  // Restrict font sizes to avoid layout shifts
  fontSize: ['10', '11', '12', '14']
});

Keeping font options limited prevents layout shifts during printing and export.

Explore more in Froala documentation.

Preparing the editor for report content

At this stage, you’re not adding page breaks or export logic yet. The goal is to ensure the editor behaves like a report canvas, not a blog editor.

Best practices for this setup:

  • Use predictable fonts and sizes
  • Avoid auto-formatting features that modify spacing
  • Keep the toolbar minimal and intentional

With this base in place, you now have a stable foundation for adding page breaks, structured tables, custom toolbar actions, and export workflows, which we’ll build on in the next sections.

Creating print-safe layouts with HTML & CSS

Once the editor is initialized, the next step is making sure the content it produces is actually print-ready. This is where HTML structure and CSS do most of the heavy lifting. Without print-safe styles, even well-formatted reports can break across pages, shift margins, or lose alignment when printed or exported.

The goal is to make the editor behave like a document page, not a responsive web layout.

Defining a page container

Wrap your report content in a fixed-width container that mirrors a standard paper size. This helps users see realistic margins while editing.

<div class="report-page">
  <!-- Froala editor content -->
</div>

Use CSS to control width, padding, and background so the layout matches a printed page.

.report-page {
  width: 794px; /* A4 width at 96 DPI */
  margin: 0 auto;
  padding: 40px;
  background: #ffffff;
}

This ensures consistent line lengths and prevents unpredictable wrapping.

Setting print margins and page rules

Use print-specific styles to control how content behaves during printing.

@media print {
  body {
    margin: 0;
  }

  .report-page {
    width: auto;
    margin: 0;
    padding: 25mm;
  }
}

Key points:

  • Avoid browser default margins
  • Set margins explicitly for print
  • Let the browser handle page size

Preventing layout breaks

Certain elements should never split across pages, especially tables and headings.

h1, h2, h3 {
  page-break-after: avoid;
}

table {
  page-break-inside: avoid;
}

This keeps section headers and table rows visually intact.

Creating visual page boundaries (optional but useful)

For longer reports, visual page boundaries help users understand where content will break when printed.

@media screen {
  .report-page {
    box-shadow: 0 0 0 1px #ddd;
  }
}

This does not affect printing but improves the editing experience.

Font and spacing consistency

Stick to conservative typography rules for print reliability.

.report-page {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

Avoid relative units like em or rem for report layouts—absolute values reduce surprises during export.

Why this matters for a JavaScript report editor

A print-ready JavaScript report editor depends on predictable layout behavior. By defining page containers, print rules, and layout constraints at the CSS level, you ensure that content authored in Froala remains consistent from:

  • On-screen editing
  • Print preview
  • Physical printing
  • Document export

With print-safe styles in place, you’re ready to introduce page breaks, which we’ll handle next.

Adding page break support

Page breaks are one of the most important features in a print-ready JavaScript report editor. Without explicit control, reports rely on the browser’s automatic pagination, which almost always leads to broken tables, split headings, and unpredictable output.

The goal here is simple: give users manual control over where pages end, while keeping the implementation clean and reliable.

Defining a page break element

Start by defining a dedicated HTML element that represents a page break. This element will exist in the editor content and translate directly into print behavior.

<div class="page-break"></div>

Attach print-specific behavior using CSS:

.page-break {
  page-break-after: always;
  break-after: page;
}

This ensures consistent behavior across modern browsers.

Styling page breaks for the editor (screen only)

During editing, users need to see where a page break exists. You can add a visual indicator that appears only on screen, not in print.

@media screen {
  .page-break {
    border-top: 2px dashed #ccc;
    margin: 24px 0;
  }
}

This gives clear feedback without affecting the final printed document.

Adding a custom page break toolbar button

Next, expose page breaks directly in the editor toolbar. This allows users to insert page breaks exactly where they need them.

Using Froala, define a custom icon and command:

FroalaEditor.DefineIcon('pageBreak', {
  NAME: 'file',
  SVG_KEY: 'page-break'
});

FroalaEditor.RegisterCommand('pageBreak', {
  title: 'Insert Page Break',
  focus: true,
  undo: true,
  callback: function () {
    this.html.insert('<div class="page-break"></div>');
  }
});

Enabling the page break button in the toolbar

Once the command is registered, add it to your editor’s toolbar configuration.

new FroalaEditor('#report-editor', {
  // Layout for report-style documents
  heightMin: 600,
  heightMax: 800,
  toolbarSticky: true,

  // Reduce non-report noise
  charCounterCount: false,
  quickInsertEnabled: false,

  // Controlled formatting
  paragraphFormat: {
    N: 'Normal',
    H1: 'Heading 1',
    H2: 'Heading 2'
  },

  fontFamily: {
    'Arial,Helvetica,sans-serif': 'Arial',
    'Times New Roman,Times,serif': 'Times New Roman'
  },

  fontSize: ['10', '11', '12', '14'],

  // Report-focused toolbar
  toolbarButtons: [
    'bold', 'italic', 'underline',
    '|',
    'insertTable',
    'pageBreak',
    '|',
    'print'
  ]
});

This keeps report-specific actions easily accessible without cluttering the UI.

Next, we’ll focus on building structured tables that remain stable across pages and exports.

Building structured tables for reports

Tables are at the core of most reports—financial summaries, audit data, analytics breakdowns, and comparisons all depend on them. In a print-ready JavaScript report editor, tables must stay readable, aligned, and intact across pages and exports.

This section focuses on building print-safe, predictable tables using Froala, HTML, and CSS.

Using tables as first-class report elements

Froala’s table tools make it easy to insert and edit tables, but for reports, you should constrain styling and behavior to avoid layout issues.

At a minimum, reports should rely on:

  • Fixed-width tables
  • Explicit headers (<thead>)
  • Consistent cell padding and borders

Example table structure:

<table class="report-table">
  <thead>
    <tr>
      <th>Description</th>
      <th>Amount</th>
      <th>Notes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Total Revenue</td>
      <td>$125,000</td>
      <td>Q4 Summary</td>
    </tr>
    <tr>
      <td>Total Expenses</td>
      <td>$78,000</td>
      <td>Operational costs</td>
    </tr>
  </tbody>
</table>

Print-safe table styling

Apply strict CSS rules to ensure tables behave consistently when printed or exported.

.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  border: 1px solid #ddd;
  padding: 8px;
  vertical-align: top;
  word-wrap: break-word;
}

Why this matters:

  • table-layout: fixed prevents column resizing issues
  • Explicit borders improve readability in print
  • Fixed padding ensures consistent row height

Preventing tables from breaking across pages

One of the most common reporting problems is tables splitting awkwardly across pages.

At minimum, prevent tables from breaking mid-render:

@media print {
  table {
    page-break-inside: avoid;
  }
}

For long tables, browsers will still paginate naturally, but this rule prevents partial row rendering and broken headers.

Repeating table headers on new pages

To keep multi-page tables readable, always use a <thead> element. Browsers automatically repeat table headers when printing.

@media print {
  thead {
    display: table-header-group;
  }
}

This ensures column headers appear at the top of each printed page.

Restricting table editing in the toolbar

For reporting workflows, too much table flexibility can hurt layout consistency. Limit table-related actions to essentials.

Example toolbar configuration:

toolbarButtons: [
  'bold', 'italic',
  '|',
  'insertTable',
  'tableHeader',
  'tableRemove',
  '|',
  'pageBreak',
  'print'
]

This keeps users focused on content, not visual experimentation.

Why structured tables matter

In reporting, tables are not decorative—they’re data containers. By enforcing structure and print-safe styling, you ensure tables created in the editor remain stable when:

  • Printing
  • Exporting to Word
  • Sharing across teams

With tables handled correctly, the editor is ready for export workflows and document output, which we’ll cover next.

Custom toolbar for report editing

A default WYSIWYG toolbar is designed for general content creation. Reporting workflows are different. Users don’t need emojis, media embeds, or visual effects. They need precise control over structure, layout, and output.

For a print-ready JavaScript report editor, the toolbar should expose only the tools that directly affect reporting quality.

Why a custom toolbar matters

In report editors:

  • Every formatting action can affect pagination
  • Inconsistent styling leads to broken print output
  • Extra tools increase the risk of layout issues

A custom toolbar keeps the editing experience intentional and predictable.

Defining a report-focused toolbar

You can add a minimal toolbar configuration tailored for reports built with Froala.

new FroalaEditor('#report-editor', {
  // Layout
  heightMin: 600,
  heightMax: 800,
  toolbarSticky: true,

  // Cleanup non-report UI
  charCounterCount: false,
  quickInsertEnabled: false,

  // Controlled formatting
  paragraphFormat: {
    N: 'Normal',
    H1: 'Heading 1',
    H2: 'Heading 2'
  },

  fontFamily: {
    'Arial,Helvetica,sans-serif': 'Arial',
    'Times New Roman,Times,serif': 'Times New Roman'
  },

  fontSize: ['10', '11', '12', '14'],

  // Report-specific toolbar
  toolbarButtons: [
    'bold', 'italic', 'underline',
    '|',
    'paragraphFormat',
    'insertTable',
    'pageBreak',
    '|',
    'print'
  ]
});

This setup prioritizes:

  • Basic text emphasis
  • Controlled heading usage
  • Table insertion
  • Manual page breaks
  • Print access

Grouping toolbar actions logically

Toolbar grouping improves usability, especially for long reports.

toolbarButtons: [
  'bold', 'italic', 'underline',
  '|',
  'paragraphFormat',
  '|',
  'insertTable',
  'tableHeader',
  '|',
  'pageBreak',
  'print'
]

Logical grouping reduces accidental formatting and keeps report actions easy to find.

Adding custom report actions

The toolbar is also where you expose report-specific commands, such as:

  • Insert page break
  • Trigger print preview
  • Export to Word

Example of a custom command button already registered earlier:

toolbarButtons: [
  'insertTable',
  'pageBreak',
  'print'
]

Custom commands integrate seamlessly alongside native Froala tools.

With a custom toolbar in place, your editor now supports structured content, page control, and clean output, the essentials of a print-ready reporting workflow.

Next, we’ll look at exporting reports to Word and handling output formats reliably.

Exporting reports to Word

Printing is often only part of a reporting workflow. In many business applications, users also expect to export reports to Word so they can share, review, or apply final formatting outside the application. For a print-ready JavaScript report editor, Word export must preserve structure—tables, headings, spacing, and page breaks.

This section focuses on a practical, implementation-first approach to exporting Froala-generated content to Word.

Why Word export needs special handling

Word documents are not just HTML files with a different extension. If you export raw HTML without preparation, you’ll quickly run into issues such as:

  • Missing page breaks
  • Broken tables
  • Inconsistent margins
  • Lost headings

The key is to control the HTML output before conversion.

Step 1: Extract clean HTML from the editor

Start by reading the editor content directly from the Froala instance.

const editorHtml = document.querySelector('#report-editor').innerHTML;

At this point, the HTML already contains:

  • Structured tables
  • Page break elements
  • Controlled typography

This is why earlier layout and styling steps matter.

Step 2: Prepare HTML for Word conversion

Before converting to DOCX, wrap the content in a print-safe document template.

function buildWordHtml(content) {
  return `
    <html>
      <head>
        <style>
          body {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12pt;
          }
          table {
            width: 100%;
            border-collapse: collapse;
          }
          th, td {
            border: 1px solid #000;
            padding: 6px;
          }
          .page-break {
            page-break-after: always;
          }
        </style>
      </head>
      <body>
        ${content}
      </body>
    </html>
  `;
}

This ensures Word receives a self-contained, well-structured document.

Step 3: Convert HTML to DOCX

In production applications, Word export is typically handled server-side for reliability and consistency.

Common approaches include:

  • HTML → DOCX libraries
  • Headless document converters
  • Backend services that generate Word files

From the frontend, send the prepared HTML to your server:

fetch('/export/word', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    html: buildWordHtml(editorHtml)
  })
});

This keeps the client lightweight and avoids browser-specific limitations.

Step 4: Preserve page breaks in Word

The .page-break element defined earlier plays a critical role here. Word recognizes page-break-after: always, ensuring manual page breaks inserted in the editor appear correctly in the exported document.

No additional logic is needed if your CSS and HTML are consistent.

Step 5: Exposing Word Export in the toolbar

Export actions should feel like part of the editor, not an external workflow. Add a custom toolbar button to trigger Word export.

FroalaEditor.RegisterCommand('exportWord', {
  title: 'Export to Word',
  focus: false,
  undo: false,
  callback: function () {
    const html = document.querySelector('#report-editor').innerHTML;
    exportToWord(html);
  }
});

Include the button in your toolbar configuration:

toolbarButtons: [
  'bold', 'italic',
  '|',
  'insertTable',
  'pageBreak',
  '|',
  'exportWord',
  'print'
]

Why this works well with Froala

Because Froala produces clean, well-structured HTML, the export pipeline stays manageable. When layout rules, page breaks, and tables are handled consistently at the editor level, exporting to Word becomes a controlled transformation, not a guessing game.

With Word export in place, your report editor now supports both physical printing and document sharing, covering the full reporting workflow.

Print preview workflow

A print-ready report editor is incomplete without a reliable print preview. Users need to see exactly how their report will look on paper before committing to print or export. Relying on guesswork at this stage leads to misaligned pages, clipped tables, and broken sections.

The print preview workflow should reuse the same HTML and CSS that drive final printing—no alternate layouts, no surprises.

Reusing the same print styles

The most important rule for print preview is consistency. The preview must use the same @media print styles defined earlier.

@media print {
  .report-page {
    padding: 25mm;
  }

  .page-break {
    page-break-after: always;
  }
}

If the preview uses different styles, it becomes meaningless.

Opening a print preview window

A common and reliable approach is to render the editor content into a dedicated print window.

function openPrintPreview() {
  const content = document.querySelector('#report-editor').innerHTML;

  const printWindow = window.open('', '_blank');
  printWindow.document.write(`
    <html>
      <head>
        <title>Print Preview</title>
        <link rel="stylesheet" href="/print.css">
      </head>
      <body>
        <div class="report-page">
          ${content}
        </div>
      </body>
    </html>
  `);

  printWindow.document.close();
}

This isolates the preview from the main app layout and ensures accurate rendering.

Triggering print from the preview

Once the preview window is ready, printing should be a single action.

printWindow.focus();
printWindow.print();

This uses the browser’s native print dialog while preserving all page break and layout rules.

Adding print preview to the toolbar

Expose the preview workflow directly in the editor toolbar so users can access it without leaving the editing context.

FroalaEditor.RegisterCommand('printPreview', {
  title: 'Print Preview',
  focus: false,
  undo: false,
  callback: function () {
    openPrintPreview();
  }
});

Include it in your toolbar configuration:

toolbarButtons: [
  'bold', 'italic',
  '|',
  'insertTable',
  'pageBreak',
  '|',
  'printPreview',
  'print'
]

What to Validate in Print Preview

Before allowing users to print or export, the preview should confirm:

  • Page breaks appear where expected
  • Tables do not split incorrectly
  • Margins and spacing are consistent
  • Headers and footers align correctly

Encouraging users to preview reduces failed prints and export rework.

With print preview implemented, users can confidently move from editing to printing or exporting without surprises.

Get the complete example from this GitHub repo.

Conclusion

Building a print-ready JavaScript report editor requires more than adding a print button. You need structured content, controlled layouts, manual page breaks, reliable tables, and predictable export workflows.

By combining Froala, HTML, and JavaScript, you can create a report editor that produces clean, consistent output from on-screen editing to print preview to Word export. With the right architecture and constraints in place, reports stop being fragile documents and become dependable, production-ready assets your users can trust.

Try Froala to build reliable, print-ready report workflows in JavaScript.

graphical user interface, text

Import Word Documents Server-Side: Why and How with Laravel + Aspose

Import Word Documents

Froala has introduced a powerful Import from Word plugin that simplifies bringing Microsoft Word documents into your Froala editor. While the plugin offers a client-side solution using Mammoth.js, many developers need greater control—better formatting fidelity, stricter HTML standards, and reliable handling of complex documents.

In this step-by-step guide, you’ll discover how to build a server-side Word import solution as a PHP/Laravel developer. We’ll leverage Aspose’s robust conversion engine to ensure your Word documents transform into editor-ready HTML with pixel-perfect formatting and complete styling preservation.

Key Takeaways

  • Client-side import (Froala’s native plugin) is fast to implement but sacrifices formatting fidelity for common documents.
  • Server-side import gives you control over conversion quality, HTML standards compliance, and handling of complex documents—at the cost of added infrastructure.
  • Aspose.Words Cloud eliminates server-side dependencies (no LibreOffice, no Java) while delivering enterprise-grade conversion reliability.
  • This guide walks you through a complete Laravel implementation that’s production-ready with minimal custom code.

Froala’s Import from Word Plugin: Client vs. Server

Selecting the appropriate approach—client-side or server-side processing—will fundamentally shape your implementation strategy and determine the capabilities of your import workflow.

Client-Side Import

Froala’s native “Import from Word” plugin leverages Mammoth.js to handle .docx conversion directly within the browser:

  • Word files are uploaded through Froala’s user interface.
  • Mammoth.js processes the conversion in the browser, eliminating initial server overhead.
  • The resulting HTML is generated and immediately inserted into the editor.
  • Implementation requires minimal custom code.

Recommended for scenarios where:

  • Rapid deployment is prioritized.
  • Formatting precision is secondary to functionality.
  • Documents are typically small in file size.
  • Development overhead should be minimized.

Server-Side Import

A custom server-side implementation allows you to process Word documents using a library or service of your choice, offering greater control over the conversion process.

Recommended for scenarios where:

  • Formatting fidelity and visual accuracy are essential.
  • Your application handles large or complex documents reliably.
  • Specific HTML standards compliance is required.
  • You need centralized control over document storage and processing.

Popular PHP libraries for Word-to-HTML conversion include PHPDocX and ConvertAPI. Each offers distinct advantages depending on your infrastructure and performance requirements.

For this guide, we implement the server-side approach using the Aspose library, which provides enterprise-grade conversion capabilities with minimal server-side infrastructure requirements.

Understanding Word Document Structure – Revised

Before implementing the conversion process, it’s essential to understand the underlying architecture of Word documents and how Aspose processes them. Microsoft Word documents (.docx files) are actually ZIP archives containing XML markup, stylesheets, and embedded media resources—a structured format that enables reliable programmatic extraction.

What Aspose Extracts

Aspose.Words provides comprehensive document parsing capabilities, processing the following elements:

  • Document structure: Paragraphs, sections, page breaks, and hierarchical relationships
  • Text formatting: Font families, weights (bold), styles (italic, underline), sizes, and color values
  • Paragraph formatting: Text alignment, indentation levels, line spacing, and spacing before/after
  • List structures: Ordered lists, unordered lists, and multi-level nested hierarchies
  • Tables: Cell content, border definitions, cell shading, and column widths
  • References: Hyperlinks with target URLs and anchor text
  • Media elements: Embedded images, charts, and multimedia content
  • Styling: Document-level styles, themes, and formatting inheritance rules

Why Choose Aspose

Aspose.Words offers distinct advantages over alternative solutions:

Formatting Fidelity

Aspose maintains complex table structures, cell alignments, and layout relationships with precision. Alternative libraries such as Mammoth.js or PHPWord often lose formatting nuances during conversion, resulting in degraded visual output.

Cloud-Based Processing

Conversion occurs on Aspose’s infrastructure, eliminating the need to install dependencies like LibreOffice or Java on your web server. This reduces server resource consumption and simplifies deployment across multiple environments.

Intelligent Media Handling

Aspose provides flexible image management options, including automatic Base64 encoding for inline images or integration with cloud storage services for scalable asset management.

Prerequisites & Setup

Before implementing the Word import solution, ensure your development environment meets the following requirements and is properly configured.

Froala Editor Environment

  • Froala Editor library version 5.x or higher
  • Valid licensing key for your deployment environment
  • Working knowledge of Froala’s configuration API

Laravel Project Structure

  • Laravel 8.x or later
  • Composer package manager installed and configured
  • Familiarity with Laravel routing, controllers, and request handling

Aspose.Words for PHP

Install the Aspose.Words Cloud library via Composer:

composer require aspose-cloud/aspose-words-cloud
  1. Obtain API Credentials
    1. Create a free account at the Aspose Cloud Dashboard.
    2. Navigate to the Applications section
    3. Retrieve your Client ID and Client Secret
  2. Configure Environment Variables

Add your Aspose credentials to your .env file:

ASPOSE_CLIENT_ID="c09ed4d3-*****-****-8a73-******"
ASPOSE_CLIENT_SECRET="6c85*************************66"
  1. Register Service Configuration

Open config/services.php and add the following entry to the returned configuration array. This allows the config() helper in your controller to find the values:

// config/services.php

return [
    // ... other services like mailgun, stripe, etc.

    'aspose' => [
        'client_id' => env('ASPOSE_CLIENT_ID'),
        'client_secret' => env('ASPOSE_CLIENT_SECRET'),
    ],
];

Why do it this way?

  • Security: You should never hardcode passwords or API keys in your Controller, as they might get pushed to GitHub/GitLab.
  • Flexibility: You can easily use different credentials for your local development and your production server.

Quick Tips:

  • After updating .env, run php artisan config:clear to ensure Laravel sees the new changes.
  • Ensure your .env file is included in your .gitignore so your keys stay private.

Implementation: Step-by-Step Code

Now let’s build the actual Laravel implementation to handle Word document imports and convert them to editor-ready HTML.

Create Routes

Define two routes in routes/web.php to handle the editor display and Word document processing:

// Display the Froala editor interface
Route::get('/editor', function () {  
    return view('editor');
});

// Handle Word document conversion via Aspose
Route::post('/editor/import-word', [WordImportController::class, 'import'])
    ->name('froala.import.word');

Route Breakdown:

  • The GET route renders the editor view where users interact with Froala.
  • The POST route accepts Word files from Froala and delegates conversion to the controller.
  • The named route allows us to reference the URL in views using Laravel’s route() helper.

Create the Controller

Create app/Http/Controllers/WordImportController.php with the following implementation:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests\ConvertDocumentRequest;
use Illuminate\Support\Facades\Log;

class WordImportController extends Controller
{
    private $wordsApi;

    /**
     * Initialize the Aspose Words API client with credentials
     * 
     * The constructor retrieves API credentials from Laravel's configuration
     * and instantiates the WordsApi client for document conversion operations.
     */
    public function __construct()
    {
        $clientId = config('services.aspose.client_id');
        $clientSecret = config('services.aspose.client_secret');

        $this->wordsApi = new WordsApi($clientId, $clientSecret);
    }

    /**
     * Convert uploaded Word document to HTML
     * 
     * This method handles the complete conversion workflow:
     * 1. Validates the uploaded file against security constraints
     * 2. Prepares a conversion request for the Aspose API
     * 3. Processes the document on Aspose's servers
     * 4. Returns the converted HTML to Froala Editor
     * 
     * @param Request $request The HTTP request containing the Word file
     * @return \Illuminate\Http\JsonResponse JSON response with HTML content or error
     */
    public function import(Request $request)
    {
        // Validate uploaded file: must be DOCX format and under 10MB
        $request->validate([
            'file' => 'required|mimes:docx|max:10240',
        ]);

        try {
            $file = $request->file('file');

            // Create conversion request specifying HTML as target format
            // Aspose preserves complex formatting, tables, and styling during conversion
            $convertRequest = new ConvertDocumentRequest(
                $file->getRealPath(),
                "html"
            );

            // Execute conversion on Aspose servers
            // Returns a file object containing the generated HTML
            $resultFile = $this->wordsApi->convertDocument($convertRequest);

            // Extract HTML content from the result file stream
            $htmlContent = file_get_contents($resultFile->getPathname());

            // Return JSON response that Froala Editor expects
            return response()->json([
                'html' => $htmlContent
            ]);

        } catch (\Exception $e) {
            // Log conversion errors for debugging and monitoring
            Log::error('Aspose Conversion Error: ' . $e->getMessage());

            // Return user-friendly error response with appropriate HTTP status
            return response()->json([
                'error' => 'Conversion failed. Please try again.'
            ], 500);
        }
    }
}

Controller Explanation:

  • Constructor: Retrieves Aspose credentials from your Laravel configuration and initializes the API client. This ensures credentials are never hardcoded in your application logic.
  • import() Method: Orchestrates the conversion workflow. The method validates incoming files, creates a conversion request with ConvertDocumentRequest, executes the conversion via Aspose’s cloud infrastructure, and returns the resulting HTML in JSON format.
  • Error Handling: Catches exceptions during conversion, logs them for troubleshooting, and returns a standardized error response that Froala can handle gracefully.

Configure Frontend: Froala Integration

Create resources/views/editor.blade.php with the following template:

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        
        <!-- Load Froala Editor stylesheets from CDN -->
        <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" 
              rel="stylesheet" type="text/css" />
        
        <title>Word Import Demo</title>
        <style>
            body {
                background-color: #eee;
            }

            h1.title {
                font-size: 2.5em;
                padding: 16px;
                border-radius: 10px;
                border: 1px solid #CCCCCC;
                text-align: center;
            }

            .container {
                max-width: 70%;
                margin: 50px auto;
            }
        </style>
        
        <!-- Store CSRF token as meta tag for use in JavaScript -->
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <script>
            /**
             * CSRF Token Injection Middleware
             * 
             * Intercepts all fetch requests and automatically attaches the CSRF token
             * required by Laravel for POST requests. This prevents CSRF attacks while
             * maintaining a seamless developer experience.
             */
            (function () {
                const token = document
                    .querySelector('meta[name="csrf-token"]')
                    ?.getAttribute('content');

                // Exit early if token unavailable or fetch not supported
                if (!token || !window.fetch) return;

                const originalFetch = window.fetch;

                // Override global fetch function
                window.fetch = function (input, init = {}) {
                    init.headers = new Headers(init.headers || {});

                    // Determine request URL for same-origin validation
                    const requestUrl = typeof input === 'string' ? input : input.url;
                    const isSameOrigin = requestUrl.startsWith('/') ||
                        requestUrl.startsWith(window.location.origin);

                    // Attach CSRF token only to same-origin requests
                    if (isSameOrigin) {
                        init.headers.set('X-CSRF-TOKEN', token);
                        init.credentials = 'same-origin';
                    }

                    // Execute the original fetch with enhanced headers
                    return originalFetch(input, init);
                };
            })();
        </script>
    </head>
    <body>
        <div class="container">
            <h1 class="title">Import From Word Demo</h1>
            
            <!-- Editor container with data attribute storing the import endpoint -->
            <div id="editor" data-import-word-url="{{ route('froala.import.word') }}"></div>
        </div>

        <!-- Load Froala Editor JavaScript library from CDN -->
        <script type="text/javascript"
                src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

        <script>
            /**
             * Initialize Froala Editor with Word Import Capability
             * 
             * Retrieves the import URL from the data attribute and configures
             * Froala to use the Laravel endpoint for all Word document conversions.
             */
            const importUrl = document.getElementById('editor').dataset.importWordUrl;
            
            const editor = new FroalaEditor("div#editor", {
                // Configure Froala to send Word files to our Laravel import endpoint
                importFromWordUrlToUpload: importUrl,
            });
        </script>
    </body>
</html>

Template Explanation:

  • CSRF Token Meta Tag: Stores the Laravel CSRF token as a meta element for retrieval by JavaScript middleware.
  • CSRF Middleware Function: Laravel enforces CSRF protection by requiring a valid token with all state-changing requests (POST, PUT, DELETE, etc.). That’s why we added a JavaScript code that automatically injects the CSRF token into all fetch requests targeting same-origin endpoints. Without this token, requests will be rejected with a 419 error.
  • Editor Initialization: The Froala editor is instantiated with the importFromWordUrlToUpload option set to your Laravel route. When users upload or drag Word files into the editor, Froala automatically submits them to this endpoint for server-side processing.
  • Data Attributes: The editor container uses a data attribute to store the import URL, keeping your template clean and allowing JavaScript to dynamically retrieve the route without string concatenation.

Testing and Validation

To verify the complete implementation:

  1. Start your Laravel development server: php artisan serve
  2. Navigate to http://localhost:8000/editor in your browser.
  3. Use Froala’s Word import feature to upload a .docx file.
  4. Confirm that the document content appears correctly in the editor with preserved formatting.

The conversion should complete within seconds, with Aspose handling all complex document structure transformations server-side.

import from word

FAQ

Can I try this with Froala’s trial license?

Yes. Froala offers a free trial that works with this implementation. Use it to validate the approach before committing to a paid license. The same code runs unchanged when you switch to a production key.

What if the conversion fails? What happens to the user?

The controller catches exceptions and returns a JSON error response. In the template, you’ll want to handle this gracefully—show an error message, allow retry, or fall back to manual copy-paste. The current implementation logs failures; monitor those logs to catch systemic issues early.

Can I cache converted documents?

Yes. Store the HTML in your database keyed by the original document’s hash (MD5 of file contents). Subsequent uploads of the same document skip conversion entirely. This works well if users regularly import the same templates.

Is it safe to send Word documents to Aspose’s servers?

Aspose processes documents on their cloud infrastructure, then discards them. If you’re handling sensitive documents (contracts, medical records, etc.), review Aspose’s data privacy and compliance documentation. For highly regulated environments, consider whether a self-hosted alternative is required.

What’s Next

You now have a production-ready Word import pipeline that preserves formatting where Froala’s native plugin falls short. From here:

  • Handle edge cases: Add image optimization, sanitize HTML output, or implement retry logic for large documents.
  • Monitor performance: Log conversion times and failures to catch issues before users do.
  • Scale gracefully: Consider caching converted documents or implementing a job queue if you’re processing high volumes.

This foundation is solid. The next step is deploying it and measuring what actually breaks in production—because something always does, and that’s where you’ll find your real optimization wins.

Ready to ship? Ensure you have a valid Froala license key. Deploy the code above to a staging environment first. Test with your actual Word documents—not sanitized examples. Then let your users loose on it and iterate.

graphical user interface, text

Building a Course Description Editor for Your LMS Using HTML Editor Software

Building a Course Description Editor for Your LMS Using HTML Editor Software

When someone opens a course page, the description is often the first thing they read. It sets expectations and influences whether they enroll. That’s why your LMS content editor plays a bigger role than it might seem.

If your LMS relies on plain text fields or markdown, the limitations show quickly. Formatting becomes frustrating, content looks inconsistent across devices, and non-technical instructors are forced to think about syntax instead of teaching.

This is where professional html editor software helps. A visual editor lets instructors write naturally while still producing clean, reliable HTML. With the right setup, you can deliver consistent course descriptions without sacrificing performance, accessibility, or control, exactly what a modern LMS needs.

Key takeaways

  • A well-designed LMS content editor directly impacts course quality, instructor efficiency, and learner engagement.
  • Plain text fields and markdown editors don’t scale well for modern LMS platforms with rich content needs.
  • Professional HTML editor software enables visual editing while generating clean, consistent HTML behind the scenes.
  • A production-ready LMS editor should balance usability for instructors with control, security, and performance for developers.
  • Froala makes it easy to build a flexible course description editor in React, with customizable toolbars and image handling.
  • Storing and rendering clean HTML simplifies content management, previews, and long-term maintenance.
  • Choosing a lightweight, framework-agnostic editor like Froala helps LMS platforms scale without added complexity.

What is an LMS content editor?

An LMS content editor is the tool you use to create and manage written content inside a learning platform. This includes course descriptions, lesson introductions, learning objectives, and other instructional text. It’s the space where instructors turn ideas into structured, readable content.

At the simplest level, some LMS platforms rely on plain textareas. These allow typing, but nothing more. Markdown editors add formatting options, but they assume the user understands syntax. That can slow instructors down and lead to inconsistent results.

A rich text or HTML-based editor like Froala takes a different approach. It lets you format content visually, headings, lists, links, and media, without writing code.

Format content visually in rich text editors
Format content visually in rich text editors

At the same time, it produces clean HTML behind the scenes. This balance is what makes a modern LMS editor usable for instructors and reliable for developers.

Rich text HTML editors produce clean HTML behind the scenes
Rich text HTML editors produce clean HTML behind the scenes

Why HTML editor software is essential for LMS course descriptions

Course descriptions need more than plain text. Headings, lists, links, and media are often essential. When an LMS relies on basic inputs or markdown, these needs quickly become friction for instructors.

Professional html editor software removes that friction. A visual editor lets instructors format content as they write and see the final result immediately, without worrying about syntax or broken layouts.

A modern LMS rich text editor also produces clean, consistent HTML. This ensures course pages render correctly across devices, support accessibility, and remain easy to maintain as your LMS grows.

Core features a production-ready LMS course editor needs

A production-ready LMS course editor needs more than basic formatting. It should balance ease of use for instructors with control, performance, and reliability for developers. The following features help ensure your editor can scale as your LMS grows.

  • Essential formatting tools: Support headings, lists, links, and basic text styling without overwhelming instructors.
  • Media and embed handling: Allow images, videos, and external content to be added easily and displayed consistently.
  • Customizable toolbar: Control which tools are available so instructors only see what they actually need.
  • Clean, semantic HTML output: Generate structured HTML that’s easy to store, render, and maintain across your LMS.
  • Mobile-friendly editing: Ensure the editor works smoothly on different screen sizes and devices.
  • Accessibility-friendly markup: Help create content that follows accessibility best practices by default.
  • Stable performance at scale: Keep editing fast and reliable, even as your course library and user base grow.

Step-by-step: building an LMS course description editor with Froala using React

Building an LMS course description editor starts with choosing an editor that works well for instructors and developers. You want visual editing, clean HTML output, and full control over configuration. Froala fits this well, especially in React-based LMS applications.

Step 1: Install Froala for React

Start by installing Froala’s React package and required dependencies:

npm install react-froala-wysiwyg froala-editor

Explore Froala’s quick installation guides for popular JavaScript frameworks.

Then import Froala’s core styles in your app entry file (for example, src/main.jsx if you’re using Vite).

import "froala-editor/css/froala_editor.pkgd.min.css";
import "froala-editor/css/froala_style.min.css";

This gives you a production-ready editor without additional setup or build tools.

Step 2: Create a course description editor component

Next, create a dedicated React component for your LMS course description editor (for example, src/components/CourseDescriptionEditor.jsx):

import React, { useState } from "react";
import FroalaEditor from "react-froala-wysiwyg";

export default function CourseDescriptionEditor() {
  const [content, setContent] = useState("");

  return (
    <FroalaEditor
      tag="textarea"
      model={content}
      onModelChange={setContent}
    />
  );
}

At this point, instructors can already write and format course descriptions visually. Froala handles the HTML generation behind the scenes.

Step 3: Customize the editor toolbar and image uploads

Most instructors don’t need advanced formatting tools. A focused toolbar keeps the editor easy to use and helps prevent layout issues.

In your course editor component (for example, src/components/CourseDescriptionEditor.jsx), define a configuration that limits formatting options and enables image uploads:

const editorConfig = {
  toolbarButtons: [
    "bold",
    "italic",
    "underline",
    "paragraphFormat",
    "formatUL",
    "formatOL",
    "insertLink",
    "insertImage",
    "undo",
    "redo"
  ],
  placeholderText: "Write your course description here...",
  heightMin: 300,

  // Image handling
  imageUpload: true,
  imageAllowedTypes: ["jpeg", "jpg", "png", "gif"],
  imageMaxSize: 5 * 1024 * 1024 // 5MB
};

Explore more on customizing your Froala toolbar.

Apply the configuration when rendering the editor:

<FroalaEditor
  tag="textarea"
  model={content}
  onModelChange={setContent}
  config={editorConfig}
/>

This setup gives instructors the tools they need to format content and add images, while keeping the editor simple, consistent, and easy to maintain within your LMS.

Step 4: Store course descriptions as HTML

Froala outputs clean HTML by default, which makes storage simple. You can save the editor’s content directly to your database:

const saveCourseDescription = async () => {
  await api.saveCourse({
    description: content
  });
};

Storing HTML avoids complex conversions and makes versioning, previews, and updates easier inside your LMS.

Step 5: Render course descriptions safely for learners

When displaying course descriptions to learners, render the stored HTML inside your LMS UI:

<div
  className="course-description"
  dangerouslySetInnerHTML={{ __html: course.description }}
/>

In production, you should sanitize content on save or before render. Froala’s controlled output makes this much easier and reduces the risk of broken layouts or security issues.

Step 6: Scale the editor across your LMS

Once implemented, this same editor can be reused for:

  • Lesson descriptions
  • Learning objectives
  • Instructor notes
  • Announcements

Because Froala is lightweight and framework-agnostic, it scales cleanly as your LMS grows without adding performance overhead.

Get the complete example from this GitHub repository.

You can explore Froala’s documentation to see how these configurations fit into real LMS workflows.

Security & performance considerations for LMS editors

Course content is user-generated, which means security can’t be an afterthought. Your LMS editor should help limit risks like cross-site scripting (XSS) by controlling which tags and attributes are allowed. Clean, predictable HTML makes sanitization easier and more reliable.

Performance matters just as much. As your LMS grows, editors need to stay responsive even with large course catalogs and many active users. Features like lightweight rendering, efficient updates, and autosave support help keep the editing experience smooth. A well-optimized editor reduces load times, avoids UI freezes, and keeps both instructors and learners happy.

Learn how Froala enhanced the security and performance with its updates.

Common mistakes LMS teams make when building course editors

Building an LMS course editor seems simple at first. But small implementation decisions can create long-term usability, security, and maintenance problems. Avoiding the following common mistakes will save your team time and prevent issues as your LMS scales.

  • Relying on basic textareas: Assuming simple text inputs will scale usually leads to formatting limits and poor authoring experiences.
  • Allowing unrestricted HTML: This often results in broken layouts, inconsistent styling, and serious security risks.
  • Over-engineering custom editors: Building everything from scratch can create tools that are difficult to maintain and evolve over time.
  • Ignoring accessibility: Poor markup and inconsistent formatting make course content harder to use for many learners.
  • Generating messy or unpredictable HTML: Unclean output creates long-term maintenance issues that become harder to fix as the LMS grows.
  • Underestimating future scale: These problems may not appear immediately, but they surface quickly as content, users, and features expand.

Why Froala is a strong fit for LMS platforms

Froala is built for LMS platforms that need both usability and control. Instructors get a clean, intuitive editing experience, while developers work with predictable, well-structured HTML.

Because Froala is lightweight and framework-agnostic, it fits easily into existing LMS architectures and scales as your content and user base grow. You can customize the editor, keep performance high, and maintain consistency across courses.

Try Froala in your LMS and explore the documentation to see how quickly you can build a production-ready course editor.

Conclusion

A strong course description editor plays a bigger role in your LMS than it might seem at first. It shapes how instructors create content and how learners experience it. When editing feels simple and reliable, course quality improves across the platform.

Using professional HTML editor software helps you avoid formatting issues, messy markup, and usability problems as your LMS grows. With clean output, flexible customization, and solid performance, you can support both non-technical instructors and technical requirements with confidence.

Froala makes this balance easier to achieve. It gives you a production-ready editor that scales with your LMS, keeps content consistent, and supports long-term growth without adding unnecessary complexity.

graphical user interface, text

How to Create a Custom Blog Editor That Connects Directly to Your CMS

Custom blog editor connected to a CMS

Default CMS editors work until they don’t. As products scale, teams often run into limitations around customization, workflow fit, and content control. Markdown-only editors solve some problems but create others, especially for non-technical users who need rich formatting and media support.

That’s why many teams choose to implement a CMS rich text editor tailored to their product. The goal isn’t to build an editor from scratch, but to create a custom blog editor that integrates cleanly with the CMS, the frontend, and real publishing workflows.

Key takeaways

  • A CMS rich text editor is not a monolithic feature. It’s a system composed of an editor layer, a CMS API, and a clear content workflow.
  • Building a custom blog editor does not mean writing an editor from scratch. It means assembling proven components in a way that fits your CMS and frontend architecture.
  • Clean, predictable HTML output is critical for long-term maintainability, previews, and content reuse across platforms.
  • The editor layer has a direct impact on author experience, content quality, and technical debt inside the CMS.
  • Choosing the right HTML editor software early simplifies integration, reduces edge cases, and keeps publishing workflows flexible as your product grows.

What “custom blog editor” really means

A “custom blog editor” doesn’t mean building a text editor from scratch. That would be slow, risky, and unnecessary. In practice, it means assembling a system where each part has a clear responsibility.

You start with an editor layer in the frontend. This is where authors write, format, and manage content. Next comes your CMS, which handles storing posts, managing metadata, and controlling access. Between them sits an API layer that moves content back and forth in a predictable way.

Content storage is another key decision. Most teams store blog content as HTML, sometimes alongside structured fields like titles, tags, or excerpts. Publishing workflows, drafts, previews, approvals are then built on top of that foundation.

This is where html editor software plays a critical role. It provides the editing experience without forcing you to build complex behavior yourself. Instead of solving cursor handling, formatting rules, or content sanitization, you focus on how content flows through your system.

The result is a custom editor experience, built from well-defined, reusable parts.

Core architecture of a CMS rich text editor

At a high level, a CMS rich text editor is made up of a few core components working together.

The editor lives in the frontend. It handles text input, formatting, embeds, and media interactions. As users write, the editor produces output, most commonly HTML, that represents the content in a portable format.

That output is sent to your CMS through an API. The CMS doesn’t need to understand how the content was created. It just stores and retrieves it. Alongside the main body, you’ll usually store structured fields such as titles, slugs, authors, and publish status.

Storage format matters. HTML is often the simplest choice because it renders easily on the frontend and works across different systems. Some CMSs use block-based or JSON formats, but those still need to be converted for display. Choosing a clean, predictable format early reduces complexity later.

Preview and publishing complete the loop. When an author edits an existing post, the CMS returns the saved content to the frontend, where it’s loaded back into the editor. Drafts, previews, and published versions are usually just different states of the same content.

You can think of the flow like this:

Core architecture of a CMS rich text editor
Core architecture of a CMS rich text editor

When this loop is clean, everything else becomes easier to build.

Choosing the right HTML editor software

Once you understand the architecture, the editor layer becomes the most important decision. You need to consider the points below when choosing an HTML editor.

  • HTML output quality: The editor should generate clean, predictable markup that your CMS can store safely and your frontend can render without surprises.
  • Framework compatibility: Framework compatibility matters just as much. Whether you’re working in React, Vue, Angular, or a custom setup, the editor should integrate cleanly without forcing unusual patterns or heavy wrappers. 
  • Plugin architecture: A strong plugin architecture is another signal of a production-ready editor. Image handling, embeds, tables, and custom content blocks shouldn’t require rewriting core logic.
  • Performance: A lightweight bundle and fast load time directly affect author experience, especially in large CMS interfaces.
  • Security and maintainability: Your content editor should have sanitization, updates, and long-term support. 

Learn how Froala’s CMS rich text editor is designed for secure, high-performance content workflows.

Step-by-step: creating a custom blog editor connected to your CMS

Let’s walk through the steps involved in creating a custom blog editor and connecting it directly to your CMS. 

Step 0: What we’re building

Before diving into code, it’s important to be clear about what this example actually demonstrates.

In this walkthrough, you’re building a custom blog editor that connects directly to a real CMS. Froala acts as the rich text editor layer in the frontend, while Strapi serves as the CMS and source of truth for storing and managing content.

The setup looks like this:

  • React frontend renders the editing interface
  • Froala provides the rich text editing experience
  • Strapi (REST API) stores blog posts and metadata
  • Blog content is saved and retrieved as HTML
  • The same content can be edited, saved, and reloaded without transformation issues

This mirrors how modern SaaS platforms, marketing sites, and headless CMS frontends handle content in production. The editor does not replace the CMS. Instead, it integrates cleanly with it, allowing each layer to focus on what it does best.

A complete, runnable example of this setup is available in the accompanying GitHub repository, which you can clone and run locally to follow along.

Step 1: Set up Strapi as the CMS

This guide uses Strapi with its REST API as the backend CMS.

Create the post content model

In Strapi, create a collection type called Post. This collection represents blog posts authored through the custom editor.

The model includes four core fields:

  • Title – the human-readable post title
  • Slug – a UID generated from the title for routing
  • Content – the HTML body generated by Froala
  • Status – a simple draft/published workflow

Create a Strapi project locally

From your project root (or a cms/ folder):

npx create-strapi-app@latest cms

Choose:

Quickstart (recommended) → YES

Database → SQLite (default)

Start with an example structure & data → NO

Start with Typescript → NO

Install dependencies with npm → YES

Initialize a git repository → NO

You don’t need to sign up for a Strapi account for this example. Strapi runs locally without signing up, and you’ll only create a one-time local admin user during setup.

Then:

cd cms
npm run develop

This will:

  • Start Strapi at http://localhost:1337
  • Open the Strapi Admin UI in the browser

One-time admin setup

The first time Strapi runs, it will ask you to:

  • Create an admin user (email + password)

This is local only, not a Strapi account.

Strapi Admin UI
Strapi Admin UI

How to create the Post content model

There are two ways to create the Post content model.

For this example, I recommend the below option (creating it via Strapi admin UI). The other option is creating the model using JSON.

Step-by-step in the UI

1. Open Strapi admin:

http://localhost:1337/admin

Strapi Administration Panel
Strapi Administration Panel

2. Go to Content-Type Builder

Go to Content Type Builder in Strapi admin panel

3. Click Create new collection type

 

Click Create new collection type (4. Set:

Display name: Post

Creating a collection type

5. Then click ‘Continue’ and add fields one by one:

Field 1: Title

  • Type: Text
  • Name: title
  • Required: ✅

Field 2: Slug

  • Type: UID
  • Name: slug
  • Attached field: title
  • Required: ✅

Field 3: Content

  • Type: Rich Text
  • Name: content
  • Required: ✅

This field will store HTML output from Froala

Field 4: Status

(Strapi will create this column automatically)

6. Click Save

7. Wait for Strapi to restart

Your Post collection is now created.

Post collection created in Strapi Content Type Builder
Post collection created in Strapi Content Type Builder

This model intentionally keeps things simple. The CMS is responsible for managing structure, metadata, and workflow state, while the editor focuses purely on content creation.

In this setup, Froala outputs clean HTML, which is stored directly in the CMS.

Enable REST API access (important)

By default, Strapi blocks public access. Enable public access to these endpoints for local development and demonstration purposes. In a production setup, authentication and role-based permissions would be applied, but the integration pattern remains the same.

For the demo:

1. Go to Settings → Users & Permissions → Roles

2. Click Public

Enable REST API access

3. Enable permissions for:

    • find
    • findOne
    • create
    • Update

Permissions of Posts

4. Save

Standard Strapi REST endpoints

These are the standard Strapi REST endpoints:

  • POST /api/posts to create a new post
  • GET /api/posts/:id to load an existing post
  • PUT /api/posts/:id to update content
  • GET /api/posts to list posts

At this point, Strapi is ready to act as the CMS layer. In the next step, you’ll integrate Froala into the React frontend and connect it directly to some of these endpoints.

Step 2: Integrate Froala into the React editor page

With the CMS in place, the next step is to build the editor layer in the frontend. This is where authors create and edit blog content, while the CMS remains responsible for storage and workflow.

In this setup, Froala is used purely as the rich text editor, not as a CMS. It lives inside a React page that represents a “create or edit post” screen, similar to what you’d see in a real admin interface.

Install Froala and the required assets

In your React project, install the Froala editor and its React wrapper:

npm install froala-editor react-froala-wysiwyg

Next, load Froala’s core files and plugins once at the application entry point. This ensures all toolbar actions and formatting features work correctly.

In src/main.jsx:

import "froala-editor/js/froala_editor.pkgd.min.js";
import "froala-editor/js/plugins.pkgd.min.js";
import "froala-editor/css/froala_editor.pkgd.min.css";
import "froala-editor/css/froala_style.min.css";

Without the plugins bundle, toolbar buttons will render but not function, which is a common integration mistake.

Your completed src/main.jsx should be like the following example :

import React from "react";
import ReactDOM from "react-dom/client";

import App from "./App";

// Froala core + plugins
import "froala-editor/js/froala_editor.pkgd.min.js";
import "froala-editor/js/plugins.pkgd.min.js";

// Froala styles
import "froala-editor/css/froala_editor.pkgd.min.css";
import "froala-editor/css/froala_style.min.css";

ReactDOM.createRoot(document.getElementById("root")).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

Create the editor page

Create a dedicated page for creating blog posts. In a real CMS, this would typically be part of an admin or dashboard interface.

Example: src/pages/EditorPage.jsx

import { useState } from "react";
import FroalaEditor from "react-froala-wysiwyg";
import editorConfig from "../components/EditorToolbarConfig.js";

export default function EditorPage() {
  const [content, setContent] = useState("");

  return (
    <div className="editor-page">
      <h2>Create Blog Post</h2>

      <FroalaEditor
        model={content}
        onModelChange={setContent}
        config={editorConfig}
      />
    </div>
  );
}

At this stage, the editor is fully functional, but it’s not yet connected to the CMS. The goal here is to confirm that Froala behaves correctly inside your application layout before introducing persistence.

Configure the toolbar and allowed content

Rather than exposing every possible formatting option, most CMS-driven editors restrict what authors can create. This keeps stored content predictable and easier to render.

Create a simple toolbar configuration:

// src/components/EditorToolbarConfig.js
const editorConfig = {
  toolbarButtons: [
    "bold",
    "italic",
    "underline",
    "paragraphFormat",
    "formatOL",
    "formatUL",
    "insertLink",
    "insertImage",
    "undo",
    "redo"
  ],
  heightMin: 300
};

export default editorConfig;

This configuration enforces editorial boundaries at the editor level, reducing the risk of invalid or unsupported markup entering the CMS.

Why this step matters

At this point, you have a real editing interface embedded in a modern frontend framework:

  • Froala handles text input, formatting, and media interactions
  • React manages editor state and UI composition
  • No CMS logic is baked into the editor itself

This separation is intentional. The editor produces clean HTML, but it does not decide where or how that content is stored. That responsibility remains with the CMS.

In the next step, you’ll connect this editor directly to Strapi by creating and saving content through its REST API, turning this UI into a true CMS-backed blog editor.

Step 3: Save editor content to Strapi via the REST API

With Froala embedded in the editor page, the next step is to persist content in the CMS. This is where the editor stops being a standalone UI component and becomes part of a real publishing workflow.

In this setup, Strapi is the source of truth. Froala produces HTML, React manages state, and Strapi stores and retrieves content through its REST API.

Create a CMS API service

To keep CMS logic out of UI components, create a small service layer responsible for communicating with Strapi.

Example: src/services/cmsApi.js

const STRAPI_URL = "http://localhost:1337";

/**
 * Convert a title into a URL-safe slug
 */
function slugify(text) {
  return text
    .toLowerCase()
    .trim()
    .replace(/[^a-z0-9]+/g, "-")
    .replace(/(^-|-$)/g, "");
}

/**
 * Create a new blog post in Strapi
 */
export async function createPost({ title, content }) {
  const slug = slugify(title);

  const response = await fetch(`${STRAPI_URL}/api/posts`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      data: {
        title: title,        // must match schema exactly
        slug,               // required UID field
        content,
        post_status: "draft"
      },
    }),
  });

  const result = await response.json();

  // Throw on validation / permission errors
  if (!response.ok) {
    const message =
      result?.error?.message || "Failed to create post in CMS";
    throw new Error(message);
  }

  return result;
}

/**
 * Fetch a single post by ID (used only in edit flows)
 */
export async function getPost(id) {
  const response = await fetch(`${STRAPI_URL}/api/posts/${id}`);

  if (!response.ok) {
    return null;
  }

  const result = await response.json();
  return result.data;
}

This function mirrors how real applications interact with a CMS: the frontend sends structured data, and the CMS handles storage and validation.

Send editor content to the CMS

Next, wire this API call into the editor page. Alongside the rich text content, you’ll typically send structured metadata such as the title and slug.

Update EditorPage.jsx:

import { useState } from "react";
import FroalaEditor from "react-froala-wysiwyg";
import editorConfig from "../components/EditorToolbarConfig";
import { createPost } from "../services/cmsApi";

export default function EditorPage() {
  const [title, setTitle] = useState("");
  const [content, setContent] = useState("");
  const [saving, setSaving] = useState(false);
  const [statusMessage, setStatusMessage] = useState("");

  async function handleSave() {
    if (!title.trim() || !content.trim()) {
      setStatusMessage("Title and content are required.");
      return;
    }

    try {
      setSaving(true);
      setStatusMessage("");

      const result = await createPost({
        title,
        content,
      });

      // Only reset editor if CMS confirms save
      if (result?.data?.id) {
        setStatusMessage("Post saved as draft in CMS.");
        setTitle("");
        setContent("");
      }
    } catch (error) {
      console.error(error);
      setStatusMessage(
        error.message || "Failed to save post. Check CMS validation."
      );
    } finally {
      setSaving(false);
    }
  }

  return (
    <div className="editor-page">
      <h2>Create Blog Post</h2>

      <input
        type="text"
        placeholder="Post title"
        value={title}
        onChange={(e) => setTitle(e.target.value)}
        style={{ width: "100%", marginBottom: "1rem" }}
      />

      <FroalaEditor
        model={content}
        onModelChange={setContent}
        config={editorConfig}
      />

      <button
        onClick={handleSave}
        disabled={saving || !title.trim() || !content.trim()}
        style={{ marginTop: "1rem" }}
      >
        {saving ? "Saving..." : "Save Changes"}
      </button>

      {statusMessage && (
        <p style={{ marginTop: "0.75rem" }}>{statusMessage}</p>
      )}
    </div>
  );
}

When the author clicks Save, the editor’s HTML output is sent directly to Strapi and stored in the content field of the Post collection.

 

Why Froala works well as a CMS rich text editor

Once you look at the full lifecycle of a custom blog editor, authoring, storage, previewing, and publishing, the editor layer becomes a critical dependency. This is where Froala fits naturally into a CMS-driven architecture.

One of the biggest advantages is clean, predictable HTML output. Froala is designed to produce structured markup that’s easy to store in a CMS and reliable to render on the frontend. That consistency matters when content needs to round-trip between the editor and the CMS without degrading over time.

Froala’s lightweight core also makes a difference in real applications. Large CMS interfaces already carry significant JavaScript overhead. An editor that loads quickly and doesn’t dominate the bundle helps keep authoring experiences responsive, even as the product grows.

From an implementation standpoint, Froala’s plugin-based extensibility aligns well with custom workflows. Features like images, tables, embeds, or custom content blocks can be enabled or restricted based on your CMS rules, without modifying the editor’s internals. This keeps the integration flexible instead of fragile.

Finally, Froala offers framework SDKs and enterprise-ready security features, making it easier to integrate into modern stacks while meeting production requirements. Instead of solving editing complexity yourself, you get a stable, well-supported CMS rich text editor that lets your team focus on content and workflow, not editor maintenance.

Final takeaway

Building a custom blog editor isn’t about recreating text-editing functionality from scratch. It’s about choosing the right components and assembling them in a way that fits your CMS and publishing workflow. When the editor layer is poorly chosen, complexity leaks into every part of the system, from storage and previews to long-term maintenance.

A well-designed CMS rich text editor keeps content clean, workflows predictable, and integrations manageable. By using a flexible, production-ready editor instead of maintaining your own, teams reduce risk and move faster without sacrificing control.

If you’re evaluating how to connect a custom blog editor directly to your CMS, exploring Froala’s documentation is a practical next step.

Tested Froala and ready to ship?

Move from evaluation to production with the right Froala license.

graphical user interface, text

 

Cloud vs Self-Hosted Editors — Which One Should You Choose?

Illustration comparing cloud vs self-hosted editors, showing cloud-based infrastructure balanced against on-premise servers for content editing

If you’re building a product that relies on rich content, such as a CMS, LMS, or SaaS platform, you’ll eventually face the “cloud vs self-hosted” decision. It often appears early, then resurfaces as your product grows and new requirements emerge.

Cloud-based editors focus on speed and convenience, while self-hosted editors emphasize control and flexibility. But the real choice depends on more than features. Performance expectations, security and compliance needs, and long-term scalability all play a role.

There’s no universally “right” option. The best approach depends on your team, infrastructure, and product goals. Also, as products mature, many teams find that control and architectural flexibility become more important than initial convenience.

This article breaks down the differences to help you choose based on your use case, not hype.

Key takeaways

  • There is no universal winner in the cloud vs self-hosted debate.
  • Cloud-based editors prioritize speed, convenience, and low setup effort.
  • Self-hosted editors offer stronger architectural control, long-term flexibility, and greater predictability as products scale.
  • Security, compliance, and performance needs often influence the decision.
  • Choosing intentionally early can prevent costly migrations later.

What is a cloud-based editor?

A cloud-based editor is hosted and managed by a third-party provider and accessed over the internet. Instead of installing the editor on your own servers, you connect to it as a service, usually through a subscription. The provider handles the infrastructure, hosting, and ongoing maintenance.

Cloud-based editor setup is minimal, updates are automatic, and scaling is largely handled for you. When new features or fixes are released, they’re typically rolled out without any action required from your team. However, this convenience can sometimes limit how deeply the editor integrates into your broader application architecture.

Explore the basics of cloud hosting.

What is a self-hosted editor?

A self-hosted editor is installed and run on your own infrastructure rather than being delivered as a hosted service. This could mean deploying it on your servers, a private cloud, or an on-premise environment. You control how the editor is configured, where it runs, and how it integrates with the rest of your system.

With a self-hosted WYSIWYG editor, updates and maintenance are managed by your team. While this requires more upfront effort, it also gives you architectural flexibility that can be valuable as your product grows. You decide when to upgrade, how features are enabled, and how the editor fits into your existing workflows and security policies.

For teams building long-term platforms rather than short-term projects, this level of ownership often becomes a strategic advantage.

Key differences at a glance

The table below summarizes the core differences between cloud-based and self-hosted editors across the areas teams most often care about.

AspectCloud-Based EditorSelf-Hosted Editor
Hosting & infrastructureHosted and managed by a third-party providerHosted on your own servers or private infrastructure
Setup timeVery fast, minimal configurationLonger initial setup and deployment
Customization flexibilityLimited to provider-supported optionsHigh flexibility and deep customization
Performance controlDepends on provider’s infrastructureFully optimized based on your stack
Data ownershipData handled through third-party systemsFull data ownership and control
Security & complianceProvider-managed, varies by vendorEasier to align with internal policies
Cost structureSubscription-based, predictable short-termInfrastructure and maintenance costs
Dependency on third partiesHigh dependency on vendor availabilityLow dependency once deployed

Pros and cons of cloud-based editors

cloud-based rich text editor

Cloud-based editors are often chosen for their convenience and speed, but they come with clear advantages and limitations.

Pros

  • Fast setup with minimal configuration
  • No need to manage servers or infrastructure
  • Automatic updates and maintenance handled by the provider
  • Easy to scale for early-stage or smaller projects
  • Predictable short-term costs through subscription pricing

Cons

  • Limited control over hosting and infrastructure
  • Performance depends on third-party servers
  • Potential data residency and data ownership concerns
  • Security and compliance options are constrained by the provider
  • Risk of vendor lock-in as the product grows

Pros and cons of self-hosted editors

self hosted rich text editor

Self-hosted editors offer a different set of trade-offs, focusing more on control and long-term flexibility.

Pros

  • Full control over data, hosting, and infrastructure, without relying on third-party availability
  • Easier to meet security, privacy, and compliance requirements
  • Greater flexibility for customization and integrations
  • Ability to optimize performance based on your own stack
  • Full control over upgrade timing with no forced updates

Cons

  • Requires initial setup and configuration
  • Ongoing maintenance and updates are your responsibility
  • Infrastructure management adds operational overhead
  • Longer time to get started compared to cloud-based solutions

When cloud makes more sense

Cloud-based editors are often the right choice when speed and simplicity matter more than deep control. For early-stage startups or small teams, cloud solutions reduce setup time and allow products to ship quickly without worrying about infrastructure or maintenance.

They also work well for proof-of-concept projects and MVPs. When the goal is to validate an idea or test user behavior, the flexibility and low upfront effort of a cloud editor can be a major advantage.

Teams without dedicated DevOps or infrastructure expertise often benefit from this model as well. By offloading hosting, scaling, and updates to a provider, developers can stay focused on building core features rather than managing systems.

In situations where customization needs are limited and content requirements are relatively simple, a cloud-based editor can provide everything needed with minimal overhead.

When self-hosted is worth considering

A self-hosted editor often becomes more compelling as products mature and requirements become more defined. Teams handling sensitive or regulated data frequently lean toward self-hosted setups because they offer full data ownership and control. Content remains within your environment, making it easier to align with internal security policies, compliance standards, and governance frameworks.

Performance-critical platforms are another strong case. When response times, uptime guarantees, or regional performance expectations truly matter, direct control over infrastructure allows teams to optimize the editor as part of their broader architecture. Instead of depending on external hosting conditions, the editor can be tuned alongside the rest of the application stack.

Self-hosted editors also make sense for long-term products where customization and integration are priorities. As workflows evolve, teams may require deeper integrations, tailored features, or tighter alignment with internal systems. A self-hosted approach provides the architectural flexibility to adapt without being constrained by a provider’s roadmap or release cycles.

Organizations with established infrastructure or defined upgrade policies often prefer self-hosted solutions as well. Controlling when updates occur, testing changes internally, and avoiding unexpected modifications can reduce operational risk and improve predictability as the product scales.

In many mature SaaS products, the editor eventually becomes a core part of the application rather than a simple add-on. In those cases, integrating it fully within your own infrastructure can provide stability, performance consistency, and long-term flexibility that are harder to achieve with fully managed external services.

Common myths about cloud vs self-hosted

Let’s explore some of the most common assumptions around cloud and self-hosted editors, and look at the practical reality behind each of them.

“Cloud is always more secure.”

Cloud providers invest heavily in security, but security isn’t automatic. How data is handled, stored, and accessed matters just as much as where it’s hosted. In many cases, self-hosted setups offer stronger control simply because teams can enforce their own security and compliance policies end to end.

Explore more about the security of cloud storage.

“Self-hosted editors are outdated.”

Self-hosted doesn’t mean old-fashioned. Many modern editors, including solutions like Froala’s self-hosted WYSIWYG editor, are built to integrate seamlessly with modern frameworks and deployment models. It’s a deployment choice, not a reflection of capability.

“Cloud solutions are always cheaper.”

Cloud-based editors often look cost-effective early on, but expenses can increase as usage scales. Subscription tiers, usage limits, and add-ons may raise long-term costs. Self-hosted solutions usually require more upfront effort, but they can offer more predictable costs over time.

These assumptions persist because the comparison is often oversimplified. In practice, both models have valid strengths. The right choice depends on your product’s needs, not common myths.

Final thoughts: it depends, but choose intentionally

Cloud-based and self-hosted editors both have a place, and neither approach is inherently better than the other. The right choice depends on how your product is built today, and how you expect it to evolve over time.

Before deciding, it’s worth stepping back and evaluating a few key factors: 

  • The size and capabilities of your team
  • Your security and compliance requirements 
  • How much customization you’ll need, and 
  • How critical performance and scalability are to your users. 

A solution that feels convenient now may introduce limitations later, while a more controlled setup might offer flexibility you’ll appreciate as your product grows.

While cloud solutions can be ideal for rapid experimentation, many teams building long-term platforms eventually prioritize control, stability, and ownership. Thinking ahead about where your product is headed, not just where it is today, can help you make a more sustainable architectural decision.

Ultimately, the most important thing is to choose intentionally. Understanding the trade-offs early can help you avoid costly migrations, rework, or architectural changes down the line, and set your product up for smoother growth in the long run.

FAQs

1. What is the main difference between cloud and self-hosted editors?

The main difference lies in hosting and control. Cloud-based editors are hosted and managed by a third-party provider, while self-hosted editors run on your own infrastructure, giving you full control over data, performance, and configuration.

2. Is a cloud-based editor better for startups?

Cloud-based editors often suit early-stage startups and MVPs because they offer fast setup, minimal maintenance, and lower upfront effort. However, as products scale, teams may reassess this choice based on security, customization, and long-term needs.

3. When should teams consider switching to a self-hosted editor?

Teams typically consider self-hosted editors when they need greater data ownership, stricter security or compliance controls, predictable performance, or deeper customization as their product matures.

graphical user interface, text

From Word to Froala in Seconds: Mastering Import from Word Plugin

Import from Word to Froala editor

The Import from Word Plugin lets users drag .docx files directly into the Froala Editor while preserving formatting and structure. 

This comprehensive guide is designed for developers, content managers, and web administrators who want to master the Import from Word Plugin. Whether you’re integrating Froala into a new project or enhancing an existing content management system, this article will walk you through every aspect of the plugin, from basic setup to advanced configurations and troubleshooting.

Import from Word document

Quick Start: Get It Working in 5 Minutes

Here’s what you need to see the plugin work:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.min.css" rel="stylesheet">
  <style>
    body { font-family: Arial, sans-serif; padding: 20px; }
  </style>
</head>
<body>
  <h1>Import a Word Document</h1>
  <p>Drag a .docx file below or click the button to select one.</p>
  
  <div id="editor"></div>
  <!-- Mammoth.js handles the .docx conversion -->
  <script src="https://cdn.jsdelivr.net/npm/mammoth@1.11.0/mammoth.browser.js"></script>
  <!-- Froala Editor core -->
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.min.js"></script>
  <!-- Import from Word plugin -->
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/import_from_word.min.js"></script>
  <script>    
new FroalaEditor('#editor', {      
  // Allow .docx files only
  importFromWordFileTypesAllowed: ['docx'],
  // Set 5MB file size limit
  importFromWordMaxFileSize: 5 * 1024 * 1024
  // Enable drag-and-drop (enabled by default)
  importFromWordEnableImportOnDrop: true
});

  </script>
</body>
</html>

That’s it. Save this as an HTML file, open it in a browser, drag a Word document onto the editor. Watch the formatting transfer instantly.

If it works—and it will—you’ve just experienced what the rest of this guide explains in detail. When you need to customize, add validation, or switch to server-side conversion, those options are all below.

What is the Import from Word Plugin?

The Import from Word Plugin is a specialized extension for the Froala Editor that enables direct import of Microsoft Word documents (.docx format) directly into the editor interface. At its core, this plugin bridges the gap between traditional document creation tools and modern web-based content management systems.

Core Functionality

The plugin’s primary function is to convert .docx files into HTML content that can be seamlessly integrated into the Froala Editor. This conversion process handles complex document structures, including text formatting, paragraph styles, lists, tables, images, and other elements that are commonly used in Word documents.

Key Benefits

  1. Direct Import: Users can import .docx files directly without needing to copy-paste content manually
  2. Format Preservation: Headings, lists, images, and other formatting elements transfer automatically
  3. Time Efficiency: Eliminates hours of manual reformatting work
  4. User-Friendly: Intuitive interface that requires minimal training
  5. Flexible Options: Supports both client-side and server-side conversion methods

Key Features and Capabilities

Seamless .docx File Import with Formatting Intact

The plugin excels at maintaining the original document’s visual integrity during the import process.

This ensures that the imported content maintains its professional appearance without requiring additional manual adjustments.

Dual Conversion Approach

A standout feature of the Import from Word Plugin is its flexible conversion architecture:

  1. Client-Side Conversion: Uses Mammoth.js library for browser-based processing
  2. Server-Side Conversion: Backend processing for larger files or enhanced security

This dual approach allows developers to choose the most appropriate method based on their specific requirements, whether prioritizing performance, security, or user experience.

Drag-and-Drop Functionality

The plugin includes intuitive drag-and-drop capabilities that enhance the user experience:

  • Direct File Drop: Users can drag .docx files directly onto the editor
  • Visual Feedback: Clear indication when files are over the editor area
  • Automatic Processing: Files are processed immediately upon dropping

This feature makes document import feel natural and integrated with the overall editing experience.

File Size and Type Restrictions

The plugin includes built-in controls to manage file uploads:

  • Size Limits: Configurable maximum file size to prevent server overload
  • Type Validation: Restrict import to specific file formats (primarily .docx)
  • User Feedback: Clear error messages for invalid or oversized files

These restrictions help maintain system performance and security while providing flexibility for different use cases.

Event-Driven Architecture

The plugin’s event system enables developers to hook into various stages of the import process:

  • Pre-Import Events: Validate files before processing begins
  • Post-Import Events: Modify or enhance imported content
  • Error Handling: Catch and manage conversion errors gracefully
  • Custom Workflows: Implement specialized business logic

This event-driven approach allows for highly customized implementations that can adapt to specific requirements.

Configuration Options

File Size Configuration

importFromWordMaxFileSize

Allow you to set the maximum allowed file size in bytes for Word document imports.

Default Value: 3 1024 1024 (3MB)

Implementation:

// Set maximum file size to 5MB

new FroalaEditor('#editor', {

  importFromWordMaxFileSize: 5 * 1024 * 1024,

  // other options...

});

Use Cases and Optimization Tips:

  1. Small Documents (1-2MB): Ideal for typical Word documents with text and basic images
  2. Medium Documents (2-5MB): Suitable for documents with moderate image content
  3. Large Documents (5-10MB): For complex documents with many images or embedded media
  4. Very Large Documents (10MB+): Consider server-side conversion for better performance

Best Practices for File Size Management:

  • Start with conservative limits and adjust based on user needs
  • Consider server capacity when setting size limits
  • Provide clear feedback to users about file size restrictions
  • Implement progress indicators for larger files
  • Consider compression for image-heavy documents
// Advanced configuration example

new FroalaEditor('#editor', {

  importFromWordMaxFileSize: 8 * 1024 * 1024, // 8MB

  // Add file size validation feedback

        events: {

          'word.beforeImport': function (file) {

            if (file.size > 5 * 1024 * 1024) {

              this.events.focus();

              alert('Large file detected. Processing may take longer...');

            }

          }

        }

});

File Type Configuration

importFromWordFileTypesAllowed

An array of allowed file extensions for import functionality.

Default Value: [‘docx’]

Implementation:

// Allow multiple file types

new FroalaEditor('#editor', {

  importFromWordFileTypesAllowed: ['docx', 'doc'],

  // other options...

});

Conversion Method Configuration

importFromWordUrlToUpload

The URL of a server-side handler for conversion. If null, client-side conversion via mammoth.js is used.

Default Value: null

Implementation:

// Server-side conversion

new FroalaEditor('#editor', {

  importFromWordUrlToUpload: '/api/convert-word',

  // other options...

});

or set it dynamically

// Implementation with dynamic configuration

new FroalaEditor('#editor', {

  importFromWordFileTypesAllowed: ['docx'],

        importFromWordMaxFileSize: 20 * 1024 * 1024, // 20MB

        events: {

          'word.beforeImport': function (file) {

          // Dynamic conversion method selection




            if (file.size > 5 * 1024 * 1024) {

              this.opts.importFromWordUrlToUpload = getConversionMethod(file.size);

              alert('Large file detected. Processing may take longer...');

            } else {

              this.opts.importFromWordUrlToUpload = null;

            }

          }

        }

});

Drag-and-Drop Configuration

importFromWordEnableImportOnDrop

Whether to trigger the import process when a valid Word file is dropped into the editor.

Default Value: true

// Disable drag-and-drop import

new FroalaEditor('#editor', {

  importFromWordEnableImportOnDrop: false,

  // other options...

});

Plugin Methods

importFromWord.import(file)

Parameters:

  • file (object): Optional. The File object to be converted and imported.

Return Values: The method returns a Promise that resolves when the import is complete and rejects if an error occurs.

Behavior:

  • If no file is provided, opens the file selection dialog
  • If a file is provided, processes it directly
  • Triggers appropriate events before and after processing

Event Handling System

Pre-Import Events

word.beforeImport(file)

The word.beforeImport event is triggered just before the file processing begins, after the file has been selected but before any conversion or import operations start.

Event Parameters and Structure:

  • file: The File object containing the selected document
  • Event can return: false to cancel the import, or true/undefined to proceed

Use Cases for Pre-Import Validation:

File Size Validation:

events: {

  'word.beforeImport': function (file) {

    const maxSize = 10 * 1024 * 1024; // 10MB

    if (file.size > maxSize) {

      return false; // Cancel import

    }

    return true; // Proceed with import

  }

}

Post-Import Events

word.afterImport(html)

The word.afterImport event is triggered after the content has been successfully converted and inserted into the editor. This event fires only when the import process completes successfully.

Event Parameters and Structure:

  • html: The converted HTML content that was imported

HTML Content Handling: The event receives the complete HTML content that was imported, allowing for post-processing, validation, or modification before the user sees the content.

Custom Post-Processing Example:

Content Cleaning and Optimization:

events: {

  'word.afterImport': function (html) {

    // Clean up Word-specific HTML artifacts

    let cleanedHtml = html;

    

    // Remove Word-specific metadata

    cleanedHtml = cleanedHtml.replace(/<o:[^>]*>.*?<\/o:[^>]*>/gi, '');

    cleanedHtml = cleanedHtml.replace(/<st1:[^>]*>.*?<\/st1:[^>]*>/gi, '');

    

    // Remove empty paragraphs and spans

    cleanedHtml = cleanedHtml.replace(/<p[^>]*>\s*&nbsp;\s*<\/p>/gi, '');

    cleanedHtml = cleanedHtml.replace(/<span[^>]*>\s*&nbsp;\s*<\/span>/gi, '');

    

    // Remove unwanted style attributes

    cleanedHtml = cleanedHtml.replace(/style="[^"]*mso[^"]*"/gi, '');

    

    // Update editor with cleaned content

    this.html.set(cleanedHtml);

    

    // Log the cleaning operation

    console.log('Content cleaned after import');

  }

}

Client-Side VS Server-Side

Client-Side Conversion via Mammoth.js

The plugin utilizes the Mammoth.js library for client-side conversion, a JavaScript library designed to convert .docx files to HTML directly within the browser environment. This approach provides several significant advantages for implementing document import functionality:

Key Advantages:

  • Reduced Server Load: Document processing occurs entirely within the user’s browser, eliminating the need for server-side resource allocation
  • Optimized Response Time: Eliminates file upload latency and server processing delays, delivering immediate conversion results
  • Enhanced User Experience: Users receive instantaneous feedback during the conversion process without waiting for server round-trips
  • Offline Functionality: Enables document import capabilities without requiring continuous server connectivity

Mammoth.js integration delivers enterprise-grade conversion reliability while maintaining optimal performance across contemporary browser environments.

Mammoth.js Implementation:

The following methods are available for including Mammoth.js in your project:

<!-- CDN Implementation -->

<script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.4.21/mammoth.browser.min.js"></script>

<!-- Alternative CDN Providers -->

<!-- jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/mammoth@1.4.21/mammoth.browser.min.js"></script>


<!-- Unpkg -->
<script src="https://unpkg.com/mammoth@1.4.21/mammoth.browser.min.js"></script>

Alternative Installation Methods:

// npm installation
npm install mammoth

// Yarn installation
yarn add mammoth

// Bower installation
bower install mammoth

// ES6 module import
import mammoth from 'mammoth';

// CommonJS implementation
const mammoth = require('mammoth');

Server-Side Conversion

For use cases where client-side conversion presents limitations, the plugin supports server-side processing through a dedicated backend service that handles .docx file conversion. This approach is recommended for:

  • Large Files: Documents exceeding browser memory constraints
  • Enhanced Security: Processing sensitive documents on secure infrastructure
  • Advanced Processing: Implementing specialized conversion requirements
  • Content Caching: Storing converted files for improved retrieval performance
  • Batch Operations: Processing multiple documents concurrently

Server-side conversion provides enterprise-level flexibility for applications requiring custom workflows or handling substantial document volumes.

Comparison Matrix: Client-Side vs Server-Side

Factor Client-Side (Mammoth.js) Server-Side
Performance Optimal for small files Optimal for large files
Security Client-based processing Secure server-based processing
Server Resources Minimal impact Higher resource utilization
File Size Limits Browser memory constraints Server capacity constraints
Customization Limited flexibility Full customization capabilities
Offline Support Yes No
Setup Requirements Requires Mammoth.js library Requires backend implementation

Conclusion

The Import from Word Plugin transforms how users move content from Word to web. Instead of the familiar ritual—open file, select text, copy, switch tabs, paste, reformat—users now drag a .docx directly into the editor and move forward. The formatting comes with it. No manual reconstruction. No lost hours.

Whether you opt for client-side speed via Mammoth.js or server-side control, the plugin handles the conversion intelligently. Configure it once, and the friction simply disappears.

Ready to implement? Start with the Basic Implementation Setup section above, test with a sample Word document, then configure the options that fit your use case.

graphical user interface, text

 

State Management Patterns for Editor Components in React-Based LMS Platforms

state react pattern

If you’re building a Learning Management System (LMS) in React, you’ve probably faced this annoying issue: you add a WYSIWYG editor, and suddenly it turns slow. You type, and suddenly the cursor jumps around or the editor re-renders for no reason.

And honestly, the issue isn’t the editor itself; it’s usually the way we handle its state.

WYSIWYG editors like Froala, TinyMCE, and Draft.js are great for creating content, but they come with their own internal state. When we try to sync that state with React (using Redux, Context, or even normal component state), things can get messy really fast.

This post covers simple, beginner-friendly patterns to integrate WYSIWYG editors into a React-based LMS without performance issues.

Key Takeaways

  • Initialise the editor only when needed so it doesn’t re-render too much.
  • Use refs instead of controlled components to keep typing smooth.
  • Debounce state updates to prevent performance degradation during typing.
  • Load the editor after a user action (like clicking a button) instead of loading it immediately.
  • Keep the editor’s content separate from other fast-changing app state to avoid slowdowns.

Understanding the Problem

Before we jump into solutions, let’s first understand why WYSIWYG editors can be tricky in React.

React works best with controlled components, where it manages the state and updates it on every change. But WYSIWYG editors don’t really work that way. They manage a lot of internal stuff on their own: cursor position, text selection, formatting, undo history, and more.

So when we try to make them fully controlled in React, every single keystroke triggers a React state update. That update causes a re-render, which then interferes with the editor’s internal state.

And the result? Laggy typing, the cursor jumping around, and a very frustrated user experience.

Now that we know what causes the lag, let’s look at how to set up a WYSIWYG editor properly before applying the patterns.

Getting Started with a WYSIWYG Editor in React

Before implementing the patterns below, you’ll need to install and set up the editor in your React project.

Installation

First, install the editor package in your React project:

 

npm install react-froala-wysiwyg --save

 

Basic Setup

Now add the following code to src/components/SimpleEditor.jsx to set up a simple editor in your React project:

 

// Import Editor styles and scripts
import "froala-editor/css/froala_style.min.css";
import "froala-editor/css/froala_editor.pkgd.min.css";
import FroalaEditorComponent from "react-froala-wysiwyg";

const SimpleEditor = () => {
  return (
    <FroalaEditorComponent
      tag="textarea"
      config={{
        placeholderText: "Start typing...",
        toolbarButtons: ["bold", "italic", "underline", "undo", "redo"],
        height: 300,
        width: 800,
        events: {
          contentChanged: function () {
            console.log("Content updated!");
          },
          initialized: function () {
            console.log("Editor is ready!");
          },
        },
      }}
    />
  );
};

export default SimpleEditor;

 

 

What these options mean:

  • tag: The HTML element the editor is built on (textarea or div).
  • placeholderText: What shows when the editor is empty.
  • toolbarButtons: Choose which toolbar buttons to show.
  • height: Sets the editor’s height.
  • width: Sets the editor’s width.
  • events: Lets you listen to things like contentChanged or initialized so you can react to editor actions.

Now, import and use it in your App.jsx file:

 

import SimpleEditor from './components/SimpleEditor';

function App() {
return <SimpleEditor />;
}

 

 

Here’s what it will look like:

froala editor

Now that you have the editor set up, let’s look at different patterns to manage its state without hurting performance.

Pattern 1: Using Refs with Uncontrolled Editors (Simplest Approach)

The easiest way to work with a WYSIWYG editor in React is to treat it as an uncontrolled component.

Instead of syncing every keystroke with React, you just use a ref to access the content whenever you need it.

Create a new file src/components/LessonEditor.jsx and add the following code inside it:

 

import React, { useRef, useState } from "react";
import FroalaEditorComponent from "react-froala-wysiwyg";

function LessonEditor() {
  const editorRef = useRef(null);
  const [isSaving, setIsSaving] = useState(false);

  const handleSave = async () => {
    // Get content only when needed
    const content = editorRef.current?.editor?.html?.get();
    setIsSaving(true);
    try {
      await saveToDatabase(content);
      alert("Lesson saved successfully!");
    } catch (error) {
      alert("Error saving lesson");
    }
    setIsSaving(false);
  };

  return (
    <div>
      <h2>Create Your Lesson</h2>
      <FroalaEditorComponent
        ref={editorRef}
        tag="textarea"
        config={{
          placeholderText: "Start writing your lesson content...",
          height: 400,
          width: 900,
        }}
      />
      <button
        onClick={handleSave}
        disabled={isSaving}
        style={{
          marginTop: "10px",
          padding: "10px 20px",
          fontSize: "16px",
          cursor: "pointer",
          backgroundColor: "#3c55c4ff",
          color: "white",
          border: "none",
          borderRadius: "5px",
        }}
      >
        {isSaving ? "Saving..." : "Save Lesson"}
      </button>
    </div>
  );
}

export default LessonEditor;

 

 

What this code does:

  • useRef creates a reference to the editor so you can read its content whenever you want.
  • React does not try to manage the editor’s internal state; the editor handles everything itself.
  • When the user clicks Save, we grab the content using the ref and send it to the database.
  • While saving, the button shows Saving… so the user knows something is happening.
  • This approach keeps typing smooth and removes the lag caused by constant re-renders.

Now import it wherever you want to show the editor:

 

import LessonEditor from './components/LessonEditor';

function App() {
  return <LessonEditor />;
}

 

 

froala editor create lesson demo

Why this works: The editor keeps its own internal state, including cursor position, formatting, and undo history. Since React isn’t watching every keystroke, nothing slows down. You only read the content when needed (like saving), which keeps your LMS fast and smooth.

This pattern works perfectly when you have a single editor. But what if your LMS page has multiple editors, like quizzes or modules? That’s where Pattern 2 comes in.

Pattern 2: Lazy Initialisation with onClick

When you’re building LMS features, you might have multiple editors on the same page, like quiz questions, explanations, hints, etc.

Loading all editors at once can slow everything down.

A simple fix is to initialise the editor only when the user clicks on it.

This keeps your page fast and avoids unnecessary memory usage.

Create a new file src/components/QuizQuestionEditor.jsx and add the following code inside it:

 

import React, { useState, useRef } from "react";
import FroalaEditor from "react-froala-wysiwyg";

function QuizQuestionEditor() {
  const [editorActive, setEditorActive] = useState(false);
  const editorRef = useRef(null);
  const [initialContent] = useState("");

  const activateEditor = () => {
    setEditorActive(true);
  };

  const handleSubmit = () => {
    if (editorRef.current) {
      const content = editorRef.current.editor.html.get();
      console.log("Question content:", content);
      // Submit to your backend
    }
  };

  return (
    <div>
      <h2>Quiz Question</h2>
      {!editorActive ? (
        <div
          onClick={activateEditor}
          style={{
            border: "1px solid #ccc",
            padding: "20px",
            borderRadius: "4px",
            cursor: "pointer",
            backgroundColor: "#f9f9f9",
          }}
        >
          Click to start writing your question...
        </div>
      ) : (
        <FroalaEditor
          ref={editorRef}
          tag="textarea"
          model={initialContent}
          config={{
            placeholderText: "Enter your quiz question here...",
            height: 400,
            width: 900,
          }}
        />
      )}
      <button
        onClick={handleSubmit}
        style={{
          marginTop: "10px",
          padding: "10px 20px",
          fontSize: "16px",
          cursor: "pointer",
          backgroundColor: "#3c55c4ff",
          color: "white",
          border: "none",
          borderRadius: "5px",
        }}
      >
        Submit Question
      </button>
    </div>
  );
}

export default QuizQuestionEditor;

 

What this code does:

  • The editor doesn’t load immediately. Instead, you show a placeholder box: “Click to start writing your question…”
  • When the user clicks, editorActive becomes true, and the editor finally loads.
  • The editor’s content is accessed using a ref whenever you submit the question.
  • This avoids loading multiple heavy editors at once and is great for quiz creation pages.

Now import it wherever you want to show the editor:

 

import QuizQuestionEditor from './components/QuizQuestionEditor';

function App() {
return <QuizQuestionEditor />;
}

 

Lazy loading of a Froala editor when the user clicks an input area

Benefits of this approach:

  • Faster initial page load.
  • Reduced memory usage (because editors load only when needed).
  • Better user experience when working with forms that contain multiple editors.

Lazy loading helps when you have many editors, but what if you also need autosave? That’s where Pattern 3 comes in.

Pattern 3: Debounced Updates with Context API

Sometimes you do need the editor’s content inside your app state, like when you want autosave.

But updating the state on every keystroke will slow things down immediately.

A simple fix is to use debouncing: wait a short time after the user stops typing before updating the state.

Create a new file src/components/AutoSaveEditor.jsx and add the following code inside it:

 

import React, { useState, useRef } from "react";
import FroalaEditor from "react-froala-wysiwyg";

function QuizQuestionEditor() {
  const [editorActive, setEditorActive] = useState(false);
  const editorRef = useRef(null);
  const [initialContent] = useState("");

  const activateEditor = () => {
    setEditorActive(true);
  };

  const handleSubmit = () => {
    if (editorRef.current) {
      const content = editorRef.current.editor.html.get();
      console.log("Question content:", content);
      // Submit to your backend
    }
  };

  return (
    <div>
      <h2>Quiz Question</h2>
      {!editorActive ? (
        <div
          onClick={activateEditor}
          style={{
            border: "1px solid #ccc",
            padding: "20px",
            borderRadius: "4px",
            cursor: "pointer",
            backgroundColor: "#f9f9f9",
          }}
        >
          Click to start writing your question...
        </div>
      ) : (
        <FroalaEditor
          ref={editorRef}
          tag="textarea"
          model={initialContent}
          config={{
            placeholderText: "Enter your quiz question here...",
            height: 400,
            width: 900,
          }}
        />
      )}
      <button
        onClick={handleSubmit}
        style={{
          marginTop: "10px",
          padding: "10px 20px",
          fontSize: "16px",
          cursor: "pointer",
          backgroundColor: "#3c55c4ff",
          color: "white",
          border: "none",
          borderRadius: "5px",
        }}
      >
        Submit Question
      </button>
    </div>
  );
}

export default QuizQuestionEditor;

 

 

 

What this code does:

  • The editor fires a contentChanged event every time the user types.
  • But instead of updating the state instantly, we debounce it using setTimeout.
  • If the user keeps typing, the timer resets.
  • When they stop typing for 2 seconds, then:
  • The content is saved into global state (LessonContext)
  • The autosave request is sent to the backend
  • A small message shows when the lesson was last saved.

Now, wrap your app in the LessonProvider:

 

import { LessonProvider, AutoSaveEditor } from './components/AutoSaveEditor';

function App() {
  return (
    <LessonProvider>
      <AutoSaveEditor />
    </LessonProvider>
  );
}

 

Froala editor with an autosave message showing the last saved time

Key points:

  • We debounce editor changes to avoid constant state updates.
  • Autosave feels fast but never slows down typing.
  • Using Context lets other components read the lesson content too.
  • Perfect for LMS dashboards with autosave, drafts, and live editing.

No matter which pattern you use, a few best practices can save you from unexpected performance issues.

Best Practices

Here are a few simple guidelines to keep your WYSIWYG editors fast, clean, and easy to manage in React, especially when you’re building LMS features.

  1. Initialise on demand: Don’t load the editor until the user actually needs it. This really helps when you have multiple editors on a single page.
  2. Use refs for content access: Instead of making the editor fully controlled, use refs to access the content only when you need it.
  3. Add debouncing for state updates: If you’re syncing editor content with state (like autosave), debounce it by 1–2 seconds so you’re not updating constantly.
  4. Keep editor state separate: Avoid mixing editor HTML with other UI state. Keep it separate from things like loading flags, filters, or user preferences.
  5. Clean up when the component unmounts: Always clear timers, intervals, or event listeners to avoid memory leaks.

And of course, there are a few easy mistakes that can undo all this good work. So now look at what to avoid.

Common Pitfalls

These are the mistakes that usually cause WYSIWYG editors to lag, re-render too much, or behave unpredictably in React. Avoiding them will make your editor setup much smoother.

  1. Making the editor fully controlled: Avoid using a value prop that updates on every change. This forces React to re-render constantly, causing cursor jumps and laggy typing.
  2. Storing HTML in a frequently updated state: Don’t mix editor content with state that updates often (like loading flags, validation, or UI filters). It leads to unnecessary re-renders.
  3. Not debouncing autosave: Saving to the backend on every character typed will crush your server and slow down the editor.
  4. Initialising too early: Loading all editors as soon as the page mounts wastes memory. Use lazy initialisation so the editor loads only when needed.
  5. Forgetting to clean up: Forgetting to clear timeouts, intervals, or listeners can cause memory leaks, especially in single-page applications like React apps.

Conclusion

Managing WYSIWYG editors in React doesn’t have to be difficult. The main thing to remember is that these editors already handle a lot of their own internal state. When we try to control every update through React, things slow down, and typing becomes laggy.

By keeping the editor uncontrolled, using refs to read content, debouncing updates, and loading the editor only when needed, you can build fast, smooth LMS features without the usual headaches.

Start with the simplest pattern that fits your use case. You can always add more advanced logic later as your app grows. Just keep in mind: you don’t need to over-optimise too early, but planning for performance from the beginning simply helps you avoid issues later.

Resources for Further Reading

graphical user interface, text

What Makes a WYSIWYG Editor Developer-Friendly?

Developer-friendly WYSIWYG editor illustration showing clean HTML output, customization, and extensible editor components

A WYSIWYG editor lets users create content visually instead of writing raw HTML. What you see is what you get. On the surface, most editors look the same. A toolbar. A text area. Some formatting buttons.

But once you start integrating one into a real product, the differences show up fast. Some editors fight your codebase. Others generate messy HTML, slow down your app, or limit how much control you have. That’s when “easy to use” stops mattering, and “easy to work with” becomes the real priority.

So what actually makes a WYSIWYG editor developer-friendly?

It’s not about flashy features or long toolbars. It’s about clean output, predictable behavior, performance, and flexibility. It’s about whether the editor fits into your stack without friction.

In this article, you’ll break down the key traits that matter most to developers, and how to evaluate a WYSIWYG editor with long-term maintainability in mind.

Key takeaways

  • A developer-friendly WYSIWYG editor is easy to integrate and doesn’t disrupt your existing stack.
  • Clean, predictable HTML output reduces long-term maintenance and styling issues.
  • Customization should be possible without forking or rewriting core editor code.
  • Lightweight performance matters for both user experience and Core Web Vitals.
  • Strong APIs, security controls, and good documentation make an editor easier to maintain as your product grows.

What does “developer-friendly” really mean?

A developer-friendly WYSIWYG editor doesn’t slow you down. It fits into your existing stack without forcing workarounds or hacks. Setup feels straightforward, not fragile.

You get predictable behavior. The editor does what it promises and produces consistent results. You don’t have to guess how it will behave in different browsers or environments.

Flexibility matters just as much. You can customize features, control output, and adapt the editor to your product’s needs. It works with you, not against you.

Most importantly, it stays out of your way. A truly developer-friendly WYSIWYG editor lets you focus on building your product instead of fighting the editor itself.

Clean & predictable HTML output

HTML output is where many WYSIWYG editors fail developers. What looks fine in the editor can turn into bloated, inconsistent markup behind the scenes. That mess shows up later as styling bugs, broken layouts, or painful cleanup work.

A developer-friendly WYSIWYG editor produces clean, semantic HTML. Tags are predictable. Structure stays consistent. You don’t have to inspect every block just to understand what was generated.

This matters long term. Clean HTML is easier to style, safer to store, and simpler to maintain. It also reduces security risks and improves performance across your app.

When an HTML WYSIWYG editor gives you control over output, your codebase stays healthy. You spend less time fixing content issues and more time shipping features that actually matter.

Customization without forking the editor

Every product has different content needs. A developer-friendly WYSIWYG editor lets you adapt those needs without rewriting the editor itself. You should be able to customize behavior, not fight defaults.

Toolbar configuration is a good starting point. You decide which buttons exist and which features stay hidden. Users see only what they need, and nothing more.

Extensibility matters even more. A solid plugin system lets you add custom buttons, commands, and workflows. You can enable or disable rich text editor features without touching core code.

When customization is built in, you avoid forks. Updates stay simple. Your editor evolves with your product instead of becoming technical debt.

Lightweight performance & fast load times

Performance matters more than it looks. A heavy editor can slow down page loads and hurt Core Web Vitals before users even start typing. That’s a problem, especially in content-heavy apps.

A lightweight WYSIWYG editor keeps bundle size under control. You load only what you need, not an entire feature set by default. This makes a big difference for web-based WYSIWYG editors running in modern frontend stacks.

Fast load times also improve the developer experience. You spend less time optimizing around the editor and more time building features. Lazy loading and modular builds help keep things efficient.

When an editor respects performance, it fits naturally into your app. It feels fast, responsive, and invisible, in the best way.

Strong API & extensibility

A polished UI is nice, but APIs are what developers rely on. A developer-friendly WYSIWYG editor gives you a clear, well-documented API to control behavior programmatically. You shouldn’t be limited to default actions.

Events, hooks, and callbacks make the editor predictable and flexible. You can listen for changes, intercept actions, or trigger custom logic when content updates. This is where real integration happens.

Extensibility also matters when your editor connects to other systems. File uploads, media libraries, CMS platforms, and workflows should plug in cleanly. A strong WYSIWYG editor API keeps everything connected without fragile hacks.

When extensibility is built into the core, the editor grows with your product. You stay in control as requirements evolve.

Framework & ecosystem compatibility

Modern apps don’t live in isolation. You’re likely working with React, Vue, Angular, or a mix of frameworks. A developer-friendly WYSIWYG editor fits into these environments without friction.

Framework-agnostic support matters. You should be able to use the same editor across projects, even as your tech stack evolves. Tight coupling to a single framework creates long-term limits.

Integration should feel natural. Clear examples, predictable lifecycle handling, and clean state management make the editor easier to work with. This is especially important for frontend WYSIWYG editors embedded deep in complex apps.

When an editor respects your ecosystem, it becomes a reliable building block, not a special case you have to manage forever.

Security & content control

Rich text content can be risky if you don’t control it. A WYSIWYG editor that allows unsafe markup can open the door to XSS attacks and data exposure. That risk grows as more users create content.

A developer-friendly WYSIWYG editor helps you stay in control. You can define allowed tags, sanitize output, and restrict what users are permitted to do. Security should be configurable, not bolted on later.

Content control matters too. Different users need different permissions. Editors should respect roles, limits, and workflows without custom patches.

When security is built into the editor, you protect both your users and your application. You also avoid last-minute fixes that slow development and create technical debt.

Documentation & developer experience (DX)

Good documentation saves hours of guesswork. A developer-friendly WYSIWYG editor explains how things work, not just what buttons exist. Setup steps should be clear from the first read.

Real examples make a big difference. You want to see how the editor behaves in real projects, not just isolated snippets. Clear API references help you move faster and avoid mistakes.

Developer experience also depends on maintenance. Regular updates, clear changelogs, and active support build trust over time. You know the editor won’t become a liability later.

When documentation is solid, the editor feels reliable. You spend less time searching for answers and more time building with confidence.

Choosing the right WYSIWYG editor for your project

There is no single WYSIWYG editor that fits every product. The right choice depends on how your app works and what your users actually need. Features alone shouldn’t drive the decision.

Start with your use case. Consider content complexity, performance expectations, and how much control you need over output. Think about integrations, security requirements, and long-term maintenance.

Popularity can be misleading. An editor that looks powerful may create friction once you start customizing it. A developer-friendly WYSIWYG editor supports your workflow instead of dictating it.

When you evaluate editors through a developer lens, the right option becomes clearer. You choose a tool that grows with your product, not one you have to replace later.

Conclusion

A developer-friendly WYSIWYG editor is not defined by how many features it offers. It’s defined by how well it fits into your workflow. Clean output, strong APIs, performance, and control matter more than flashy tools.

When an editor respects your stack, security needs, and long-term goals, it becomes an asset instead of a burden. You spend less time fixing issues and more time building your product.

As you evaluate your options, focus on maintainability and flexibility. The right editor should support your growth today—and still make sense months or years down the line.

FAQs

What makes a WYSIWYG editor developer-friendly?

A developer-friendly WYSIWYG editor is easy to integrate, produces clean HTML, and offers strong customization options. It gives you control over output, performance, and security without forcing workarounds or forks.

Why does HTML output matter in a WYSIWYG editor?

Messy or inconsistent HTML creates long-term problems. Clean, predictable output makes styling easier, improves performance, and reduces security risks in content-driven applications.

Should developers prioritize features or flexibility when choosing a WYSIWYG editor?

Flexibility should come first. A rich feature set means little if the editor is hard to customize or maintain. Developers benefit more from extensibility, strong APIs, and predictable behavior than from extra buttons.

graphical user interface, text

10 Best WYSIWYG Editors for Web Developers in 2026

Illustration showing modern WYSIWYG editors and code interfaces used by web developers to create and edit rich content

Modern web applications rely on rich content experiences. From dashboards to CMS platforms, you need tools to make content creation fast and reliable. That’s where the best WYSIWYG editors continue to play a key role in 2026.

WYSIWYG editors have transformed the way you create and edit content by showing you what you will get while working. They still produce clean HTML behind the scenes. For developers like you, this means fewer formatting issues, faster workflows, and better user experiences. For teams, it reduces friction between content creators and code.

In this guide, you’ll find a practical WYSIWYG editor comparison covering the tools web developers use most today. You can explore how they differ, what they’re best suited for, and how to choose the right one for your project.

Key takeaways

  • The best WYSIWYG editors help you build rich content experiences faster without writing raw HTML. They reduce formatting errors and improve consistency across applications.
  • Not all WYSIWYG editors work the same way. Some focus on simplicity, while others offer deep customization, structured content models, or headless architectures.
  • Modern WYSIWYG editors integrate smoothly with frameworks like React, Vue, and Angular. This makes them suitable for component-driven and scalable web apps.
  • Open-source and commercial editors both have strengths. Your choice depends on support needs, maintenance effort, and long-term project goals.
  • The right editor is the one that fits your use case. Always evaluate based on your stack, users, and how much control you need over content.

What is a WYSIWYG editor?

A WYSIWYG editor, short for What You See Is What You Get, allows you to create content in a visual interface. It automatically generates the underlying HTML. Instead of writing raw markup, you can format text, add images, and structure content the same way it will appear on the page.

This is different from plain text or code editors where you need to change HTML and CSS manually. A WYSIWYG text editor removes that complexity and reduces formatting errors.

Today, WYSIWYG editors are widely used in content management systems, web apps, form builders, and any interface where non-technical users need to create structured content.

Why web developers still use WYSIWYG editors in 2026

Web developers still rely on WYSIWYG editors because they speed up content creation without sacrificing control. Your teams can build rich content experiences quickly while avoiding repetitive HTML work. This is especially valuable in content-heavy applications.

You can integrate modern WYSIWYG smoothly with frameworks like React, Vue, and Angular. They support modular architectures and custom configurations. This makes them suitable for today’s component-driven development.

Accessibility and collaboration also matter more than ever. A visual editor allows designers, marketers, and developers to work together efficiently while maintaining consistent, structured output.

How we evaluated the best WYSIWYG editors

To create a fair WYSIWYG editor comparison, each tool was evaluated using the same criteria. We looked at core editing features such as formatting options, media handling, and plugin support. These basics determine how flexible an editor is in real projects.

Framework compatibility was also important. Editors that integrate well with React, Vue, Angular, or plain JavaScript scored higher for modern workflows. We also considered customization options, bundle size, and performance.

Finally, we reviewed documentation quality, community support, and licensing models. This helps developers understand long-term maintenance and adoption costs.

10 best WYSIWYG editors for web developers in 2026

Here is my list of 10 best WYSIWYG editors for web developers in 2026. You can explore their key features, use cases, support for integration with different frameworks and pros & cons below:

1. Froala Editor

Froala HTML WYSIWYG editor screenshot

Froala is a modern and versatile HTML WYSIWYG editor designed with developers in mind. It focuses on clean output, performance, and flexibility rather than overwhelming users with unnecessary features. The editor produces well-structured HTML that works reliably across applications.

Key features include rich text formatting, media handling, extensible plugins, and strong security controls. It is lightweight, which helps keep bundle sizes small and load times fast. Bundle size is where that promise usually breaks down, and our WYSIWYG editor comparisons show which editors keep it small without thinning out the feature set.

  • Best for: content-heavy web apps and SaaS platforms.
  • Framework support: React, Vue, Angular, and plain JavaScript.
  • Pros: fast, clean output, highly customizable.
  • Cons: commercial licensing required.

2. TinyMCE

TinyMCE WYSIWYG editor

TinyMCE is one of the most widely used WYSIWYG editors on the web. It offers a familiar editing experience and a large ecosystem of plugins. Many developers recognize it from CMS platforms and enterprise applications.

Key features include extensive formatting tools, media embedding, and advanced plugin support. The editor is highly configurable, but heavier setups may require careful optimization. That optimization work is the whole subject of Froala vs TinyMCE, which weighs TinyMCE’s configurability against the tuning it demands.

  • Best for: enterprise content platforms and CMS-driven sites.
  • Framework support: React, Vue, Angular, and vanilla JavaScript.
  • Pros: mature ecosystem, strong documentation.
  • Cons: larger bundle size and premium features behind paid plans.

3. CKEditor

CKEditor - rich text editor

CKEditor is a powerful WYSIWYG editor known for its structured content model. It is often used in large-scale applications where consistency and control matter. The editor emphasizes clean markup and predictable behavior.

Key features include modular plugins, collaborative editing options, and strong content filtering. CKEditor is highly extensible, but setup can be more complex compared to lightweight editors.

  • Best for: enterprise apps and collaborative editing workflows.
  • Framework support: React, Vue, Angular, and plain JavaScript.
  • Pros: structured output, advanced collaboration features.
  • Cons: steeper learning curve and licensing considerations.

4. Quill

Quill - a lightweight, open-source WYSIWYG editor

Quill is a lightweight, open-source WYSIWYG editor built with a modern API. It focuses on simplicity and gives developers fine-grained control over content behavior. The editor uses a structured document model rather than raw HTML.

Key features include a clean core, customizable modules, and a powerful delta-based data format. Quill does not try to handle every use case out of the box, which keeps it flexible and fast.

  • Best for: custom editors and developer-driven interfaces.
  • Framework support: JavaScript, React, Vue, and Angular wrappers.
  • Pros: lightweight, open source, flexible API.
  • Cons: limited built-in UI features without customization.

5. Summernote

Summernote - open-source WYSIWYG editor

Summernote is a simple, open-source WYSIWYG editor designed for quick integration. It offers a clean interface that feels familiar to users who need basic rich text editing. The setup is straightforward and works well for smaller projects.

Key features include standard formatting tools, image uploads, and drag-and-drop support. Summernote is built on jQuery, which makes it easy to add to legacy systems but less ideal for modern frameworks. Modern framework compatibility is exactly where the newer editors diverge, and how Froala compares to Tiptap covers that ground for teams planning AI-ready architectures.

  • Best for: small websites and legacy applications.
  • Framework support: jQuery-based environments.
  • Pros: easy setup, lightweight, open source.
  • Cons: limited modern framework support and extensibility.

6. TipTap

TipTap - a headless WYSIWYG editor

TipTap is a headless WYSIWYG editor built on top of ProseMirror. It gives developers full control over the UI while handling complex editing logic under the hood. This makes it a strong fit for highly customized interfaces.

Key features include a flexible extension system, collaborative editing support, and a schema-driven content model. Because it is headless, most of the visual layer must be built manually.

  • Best for: custom-rich editors and design-heavy applications.
  • Framework support: React, Vue, and vanilla JavaScript.
  • Pros: extremely flexible, modern architecture.
  • Cons: requires more development effort to implement.

7. Slate

Slate - highly customizable WYSIWYG editor framework

Slate is a highly customizable WYSIWYG editor framework built specifically for React. It gives developers full control over how content is structured, rendered, and edited. Slate acts more like a toolkit than a ready-made editor.

Key features include a flexible document model, React-first architecture, and complete control over editor behavior. This makes it possible to build unique editing experiences that go far beyond standard text formatting.

  • Best for: advanced, React-based custom editors.
  • Framework support: React only.
  • Pros: extremely flexible, full control over content logic.
  • Cons: requires significant setup and implementation effort.

8. Trumbowyg

Trumbowyg - open-source WYSIWYG editor

Trumbowyg is a minimal, open-source WYSIWYG editor focused on speed and simplicity. It avoids complex features in favor of a clean editing experience. This keeps the editor lightweight and easy to understand.

Key features include basic formatting tools, plugin extensions, and fast initialization. Trumbowyg is jQuery-based, which makes it suitable for older projects but less aligned with modern frameworks.

  • Best for: simple editing needs and lightweight projects.
  • Framework support: jQuery-based environments.
  • Pros: very lightweight, easy to integrate.
  • Cons: limited advanced features and modern framework support.

9. Editor.js

Editor.js free and open-source block-based WYSIWYG editor

Editor.js is a free and open-source block-based WYSIWYG editor. It takes a different approach to content creation. Instead of editing free-flowing text, users build content using structured blocks like paragraphs, images, lists, and embeds. This makes content more predictable and reusable.

Key features include JSON-based output, modular block plugins, and clean separation between content and presentation. Editor.js focuses on data structure rather than visual styling. Evaluating how these data-driven structures impact real-world usability is a key part of our guide to comparing WYSIWYG Editors for modern web applications.

  • Best for: content-driven apps and headless CMS setups.
  • Framework support: JavaScript with wrappers for React and Vue.
  • Pros: structured output, modern block-based editing.
  • Cons: limited traditional rich text formatting.

10. MediumEditor

MediumEditor inline WYSIWYG editor

MediumEditor is a lightweight, inline WYSIWYG editor inspired by the editing experience on Medium. It focuses on simplicity and keeps the interface almost invisible while users write. The goal is to make content creation feel natural and distraction-free.

Key features include inline editing, basic formatting options, and minimal configuration. MediumEditor does not try to handle complex layouts or advanced content structures.

  • Best for: simple text editing and inline content experiences.
  • Framework support: plain JavaScript with community wrappers.
  • Pros: clean UX, very lightweight.
  • Cons: limited features and not ideal for complex editing needs.

Quick comparison table

The table below offers a high-level WYSIWYG editor comparison to help you spot key differences at a glance. It highlights licensing models, framework support, customization levels, and common use cases. Use this overview as a starting point before exploring each editor in detail and testing them within your own development environment.

Editor Open-source / Commercial Framework support Customization level Ideal use case
Froala Editor Commercial React, Vue, Angular, JS High Content-heavy web apps
TinyMCE Hybrid React, Vue, Angular, JS High CMS and enterprise platforms
CKEditor Hybrid React, Vue, Angular, JS High Structured enterprise content
Quill Open source JS, React, Vue Medium Custom lightweight editors
Summernote Open source jQuery Low–Medium Small or legacy projects
TipTap Open core React, Vue, JS Very high Custom editor experiences
Slate Open source React Very high Advanced React-based editors
Trumbowyg Open source jQuery Low Simple editing needs
Editor.js Open source JS, React, Vue Medium Block-based content systems
MediumEditor Open source JavaScript Low Inline text editing

Conclusion

There is no single editor that fits every project or team. Each option in this list serves a different purpose, depending on how much control, structure, and flexibility you need. The best choice depends on your application, your users, and your long-term maintenance goals.

Before committing, it’s worth testing a few editors in real scenarios. Look at how they integrate with your stack, how they handle content, and how easy they are to extend. A thoughtful evaluation will help you choose a WYSIWYG editor that supports both your current needs and future growth.

FAQs

What is the best WYSIWYG editor for web developers?

There is no universal best option. The right WYSIWYG editor depends on your project requirements, framework, and level of customization needed. Some editors focus on simplicity, while others are built for complex, structured content.

Are open-source WYSIWYG editors good enough for production use?

Yes, many open-source WYSIWYG editors are production-ready. However, they may require more customization and maintenance compared to commercial tools. Support, updates, and long-term stability should be considered.

Can WYSIWYG editors be used with modern JavaScript frameworks?

Most modern WYSIWYG editors support frameworks like React, Vue, and Angular. Some are framework-specific, while others offer wrappers or SDKs. Always check integration options before choosing an editor.

graphical user interface, text

Froala V5.0.0 Release: Code Snippets, Word Imports, and More

Froala V5.0.0

Froala V5.0.0 introduces two major features: code snippet insertion with syntax highlighting, and direct Word document import with formatting preserved. This release also includes table handling improvements and updated styling defaults.

Code Snippet Feature Overview

The Code Snippet plugin adds syntax-highlighted code blocks to your editor. Supports JavaScript, Python, HTML, CSS, TypeScript, Java, C++, SQL, and JSON. Works across Chrome, Firefox, Edge, and Safari.

code snippet insertion

Inserting Code Snippets

Click the “Insert Code Snippet” button in the toolbar to open the code entry modal. Select a programming language from the dropdown and paste or write your code. Syntax highlighting applies automatically.

Code Block Rendering

Code snippets are rendered in a monospace font within styled <pre> and <code> blocks, ensuring precision and consistency. The plugin intelligently preserves indentation and line breaks, maintaining the exact formatting developers intended. By default, code blocks are read-only, protecting formatting integrity while allowing users to view and reference code effortlessly.

Edit, Remove, and Copy with Ease

Use the Code Snippet toolbar to edit, remove, or copy code blocks. The “Copy to Clipboard” button copies the code with formatting intact.

code snippet edit

Developer Control and Customization

Froala V5.0.0 provides a comprehensive set of options, methods, and events that give developers programmatic control over the code snippet feature.

The plugin configuration options allow developers to customize the code snippet feature according to their needs. Whether you want to limit available programming languages, set a default language preference, or tailor the feature to your specific workflow, these settings give you complete control over the code snippet behavior.

Additionally, there are methods for code snippet insertion, updating, and display. These methods enable you to integrate code snippet functionality seamlessly into your custom workflows and automate code block management.

Moreover, the Code Snippet plugin exposes powerful events that allow you to hook into the code insertion lifecycle. These events enable you to implement custom validation, analytics tracking, and dynamic code processing—giving you fine-grained control over how code snippets are handled within your editor. By leveraging these events, you can build sophisticated workflows that align with your application’s specific requirements and user needs.

new FroalaEditor('.selector', {
  codeSnippetLanguage: {
    'JavaScript': 'javascript',
    'Python': 'python',
    'Ruby': 'ruby',
    'Go': 'go',
    'Rust': 'rust'
  },
  codeSnippetDefaultLanguage: 'Python',
  events: {
    'codeSnippet.beforeInsert': function (code) {
  
      // Add a comment to all code snippets
      return '// Auto-generated comment\n' + code;
    },
    'codeSnippet.afterInsert': function (code) { 
   
      console.log('Code snippet inserted:', code);

    }

}, function () {
  // Call the method inside the initialized event.
  this.codeSnippet.insert('console.log("Hello World");', 'JavaScript');

});

Import from MS Word Feature Overview

Another powerful addition to Froala V5.0.0 is the ability to seamlessly import content from Microsoft Word documents into the editor while preserving formatting, styles, and structure. This feature simplifies the transition for users who draft content in Word, ensuring compatibility and reducing the need for manual adjustments, enhancing productivity and usability across platforms.

Import from word

Why This Enhancement Matters

Content creators often work in Microsoft Word due to its familiarity and advanced formatting capabilities. However, moving that polished content into a web editor typically requires tedious manual adjustments—reformatting text, recreating tables, repositioning images, and reapplying styles. The Import from MS Word feature solves this problem entirely, allowing users to upload Word documents and have all their work instantly available in the editor, exactly as intended.

How It Works

Importing Word documents is remarkably simple. Users click the “Import from Word” button on the toolbar, select their .doc or .docx file, and the editor handles the rest. The plugin even supports drag-and-drop importing, allowing users to simply drag Word files directly into the editor for instant import—making the process as intuitive as possible.

Comprehensive Content Preservation

The Import from MS Word feature preserves virtually every element of your Word document:

Text & Formatting: All text formatting is maintained exactly as authored. Headings and paragraphs retain their structure and hierarchy, ensuring your document’s visual organization remains intact.

Lists: The plugin imports lists with complete accuracy, preserving indentation and hierarchy.

Images & Media: Embedded images imported directly into the editor.

Styling & Links: Inline styles such as font color, background color, and text highlights are preserved. Hyperlinks remain functional, allowing your content to maintain its interconnectedness.

Enterprise-Grade Performance

The plugin is engineered to handle real-world document sizes efficiently. It processes large, complex documents, importing smoothly and quickly without freezing the editor or degrading performance.

Robust Error Handling

The feature includes intelligent error management. For example, if a Word file size is larger than what specified, users receive a clear, helpful error message explaining the issue. 

word Import error

Developer Control & Customization

Froala V5.0.0 provides developers with comprehensive control over the Import from MS Word feature through powerful configuration options, methods, and events:

Configuration Options

importFromWordMaxFileSize – Control the maximum allowed file size (default: 3 MB). Adjust this setting based on your infrastructure and user needs.

importFromWordFileTypesAllowed – Specify which Word file formats are accepted (default: [‘.docx’]). Enable support for legacy .doc files if required.

importFromWordUrlToUpload – Provide your own server endpoint for processing Word file uploads, giving you complete control over file handling and storage.

importFromWordEnableImportOnDrop – Enable or disable drag-and-drop import functionality (default: true). Disable this if you want to restrict imports to the toolbar button only.

Methods

editor.importFromWord.import() – Programmatically trigger a file selection dialog, or pass a file object directly to import without user interaction. This enables integration with custom file pickers and automation workflows.

Events

word.beforeImport – Hook into the import lifecycle before processing begins. Use this event to validate files, track analytics, or perform custom preprocessing.

word.afterImport – Trigger custom logic after import completes successfully. Implement post-import workflows, update UI elements, or notify other systems that new content has been added.

Import from MS Word Overall

The Import from MS Word feature transforms how teams collaborate and manage content. By eliminating manual reformatting, preserving document fidelity, and providing developers with extensive customization options, this enhancement makes Froala V5.0.0 an even more powerful choice for organizations relying on Microsoft Word in their content workflows. Whether you’re a content creator seeking convenience or a developer building sophisticated workflows, this feature delivers tangible value and productivity gains.

Table Enhancements

Froala V5.0.0 brings meaningful improvements to table editing and management, making it easier for content creators to work with tables while giving developers finer control over table behavior and styling.

Smarter Line Break Handling in Table Cells

Tables are essential for organizing data and content, but managing text wrapping within cells can be tricky. Froala V5.0.0 introduces the retainLineBreaksInCellsOnWrap option, which gives you control over how line breaks are handled when cell content wraps to multiple lines.

What This Means for You

By default, Froala now retains line breaks within table cells when content wraps (retainLineBreaksInCellsOnWrap: true). This is particularly useful for content creators who intentionally format their cell content with line breaks for readability and structure—think of lists, multi-line labels, or formatted addresses within a table. Your carefully structured formatting is now preserved exactly as you intended.

If you prefer the behavior where line breaks are removed during wrapping, you can simply disable this feature by setting retainLineBreaksInCellsOnWrap to false. This flexibility ensures Froala adapts to your specific workflow and content requirements.

Real-World Example

Imagine you’re creating a product comparison table with detailed descriptions in each cell. You might want product features listed on separate lines within a cell for clarity—without line breaks being automatically stripped, your formatting stays intact, resulting in a cleaner, more professional-looking table.

Cleaner Table Styling Defaults

Froala V5.0.0 refines how table styling defaults are applied, giving you more control and preventing unnecessary styling overhead.

What Changed

Two table styling configurations have been updated with improved defaults:

  • tableDefaultBorderWidth – Now defaults to an empty string () instead of a predefined value
  • tableDefaultBorderStyle – Now defaults to an empty string () instead of a predefined value

Why This Matters

Previously, Froala suggested default border widths and styles for new tables. While this provided a starting point, it sometimes resulted in unwanted styling being automatically applied—particularly when you wanted complete design flexibility or preferred to apply your own CSS styling.

By changing these defaults to empty strings, Froala now takes a “blank slate” approach: new tables created without enforcing any specific border styling. This means:

More Design Freedom – You have complete control over table appearance from the start

Cleaner HTML – Less unnecessary inline styling clutters your code

Better CSS Integration – Tables integrate seamlessly with your site’s stylesheet without style conflicts

Consistent Branding – Apply your own design system directly through CSS rather than fighting against defaults

For Content Creators

You’ll notice that newly created tables now appear with minimal or no visible borders by default. Don’t worry—borders are easy to add! Using the table toolbar, you can quickly apply border styles that match your content needs. This approach empowers you to design tables intentionally rather than inheriting styling you didn’t ask for.

For Developers

These changes simplify table integration into custom applications. With no default border styling applied, you have complete freedom to:

  • Apply your own border styling via CSS frameworks (Bootstrap, Tailwind, etc.)
  • Maintain consistent table appearance across your application.
  • Avoid CSS specificity conflicts with default styles

If you need the old behavior where borders are suggested by default, you can easily restore it by explicitly setting these configuration options in your Froala initialization.

Result: Tables That Work the Way You Do

These table enhancements reflect Froala’s commitment to balancing powerful functionality with user control. Whether you’re preserving intentional formatting within cells or designing tables with complete styling freedom, Froala V5.0.0 adapts to your workflow rather than imposing rigid defaults. Your tables, your way.

Much More…

This release includes additional improvements and bug fixes. See the complete changelog for details.

How Can I Update?

Update to Froala WYSIWYG Editor 5.0.0 today and experience enhanced editing features and improvements.

Check our getting-started guide to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance TypeScript support, is a stepping stone towards that commitment. We encourage you to try this improved TypeScript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Please visit the release notes for a complete list of changes.

Technical Questions

If you have a technical question, you can check whether we have already answered it in our help center. If not, contact our Support team.

graphical user interface, text

Elevate Your Delphi Web Application with Seamless Rich Text Editing: Mastering Froala TMS Web Core Integration

logo, icon

As a Delphi developer, you know the importance of building modern, responsive web applications with a great user experience. The TMS WEB Core framework is a powerful tool for creating such apps, but what if you need a robust WYSIWYG (What-You-See-Is-What-You-Get) editor for your content management features?

No worries, the TMS WEB Core framework has a WEB Component for integrating Froala, a powerful WYSIWYG Editor, allowing Delphi web applications to seamlessly incorporate rich text editing capabilities and enhance user experience.

In this step-by-step guide, we’ll walk you through the simple process of integrating the Froala editor into your TMS WEB Core Delphi applications. By leveraging the power of Froala and the flexibility of TMS WEB Core, you can deliver a high-quality content management solution within your Delphi web projects.

Key Takeaways

  • TMS WEB Core makes modern Delphi web apps possible, and integrating a WYSIWYG editor like Froala significantly improves content editing and user experience.
  • Froala integrates seamlessly with TMS WEB Core through the TMSwebFroalaEditor component, minimizing setup time and reducing custom JavaScript work.
  • The integration supports both classic and inline editing modes, giving developers flexibility to tailor the editor experience to different use cases.
  • Froala is lightweight yet feature-rich, offering advanced formatting, media handling, and extensibility without compromising performance.
  • This guide provides a practical, step-by-step integration path, including setup, demo usage, and source code insights to help you implement Froala confidently in real projects.

Why Use the TMS WEB Core Framework?

The TMS WEB Core framework is the foundation of an exciting new and modern way for creating web client applications from Delphi using a component-based framework. Some key benefits of using TMS WEB Core include:

  • Cross-platform compatibility: TMS WEB Core allows you to create web applications that can run on a variety of platforms, including Windows, macOS, and Linux.
  • Rapid development: The framework provides a wealth of pre-built components and tools, enabling you to quickly build and deploy feature-rich web applications.
  • Seamless integration: TMS WEB Core integrates seamlessly with other Delphi technologies, such as the Froala WYSIWYG Editor, allowing you to create a cohesive and efficient development ecosystem.
  • Modern web standards: The framework is built on the latest web technologies, ensuring your applications are up-to-date and provide an optimal user experience.
  • The TMS WEB Core web client application is open to work with different server technologies. This includes but is not limited to Embarcadero RAD Server, Node.js, ASP.NET Core microservices.

Why Integrate Froala Editor with TMS WEB Core?

The Froala WYSIWYG HTML Editor is a lightweight WYSIWYG HTML editor. However, it is a feature-rich, customizable editor that allows users to easily format text, insert images, and more, all without needing to write HTML code.

Some key benefits of this integration include:

  • Intuitive WYSIWYG editing experience for your users
  • Extensive customization options to match your app’s branding and design
  • Robust feature set including table manipulation, responsive video embedding, and more
  • Seamless integration with the TMS WEB Core framework for a cohesive user experience

Froala TMS Web Core Integration Guide

The TMS WEB Core offers the TMSwebFroalaEditor WEB Component that simplifies the Froala Editor integration with TMS WEB Core framework. The integration process is straightforward, allowing you to quickly set up the Froala editor, saving a lot of development time and effort.

Integrate the Froala WYSIWYG Editor into your TMS WEB Core Delphi application using the TMSwebFroalaEditor component by following these steps:

Step 1: Install the RAD Studio IDE

As a Delphi developer, you may already be using RAD Studio. If not, we recommend installing it. RAD Studio is an advanced IDE for rapidly and visually building high-performance platform-native apps for Windows, Linux, iOS, macOS and Android from a single codebase.

Step 2: Install the TMS WEB Core Framework

The TMS WEB Core is a framework for creating modern web applications in Delphi. You can download and install the latest version of the framework from the official TMS Software website. Download the version compatible with your RAD Studio. The integration requires TMS WEB Core version 1.2.3.0 or newer.

Step 3: Install the TMSwebFroalaEditor Component

    1. Download and install the TMSwebFroalaEditor component from the TMS Software website.Froala Editor TMS WEB Core component
  1. Extract the downloaded ZIP file: it contains the following folders:
    • The “Component Library Source” folder,
    • The “Core Source” folder.
    • The “Demo” folder.
  2. Add the Library path: Add the “Core Source” folder path to the TMS WEB library path (RAD Studio: Tools > Options > TMS WEB > Library Path). Restart RAD Studio afterwards to ensure changes are applied.
  3. Install the package file “TMSWEBFroalaEditor”:
    1. Open the "Component Library Source/TMSWEBFroalaEditor.dpk" package file in the Rad Studio.
    2. This package requires the TMSWEBCorePkgLibDXE11.dcp library. Update this line if you are using a different TMS WEB Core version.
    3. Compile the package: Right-clicking on the package in the Project Manager and selecting “Compile”.
    4. Install the package: Right-clicking on the package in the Project Manager and selecting “Install”. Now you are ready to use the component in your project.

Step 4: Play with the Demo

The demo illustrates displaying the Froala Editor within your TMS WEB Core Delphi application. To run it, you need to do the following steps:

    1. Open the Demo Project: Locate the "Demo/FroalaEditor.dpk" package file in the downloaded ZIP folder and open it in your RAD Studio IDE.
    2. Include Froala Editor: Open “Index.html“ file. Note, the code assumes you will download the Froala Editor files and host them on your server. However, you can replace the local Froala stylesheet and JavaScript links with CDN links so we don’t need to download it. 
      <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. Understand the Demo Structure: The demo project likely consists of several files, including:
      • FroalaEditor.dpr: The main project file.
      • FroalaEditorForm.pas: The main form file, which contains the Froala Editor component and other UI elements.
    2. Run the Demo: To run the demo application, simply click the “Run” button in your RAD Studio IDE. This will compile and launch the demo, allowing you to interact with the Froala Editor integrated into the TMS WEB Core application.
    3. Inspect the Code: Once the demo is running, you can inspect the code to understand how the TMSWEBFroalaEditor component is being used. This can provide valuable insights and help you integrate the Froala Editor into your own TMS WEB Core projects.

Understanding the Source Code

By exploring the demo, you’ll get a better understanding of how to use the TMSWEBFroalaEditor component and integrate the Froala Editor into your own TMS WEB Core Delphi applications. The demo serves as a helpful starting point and reference for your own implementation.

For instance, to setup your own Froala Editor, do the following

  • Declare an external function so we can use Object Pascal to create the Editor Object.
  • Create an object that links the Froala Editor events with the WEB Core event handlers.
  • Initialize the Froala Editor
var  
  FEvents: TJSObject;  
  FFroalaEditor: TJSObject;  
  function froalaEditor(s: string; jsObject: TJSObject): TJSObject; overload; external name 'new FroalaEditor';  
  
begin  
    FEvents := new([  
     'contentChanged', @HandleChanged,  
     'initialized', @HandleLoaded,  
     'focus', @HandleStartEdit,  
     'blur', @HandleEndEdit  
     ]);  
  
    FFroalaEditor := froalaEditor('div#' + ElementID,   new([  
      'toolbarInline', false,  
      'events', FEvents  
      ]));  
end;

Froala WYSIWYG HTML Editor Modes

Note the demo offers two ways to use the Froala Editor:

Classic: This is the default behavior.

Froala classic editor

Inline: Show the Editor toolbar upon content selection.

Connect any TWebLabel to the TWebFroalaEditor component to instantly make it editable in the browser.

WebLabel1.EventStopPropagation := [];  
WebFroalaEditor1.Visible := False;  
WebFroalaEditor1.InlineEditing := True;  
WebFroalaEditor1.Editor := WebLabel1;

Froala inline editor

By now, you have learned how to easily add a powerful, customizable WYSIWYG editing experience to your TMS WEB Core Delphi applications, providing your users with an intuitive and efficient way to manage content.

Live Demo

A live demo of the Froala editor integration is available at https://download.tmssoftware.com/tmsweb/demos/froalaeditor/. Explore the editor’s rich text editing capabilities and view the corresponding HTML code and triggered web core event handlers below the editor.

Conclusion

In this guide, we’ve walked through the seamless process of integrating the Froala Editor into your TMS WEB Core Delphi applications. By leveraging the powerful TMSwebFroalaEditor component, you can quickly add rich text editing capabilities to your web applications.

Integrating Froala WYSIWYG HTML Editor with TMS WEB Core allows Delphi developers to create modern, responsive web apps with an intuitive WYSIWYG interface for managing content. With features like inline editing, table manipulation, and responsive video embedding, the Froala Editor provides a top-notch user experience that will delight your end-users.

With the steps outlined in this guide, you now have the knowledge and tools to integrate the Froala Editor into your own TMS WEB Core Delphi projects. By incorporating this powerful integration, you can deliver exceptional content management capabilities and take your Delphi web applications to new heights.

Get started today and elevate your Delphi web development with the TMS WEB Core Froala Editor integration

FAQs

What is TMS web Core?

TMS WEB Core is a Delphi-based framework for building modern, responsive web applications. It allows developers to create cross-platform web apps using Object Pascal while leveraging standard web technologies like HTML, CSS, and JavaScript, without needing to learn a new programming language.

Does Froala work natively with TMS WEB Core?

Yes. Froala integrates smoothly with TMS WEB Core using the TMSwebFroalaEditor component, allowing Delphi developers to add rich text editing without manually wiring complex JavaScript logic.

Can I use Froala in both classic and inline editing modes with TMS WEB Core?

Yes. The Froala Editor supports both classic and inline modes when used with TMS WEB Core, giving you flexibility to choose how and where content becomes editable in your Delphi web application.

Do I need to host Froala files locally when using TMS WEB Core?

No. While you can host Froala assets locally, you may also use the Froala CDN to load the editor’s CSS and JavaScript files, which simplifies setup and speeds up development.

How to Use Bootstrap: Set Up and Customize in Your Project

Responsive web design layout showing how to use Bootstrap to build modern, mobile-friendly websites across desktop, tablet, and smartphone screens.

Bootstrap is one of the most popular frameworks for building responsive and modern web applications. It’s extensive, modern, and easy to learn, making it suitable for beginners and experts alike.

In this guide, you’ll learn how to use Bootstrap, from installing it through different ways to customizing it to your liking.

You’ll also explore how Bootstrap helps boost developer productivity, including its various UI components, quick setup, and compatibility with modern browsers.

Additionally, you’ll learn about React Bootstrap, a reimplementation of Bootstrap components using React. This open-source, community-maintained project is an alternate way of implementing Bootstrap in React. It’s not official Bootstrap, but it’s perfect for React apps.

Illustration showing how to use Bootstrap to build responsive web layouts across desktop, tablet, and mobile devices.

When developing modern websites and applications, you should also consider using tools that go well with one another. Froala is an HTML editor that synergizes well with Bootstrap. It consists of an intuitive, SEO-friendly, and already responsive interface in addition to powerful editing tools.

Key takeaways

  • Bootstrap makes responsive design easier by offering pre-built UI components, a powerful grid system, and mobile-first styles that work across devices. 
  • You can install Bootstrap in multiple ways—via CDN, compiled files, or NPM—depending on your project setup and performance needs. 
  • Learning how to use Bootstrap effectively means understanding its components, helpers, utilities, and customization options rather than relying on default styles. 
  • Bootstrap is highly customizable using CSS variables, custom CSS, and Sass, allowing you to align the framework with your brand’s colors, fonts, and layout. 
  • For modern workflows, Bootstrap integrates well with tools like React Bootstrap and editors such as Froala, helping you build faster, cleaner, and more maintainable web applications.

Before learning how to use Bootstrap…

You might want a refresher on its different components, as well as how to install Bootstrap. If you’re already familiar with these, skip to the next section, where you’ll explore customizing Bootstrap CSS.

Prerequisites & assumptions

Before diving into how to use Bootstrap, this guide assumes the following:

  • Bootstrap version: All examples use Bootstrap 5.x (specifically 5.3+). Class names, utilities, and JavaScript behavior may differ in earlier versions.
  • Project setup: Examples apply to plain HTML projects, as well as React apps using tools like Create React App (CRA), Vite, or similar bundlers.
  • Node.js (optional): If you install Bootstrap via NPM or use Sass, you’ll need Node.js v16 or higher and NPM installed.
  • Compiled files: “Compiled Bootstrap files” refer to the prebuilt, minified CSS and JavaScript bundles provided by Bootstrap. These are ready to use and do not require a build step.
  • Basic web knowledge: You should be comfortable with basic HTML, CSS, and JavaScript to follow along smoothly.

Understanding Bootstrap’s UI components

To use Bootstrap for building responsive web apps and mobile-first styles, you make use of pre-designed, customizable UI components.

These are essentially themes or styles that you apply to plain HTML elements via the class attribute.

Once the page loads, Bootstrap will then style and design your elements according to the contents of their class attributes.

For example, you can turn a common div element into a navbar by appending the “navbar” class to it. To expand the navbar on larger screen sizes, add “navbar-expand-lg.” If you want a darker theme to it, add the “bg-dark” (as of version 5.x) class.

You can even use different styling classes for one element. Think of these components as makeup or accessories for your elements. Mix and match or use them however you like to beautify and standardize the site contents.

Ultimately, they should make your site look better and consistent across different CSS media queries or screens, including mobile devices.

Each Bootstrap CSS UI component has a specific purpose. Some are for layout, while others are for theming, form design, and individual element styling.

The Bootstrap documentation pages categorize them into the following:

Layout

These are the components that deal with organizing the DOM elements to ensure that the site contents have visual structure and responsiveness.

These usually act as styling for div elements containing elements of their own. Layout concepts include the grid system, full-width containers (which wraps site contents), and breakpoints.

Content

Content components are global styling settings for text, images, tables, and more. This means that by using content components, you can set Bootstrap’s basic styling throughout your plain JS or React projects.

For example, you can use the “img-fluid” class across your images to make them responsive without having to touch CSS properties.

Forms

As the name suggests, this type of component is responsible for styling form elements and input fields.

These UI components include text fields, floating labels, textareas, radio buttons, checkboxes, select fields, and validation classes.

Components

What the Bootstrap docs categorize as “components” refers to pre-built UI components that come with built-in styling and interactivity (e.g., hover or popover events).

Each specific component already has Bootstrap’s consistent styling and JavaScript functionality. However, you can also modify these further using utilities, helpers, and even custom CSS.

These include the bulk of Bootstrap’s components: buttons, navbars, cards, carousels, list groups, and a lot more. Bootstrap’s UI components also include JavaScript plugins such as modals, tooltips, popovers, and collapsibility.

When learning how to use Bootstrap, it's vital to understand how its components work and interact with one another. This image presents a few of these components used together to create a responsive and presentable design.

Helpers

Helpers refer to smaller classes that perform a single function. You usually use these together with other Bootstrap components.

Examples of helpers include colored links, specific component positioning (e.g., “fixed-top,” “sticky-bottom”), text truncation, visually hidden elements (for assistive technologies), and some others.

Utilities

Utilities are general-purpose styling classes for HTML elements. Unlike helpers, they have a broader, more global scope, allowing you to control styling like colors, spacing, and typography. Like helpers, they usually go together with other classes or components.

Examples of Bootstrap utilities include margins, padding, text colors, flex options, shadows, borders, sizing, and more.

Now that you’ve had a refresher, it’s time to install Bootstrap.

Installing Bootstrap

There are different methods for installing the Bootstrap CSS and JS files. Here, you’ll discover some of the most popular ones.

Via compiled Bootstrap CSS and JS

You can install Bootstrap by downloading its ready-to-use codes that include both compiled and minified Bootstrap CSS bundles and JavaScript plugins.

Note that this method does not include documentation, source files, or optional JS dependencies like Popper.

Install Bootstrap via compiled CSS and JavaScript. Include the files that you need in your JS or React app’s folder afterwards. Whether you’re using React or a non-framework setup, the steps for this method are generally the same.

Via the Bootstrap CDN

A quick alternative installation method for Bootstrap is by using the Bootstrap CDN. This method allows you to call a cached version of Bootstrap in your plain JS or React application.

This helps you get started faster and more easily. To add the framework through Bootstrap CDN, include the following code in your index.html file:

<head>
<!--other head items-->
...
<!--Bootstrap 5 CSS-->
<link 	href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>

<body>
<!--other body items-->
<!--Bootstrap 5 JavaScript-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>

This gives you the latest delivered version. You can also specify which version of Bootstrap you want in your project by replacing the version number.

If you need interactive components such as tooltips or popovers without using the bundled JavaScript file, you can install Popper explicitly.

Via package manager

The last installation method is installing Bootstrap using NPM. To use this approach, you need Node.js (v16+) and NPM installed.

Open your CLI, navigate to your project directory, and run:

npm install bootstrap@5.3.3

This installs Bootstrap 5.3.3 into the node_modules folder, making it available for JavaScript and React-based projects.

When do you need Popper?

If you plan to use interactive components like tooltips, popovers, or dropdowns without the bundled JavaScript file, install Popper explicitly:

npm install @popperjs/core

For most projects, this extra step is not required. If you import Bootstrap’s bundled JavaScript file, Popper is already included:

import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.bundle.min.js';

This is the recommended setup for React, Vite, and modern JavaScript workflows.

After installation, you’ll see Bootstrap listed in your package.json dependencies.

"dependencies": {
  "bootstrap": "^5.3.3",
  "react": "^18.3.1",
  "react-dom": "^18.3.1"
}

 

If you’re not using a framework, you’ll generally include the Bootstrap files in your HTML pages, similar to the code below.

<head>
<!--other head items-->
...
<!--Bootstrap 5 CSS-->

<!--If you installed Bootstrap via NPM, use the "node_modules" directory. Otherwise, replace "node_modules" with the path to your Bootstrap CSS-->
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">

</head>

<body>
<!--other body items-->
<!--Bootstrap 5 JavaScript-->
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>

With this, you should have the ability to use Bootstrap’s components throughout your HTML page (and other pages that use it).

On the other hand, for a React app, import Bootstrap by adding the following code to your “src/index.js” file:

import 'bootstrap/dist/css/bootstrap.min.css';

import "bootstrap/dist/js/bootstrap.bundle.min";

This allows you to use Bootstrap components throughout your React app. Now, let’s dive into styling and customizing your projects using Bootstrap’s grid system and other components.

Bootstrap 5 vs Bootstrap 4: Key differences to know

If you’re coming from Bootstrap 4, a few important changes in Bootstrap 5 can affect how you set up and use the framework:

  • No jQuery dependency
    Bootstrap 5 completely removes jQuery. All JavaScript plugins now use plain JavaScript, reducing bundle size and improving performance.
  • Popper is bundled by default
    In Bootstrap 5, bootstrap.bundle.min.js already includes Popper. You don’t need to install or import it separately for tooltips, popovers, or dropdowns.
  • Separate JS files still exist
    If you prefer more control, Bootstrap 5 also provides individual JavaScript files without Popper. This is useful when you want to manage dependencies manually or reduce bundle size.

These changes make Bootstrap 5 easier to integrate into modern JavaScript frameworks and simpler to use in plain HTML projects.

Basic customization

To understand Bootstrap’s customization capabilities, let’s look into using its grid layout system, color styling, and font styling.

How to use Bootstrap’s grid system

The grid system is a way of laying out HTML elements in terms of rows and columns. By doing so, you ensure that each component containing elements is properly displayed with respect to each other.

Each row takes up its parent’s entire width and has a total of 12 columns, which you can divide in any way you like. For example, if you want three equal-sized columns for a row, you have to change their size to 4 (3 columns x 4 column size = 12 total columns).

On the other hand, each column can have one or more rows. You can also nest these rows and columns together.

Now, let’s test it out by creating a page with a few rectangles. Try creating some rows and dividing them into columns of varying widths. To discern them from each other, add some background colors as well.

To get started, open your file (in this case, index.html) and add the following code:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <title>How to Use Bootstrap</title>

  <!-- Bootstrap 5.3.3 CSS -->
  <link
    href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
    rel="stylesheet"
    integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
    crossorigin="anonymous"
  />
</head>

<body>
  <div class="container-fluid bg-light vh-100">
    <div class="row h-25">
      <div class="col border border-danger text-center">col-12</div>
    </div>

    <div class="row h-25">
      <div class="col-md-6 border border-danger text-center">col-6</div>
      <div class="col-md-6 border border-danger text-center">col-6</div>
    </div>

    <div class="row h-25">
      <div class="col-md-8 border border-danger text-center">col-8</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
    </div>

    <div class="row h-25">
      <div class="col-md-2 border border-danger text-center">col-2</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
      <div class="col-md-2 border border-danger text-center">col-2</div>
    </div>
  </div>

  <!-- Bootstrap 5.3.3 JS bundle (includes Popper) -->
  <script
    src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
    crossorigin="anonymous"
  ></script>
</body>
</html>

First, add Bootstrap (in this case, through Bootstrap CDN). Next up, create a div element with the class “container-fluid,” which wraps site contents in a full-width container.

If you prefer something narrower than a full-width container, use “container” instead.

We also add the “bg-light” and “vh-100” classes to the wrapper. The former is simply for adding a touch of color, while the latter makes the container span the entire height of the screen.

Afterwards, create four rows of equal height (“h-25” allows a row to take up a fourth, or 25%, of the parent element’s height).

Finally, create as many as twelve columns for each row. How you divide it is up to you, but in the example above, you have:

  • 1-column row: The first row only has one column. You can use either “col” or “col-12” to allow a column to take up the entire width of the row.
  • 2-column row: The second row has two equal-length columns. Hence, each column has the “col-md-6” class.
  • 3-column row (unequal lengths): The third row has three columns of varying sizes. The first one is longer (8 columns long), while the other two have an equal length of 2. How you divide the row is up to you, but the total columns per row should be 12.
  • 6-column row: The fourth row has six columns of size 2.

To better discern the columns, add a border to each of them by appending the “border border-danger” classes.

The “border” (as the name suggests) class adds a border to an element, while the “border-danger” one adds Bootstrap’s red theme color to it.

Run the application, and you should see the following screen:

A sample application powered by Bootstrap. This screen contains 4 rows with different columns each. All columns have a reddish border color from Bootstrap's border-danger class.

Now, let’s try customizing Bootstrap’s default colors and fonts with some custom CSS.

How to customize colors and fonts

You can override Bootstrap’s default settings with custom CSS and Bootstrap 5.

Bootstrap 5 defines prebuilt CSS variables (–bs-*) for colors, typography, spacing, and more. These variables make overriding Bootstrap styles easier without modifying Bootstrap’s core files.

Overriding these CSS variables changes all elements that use Bootstrap’s default styles to follow your theme, colors, and fonts.

For instance, create a CSS file, include it in your HTML, and insert the following lines of code:

:root {
    --bs-light: #eeeeee;
    --bs-danger: #01a4f9;
    --bs-body-font-family: 'Roboto', sans-serif;
}

.bg-light {
    background-color: var(--bs-light) !important;
}

.border-danger {
    border-color: var(--bs-danger) !important;
}

The code above defines some CSS variables (e.g., –bs-light) for changing the colors of the “light” and “danger” properties. Moreover, it also changes the default font into “Roboto.”

Note that the colors this code is using are significantly different from the default (whitish gray to slightly darker gray, red to light blue).

Afterwards, the code uses these CSS variables for the “background-color” and “border-color” properties. Now, if you run the application, you should see:

In our grid example, the border color has changed into a lighter shade of blue. Additionally, the background color is now a darker gray, and the font family is different.

In addition to colors and fonts, you can also use CSS to customize buttons, navbars, forms, dropdown menu, and other components by using the “!important” keyword. This overrides Bootstrap’s default properties.

In summary, to integrate your color scheme and typography, define CSS variables to change the default colors and fonts to your theme’s. Afterwards, you can use these variables across your CSS file together with the “important” keyword.

Now, let’s move into the more advanced Bootstrap customization techniques.

Advanced customization techniques

If you want to go beyond basic CSS customization for Bootstrap, you should try using both Bootstrap JS plugins and Sass.

JS plugins add a bit of animation and interactivity to your components, improving the UX. Sass, on the other hand, provides a more organized way of customizing styles, making it perfect for theming.

Modifying Bootstrap components with Sass

Sass (Syntactically Awesome Stylesheets) is a CSS preprocessor that allows you to write cleaner styles more efficiently. The Bootstrap framework is built on Sass, which means that you can easily customize its components and styles to match your needs.

The best part is you don’t have to manually override styles using CSS like we did in the previous section.

Note: Sass requires that you get the entire library using NPM or local installation. Bootstrap Sass won’t work if you’re using the CDN.

Let’s start setting up Sass. First, go to your project directory and run the following line:

npm install -g sass

This command installs the Sass compiler in your directory, allowing you to use Sass commands.

Afterwards, create a new folder in your root and name it “scss” or something similar. In this new folder, create a file called “custom.scss.”

Here, you’re creating your own stylesheet that imports Bootstrap instead of modifying Bootstrap’s core files. This is because Bootstrap does not recommend modifying its core files.

Open your “custom.scss” file and add the following lines:

$light: #eeeeee;
$danger: #28a745;

$font-family-base: 'Roboto', sans-serif !default;

@import "../node_modules/bootstrap/scss/bootstrap";

Here, you’re defining new colors for the “light,” “danger,” and “font-family-base” CSS properties. This step is similar to what you did in the previous section, albeit easier. This code also uses a different “danger” color from earlier.

Lastly, import the Bootstrap components at the end of the SCSS file. Bootstrap recommends importing only what you need, but for simplicity, the code above imports the entire library.

Afterwards, in your CLI, move up to the “scss” folder and run the following line:

sass custom.scss custom.css

This command essentially tells the Sass compiler to compile our “custom.scss” file into CSS, specifically with the filename “custom.css.” Afterwards, you should see the newly generated “custom.css” file in your “scss” folder.

For the next step, since you’re creating your own stylesheet that imports Bootstrap, you won’t need the Bootstrap CSS link in your HTML file anymore. In your index.html, replace the head contents with:

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Sample Bootstrap App</title>
    <!--<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">-->
    <!--<link href="styles.css" rel="stylesheet">-->
    <link rel="stylesheet" href="scss/custom.css">
</head>

Note that the previous links (to the Bootstrap files and the custom stylesheet) are now commented so that you can use the new CSS file that you compiled from SCSS beforehand.

Run the application, and you should see the following changes:

After creating an SCSS file, compiling it into CSS, and using it, we are able to achieve the same effect of customizing Bootstrap, but in an easier manner.

Using Bootstrap’s JavaScript Plugins

Bootstrap provides different JavaScript plugins to add interactivity and animation to your projects. These JS plugins include:

  • Modal: These are pop-up dialogs that you can use to display information, policies or terms of use, and forms. These usually include a title, body, and footer.
  • Tooltips & Popovers: Plugins that show additional information on mouse hover (tooltips) or click (popovers). These can have either only text or a pair of title and text.
  • Toast: Use these when you want to display stylized notifications easily. These also typically include a header and a body.
  • Collapse: Plugins that create toggleable elements. These keep the application looking clean, hiding and showing elements that could clutter the display on smaller screens.
  • Carousel: These are responsive image sliders. They usually come with a title, body, image, and a pair of “next” and “previous” buttons for going through the media files.

Let’s try using a tooltip and popover. In your index.html file, pick any column from any row and add the following lines of code:

<button type="button" class="btn btn-danger text-white" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" data-bs-content="This popover appears at the top of the button.">
     Click Me!
</button>

<button type="button" class="btn btn-info text-white" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="This tooltip appears at the right side of the button.">
     Hover over me!
</button>

This code adds two buttons: one for triggering the popover event and another for the tooltip event. Specify the type of data toggle using the “data-bs-toggle” property, then specify the placement of the tooltip and popover.

Afterwards, after the Bootstrap script near the bottom of the body, add the following lines:

<script>
        const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]');
        const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl));

        const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
        const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
</script>

What this code does is initialize both the popover and tooltip trigger lists, enabling them for the page. Run the application to see the two new buttons that show a tooltip when hovered and a popover when clicked:

This image demonstrates Bootstrap's popover and tooltip components. It shows two buttons: one for displaying a popover on click and another for displaying a tooltip on hover.

These components are already cool, but you can take it up a notch by customizing them further using data attributes and JavaScript.

For example, you can use data attributes to change the behavior of the popover button, shown in the code below:

<button type="button" class="btn btn-danger text-white"
     data-bs-container="body"
     data-bs-toggle="popover"
     data-bs-placement="top"
     data-bs-config='{"animation": false, "delay": {"show": 500, "hide": 100}}'
     data-bs-content="This popover appears at the top of the button.">Click Me!</button>

This removes Bootstrap’s default animation for the popover. Instead, it will show the popover after 500ms without the fade-in effect. Note that to use the “data-bs-config,” you need to modify your popover and tooltip script into something like:

document.addEventListener("DOMContentLoaded", function () {
    const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]');

    popoverTriggerList.forEach((popoverTriggerEl) => {
        const config = JSON.parse(popoverTriggerEl.getAttribute("data-bs-config"));
        new bootstrap.Popover(popoverTriggerEl, config);
    });

    const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
    tooltipTriggerList.forEach((tooltipTriggerEl) => {
        new bootstrap.Tooltip(tooltipTriggerEl);
    });
});

On the other hand, you can use JavaScript to change the behavior of the plugins. For instance, to dynamically update the tooltip options, replace the tooltip script with:

document.addEventListener("DOMContentLoaded", function () {
            const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');

            tooltipTriggerList.forEach((tooltipTriggerEl) => {
                const tooltip = new bootstrap.Tooltip(tooltipTriggerEl);

                tooltipTriggerEl.addEventListener("mouseenter", function () {
                    tooltip.setContent({ '.tooltip-inner': "New Tooltip Text!" });
                    tooltip.update();
                });
            });
});

This code dynamically replaces the contents of the tooltip on DOM load.

That’s all we need to discuss in this article about using Bootstrap’s most common features. But before you go, why not talk about another suitable Bootstrap implementation for React apps?

Common Bootstrap errors & how to fix them

Even when you know how to use Bootstrap, a few common setup issues can cause components to break or behave unexpectedly. Here are the most frequent problems developers run into, and how to fix them quickly.

1. Tooltips or popovers not working

Problem: Tooltips, popovers, or dropdowns don’t appear when expected.
Cause: Bootstrap’s JavaScript plugins require manual initialization.
Fix: Ensure you initialize them after the DOM loads:

document.addEventListener("DOMContentLoaded", function () {

  document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(

    el => new bootstrap.Tooltip(el)

  );

});

Also confirm you’re using bootstrap.bundle.min.js, which includes Popper.

2. JavaScript imported twice

Problem: Modals open twice, animations behave oddly, or console warnings appear.
Cause: Bootstrap JS is loaded more than once (e.g., via CDN and NPM). 

Fix: Import Bootstrap JavaScript only once—either:

  • via CDN or
  • via NPM/bundler (import ‘bootstrap/dist/js/bootstrap.bundle.min.js’)

Never mix both approaches in the same project.

3. Missing Popper (older Bootstrap versions)

Problem: Dropdowns or popovers fail in Bootstrap 4 or earlier.
Cause: Popper.js is required but not included.
Fix:

  • For Bootstrap 5: Always use bootstrap.bundle.min.js (Popper included).
  • For Bootstrap 4: Add Popper manually before Bootstrap JS.

4. Styles not applying as expected

Problem: Bootstrap classes appear correct, but styles don’t apply.
Cause: Custom CSS overrides Bootstrap unintentionally.
Fix:

  • Check CSS load order (Bootstrap first, custom CSS after).
  • Avoid overusing !important.
  • Use Bootstrap utility classes before writing custom overrides.

5. Components not responsive

Problem: Layout breaks on mobile or tablet screens.
Cause: Missing viewport meta tag or incorrect grid usage.
Fix: Ensure this tag exists in your <head>:

<meta name="viewport" content="width=device-width, initial-scale=1">

Also, verify correct breakpoint classes (col-md-*, col-lg-*, etc.).

React Bootstrap: an alternative for React apps

Bootstrap, as it is, works well with React apps. But if you want something that works more like React, then you should consider using React Bootstrap. Let’s quickly explore what it is and what makes it different below.

What is React Bootstrap?

React Bootstrap is a popular front-end framework from an open-source community. Although not officially from the Bootstrap team, it is perfect for React apps because it doesn’t rely on direct DOM manipulation.

Instead, it’s built on React components, ensuring better compatibility with React’s virtual DOM and state management. So, instead of using syntax like “<button class=’btn btn-primary’>…,” you would use something like “<Button variant=’primary’>Primary</Button>.”

Key differences between traditional and React Bootstrap

  • Component-based Approach: React Bootstrap provides pre-built React components like <Button> and <Form> instead of using HTML and class-based Bootstrap components.
  • No jQuery Dependency: Bootstrap 4 required jQuery for some interactive features. Bootstrap 5 removes this dependency and uses plain JavaScript instead. On the other hand, React Bootstrap relies on React itself, reducing unnecessary dependencies.
  • Better Integration with React Apps: React Bootstrap components support props, state management, and lifecycle methods, allowing more flexibility to ensure proper rendering.

Best practices for using Bootstrap

Using Bootstrap is easy, even if you are a beginner. However, beginner or not, developers should always research and consider the best practices when using Bootstrap. By doing so, you can avoid future headaches like security breaches, obsolescence, and performance issues.

Here are two important things to consider for Bootstrap:

Keep Bootstrap updated

Regularly updating Bootstrap ensures access to the latest features, performance improvements, and security patches. Outdated versions may have vulnerabilities or lack support for modern web standards.

Just be sure to check the documentation pages first before updating to the latest. Bootstrap could change some syntax on their next update, possibly breaking some existing code if not thoroughly checked. For example, “text-start” and “text-end” used to be “text-left” and “text-right” a few years ago.

Optimize Bootstrap for performance

  • Minimize CSS and JS files: Use only the necessary Bootstrap components by customizing builds. You can also use other third-party tools to help remove unused styles.
  • Use only necessary components: As briefly stated earlier, instead of importing the entire Bootstrap library, import individual components to reduce bundle size and improve loading times.

Conclusion

And that’s it! You now have some basic understanding of how Bootstrap works. Additionally, you’re now equipped to customize it to suit your applications.

Experimenting with different customization options will help tailor Bootstrap to specific project needs.

So, how do you find Bootstrap so far? Did you play around with the different components and customization settings? Share your experiences and tips on using Bootstrap in the comments!

FAQs

1. How do beginners start learning how to use Bootstrap?

Beginners can start learning how to use Bootstrap by adding it via the Bootstrap CDN and experimenting with the grid system, utility classes, and common components like buttons and cards.

2. Do I need JavaScript to use Bootstrap effectively?

No. You can use Bootstrap’s layout, grid, and styling features without JavaScript. JavaScript is only required for interactive components like modals, tooltips, and dropdowns.

3. What is the best way to customize Bootstrap for real projects?

For simple projects, custom CSS and CSS variables are enough. For larger projects, using Bootstrap with Sass via NPM provides better control and scalability.

graphical user interface, text

Discover the Best HTML Code Generator for Web Development

HTML code generator illustration showing a code editor icon with brackets and settings gear, representing automated HTML generation for web development

HTML code generators have helped web developers speed up their development cycles since their emergence. By providing a user-friendly interface to generate HTML code, they are able to significantly lessen manual coding. Many of these tools function as a WYSIWYG editor, allowing users to create and edit web pages visually without needing to write extensive code.

A visual representation of an HTML code generator.

Thus, businesses, developers, and even non-technical hobbyists have chosen to rely on these HTML generators or integrate them into their workflow.

If you’re planning to find the best HTML code generator that suits your needs, then read on below. In this guide, you’ll see some key features to look for in these generators, as well as a list featuring the best of them. Additionally, you’ll explore how you can quickly integrate one in your projects.

Key Takeaways

  • HTML code generators speed up development by reducing repetitive manual coding and enabling visual or assisted HTML creation.
  • Not all generators are the same—some focus on WYSIWYG editing, while others behave more like IDEs or desktop site builders.
  • The best HTML code generator depends on your workflow, project size, and whether you prioritize visual editing, clean output, or deep customization.
  • Features like syntax highlighting, templates, and cross-browser compatibility are essential for producing reliable, maintainable code.
  • Generated HTML should always be reviewed to ensure semantic structure, accessibility, security, and long-term maintainability.
  • Modern generators integrate easily into existing workflows, whether through online tools, CDN-based editors, package managers, or standalone applications.

What is an HTML Code Generator?

Whenever we build webpages, we write HTML code using text editors and view the result through a browser. Let’s call this “traditional coding.”

HTML code generators, on the other hand, allow developers to use a visual or text-based interface to generate code.

For example, a user can type on the generator’s text editor, select the text, and click some buttons (e.g., bold and italics). Afterwards, the generator will convert the editor’s contents (e.g., <strong><em>Some text</em></strong>) into HTML code. The way generators display the HTML code might differ, but the end result should be the same.

With these features, HTML generators help developers reduce or skip some basic coding, allowing them to focus on other important parts like optimization, security, and analysis.

Key Features to Look for in an HTML Code Generator

Nowadays, code generators come with plenty of features. Most of these are standard and essential, while others have more niche or specific uses. Here are four important features that the best HTML code generators should contain:

User-friendly Interface

This might appear obvious or simple at first glance, but the truth is that some generators prioritize other things over a polished user interface. Without proper layouts, organization, accessibility, customization, and a clean, modern look, a feature-rich code generator would turn into a difficult, counterintuitive tool.

So, for efficiency (and for not straining your eyes), choose a generator that looks and feels intuitive and seamless.

Auto-completion and Syntax Highlighting

Auto-completion and syntax highlighting are integral parts of every development process because of how they reduce issues, ensure clean code, and provide convenience.

The former automatically suggests code when you type in the editor, possibly reducing human errors (such as typos). Additionally, it helps cut time when writing repetitive code. On the other hand, syntax highlighting helps you identify syntax errors or inconsistencies in the editor.

Code Snippets and Templates

The code snippets feature contributes greatly to the rapid development of web pages. It allows developers to use pre-written codes and insert or paste them directly into projects.

Templates provide developers with a fixed yet customizable web page design and features. They serve as a good foundation for a project, especially for those who want a quick start.

In case you’re looking for ways to visualize code snippets or animate them in various ways, you can look at tools like Snappify.

Cross-browser Compatibility

Browsers may display HTML code differently. That’s why you usually test the look and feel of your web pages across different browsers before deploying them.

The same goes for HTML generators. When looking for the right one for your use case, you should pick that which already has cross-browser compatibility.

Top HTML Code Generators Available Today

There are many HTML generators available, each with its own strengths and weaknesses. Here’s a list of some of the best options you can consider:

1. Froala Editor

Froala, a WYSIWYG editor that also functions as an HTML code generator. The image shows two screens, one with the user interface and the other with the generated HTML code from the editor's code view feature.

Froala is a WYSIWYG editor (think drag-and-drop, rich-text editing, and image handling) that also contains code generation features. With over 100 features, it’s a tool that you can use for code generation, blog sites, web content creation, and more.

Features

  • Rich text and formatting features (e.g., Markdown, basic styling, tables, etc.)
  • Code Mirror integration for converting visual elements into code
  • Integration with Codox.io for collaboration and real-time editing features
  • Advanced file uploading and transformations
  • Lightweight (50 KB gzip core) and fast (about 40 ms initialization)

Pros

  • High degree of customization
  • A responsive, accessible, cross-browser, and cross-platform WYSIWYG editor that also supports SEO optimization
  • Easy integration with different front-end frameworks like React and server-side tools like PHP
  • Free trial with full features

Cons

  • No code templates exist at the moment.

Suitable for: Professionals and businesses that need a powerful, customizable, and light HTML editor and generator

2. Bootstrap Studio

An sample image that shows Bootstrap Studio's HTML code generator and IDE.

This is a desktop application that leverages the Bootstrap framework to create responsive web pages. It primarily offers several drag-and-drop components to assemble these web pages. Compared to other generators, this feels like more of a full-fledged IDE for web design.

Features

  • Bootstrap framework support (several versions are available)
  • Drag-and-drop editing for rapid development
  • Real-time preview of web page designs across different devices and screen widths (like a hot reload for page design)
  • Pre-made templates and components
  • Fonts and icons are available

Pros

  • Great for responsive web design
  • A good degree of customization
  • Easy to learn
  • Intuitive and clean IDE UI

Cons

  • Might seem too heavy for simpler or specific HTML code generation requirements

Suitable for: Web page designers or developers who feel more comfortable with drag-and-drop IDEs

3. CoffeeCup HTML Editor

This image shows the UI of CoffeeCup's HTML editor, particularly the tag highlighting feature.

CoffeeCup’s HTML editor offers dozens of useful tools for building web pages, prioritizing development speed and convenience.

Features

  • Code completion for convenience and reducing typographical errors
  • Tag highlighting for knowing where each tags (e.g., div) start and end
  • Template downloader
  • Components library
  • Free trial is available

Pros

  • Good syntax highlighting and auto-completion features
  • Lets you get started easily
  • Good file structure organization
  • Great for developers and designers who are already familiar with non-visual IDEs

Cons

  • The IDE’s UI looks clean but might seem less modern compared to others
  • There’s a free trial, but there’s no online HTML code generator demo available

Suitable for: Developers who are more comfortable with manual coding but want a little automation features and convenience

A table of comparison that summarizes the information above.

How to Choose the Right HTML Code Generator for Your Needs

With many available options to generate HTML code, you should consider the following factors:

Project Requirements

Are you building a full website, or are you looking to quickly generate HTML code? Do you need many features or just specific ones? Are compliance, security, clean layouts, SEO, and performance important for you? How about scalability?

Team Size

If you’re working solo, you can opt for a simple, easy-to-use, and possibly free tool to generate HTML code. On the other hand, small and larger teams might benefit from more robust tools, especially those with collaboration features.

Budget

Some HTML code generators are free or have a perpetual plan option. Others require a subscription. Better ones offer all of the aforementioned. Choose a tool that aligns with your budget constraints.

Remember that before you fully commit, you should test out the tools with either a free trial or a live demo. You can then gauge whether the features align with your needs and workflow.

Integrating an HTML Code Generator into Your Workflow

You can use HTML code generators in several ways. Here are some examples that demonstrate how you can integrate them into your workflow:

Online HTML code generators

If you just need a quick and accessible start to your projects, you can use online HTML generators. These include online HTML editor demos and even AI-powered LLMs like ChatGPT. To get started, visit the site of your preferred online editor.

Web app integration

You can also integrate these generators into applications (e.g., internal apps or apps for your users). For example, you can install Froala Editor by either downloading its files as a ZIP, using the CDN, or using package managers like NPM.

After you have the editor’s files (or if you’re using CDN), you can then import them into your project directly like the following lines:

<!--Import via CDN-->
<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>

Once you have them, you’re ready to initialize the editor and enable your application’s users to generate HTML.

As separate desktop applications

Lastly, you can download or purchase full IDEs with code generation features. This method would probably require the most effort and resources but might also come with the most features. Hence, you must ensure that you can maximize the use of these features should you get such a code generator.

Conclusion

In web development, you can supplement your current tech stack with a tool that can generate HTML code. This speeds up the layout design and development process while possibly reducing errors.

Before you start implementing, it is worth noting that neither traditional coding nor HTML generators is better than the other. Furthermore, you should always review generated code to be safe.

To find the best one for you, check each of the best HTML code generators out (demos, free trials, etc.). In the end, the answer will depend on your project needs, development style, pacing, and budget.

FAQs

How to generate code for HTML?

You can generate HTML code by writing it manually in a text editor, using an HTML code generator or WYSIWYG editor, or through AI tools. HTML generators allow you to design visually or use templates, then automatically convert your input into structured HTML code.

Can ChatGPT create HTML?

Yes, ChatGPT can generate HTML code based on prompts you provide. It’s useful for creating layouts, components, forms, and sample markup. However, the generated code should always be reviewed and tested before use in production.

Can AI write HTML code?

Yes, AI tools can write HTML code efficiently, especially for common layouts and components. While AI speeds up development, developers should still validate the output for correctness, accessibility, performance, and security.

Are HTML code generators good for SEO?

Yes, HTML code generators can be good for SEO if they produce clean, semantic HTML. To get the best results, developers should review generated code to ensure proper heading structure, accessible markup, optimized images, and minimal unnecessary elements.

Do HTML code generators replace manual coding?

No, HTML code generators do not fully replace manual coding. They are best used to speed up layout creation and repetitive tasks, while developers still refine, optimize, and secure the generated code for production use.

graphical user interface, text

Adding Rich Text Editor Support For Contact Form 7 WordPress Plugin

rich-text editor for contact form 7

Would you like to allow users to submit formatted content through your Contact Form 7 forms instead of plain text? This guide explains step-by-step how you can integrate a rich-text editor for Contact Form 7 using the Froala WordPress content editor.

What Is Contact Form 7?

Contact Form 7 is one of the most popular form-building plugins used by millions of WordPress websites worldwide. It’s incredibly reliable and powerful for creating simple to advanced forms.

Contact form 7

But there’s one limitation—its default text area fields only allow plain text submissions. This means users can’t include HTML tags like bold text, italics, headings, or any other visually appealing formatting.

That’s where adding a rich text editor like Froala can greatly improve the user experience and allow your forms to accept visually engaging, formatted submissions.

Why Add a WordPress Content Editor to Contact Form 7?

By adding a rich text editor field, you’ll significantly enhance your user’s experience. Contributors to your forms will now be able to easily provide complex content using the wordpress editor. Instead of receiving boring plain text submissions, you’ll get nicely formatted messages including headings, bold text, italicized text, and lists.

This improvement can make submissions easier to read, more organized, and visually appealing, potentially boosting your engagement and conversion rates. Your WordPress site and your email communications will both look more professional and polished.

Creating a Rich Text Editor Field for Contact Form

Let’s get started! Follow these easy steps to add the feature to your form:

Step 1: Setting Up Your Contact Form

  • In your WordPress dashboard, navigate to Contact Form 7 under the plugins menu.
  • Either create a new form or select an existing contact form to edit.
  • You might already have something like this in your form template:
<label> Your name
    [text* your-name autocomplete:name] </label>

<label> Your email
    [email* your-email autocomplete:email] </label>

<label> Subject
    [text* your-subject] </label>


[submit "Submit"]

Step 2: Adding a Rich Text Editor Field for Contact Form

Now let’s add the new Froala-powered rich text editor field:

  • Click on the “textarea” button to insert a new field.

rich text wordpress content editor

  • In the “Field name” input, provide a unique identifier such as “message“.
  • In the “Class attribute” input, add a class name you’ll use later to reference the field in the Froala initialization code. A simple example is “editor“.
  • Your inserted tag will look like this:
[textarea message class:editor]

Insert text area field

  • Click “Insert Tag“, and your form template will now include this new field for complex content submission.
  • Save your updated contact form.

Initializing Froala Rich Text Editor on Your Form

You’re almost there! Next, you’ll need to set up your form emails to handle HTML content properly.

Step 3: Configuring Email Submission with HTML Tags

  • In your Contact Form 7 settings, click the “Mail” tab.
  • Ensure you’ve checked “Use HTML content type“. This setting allows your submissions to include HTML tags and maintain their formatting.
  • Also, ensure the “message” field is referenced in your “Message body“.
contact form email setup
  • Click “Save” and copy the generated shortcode provided by Contact Form 7.

Step 4: Embedding Your Contact Form into a WordPress Page

To display your new rich text-enabled form, embed the shortcode into one of your WordPress pages:

  • Open the page editor for your desired page.
  • Paste your shortcode where you want the form to appear:

Error: Contact form not found.

Insert contact form shortcode
  • Click “Publish” or “Update” to make the page live on your WordPress site.

Step 5: Adding the Froala WordPress Content Editor to the Form Page

Now, you’ll add the Froala rich text editor resources directly to your page. Simply include the Froala CDN link and initialization script:

Add these CDN references to your page or site’s HTML head:

<link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.min.css' rel='stylesheet' />
<script src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.min.js'></script>

Then initialize the Froala editor on your textarea field using the class name “editor“:

<script> document.addEventListener('DOMContentLoaded', function() { new FroalaEditor('.editor'); }); </script>
rich text editor for contact form 7

After adding this code snippet, save and publish your page.

Safety & Validation: Handling Rich Text Submissions Securely

While adding a rich text editor for Contact Form 7 improves usability, it’s important to handle formatted content safely. Allowing HTML input introduces new considerations around validation, sanitization, and storage.

Here are a few best practices to follow:

Limit Allowed HTML Tags

Not all HTML tags should be accepted from user submissions. Limit input to safe formatting elements such as <strong>, <em>, <ul>, <ol>, <li>, and <p>. Avoid allowing scripts, inline styles, or embedded media unless absolutely necessary.

WordPress provides built-in functions for sanitizing user input. To learn more about best practices, refer to the official WordPress sanitization documentation

Sanitize Output Before Displaying or Sending

Always sanitize rich text content before displaying it on your site or including it in emails. This helps prevent XSS attacks and malformed HTML from breaking layouts.

If you’re using the submission content in email notifications, ensure that HTML output is properly escaped or filtered to maintain consistent formatting across email clients.

Decide How HTML Should Be Stored or Emailed

Before going live, decide whether rich text submissions should be:

  • Stored as raw HTML
  • Sanitized HTML
  • Converted to plain text for email delivery

For many use cases, sanitizing and sending HTML emails works well. For others, such as support forms or internal tools, converting submissions to clean, readable text may be safer and more reliable.

Taking a few extra steps to validate and sanitize user input ensures your rich text forms remain both powerful and secure.

Testing Your New Rich Text Contact Form

Now it’s time to test your implementation:

  • Open your published page in a browser.
  • You should now see your contact form with the Froala rich text editor field instead of the plain textarea.

rich-text editor for contact form 7

  • Enter test values and experiment by formatting your message with headings, bold, italics, and more.
  • Submit your form and verify the formatted HTML content appears correctly in your email inbox.

rich-text editor for contact form 7 submitted

Improving Your WordPress Submissions with Complex Content

With Froala integrated, your website visitors can now submit visually rich and complex content directly through your forms. This simple upgrade drastically improves the readability and organization of form responses. It also enhances your overall communications, making them look professional and polished.

No more monotonous plain text submissions—each submission now comes beautifully formatted and ready for immediate use, perfect for your next post.

Conclusion

By following this straightforward, step-by-step guide, you’ve successfully added a powerful rich text editor to your Contact Form 7 forms. With Froala powering your form submissions, your website’s user experience is significantly enhanced, allowing for detailed, structured, and engaging responses.

This simple yet impactful integration transforms the way your website visitors interact with your forms, providing a much-improved WordPress experience. Now go ahead and enjoy the benefits of beautifully formatted submissions!

FAQs

Can Contact Form 7 support a rich text editor?

Yes. While Contact Form 7 only supports plain text fields by default, you can add a rich text editor for Contact Form 7 by integrating a third-party editor like Froala. This allows users to submit formatted content such as bold text, headings, lists, and more.

Is it safe to use a rich text editor in Contact Form 7?

Yes, as long as you follow proper security practices. When using a rich text editor for Contact Form 7, it’s important to limit allowed HTML tags, sanitize user input, and validate output before displaying or emailing submissions. WordPress provides built-in sanitization functions to help handle formatted content safely.

Will rich text formatting appear correctly in Contact Form 7 emails?

It can. To ensure formatting is preserved, you must enable the HTML content type in Contact Form 7’s Mail settings. Once enabled, formatted submissions created using a rich text editor will appear correctly in email notifications, provided the HTML is properly sanitized.

graphical user interface, text

How to Control Font Size in Froala Editor: Complete Guide to Pixel-Precise Typography

Font Size Plugin

Precise typography is fundamental to professional document design. Froala’s font sizing controls give you pixel-level accuracy and flexible unit options, ensuring your typography remains consistent and intentional across every page. From responsive layouts that adapt seamlessly to different screens, to accessible contrast ratios that meet accessibility standards, to maintaining visual harmony across devices—Froala delivers the typographic control you need for polished, professional results.

In this article, we’ll explore the Froala editor’s powerful font sizing capabilities—including options, methods, and events that developers can leverage to give end-users precise typographic control.

Whether you’re building a content management system, a blogging platform, or a collaborative writing tool, mastering these features enables you to deliver a seamless, professional editing experience.

Font Size Plugin

Key Takeaways

  • Use fontSize to define a custom set of sizes aligned with your brand guidelines and design system.
  • Control units with fontSizeUnit to ensure responsive, accessible typography across devices.
  • Display selected text sizes on the toolbar with fontSizeSelection for real-time user feedback.
  • Leverage command.before and command.after events to implement custom logic around font size changes.
  • Ensure the Font Size plugin is enabled and properly configured in your editor setup.

Froala Font Size Options

The Froala editor provides multiple font size options that cater to different design needs and user preferences.

Set Font Sizes

The fontSize option allows developers to define a custom set of font sizes available to end-users in the editor. This gives you precise control over the typographic choices permitted within your application.

By specifying exact pixel values or relative units, you ensure typographic consistency while preventing users from applying arbitrary sizes that could break your design system.

PRO tip: Consider using predefined ranges that align with your brand guidelines—perhaps 12px for body text, 16px for leads, and 24px for headings.

new FroalaEditor('div#froala-editor', { 
    fontSize: [12, 18, 32],
 });

Set Font Size Units

The fontSizeUnit option allows you to control the default font size unit used in your editor, whether that’s pixels, points, ems, rems, or percentages for maximum flexibility and responsive design compatibility.

With `fontSizeUnit: ‘rem’`, your typography scales responsively across all devices while maintaining accessible, scalable text sizing throughout your application.

This approach ensures that users can adjust text sizes based on their preferences without compromising the overall design integrity or visual hierarchy of your content documents and layouts.

new FroalaEditor('div#froala-editor', {
    fontSize: [12, 18, 32],
    fontSizeUnit: 'pt',
});

Display Selected Text Font Size On The Editor Toolbar

The fontSizeSelection option enhances usability by displaying the current font size of selected text directly on the editor toolbar. When set to true, users can instantly see what size is applied to their text without hunting through the code view option.

This real-time feedback improves editing efficiency and helps users maintain consistent typography throughout their document.

new FroalaEditor('div#froala-editor', {
    fontSizeSelection: true,
    fontSize: [12, 18, 32],
    fontSizeUnit: 'pt',
});

Set The Default Font Size Of The Editor

Another important option is fontSizeDefaultSelection. This option sets the default font size applied when users begin typing new content or add unstyled text to the editor.

By establishing a sensible baseline font size, developers ensure that new content maintains visual consistency without requiring constant user intervention or manual formatting corrections.

It is important to note that when a user presses Enter to create a new line, the editor automatically inherits the formatting of the previous line. This behavior ensures consistent typography throughout the document without requiring manual formatting adjustments.

new FroalaEditor('div#froala-editor', {
    fontSizeDefaultSelection: "12pt",
    fontSizeSelection: true,
    fontSize: [12, 18, 32],
    fontSizeUnit: 'pt',
});

PRO TIP: Keep Font Size Format When Text Deleted

Froala’s keepFormatOnDelete option preserves text formatting when content is deleted. When enabled, the editor maintains the formatting of deleted text and applies it to any new content you type immediately afterward.

Example: If you format text to 32px, then delete it and begin typing again, the new text automatically inherits the 32px size—even if your default font size is set to a different value.

This feature streamlines editing workflows by eliminating the need to reapply formatting after deletions, ensuring consistent typography throughout your document without manual intervention.

new FroalaEditor('div#froala-editor', {
    fontSizeDefaultSelection: "12pt",
    fontSizeSelection: true,
    fontSize: [12, 18, 32],
    fontSizeUnit: 'px',
    keepFormatOnDelete: true
});

Froala Font Size Methods

Apply Font Size to Text

The `fontSize.apply` method programmatically applies a specific font size value to the selected text withinthe Froala editor instance. This is useful when you need to apply consistent formatting programmatically based on user actions or document requirements within your application. For example, you might automatically set all headings to 28px or ensure body paragraphs maintain a readable 16px baseline throughout.

Froala Font Size Related Events

You can use the command.before and command.after events to execute custom logic before or after font size changes occur. By validating that the triggered command is fontSize, you can intercept these events and implement application-specific behavior.

Before font size changes, use command.before to:

  • Validate the current text selection
  • Check document constraints or business rules
  • Prompt users for confirmation before applying modifications.

After font size changes, use command.after to:

  • Update the UI to reflect the new font size.
  • Log formatting changes for audit trails
  • Trigger validation routines
  • Synchronize modifications across collaborative editing sessions
const editor = new FroalaEditor('div#froala-editor', {
  toolbarButtons: ['fontFamily', 'fontSize', 'html'],
  fontSize: [12, 16, 24, 32],
  fontSizeUnit: 'px',
  events: {
    'commands.before': function (cmd, size) {
      // Do something here
      if (cmd === 'fontSize') {
        // this is the editor instance.
        const selectedText = this.selection.text();

        // Enforce business rule: prevent sizes over 24px
        if ( parseInt(size, 10) > 24) {
          alert('Font size cannot exceed 24px per brand guidelines');
          return false;
        }
      }
    },
    'commands.after': function (cmd, size) {

      if (cmd === 'fontSize') {
        // Log the change for audit trail
        console.log('Font size changed to:', size);

        // Update custom UI element
       // document.getElementById('current-size').textContent = size;

        // Trigger validation
        validateDocumentFormatting();

        // Sync to collaborative session (example)
        syncChangesToCollaborators({
          action: 'fontSize',
          value: e.args[0],
          timestamp: new Date(),
        });
      }
    },
  },
});

font size events

These events give developers the hooks needed to implement custom logic, maintain data integrity, and create a polished editing experience for end-users.

Froala Font Size Plugin

The font sizing options, methods, and events described above are only available when the Font Size plugin is enabled in your Froala editor instance.

Including the Font Size Plugin

If you’re using a custom Froala build (not the pre-packaged .pkgd version), you’ll need to explicitly include the Font Size plugin script:

https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/font_size.min.js

Once included, the plugin activates automatically.

Verifying Your Configuration

If you’re customizing your editor setup, confirm these settings are properly configured:

  • pluginsEnabled — Ensure fontSize is included in this array
  • pluginsDisabled — Verify fontSize is not listed here
  • toolbarButtons — Confirm fontSize appears in your toolbar configuration

FAQ

Can I set custom font sizes for different user roles?

Yes. Define your fontSize array with specific values, then conditionally render the editor with different configurations based on user permissions.

What happens if a user’s browser doesn’t support a font size unit I specify?

Modern browsers support px, pt, em, rem, and %. Stick to these standard units and test across your target browsers to ensure compatibility.

Can I prevent users from making text too large or too small?

Yes. Control available sizes by defining your fontSize array with only the sizes you want to permit in your application.

Why isn’t the font size toolbar button appearing?

Verify the Font Size plugin is included, fontSize is in your pluginsEnabled array, and fontSize is listed in your toolbarButtons configuration.

How do I undo a font size change?

Users can press Ctrl+Z (Windows) or Cmd+Z (Mac) to undo formatting changes, just like any other edit.

Conclusion

Mastering Froala’s font sizing capabilities empowers you to deliver professional, accessible typography throughout your application. Whether you’re defining brand-aligned sizes, ensuring responsive scaling, or maintaining consistent formatting across collaborative editing sessions, these tools give you the precision and flexibility needed for polished document design.

Ready to experience seamless typographic control? Try Froala’s editor free today and see how pixel-perfect font sizing transforms your editing experience.

Froala Anchor Plugin: A Practical Guide for Implementing In-Editor Navigation

Anchor text

In the world of web development, creating intuitive navigation experiences is crucial for user engagement and content accessibility. Froala’s Anchor Plugin emerges as a powerful solution for developers seeking to implement anchor-based navigation within their rich text editor. This comprehensive guide will walk you through everything you need to know about the Anchor Plugin, from basic setup to advanced integration with Froala’s Export to Word feature.

Whether you’re building a documentation site, creating long-form content, or developing a knowledge base, understanding how to effectively use anchor links can significantly improve your user experience. This guide is designed for developers, content creators, and web developers who want to master Froala’s Anchor Plugin and leverage its full potential in their projects.

Anchor Plugin Guide

What Are Anchor Links?

Anchor links are specific points within a web page that you can link to directly, allowing users to navigate to specific sections without scrolling through the entire content. In HTML, anchors are implemented using the <a> tag with a name attribute or the id attribute on any HTML element.

<!-- Anchor point -->
<h2 name="section1" id="section1">Section 1</h2>

<!-- Link to anchor -->
<a href="#section1">Go to Section 1</a>

Common use cases include:

  • Table of contents navigation
  • FAQ sections with quick jump links
  • Long articles with numbered sections
  • Documentation sites with hierarchical content
  • E-commerce product specifications
  • Educational content with multiple chapters

The primary benefits of anchor links include improved user experience, better content organization, and enhanced accessibility for users with disabilities. They provide immediate access to relevant information, reducing cognitive load and improving content discoverability.

Getting Started with Froala’s Anchor Plugin

Before diving into the implementation, ensure you have the following prerequisites:

Installation and Setup

To get started with the Anchor Plugin, follow these steps:

    1. Install the Anchor Plugin:
      Include via CDN or using other alternative installing methods.

      <link href="path/to/froala_editor.min.css" rel="stylesheet" type="text/css" />
      <link href="path/to/css/plugins/link_to_anchor.min.css" rel="stylesheet" type="text/css" />
      
      
      <script type="text/javascript" src="path/to/js/froala_editor.min.js"></script>
      <script type="text/javascript" src="path/to/js/plugins/link_to_anchor.min.js"></script>
      <script type="text/javascript" src="path/to/js/plugins/export_to_word.min.js"></script> <!-- Optional: for Word export -->
    2. Include the plugin in your initialization:
      The Anchor plugin is enabled by default. If you are customizing enabled plugins:

      • Ensure “linkToAnchor” is listed in pluginsEnabled.
      • Ensure “linkToAnchor” is NOT listed in pluginsDisabled.
    3. Include the Anchor button in the toolbar buttons:
      To display the Anchor button on the toolbar, ensure the insertAnchor is included in the toolbar button configurations for all sizes:

        • toolbarButtons
        • toolbarButtonsMD
        • toolbarButtonsSM
        • toolbarButtonsXS
$(document).ready(function() {

  new froalaEditor('#edit', {

     pluginsEnabled: ['linkToAnchor', 'exportToWord'],

  pluginsDisabled: ['track_changes', 'fontSize'],

  toolbarButtons: ['insertAnchor', 'export_to_word', 'undo', 'redo', '|', 'bold', 'italic']

  });

});

Inserting Anchors in the Editor

Using the Anchor Insertion Button

Once the plugin is activated, Froala adds an anchor button to the toolbar. Here’s how to use it:

  1. Place your cursor where you want to insert an anchor.
  2. Click the anchor button in the toolbar.
  3. Enter the anchor name in the dialog that appears.
  4. Click “Insert” to create the anchor.

You’ll see a small anchor icon appear in the editor. This visual indicator helps you locate anchors within your content.

anchors

Best Practices for Anchor Management

When working with anchors, consider these best practices:

  • Use descriptive, meaningful names.
  • Follow a consistent naming convention (e.g., section1, faq-item-2)
  • Avoid spaces and special characters in anchor names.
  • Keep anchor names short but descriptive.
  • Test anchor links regularly to ensure they work correctly.

Creating Links to Scroll to Anchors

Link Creation Workflow

Creating links to anchors in Froala is straightforward:

  1. Select the text you want to turn into a link.
  2. Click the link button in the toolbar.
  3. In the link dialog, choose the anchor reference (e.g., #section1) from the dropdown list.
  4. Click “Insert” to create the link.

Clicking the link smoothly scrolls to the anchor text.

Plugin Options and Events

The Anchor Plugin provides one option and two events for programmatic control:

Anchor Plugin Configuration

This configuration allows developers to customize the edit anchor popup buttons. This popup appears when clicking an existing anchor in the editor.

new FroalaEditor('#editor', {

  anchorEditButtons: ['anchorEdit', 'anchorRemove']

});

Event Handlers

Listen to anchor-related events to create custom workflows:

Before inserting the anchor text

Use anchor.beforeInsert event to execute pre-insert validation, modify anchor data, trigger custom animations, and synchronize with other plugins or content blocks in the editor.

For example, configure validation to ensure anchor names meet your requirements:

new FroalaEditor('#editor', {

  anchorEditButtons: ['anchorEdit', 'anchorRemove']

});
Event Handlers
Listen to anchor-related events to create custom workflows:
Before inserting the anchor text
Use anchor.beforeInsert event to execute pre-insert validation, modify anchor data, trigger custom animations, and synchronize with other plugins or content blocks in the editor.
For example, configure validation to ensure anchor names meet your requirements:
new FroalaEditor('#editor', {

  events: {

    'anchor.beforeInsert': function (link, anchorName) {

      
      if (anchorName.length < 3) return false; // Prevent insertion
      
      if (!/^[a-zA-Z0-9_-]+$/.test(anchorName)) return false; // Prevent insertion
      
      return true; // Allow insertion
 

      }

  }

});

This enables robust pre-insert checks, preventing invalid anchors and ensuring consistent naming across the document and navigation within your workflow.

Before removing the anchor text

Another available event is anchor.beforeRemove, which allows you to ensure proper cleanup, update internal references, and trigger downstream updates across the editor’s content structure consistently.

Integration with Export to Word Feature

One of the powerful aspects of Froala’s Anchor Plugin is its seamless integration with the Export to Word feature. This ensures that your anchor-based navigation structure is preserved when exporting content to Word documents.

How Anchor Plugin Works with Export to Word

When you export content containing anchors to Word, Froala automatically:

  1. Preserves anchor points: All anchor markers are converted to Word bookmarks
  2. Maintains link structure: Anchor links are converted to Word hyperlinks
  3. Keeps navigation intact: Users can still jump to specific sections in the exported document.

Conclusion

Froala’s Anchor Plugin provides developers with a powerful and flexible solution for implementing anchor-based navigation within rich text editing environments. Throughout this comprehensive guide, we’ve explored the plugin’s capabilities from basic setup to advanced integration with other features like Export to Word.

Key takeaways include:

  1. Versatile Implementation: The Anchor Plugin seamlessly integrates with Froala’s editor, offering control over anchor creation and management.
  2. Enhanced User Experience: Anchor links significantly improve content navigation, making large documents more accessible and user-friendly.
  3. Cross-Feature Compatibility: The plugin works harmoniously with Froala’s Export to Word feature, ensuring that navigation structures are preserved across different formats.
  4. Extensive Customization: With configuration options and events, developers can tailor anchor functionality to meet specific project requirements.

By following the best practices and implementation strategies outlined in this guide, developers can create sophisticated navigation experiences that enhance both user engagement and content accessibility. The Anchor Plugin exemplifies Froala’s commitment to providing comprehensive, developer-friendly solutions for modern web development challenges.

Additional Resources

To further enhance your understanding and implementation of Froala’s Anchor Plugin, consider exploring these additional resources:

Official Froala Documentation Links

By leveraging these resources and following the comprehensive guide provided, you’ll be well-equipped to implement Froala’s Anchor Plugin effectively and create exceptional navigation experiences for your users.

Building a Complete Document Generator with Froala 4.7 Plugins

automating document workflows

Froala 4.7 introduced a powerful trio of plugins that streamlines document workflows. Link to Anchor handles internal navigation, Page Break controls print layout, and Export to Word allows for generating downloadable files. While these tools are effective individually, they become a complete document generation system when combined.

This guide details how to integrate these plugins into a cohesive workflow. We will build a custom toolbar button that scans document headings and generates a semantic Table of Contents (TOC) directly inside the editor. This solves a common user friction point where manual linking becomes tedious for long reports in a WYSIWYG editor.

The Objective

The end goal is a seamless user experience. A user clicks a single button, the editor scans their content for structure, and a linked TOC appears at the top of the document. Users can then insert page breaks between sections and export the final result to Microsoft Word with the layout preserved.

Key Takeaways

  • Integrate Core Plugins Combine Link to Anchor, Page Break, and Export to Word for seamless workflows.
  • Automate Navigation Build a custom button that auto-generates a Table of Contents from headings.
  • Sanitize Data Implement logic to create URL-safe anchors and handle duplicate headings.
  • Export Fidelity Ensure page breaks and navigation links remain functional in Word downloads.
  • Validate Input Add safeguards to ensure manual anchor names adhere to strict naming conventions.

What We Are Building

The custom button performs four specific logic operations.

  1. Scans the DOM It identifies all H2 and H3 headings within the editor instance.
  2. Sanitizes Anchors It automatically creates URL-safe anchor tags for navigation.
  3. Generates Navigation It builds a nested, linked list at the top of the content.
  4. Manages Duplicates It intelligently handles identical heading names by appending unique counters.

This automation removes the need for manual anchor placement and ensures every exported document has a functional navigation structure.

Plugin Setup

To begin, you must load all three plugins along with their required dependencies. Note that the Export to Word plugin relies on FileSaver and html-docx-js. These libraries must be loaded before the Froala script to ensure the export functionality initializes correctly.

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Froala Editor Basic Setup</title>
    
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/froala_editor.pkgd.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/plugins/link_to_anchor.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/plugins/page_break.min.css" rel="stylesheet">
    
    <style>
        html { 
            /* Enables smooth scrolling when jumping to anchors */
            scroll-behavior: smooth; 
        }
    </style>
</head>
<body>
    
    <div id="editor"></div>
    
    <script src="https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.min.js"></script>
        
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/froala_editor.pkgd.min.js"></script>
    
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/plugins/link_to_anchor.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/plugins/page_break.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/plugins/export_to_word.min.js"></script>
    
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // Initialize the editor on the div with id="editor"
            new FroalaEditor('#editor', {
                heightMin: 400, // Set a minimum height
                // Add any desired toolbar buttons and configurations here
                toolbarButtons: ['bold', 'italic', 'formatOL', 'formatUL', '|', 'pageBreak', 'export_to_word']
            });
        });
    </script>
</body>
</html>

 

Creating the Generate TOC Button

Custom toolbar buttons in Froala require a two-step definition process. First, we define the visual icon. Second, we register the command logic.

The implementation below uses DOMParser rather than regex for HTML manipulation. This is the industry standard for security and reliability, as it avoids the common pitfalls of parsing HTML strings manually.


// Define the button icon for the toolbar
FroalaEditor.DefineIcon('generateTOC', {
    NAME: 'list-ol', 
    SVG_KEY: 'orderedList' // Uses the icon key for an ordered list
});

// Register the custom command 'generateTOC'
FroalaEditor.RegisterCommand('generateTOC', {
    title: 'Generate Table of Contents',
    focus: true, // Focus on the editor after execution
    undo: true, // Allow the action to be undone
    refreshAfterCallback: true, // Refresh the toolbar state
    
    // The main function executed when the button is clicked
    callback: function() {
        var content = this.html.get();
        var parser = new DOMParser();
        // Parse the current editor content into a manipulable DOM document
        var doc = parser.parseFromString(content, 'text/html');
        // Find all H2 and H3 headings in the content
        var headings = doc.querySelectorAll('h2, h3');
        
        // Exit if no headings are found
        if (headings.length === 0) {
            alert('No headings found. Add H2 or H3 headings first.');
            return;
        }
        
        // Remove existing TOC if regenerating to avoid duplication
        var existingTOC = doc.querySelector('.generated-toc');
        if (existingTOC) {
            existingTOC.remove();
        }
        
        // Variables to track anchor names and TOC items
        var usedAnchors = {};
        var tocItems = [];
        
        // Process each heading found
        headings.forEach(function(heading) {
            // Convert heading text to an anchor-safe slug
            var baseAnchor = heading.textContent
                .toLowerCase()
                .replace(/[^a-z0-9_\s-]/g, '') // Remove invalid characters
                .replace(/\s+/g, '-')          // Replace spaces with hyphens
                .substring(0, 50);             // Limit length
                
            // Initialize anchor name
            var anchor = baseAnchor;
            
            // Handle duplicate headings by appending an index (e.g., section-2)
            if (usedAnchors[baseAnchor]) {
                usedAnchors[baseAnchor]++;
                anchor = baseAnchor + '-' + usedAnchors[baseAnchor];
            } else {
                usedAnchors[baseAnchor] = 1;
            }
            
            // Add the unique ID (anchor) to the heading element itself
            heading.id = anchor;
            
            // Store the data needed to build the list
            tocItems.push({
                text: heading.textContent,
                anchor: anchor,
                level: heading.tagName // 'H2' or 'H3'
            });
        });
        
        // Start building the Table of Contents HTML structure
        var tocHTML = '<div class="generated-toc"><h4>Table of Contents</h4><ul>';
        
        // Iterate over the prepared items to build the list links
        tocItems.forEach(function(item) {
            // Determine if the item needs indentation (for H3 headings)
            var indent = item.level === 'H3' ? ' class="indent"' : '';
            // Create the list item with a link to the corresponding anchor
            tocHTML += '<li' + indent + '><a href="#' + item.anchor + '">' + item.text + '</a></li>';
        });
        
        tocHTML += '</ul></div>';
        
        // Prepend the generated TOC HTML to the rest of the document content
        this.html.set(tocHTML + doc.body.innerHTML);
    }
});

The callback function parses the editor content to locate all H2 and H3 elements. It generates URL-safe anchor names from the heading text and handles duplicate headings (such as two sections named “Overview”) by appending an incremental number. Finally, it injects the ID attributes and prepends the linked list.

Styling the Generated TOC

Visual hierarchy is essential for a usable table of contents. The following CSS ensures the TOC is distinct from the main body content, using a left border and specific background color to denote it as a navigation element.


/* Styling for the main Table of Contents container */
.generated-toc {
    background: #f8f9fa; /* Light grey background for contrast */
    padding: 20px 24px; /* Internal spacing */
    margin-bottom: 24px; /* Space below the TOC box */
    border-radius: 6px; /* Slightly rounded corners */
    /* Highlight the TOC with a prominent blue left border */
    border-left: 4px solid #0066cc; 
}

/* Styling for the TOC header (e.g., "Table of Contents") */
.generated-toc h4 {
    margin: 0 0 12px 0; /* Space below the header */
    font-size: 14px;
    text-transform: uppercase; /* All caps text */
    letter-spacing: 0.5px; /* Slight letter spacing */
    color: #666; /* Grey text color */
}

/* Styling for the unordered list element */
.generated-toc ul {
    margin: 0;
    padding: 0;
    list-style: none; /* Remove default bullet points */
}

/* Styling for each list item */
.generated-toc li {
    margin: 8px 0; /* Vertical spacing between items */
}

/* Styling for the anchor links within the list */
.generated-toc li a {
    color: #0066cc; /* Blue link color */
    text-decoration: none; /* Remove default underline */
}

/* Hover effect for the links */
.generated-toc li a:hover {
    text-decoration: underline; /* Add underline on hover */
}

/* Indentation specifically for H3 items */
.generated-toc .indent {
    margin-left: 20px; /* Push H3 items to the right */
}

Adding Anchor Validation

In professional environments, maintaining clean data is as important as the feature itself. If users need to create anchors manually using the native insertAnchor button, you should validate their input to prevent broken links or invalid HTML IDs.

The specific regex used here enforces lowercase compatibility and prevents special characters that might break URL hashes.

 

events: {
    /**
     * Anchor beforeInsert Event Handler
     * * This function validates anchor names before they are inserted into the editor.
     * It ensures the anchor name meets minimum length and character requirements.
     * * @param {string} link - The link object (usually not used here but part of Froala signature)
     * @param {string} text - The proposed anchor name entered by the user
     * @returns {boolean} True to proceed with insertion, false to stop it
     */
    'anchor.beforeInsert': function(link, text) {
        // 1. Minimum Length Check
        if (text && text.length < 3) {
            alert('Anchor names must be at least 3 characters.');
            return false;
        }
        
        // 2. Character Validation Check
        // The pattern only allows lowercase letters (a-z), numbers (0-9), hyphens (-), and underscores (_).
        var validPattern = /^[a-z0-9_-]+$/;
        if (text && !validPattern.test(text)) {
            alert('Use lowercase letters, numbers, hyphens, and underscores only.');
            return false;
        }
        
        // If all checks pass, allow the anchor to be inserted
        return true;
    }
}

 

This validation logic rejects ambiguous names like “A” or “Section 1” while accepting standard formats like “requirements”, “phase-1”, or “section_intro”.

Complete Working Example

Below is the complete implementation code. You can copy this into a single HTML file to test the full workflow from heading generation to Word export.

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Froala Editor with Dynamic TOC Generation</title>
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/froala_editor.pkgd.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/plugins/link_to_anchor.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/plugins/page_break.min.css" rel="stylesheet">
    
    <style>
        /* Smooth scrolling for anchor links */
        html { 
            scroll-behavior: smooth; 
        }
        
        .generated-toc {
            background: #f8f9fa;
            padding: 20px 24px;
            margin-bottom: 24px;
            border-radius: 6px;
            border-left: 4px solid #0066cc;
        }
        
        .generated-toc h4 {
            margin: 0 0 12px 0;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #666;
        }
        
        .generated-toc ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        
        .generated-toc li {
            margin: 8px 0;
        }
        
        .generated-toc li a {
            color: #0066cc;
            text-decoration: none;
        }
        
        .generated-toc li a:hover {
            text-decoration: underline;
        }
        
        /* Indentation for H3 items */
        .generated-toc .indent {
            margin-left: 20px;
        }
    </style>
</head>
<body>
    <div id="editor">
        <h2>Project Overview</h2>
        <p>This document outlines the technical specifications for the dashboard redesign. All stakeholders should review before the kickoff meeting scheduled for next week.</p>
        
        <h2>Requirements</h2>
        <p>The new dashboard must support real-time data updates, mobile responsiveness, and accessibility compliance. Performance targets require sub-second load times.</p>
        
        <h3>Functional Requirements</h3>
        <p>Users need to filter data by date range, export reports to CSV, and customize widget layouts. Role-based permissions control section access.</p>
        
        <h3>Technical Requirements</h3>
        <p>The frontend uses React 18 with TypeScript. Backend APIs follow REST conventions with JSON responses. All endpoints require JWT authentication.</p>
        
        <h2>Timeline</h2>
        <p>Development spans 12 weeks divided into three phases covering infrastructure, features, and testing.</p>
        
        <h3>Phase 1 Foundation</h3>
        <p>Weeks 1 through 4 establish the component library, API layer, and auth system. Deliverables include a working prototype.</p>
        
        <h3>Phase 2 Features</h3>
        <p>Weeks 5 through 8 build dashboard widgets, reporting tools, and user settings. Each feature requires design review first.</p>
        
        <h3>Phase 3 Testing</h3>
        <p>Weeks 9 through 12 cover performance optimization, accessibility audits, and user acceptance testing.</p>
        
        <h2>Team</h2>
        <p>Two frontend developers, one backend developer, one designer, and one QA engineer. The PM coordinates with stakeholders weekly.</p>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.min.js"></script>
    
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/froala_editor.pkgd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/plugins/link_to_anchor.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/plugins/page_break.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/plugins/export_to_word.min.js"></script>
    
    <script>
        "use strict";

        /*
         * 1. Define and Register the Custom 'Generate TOC' Command
         */

        // Define the Generate TOC button icon
        FroalaEditor.DefineIcon('generateTOC', {
            NAME: 'list-ol', 
            SVG_KEY: 'orderedList'
        });
        
        // Register the custom command
        FroalaEditor.RegisterCommand('generateTOC', {
            title: 'Generate Table of Contents',
            focus: true,
            undo: true,
            refreshAfterCallback: true,
            callback: function() {
                var content = this.html.get();
                var parser = new DOMParser();
                // Parse the editor content as an HTML document
                var doc = parser.parseFromString(content, 'text/html');
                var headings = doc.querySelectorAll('h2, h3');
                
                if (headings.length === 0) {
                    alert('No headings found. Add H2 or H3 headings first.');
                    return;
                }
                
                // Remove existing TOC if regenerating
                var existingTOC = doc.querySelector('.generated-toc');
                if (existingTOC) {
                    existingTOC.remove();
                }
                
                // Track anchor names to handle duplicates (e.g., 'title' 'title-2')
                var usedAnchors = {};
                var tocItems = [];
                
                headings.forEach(function(heading) {
                    // Create a clean base anchor from the heading text
                    var baseAnchor = heading.textContent
                        .toLowerCase()
                        .replace(/[^a-z0-9_\s-]/g, '') // Remove non-alphanumeric/spaces/hyphens
                        .replace(/\s+/g, '-')          // Replace spaces with hyphens
                        .substring(0, 50);             // Truncate
                        
                    var anchor = baseAnchor;
                    
                    // Handle duplicates by appending a number
                    if (usedAnchors[baseAnchor]) {
                        usedAnchors[baseAnchor]++;
                        anchor = baseAnchor + '-' + usedAnchors[baseAnchor];
                    } else {
                        usedAnchors[baseAnchor] = 1;
                    }
                    
                    // Set the ID attribute on the actual heading element
                    heading.id = anchor;
                    
                    // Prepare data for the TOC list
                    tocItems.push({
                        text: heading.textContent,
                        anchor: anchor,
                        level: heading.tagName // H2 or H3
                    });
                });
                
                // Construct the TOC HTML structure
                var tocHTML = '<div class="generated-toc"><h4>Table of Contents</h4><ul>';
                
                tocItems.forEach(function(item) {
                    var indent = item.level === 'H3' ? ' class="indent"' : '';
                    tocHTML += '<li' + indent + '><a href="#' + item.anchor + '">' + item.text + '</a></li>';
                });
                
                tocHTML += '</ul></div>';
                
                // Insert the new TOC at the beginning of the editor content
                this.html.set(tocHTML + doc.body.innerHTML);
            }
        });

        /*
         * 2. Initialize the Editor
         */

        new FroalaEditor('#editor', {
            // Define the toolbar buttons to be displayed
            toolbarButtons: [
                'bold', 'italic', 'paragraphFormat',
                '|',
                'generateTOC', // Custom TOC button
                'insertAnchor', // Froala native anchor button
                'insertLink',
                '|',
                'pageBreak',
                '|',
                'export_to_word'
            ],
            // Enable necessary plugins
            pluginsEnabled: [
                'link',
                'linkToAnchor',
                'pageBreak',
                'exportToWord',
                'paragraphFormat'
            ],
            // Export to Word configuration
            wordExportFileName: 'document-with-toc',
            exportPageBreak: true,
            heightMin: 500,
            
            // Custom event handling for anchor insertion (manual creation)
            events: {
                'anchor.beforeInsert': function(link, text) {
                    // Validation for manual anchor names
                    if (text && text.length < 3) {
                        alert('Anchor names must be at least 3 characters.');
                        return false; // Prevent insertion
                    }
                    
                    var validPattern = /^[a-z0-9_-]+$/;
                    if (text && !validPattern.test(text)) {
                        alert('Use lowercase letters, numbers, hyphens, and underscores only.');
                        return false; // Prevent insertion
                    }
                    
                    return true; // Allow insertion
                }
            }
        });
    </script>
</body>
</html>

 

Testing the Workflow

  1. Click the “Generate Table of Contents” button (the list icon). A linked TOC appears at the top.
  2. Click any link in the TOC to verify it scrolls to the correct section.
  3. Add page breaks before major sections to control print layout.
  4. Click the export button to download the file as a Microsoft Word document.

How the Pieces Fit Together

The Generate TOC button creates anchor IDs on headings programmatically. The Link to Anchor plugin’s insertAnchor button lets users add additional anchors manually anywhere in the document. The insertLink dropdown recognizes all anchors (both auto-generated and manual) which facilitates creating cross-references within the text.

Critically, Page Breaks inserted between sections carry through to the Word export. This ensures that when the file is downloaded, each major section starts on a new page, maintaining the document’s professional appearance.

Quick Reference

Custom Button Registration

  • FroalaEditor.DefineIcon() sets the toolbar icon.
  • FroalaEditor.RegisterCommand() defines the button behavior.
  • undo: true enables undo/redo history for the TOC generation.

Anchor Name Pattern

  • Allowed a-z, 0-9, -, _
  • Validation Regex /^[a-z0-9_-]+$/
  • Minimum Length 3 characters recommended.

Export to Word

  • Requires FileSaver and html-docx-js loaded first.
  • exportPageBreak: true includes page breaks in the output.
  • wordExportFileName sets the default download filename.

Next Steps

All three plugins require Froala 4.7 or later and are included in every license tier. For the complete API reference, consult the official plugin documentation.

graphical user interface, text

Add In-Document Navigation to Your Editor with the Link to Anchor Plugin

link anchor

Long-form content needs structure. Whether your users are writing technical documentation, course materials, or detailed reports, they need a way to help readers navigate to specific sections without scrolling through pages of text in a WYSIWYG editor.

The Link to Anchor plugin, introduced in Froala 4.7, adds this capability directly to the editor. Users can insert named anchors at key points in their document, then create links that jump to those anchors. When readers click the link, the page scrolls smoothly to the target section.

What the Plugin Does

The plugin adds two related features to the editor toolbar.

First, users can insert named anchors at any cursor position. These anchors appear as small bookmark icons in the editor, marking locations that can be linked to.

Second, when users create a link using the standard Link plugin, a dropdown now appears listing all available anchors in the document. Selecting an anchor creates an internal link that smoothly scrolls to that position when clicked.

Both the Link plugin and Link to Anchor plugin need to be enabled for the full functionality.

Setting Up the Editor

Here’s a complete implementation using CDN resources. This approach requires no build tools and gives you a working editor in minutes:

 
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Froala Link to Anchor Demo</title>
  
  <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.1/css/froala_editor.pkgd.min.css" 
        rel="stylesheet" type="text/css" />
  
  <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.1/css/plugins/link_to_anchor.min.css" 
        rel="stylesheet" type="text/css" />
  
  <style>
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      max-width: 900px;
      margin: 40px auto;
      padding: 0 20px;
    }
    
    /* Enable smooth scrolling for anchor navigation */
    html {
      scroll-behavior: smooth;
    }
  </style>
</head>
<body>
  <h1>Document Editor with Anchor Links</h1>
  
  <div id="editor">
    <h2>Getting Started</h2>
    <p>This is the introduction. Add an anchor here so readers can jump back from anywhere.</p>
    
    <h2>Main Content</h2>
    <p>Your primary content goes here. Consider adding anchors at each major heading.</p>
    
    <h2>Conclusion</h2>
    <p>Wrap up your document here.</p>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.1/js/froala_editor.pkgd.min.js"></script>
  
  <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.1/js/plugins/link_to_anchor.min.js"></script>
  
  <script>
    var editor = new FroalaEditor('#editor', {
      key: 'YOUR_LICENSE_KEY',
      
      toolbarButtons: {
        moreText: {
          buttons: ['bold', 'italic', 'underline', 'fontSize'],
          buttonsVisible: 3
        },
        moreParagraph: {
          buttons: ['alignLeft', 'alignCenter', 'formatOL', 'formatUL', 'paragraphFormat'],
          buttonsVisible: 3
        },
        moreRich: {
          buttons: ['insertLink', 'insertAnchor', 'insertImage', 'insertTable'],
          buttonsVisible: 3
        },
        moreMisc: {
          buttons: ['undo', 'redo', 'fullscreen', 'html'],
          align: 'right',
          buttonsVisible: 2
        }
      },
      
      pluginsEnabled: [
        'align', 'fontSize', 'fullscreen', 'image', 'link', 
        'linkToAnchor', 'lists', 'paragraphFormat', 'table', 'codeView'
      ],
      
      heightMin: 300,
      heightMax: 600
    });
  </script>
</body>
</html>

Understanding the Configuration

The toolbarButtons configuration places insertAnchor alongside insertLink in the “moreRich” group. This keeps related functions together in the toolbar.

The pluginsEnabled array explicitly includes both link and linkToAnchor. While the packaged Froala build includes most plugins by default, being explicit helps when optimizing load times.

The CSS scroll-behavior: smooth property ensures that anchor link clicks animate the scroll rather than jumping instantly.

Handling Anchor Events

For more control over anchor behavior, you can listen to the plugin’s events:

var editor = new FroalaEditor('#editor', {
  key: 'YOUR_LICENSE_KEY',
  
  // Explicitly enabled plugins
  pluginsEnabled: ['link', 'linkToAnchor', 'align', 'lists'],
  
  // Customized toolbar layout
  toolbarButtons: [
    ['bold', 'italic', 'underline'],
    ['insertLink', 'insertAnchor'], // Buttons for linking and inserting/managing anchors
    ['undo', 'redo']
  ],
  
  // Custom event handlers for the Anchor plugin
  events: {
    'anchor.beforeInsert': function(link, text) {
      if (text && text.length < 3) {
        // Validation check
        alert('Anchor names should be at least 3 characters');
        return false; // Prevents the anchor from being inserted
      }
      console.log('Inserting anchor:', text);
      return true; // Allows the anchor to be inserted
    },
    
    'anchor.beforeRemove': function(link) {
      console.log('Removing anchor:', link);
      // You could add a confirmation here (e.g., return confirm('Are you sure?'))
      return true; // Allows the anchor to be removed
    }
  }
});

The anchor.beforeInsert event fires before an anchor is added. Returning false cancels the insertion, which is useful for enforcing naming conventions or limiting anchors per document.

Link Anchor in Action

 

Practical Use Cases

The Link to Anchor plugin fits naturally into several content types.

Documentation and help articles often run to dozens of pages. Adding anchors at each major section with a table of contents at the top lets readers jump directly to the information they need.

Course materials benefit from structured navigation within lessons. Anchors allow students to bookmark progress conceptually and return to specific concepts during review.

Long-form reports like annual reports and research papers also benefit. Stakeholders can jump to sections most relevant to their interests.

Getting Started

The Link to Anchor plugin requires Froala 4.7 or later. Add the plugin by including its JavaScript and CSS files as shown in the examples above.

For the complete API reference, see the Link to Anchor plugin documentation. The Froala 4.7 release notes cover additional features like page breaks and Word export.

If you’re new to Froala, the CDN installation guide walks through the basics, and the plugins overview explains how the modular architecture lets you include only the features you need.

For smooth scrolling behavior, the MDN documentation on scroll-behavior covers the CSS approach. If you need more control over the animation, CSS-Tricks has a detailed guide covering both CSS and JavaScript options.

A Comprehensive Guide to Froala’s Page Break Plugin

Page Break plugin

The Page Break Plugin, one of the three major features introduced in the 4.7 release, addresses a long-standing gap in document creation workflows. For years, users have requested the ability to insert page breaks similar to what they experience in Microsoft Word or Google Docs. This plugin delivers exactly that functionality, providing seamless integration with Froala’s powerful export capabilities.

What is the Page Break Plugin and Its Use Cases

The Page Break Plugin is a specialized component that allows users to insert explicit page breaks within the editor content. Unlike traditional line breaks or paragraph separators, page breaks are structural elements that signal where a new page should begin when the document is exported to formats like Word (.docx) or PDF, or when printed.

Key use cases for the Page Break Plugin include:

  • Marketing Reports: Create professional multi-chapter reports with chapters starting on separate pages
  • Technical Documentation: Structure complex documentation with clear section divisions
  • Legal Documents: Format contracts and agreements with precise page control
  • Academic Papers: Organize thesis chapters, research papers, and technical manuals
  • Email Templates: Design multi-section email campaigns with deliberate page breaks
  • Annual Reports: Build comprehensive corporate reports with executive summaries on dedicated pages
  • Training Materials: Create structured training documents with logical page divisions

When to Use Page Breaks

Page breaks are particularly valuable when your use case involves:

  • Long-form content that requires logical separation
  • Documents destined for print or PDF export
  • Professional formatting where content organization matters
  • Multi-page documents where specific sections need dedicated pages
  • Compliance or regulatory documents requiring structured layouts

Understanding Page Breaks in Froala

A page break is a structural marker in a document that instructs rendering engines—whether browsers, PDF generators, or word processors—to start a new page at that point. In Froala, page breaks are represented using a special HTML custom structure that’s intelligible to various export formats.

Installation and Setup

Prerequisites and Requirements

Before implementing the Page Break Plugin, ensure you have:

  1. Froala Editor Version 4.7.0 or later – The page break plugin is a new feature introduced in this version.
  2. Valid Froala License.

Enabling the Page Break Plugin

Step 1: Including Required JavaScript Files

For vanilla JavaScript implementations, include the necessary Froala libraries in your HTML:

<!-- Include Froala CSS -->

<link href="path/to/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Froala JavaScript (packaged version includes all plugins) -->

<script type="text/javascript" src="path/to/froala_editor.pkgd.min.js"></script>

If using the basic version of Froala without plugins bundled, you must include the page break plugin separately

<link href="path/to/froala_editor.min.css" rel="stylesheet" type="text/css" />
<link href="path/to/css/plugins/page_break.min.css" rel="stylesheet" type="text/css" />


<script type="text/javascript" src="path/to/js/froala_editor.min.js"></script>
<script type="text/javascript" src="path/to/js/plugins/page_break.min.js"></script>
<script type="text/javascript" src="path/to/js/plugins/export_to_word.min.js"></script> <!-- Optional: for Word export -->

If using a module system like Webpack or ES6 imports, enable the page break plugin in your configuration:

import FroalaEditor from 'froala-editor';

Step 2: Initializing the Editor with Page Breaks Enabled

To enable the Page Break feature when customizing plugins:

  • Ensure “pageBreak” is listed in pluginsEnabled.
  • Ensure “pageBreak” is NOT listed in pluginsDisabled.

Additionally, to make the Page Break button available on the toolbar, ensure the pageBreak is included in the toolbar button configurations for all sizes:

  • toolbarButtons
  • toolbarButtonsMD
  • toolbarButtonsSM
  • toolbarButtonsXS
new FroalaEditor('#editor', {
  pluginsEnabled: ['pageBreak', 'exportToWord'],
  pluginsDisabled: ['track_changes', 'fontSize'],
  toolbarButtons: ['pageBreak', 'export_to_word', 'undo', 'redo', '|', 'bold', 'italic']
});

Step 3: Set Page Break Plugin Configuration Properties 

The exportPageBreak Option

This critical option controls whether page breaks are preserved during export operations:

new FroalaEditor('#editor', {

  exportPageBreak: true,  // Enable page break export

});

When exportPageBreak is set to true, page breaks are converted to appropriate format-specific equivalents during Word export.

Customizing Page Break Behavior for Your Use Case

The plugin offers the pageBreak.beforeInsert event, which fires before a page break is inserted, allowing you to validate or prevent the action.

You can use this event to limit the number of page breaks inserted per document.

new FroalaEditor('#editor', {

  events: {

    'pageBreak.beforeInsert': function () {

      console.log('Page break insertion triggered');     

      // Example: Allow only 5 page breaks per document

      const breakCount = this.$el.find('.fr-page-break').length;

      if (breakCount >= 5) {

        alert('Maximum 5 page breaks allowed');

        return false; // Prevent insertion

      }

      return true; // Allow insertion

    }

  }

});

Using the Page Break Plugin: User Perspective

Inserting Page Breaks via Toolbar

Once the Page Break Plugin is enabled and the toolbar button is visible:

  1. Position your cursor where you want the page break to occur.
  2. Click the page break button (By default, it is on the “More Rich“ toolbar buttons group and represented by an icon showing pages stacked together)
  3. A visual indicator appears in the editor showing the page break location.
  4. Continue editing as normal.

The page break creates a visual guide in the editor—a dotted line with a subtle visual marker—without disrupting the editing experience.

Page Break Insertion

Visual Representation in the Editor

Page breaks are represented with a gray dotted horizontal line where the page break exists with a “Page Break” label on the left.

Hovering over the page break marker displays a yellow border and a selection handle, which allows users to select, move, or delete the page break.

These visual cues help users understand document structure without making the editor appear cluttered.

Page Break Hover

Moving Page Breaks

To modify page break placement:

  1. Click directly on the page break selection handle.
  2. Drag the page break to a new position.

Page Break

Removing Page Breaks

To remove an accidentally inserted page break:

  1. Click directly on the page break selection handle.
  2. Press the Delete key or Backspace
  3. The page break is removed, and content flows together.

Removing Page Break

Conclusion

The Froala Page Break Plugin represents a significant advancement in web-based document editing. By providing explicit pagination control combined with seamless export capabilities, it enables developers to build professional document creation applications.

The Froala Page Break Plugin is ready for implementation in your projects. Whether you’re building marketing automation platforms, documentation tools, or custom reporting systems, page breaks provide the professional document structure your users expect.

Next Steps:

  1. Evaluate Froala for your use case
  2. Download the free trial
  3. Experiment with page break functionality
  4. Integrate into your development roadmap.
  5. Share your implementation with the community

The future of web-based document editing is here—make page breaks part of your solution.

Frequently Asked Questions (FAQ)

Is a page break the same as a regular line or paragraph break?

No. A page break is a structural marker that signals where a new page should start in PDF or Word exports and in print workflows. It does not simply insert extra space or a cosmetic divider; it defines content flow across pages.

Will page breaks always render on-screen exactly as they will export?

The editor shows a visual indicator for page breaks, but rendering can differ across export targets (Word vs PDF) due to format-specific layout rules. Expect similar but not guaranteed pixel-perfect alignment across formats.

Are there performance or memory considerations for documents with many page breaks?

Page breaks add structural markers to the document model. In very large documents, excessive breaks can impact editing responsiveness slightly; balance the number of breaks with your editing needs and test in your target environment.

How do I verify that page breaks export correctly?

Create a sample doc with known page-break placements, export to Word and PDF, and compare the page boundaries. Use the beforeInsert hook to enforce constraints during drafting to reduce export surprises.

Resources for Further Learning

Official Documentation:

 

Froala Editor 4.7.1: Cleaner HTML and Smooth Pasting

Froala 4.7.1 release

The 4.7.1 release focuses on the stability and reliability, tackling 15+ customer-reported issues behind the scenes. This release tightens up find-and-replace, cleans HTML output, and smooths copy-paste. All of this comes on the heels of 4.7.0’s game-changing features—Anchor text, Export to Word, and page breaks. Ready to see what’s new?

Seamless Support for the Latest Vimeo Link Formats

The Froala video plugin now fully supports the latest Vimeo event links and embed codes. This means you can reliably embed Vimeo videos and have them play directly inside the editor.

What’s improved and why it matters:

  • Seamless embedding: New Vimeo formats are recognized automatically, so you don’t have to juggle code or workarounds.
  • In-editor playback: Videos render and play inside the editor, giving you a true WYSIWYG experience.
  • Improved reliability: The updated formats reduce compatibility issues when inserting or updating Vimeo content.

Benefits for you:

  • Faster workflow: Copy, paste, and embed Vimeo videos with fewer steps.
  • Cleaner output: Consistent, standards-compliant embeds that render predictably.

Support Vimeo video

Lean HTML, Cleaner Output

This release introduces cleanReduntantStyleOnGet configuration. With this configuration enabled, the editor automatically removes redundant styling inherited from parent elements and unwraps non-block elements lacking attributes when retrieving content using editor.html.get(). The result is cleaner, more concise HTML output with less unnecessary markup.

Benefits for you:

  • Cleaner HTML: Removes redundant styles and empty wrappers, producing leaner markup.
  • More predictable rendering: Output is easier to process downstream and maintain consistency across editors.
  • Faster downstream edits: With simpler HTML, further formatting or transformations are less error-prone.

Start Fresh: Clean New Lines After Pasting

The 4.7.1 release comes with a new configuration, clearFormatOnEnterNewLine. This option controls how formatting behaves when you start a new line after pasting content. If set to true: the new line starts with a clean, default style. It will not inherit formatting (font, color, size, etc.) from the pasted content or surrounding text. If set to false (or not enabled): the new line likely retains the same formatting as the previous line.

Why this matters:

  • Predictable formatting: You get a fresh line you can style from scratch, instead of fighting inherited styles.
  • Easier edits: The toolbar formatting you apply will affect the new line immediately, without needing to strip or override inline styles.

Benefits for you:

  • Cleaner, more consistent new lines after paste.
  • Reduces issues when pasting content from sources like Wikipedia, where inline styles can bleed into the new line.
  • Improves workflow by making formatting changes intuitive and reliable from the start.

Find and Replace Improvements

The 4.7.1 release introduces a cleaner, more intuitive Find and Replace experience. These updates make the tool less disruptive, more precise, and easier to navigate—especially when editing complex documents or working with multiple editors.

find and replace feature

Precise Popup Repositioning

When you drag and drop to reposition the Find and Replace popup, it now snaps to the exact position where you drop it.

Why it matters:

The tooltips align more accurately with your cursor, making it easier to locate and use the popup in rapid edits.

Benefit to you:

Faster, more reliable placement during demanding edits and when working with complex layouts.

Find/Replace Shortcuts Now in the Help Guide

The Help popup now displays the shortcuts for Find and Replace (Ctrl + F on Windows, Command + F on Mac).

Why it matters:

Your users don’t have to remember shortcuts off the top of their head; guidance is right where they look.

Benefit to you:

Quicker access to the feature with improved keyboard navigation and discoverability.

Find/Replace Popup Clears on Instance Switch

Switching focus from one Froala editor instance to another resets the Find and Replace popup (clears the popup fields).

Why it matters:

Each editor instance starts fresh, avoiding stale searches from another context.

No More Overlaps with Quick Insert Icon

The Find and Replace popup no longer overlaps the Quick Insert icon. This prevents overlapping interactions and keeps focus predictable during quick edits.

Focus-Aware Highlighting: Maintain Selection While Editing

When you select text and then open the formatting dropdown menu (for example, the color picker dropdown), the text remains highlighted. You won’t lose your selection or be surprised by a shift in highlight while you’re adjusting styling.

Why this matters:

  • Predictable editing: Highlights stay in place, so you can apply changes without reselecting.
  • Faster workflow: You don’t waste time reselecting text or reapplying emphasis after opening a formatting tool.
  • Reduces confusion: Maintains visual continuity, making it clear which text will be affected by your formatting.

Programmatic Styling of Table Cell Text

The editor now reliably applies programmatic style changes to the actual text inside selected table cells. Previously, font size and other text styles could fail to affect the cell content when updated via API calls.

Example: Selecting table cells and calling froala.fontSize.apply('20pt') now updates the text inside those cells to “20pt” as expected.

This means with the V4.7.1 release, you can reliably bulk format table text via API.

Paste with Confidence: Higher Fidelity from External Apps

With the 4.7.1 release, you get fresher fidelity when pasting from Word, OneNote, and other apps. Pasted content now retains more of the original formatting and structure instead of becoming misaligned or fragmented.

  • Fixed OneNote image-pasting issue
    When content from OneNote is pasted, it no longer converts to an image by default, so you get text that you can edit and count toward character limits.
  • Multilevel lists stay aligned.
    Nested/bulleted lists paste with correct indentation and alignment, preventing corruption or shifting.
  • Roman numerals and font family preserved
    Pasted Roman numeral lists retain their intended font family and styling, keeping lists consistent with the source.

Users are more likely to see output that matches their original documents, saving time and effort.

Much More…

This release includes additional improvements and bug fixes. See the complete changelog for details.

How Can I Update?

Update to Froala WYSIWYG Editor 4.7.1 today and experience enhanced editing features and improvements.

Check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance TypeScript support, is a stepping stone towards that commitment. We encourage you to try this improved TypeScript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

Technical Questions

Save Time, Reduce Rework: Froala’s Export to Word in action

Export to Word

In the fast-paced world of content creation, efficiency and compatibility are everything. Whether you’re a developer, content manager, or editor, the ability to seamlessly move your work from a rich text editor to a Word document can save hours of formatting and rework. That’s where Froala’s Export to Word Plugin shines.

Designed to bridge the gap between web-based content and traditional document formats, this plugin empowers users to convert beautifully formatted Froala Editor content directly into fully compatible Microsoft Word files—with just one click. The result? Effortless document sharing and smoother workflows across teams and platforms.

In this article, we’ll explore how the Export to Word Plugin works, its standout features, real-world use cases, and best practices to help you make the most of this powerful tool in your content pipeline.

Key Takeaways

  • One-click export from Froala Editor to DOCX.
  • You can customize export behavior with options like wordExportFileName and by subscribing to events (word.beforeExport, word.afterExport).
  • This plugin helps maintain fidelity across cross-team sharing and cross-platform workflows.

Plugin Functionality

When the user clicks on the “Export to Word“ button, the plugin intelligently translates the editor content into a native Microsoft Word format, ensuring that the original design and structure remain intact during the conversion process.

export to word

Key Benefits

Discover how the Export to Word plugin unlocks smoother collaboration, consistent documents across teams, and significant time savings. Keep reading to see the concrete ways this tool streamlines your content pipeline and boosts productivity.

Simplified Workflow

Developers and content creators can now effortlessly move content between Froala Editor and Word documents with minimum manual reformatting.

Cross-Platform Compatibility

The plugin works consistently across:

  • Different browsers
  • Various operating systems

Time and Effort Savings

  • Eliminates manual document reconstruction
  • Reduces potential errors in content transfer
  • Streamlines documentation processes

Installation and Setup

Getting started with the Froala Editor is a straightforward process designed to get you up and running quickly.

Prerequisites

Before you begin, ensure you have:

  • A modern web browser
  • Basic JavaScript knowledge

Download the Editor

To obtain the Froala Editor, download the ZIP package by submitting the form on our download page. Refer to our get started page for alternative installation methods based on your framework.

After submitting the download form, save the API key that appears. Use this key to start your trial or choose a paid plan to obtain a licensed key for production use.

Include necessary JavaScript and CSS files

Open your project HTML file and include the Froala Editor JavaScript and CSS files.

There are different ways to do that.

  1. Include Froala files in one bundle

    Use Froala’s combined .pkgd bundle to simplify your setup (includes core editor and plugins).

    <!-- Include Froala CSS -->
    <link href="{{editor__download__folder}}/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
    
    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.pkgd.min.js"></script>

     Note: When you use the “.pkgd” bundle, you don’t need to load the individual plugin files separately (including the Export to Word plugin).

  2. Include Froala files separately

    If you prefer to manage plugins individually, load the core files first and then add the Export to Word plugin explicitly.

    <!-- Include Froala CSS -->
    <link href="{{editor__download__folder}}/css/froala_editor.min.css" rel="stylesheet" type="text/css" />
    
    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.min.js"></script>
               
    <!-- Include The “Export to Word“ plugin JS file -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/plugins/export_to_word.min.js"></script>

In either case, include the file-saver and html-docx libraries. These libraries are required for converting the editor content to Word documents.

<script src="https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.min.js"></script>

Initialize Your Editor

To initialize your Froala Editor, create an HTML container for the editor, then initialize Froala Editor on the container with JavaScript.

Here is the full code of what we did.

<!DOCTYPE html>
<html>

<head>
    <title>Froala WYSIWYG Editor</title>
    <!-- Include Froala CSS -->
    <link href="{{editor__download__folder}}/css/froala_editor.pkgd.min.css" rel="stylesheet"
        type="text/css" />
</head>

<body>
    <!-- HTML element where the editor will be initialized -->
    <div id="editor">
        <p>This is the initial content of the editor.</p>
    </div>

    <!-- Include file-saver and html-docx libraries JS files -->
    <script src="https://cdn.jsdelivr.net/npm/file-saver-es@2.0.5/dist/FileSaver.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/html-docx-js@0.3.1/dist/html-docx.min.js"></script>
        
    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.pkgd.min.js"></script>

    <script>
        // Initialize the Froala Editor
        new FroalaEditor('#editor');
    </script>
</body>

</html>

Enabling the Plugin

The “Export to Word“ plugin is active by default. If you customize which plugins are loaded, make sure to explicitly include “exportToWord” in pluginsEnabled configuration and exclude it from pluginsDisabled configuration.

new FroalaEditor('#editor', { 

      pluginsEnabled: ['exportToWord','findReplace', 'fontFamily', 'image', 'link', 'video', 'emoticons'],

      pluginsDisabled: [

      'track_changes', 

      'fontSize'

      ]

 });

Toolbar Button

When the plugin is enabled, the “Export to Word” button will appear on the editor toolbar automatically.

If you’re customizing the editor’s toolbar buttons and want to display the Export to Word button, add export_to_word to your toolbar configuration:

new FroalaEditor('#editor', { 

      toolbarButtons: ['export_to_word', 'bold', 'italic', 'insertLink'],

      pluginsEnabled: ['exportToWord','findReplace', 'fontFamily', 'image', 'link', 'video', 'emoticons'],

      pluginsDisabled: [

      'track_changes', 

      'fontSize'

      ]

 });

Froala can tailor the toolbar for different screen sizes to create a responsive toolbar experience using these options:

  • toolbarButtonsMD (Medium screens)
  • toolbarButtonsSM (Small screens)
  • toolbarButtonsXS (Extra small screens)

By default, these inherit the buttons from toolbarButtons.

Ensure “export_to_word” is included where needed in the relevant configuration.

The Export to Word Plugin Configuration

Froala’s Export to Word plugin provides multiple options, events, and methods to allow developers to customize the exporting process.

Rename Exported Document

The wordExportFileName option lets you set the file name for the exported Word document. You only provide the base name; the plugin will append the .docx extension automatically.

If you don’t specify a name, the export will use a default name such as “froala_editor .docx”.

new FroalaEditor('#editor', { 

    wordExportFileName: "myfile",

});

Customize the HTML Content Before Export

The word.beforeExport event lets you preprocess the editor’s HTML content right before it is converted to a Word document. In this event, you receive the HTML to be exported and must return the modified HTML. This gives you full control to adjust formatting, remove unwanted elements, or inject additional content before the export takes place.

Key points:

  • Access the editor content as HTML within the event.
  • Return the transformed HTML to be exported.
  • Use this hook to apply custom formatting or content tweaks prior to conversion.
new FroalaEditor('#editor', { 
      wordExportFileName: "myfile",
      events: {
        'word.beforeExport': function (editorHtml) {
          
          // this is the editor instance.

            // Example: append a note to the exported document
          editorHtml += "<div>Exported By Mostafa</div>"; 

          return editorHtml;

        }
      }
 });

Customization After Export Process

Use the word.afterExport event to run actions once the Word export completes. This is ideal for logging, analytics, notifications, or updating the editor with the result of the export.

What you get:

  • The exported HTML content is provided to the event callback, so you can access or modify it as needed.
  • You can perform post-export tasks (e.g., send metrics, display a success message, or refresh the editor content).
new FroalaEditor('#editor', { 
      wordExportFileName: "myfile",
      events: {
        'word.beforeExport': function (editorHtml) {
          
          // this is the editor instance.

          // Edit the editor content
          editorHtml += "<div>Exported By Mostafa</div>"; 

          return editorHtml;

        },
        'word.afterExport': function (editorHtml) {

           // example: update the editor with the exported content
          this.html.set(editorHtml);
        },
      }
 });

This event provides flexibility in handling post-export tasks and integrating with other systems or tracking mechanisms.

Notes:

  • Use the afterExport event for tasks that should run only after the document has been successfully created.
  • The exportedHtml parameter gives you the final HTML that was converted to Word, allowing you to synchronize your UI or data flow accordingly.

Programmatically Export Content

In addition to using the toolbar button, you can trigger the Word export from code. The exportToWord.export() method lets you initiate the export on demand, from any custom event or workflow you define.

Key benefits:

  • Flexible export triggers (e.g., after a save, on a separate button, or in response to a workflow event)
  • Decouples export from the toolbar UI
  • Keeps the user flow consistent with your application logic
new FroalaEditor('#editor', { 
      wordExportFileName: "myfile",
      events: {
        initialized: function () {
          this.exportToWord.export()
        },
      }
 });

Use Cases

Here are a few practical scenarios where the Export to Word plugin proves especially valuable. In real-world workflows, teams across content management, collaboration, and enterprise documentation rely on seamless web-to-Word exports to publish, archive, and share polished documents. The use cases below illustrate how this tool fits into everyday processes, helping you choose the right approach for your needs.

Content Management Systems

  • Quickly convert web articles to downloadable documents
  • Facilitate content archiving
  • Enable easy sharing of web-based content

Collaborative Writing Platforms

  • Seamless transition between web and desktop editing
  • Preserve formatting during collaboration
  • Support multiple document workflows

Enterprise Documentation

  • Standardize document creation processes
  • Integrate web content with traditional document management
  • Enhance cross-department content sharing

Conclusion

The Export to Word Plugin represents a significant leap in web-to-document conversion technology. By seamlessly bridging the gap between web interfaces and Microsoft Word, it empowers developers and content creators to work more efficiently and flexibly.

As digital content continues to evolve, tools like this plugin will become increasingly essential in creating smooth, intuitive content workflows.

Take the next step

Ready to experience flawless Word exports in your own workflow? Download Froala Editor with the Export to Word plugin and put it to the test. This quick-start keeps you moving from editor to Word with minimal fuss.

FAQ

Do I need a separate converter or server-side component?

No. The plugin leverages client-side libraries (file-saver and html-docx-js) to produce Word documents in the browser.

Can I customize export behavior?

Yes. Use options like wordExportFileName, and hook into events such as word.beforeExport and word.afterExport as described in the article.

Where can I try Froala’s Export to Word plugin?

You can explore this interactive JSFiddle demo or install the plugin in your project for evaluation today.

 

Froala 4.7 Release with Anchors, Page Breaks, and Word Export

Froala 4.7

You asked for anchor text, page breaks, and export to Word features. We listened and today we are excited to announce our long awaited release, Froala 4.7 is available for download.

With advanced document organization features, your favorite rich text editor is now even more powerful allowing you to create documents with greater precision and efficiency.

With the new anchor text feature, you can easily link to specific sections within your content. The page break option ensures seamless formatting for printed or exported documents, while the export to Word functionality simplifies sharing and collaboration.

In this article, we’ll delve deeper into each of these new features and explore how they can enhance your document creation process. Let’s take a closer look at what makes these updates so impactful.

Anchors, Page Breaks, and Word Export

Introduce Anchors Feature

Anchors are particularly useful for creating tables of contents or linking to specific sections in long documents, allowing readers to jump to specific sections with just a click.

By creating strategic anchor points, writers can improve document readability and structure, making information easier to find and access.

Froala 4.7 introduces a robust anchor feature that lets users:

Insert Named Anchor

Click the anchor toolbar button to open a dialog box. Enter a descriptive name for the anchor, which will be inserted into the HTML at the cursor’s current location. Anchors are represented with a bookmark icon.

Create Link to an Anchor

To link to an anchor, click the insert link button. You can:

  • Select from a list of existing anchors
  • Manually enter the anchor name (e.g., #introduction)

When clicked, the link will smoothly scroll to the targeted anchor position.

anchors

Pro Tip for Effective Anchor Text Usage

To maximize the utility of anchor text, use clear, descriptive names that reflect the content of the section. For example, instead of generic names like “section1”, use meaningful identifiers like “advanced-features” or “getting-started”. This approach not only improves navigation but also enhances the overall user experience and document structure.

Introduce Page Break Feature

This release enables a user to insert page breaks in the editable area. This is useful for creating print-ready documents or preparing content for export. Page breaks help maintain consistent formatting and improve document readability, especially when dealing with longer texts.

Users can easily insert a page break at any point in their document, ensuring smooth pagination and a professional appearance.

This feature is particularly beneficial for academic papers, reports, and other formal documentation where precise layout is crucial.

We implemented the Page Break feature with precision and user-friendly functionality. Users can access the Page Break option through a dedicated toolbar button, which inserts a non-editable horizontal marker at the cursor’s current position. This marker is visually distinct, allowing easy identification within the document.

Page breaks can only be removed through explicit deletion using Backspace or Delete keys after selecting the page break handle, preventing accidental removal during typing.

Additionally, the implementation guarantees cross-browser compatibility and supports smooth keyboard navigation, making it accessible and consistent across different platforms and devices.

The new pageBreak plugin includes the exportPageBreak option, enabled by default. Disabling it excludes page break elements from the html.get method, offering developers granular control over page break handling during export.

The plugin also features the pageBreak.insert() method and a pageBreak.beforeInsert event, triggered before insertion.

These advanced options provide developers with extensive flexibility in managing page breaks, ensuring intuitive and responsive document editing.

Developers can easily customize page break behavior for web documentation, print preparation, or complex document management, seamlessly integrating the feature into various workflows to cater to diverse user requirements.

Introduce Export to Word Feature

This release enables users to export content from a web-based rich text editor into a well-formatted Microsoft Word document (.docx) while preserving text formatting, images, tables, and styles.

This feature helps streamline document creation workflows by bridging the gap between web-based editing and traditional word processing. Users can now seamlessly transfer their carefully crafted content to Microsoft Word without losing formatting or layout integrity.

The export functionality supports a wide range of document elements, including complex formatting, embedded images, and intricate table structures, ensuring a smooth transition from web editor to professional document preparation.

This feature is particularly beneficial for professionals who frequently switch between web-based editing platforms and Microsoft Word. Researchers, writers, and content creators will appreciate the ability to quickly transfer their work without manual reformatting.

The export feature supports multiple languages and character sets, ensuring compatibility with international document standards.

export to word

The exportToWord plugin lets developers configure a default filename for exported files using the wordExportFileName setting. It also offers word.beforeExport and word.afterExport events for customizing content before or after the export.

By providing a seamless transition between web editing and traditional word processing, Froala 4.7 empowers users to work more efficiently and maintain document quality across different platforms.

Pro Tip for Export to Word

When exporting documents, ensure all formatting elements are compatible with Word’s document structure. Consider using standard fonts and avoiding complex CSS styling that might not translate perfectly.

Test the exported document in different versions of Microsoft Word to guarantee consistent rendering. Always review the exported file to confirm that critical elements like headings, lists, and embedded media maintain their intended appearance and layout.

Enable Dynamic Translation for the new Table Cell Popup

Froala 4.6.2 introduced a new table and cell features, including border customization and dimension/sizing options. Input labels, tooltips, and placeholders for these features now utilize the editor’s language system, enabling localization.

The localization feature allows developers to create multilingual interfaces with ease, supporting a global user base. By dynamically translating interface elements, the editor becomes more accessible to international users.

Much More…

We have addressed various issues reported by our users to enhance the overall performance and stability of Froala Editor. These include:

  • Inserting an emoji no longer changes the paragraph’s font-family.
  • Enhance plain paste feature to strip out all background color, font family, and formatting from the source.

Please find the complete changelog list here.

How Can I Update?

Update to Froala WYSIWYG Editor 4.7 today and experience enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.7.0/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

Mastering Froala Helpers for Device Detection, URL Safety, and More

Froala Helpers

When building advanced experiences with the Froala WYSIWYG Editor, developers often find themselves writing extra JavaScript to handle things like device detection, scroll behavior, or URL validation.

But here’s the good news — Froala already provides a built-in solution for that: Helpers.

Helpers are small, smart utilities bundled inside Froala that make your code cleaner, faster, and easier to maintain. In this article, we’ll explore some of the most useful helpers — from detecting mobile devices to keeping your URLs safe.

 

🔑 Key Takeaways

  • Froala Helpers provide small yet powerful utilities that simplify editor customization.
  • You can detect devices (mobile, iOS, Android, etc.) to deliver tailored UI experiences.
  • Use scroll helpers to keep toolbars or elements aligned as users scroll.
  • The sanitizeURL() helper adds a vital layer of security for link handling.
  • Helpers make your code simpler, faster, and more consistent across platforms.

Whether you’re fine-tuning the editor’s UX or building a custom plugin, helpers let you focus on features — not boilerplate code.

🌟 What Are Froala Helpers?

Froala Helpers are utility functions accessible via editor.helpers. They’re designed to simplify common tasks that developers repeatedly need when customizing the editor or building plugins.

For example, you can:

  • Detects whether the user is on iOS or Android.
  • Check if the editor is being used on a touch device.
  • Get the scroll position of the page.
  • Sanitize URLs before inserting them into the editor.

Instead of writing this logic manually, you can use these helpers directly from the Froala instance.

const editor = new FroalaEditor('#editor', {});

console.log(editor.helpers.isMobile()); // true or false

These small methods pack a big productivity punch — they save time, improve reliability, and help you create smarter editor experiences.

⚙️ Why Froala Helpers Matter

When customizing Froala, developers often deal with:

  • Device-based UI adjustments (e.g., hiding toolbars on mobile)
  • Handling touch versus keyboard input
  • Keeping toolbars visible during scrolling
  • Cleaning URLs to prevent unsafe content

Without helpers, these tasks can be repetitive and prone to cross-browser issues. Froala Helpers provide ready-made, tested, and optimized solutions that work consistently across devices and browsers.

Top benefits include:

  • 🧠 Simplicity: No need to reinvent the wheel.
  • Performance: Built-in and optimized for speed.
  • 🧩 Consistency: Reliable behavior across all browsers.
  • 🛡️ Security: Safer URL handling and cleaner code.

📱 Device Detection Helpers

Let’s start with the helpers that detect user devices. These are especially useful when building responsive, adaptive experiences in Froala.

1. helpers.isMobile()

Detects if the user is on any mobile device.

Example:

if (editor.helpers.isMobile()) {

  console.log('Mobile layout activated');

}

Use Case: Load a simplified toolbar or disable certain features on smaller screens for a smoother mobile experience.

2. helpers.isAndroid()

Detects Android devices.

Example:

if (editor.helpers.isAndroid()) {

  console.log('Running on Android');

}

Use Case: Handle Android-specific quirks — for example, adjusting cursor handling or input focus behavior in Chrome on Android.

3. helpers.isBlackberry()

Checks if the user is on a Blackberry device.

Example:

if (editor.helpers.isBlackberry()) {

  console.log('Blackberry device detected');

}

Use Case: Though Blackberry devices are rare today, this can still help in enterprise or legacy applications that must support older systems.

4. helpers.isIOS()

Detects whether the editor is running on iPhone or iPad.

Example:

if (editor.helpers.isIOS()) {

  console.log('Running on iOS');

}

Use Case: Adjust touch or clipboard behaviors that behave differently in Safari on iOS.

5. helpers.isMac()

Detects if the system is macOS.

Example:

if (editor.helpers.isMac()) {

  console.log('Mac detected');

}

Use Case: Use platform-specific keyboard shortcuts — for example, using the Command (⌘) key instead of Control.

6. helpers.isTouch()

Checks if the device supports touch input.

Example:

if (editor.helpers.isTouch()) {

  console.log('Touch input detected');

}

Use Case: Switch hover interactions to tap interactions for touch screens.

7. helpers.isWindowsPhone()

Detects Windows Phone browsers.

Example:

if (editor.helpers.isWindowsPhone()) {

  console.log('Windows Phone device detected');

}

Use Case: Support or test compatibility for legacy Windows Phone browsers.

🧩 Pro Tip: Combine these helpers for more granular targeting.

if (editor.helpers.isMobile() && editor.helpers.isIOS()) {

  console.log('Optimize editor for iPhone users');

}

🧭 Scrolling Helpers

These helpers come in handy when you need to respond to the editor’s scroll position — for example, repositioning floating toolbars or syncing UI elements as users scroll.

scrolling helpers

8. helpers.scrollTop()

Gets the vertical scroll position.

Example:

const top = editor.helpers.scrollTop();

console.log('Scroll top:', top);

Use Case: Keep floating toolbars in view when the editor or window is scrolled.

9. helpers.scrollLeft()

Gets the horizontal scroll position.

Example:

const left = editor.helpers.scrollLeft();

console.log('Scroll left:', left);

Use Case: Useful for horizontally scrollable tables or editors embedded in side-by-side layouts where toolbar alignment matters.

🔒 URL Sanitization Helper

Security is a big concern in rich text editors — especially when users can insert links. That’s where Froala’s sanitizeURL() helper shines.

10. helpers.sanitizeURL(url)

Cleans a URL to ensure it’s valid and safe before being inserted into the editor.

Example:

const userInputURL = "javascript:alert('xss')";

const safeURL = editor.helpers.sanitizeURL(userInputURL);

console.log(safeURL); // outputs an empty string

Use Case: Prevent users from inserting malicious or invalid links. This adds an extra layer of protection against XSS (Cross-Site Scripting) attacks and ensures that all URLs embedded in your content are safe and well-formed.

🧩 Putting It All Together: Real-World Scenarios

Here are a few ways you can combine helpers for practical results.

🧠 Example 1: Adaptive Toolbar for Mobile

if (editor.helpers.isMobile() || editor.helpers.isTouch()) {

  editor.opts.toolbarBottom = true;

}

Move the toolbar to the bottom of the editor when users are on touch devices for better usability.

⌨️ Example 2: Platform-Specific Shortcuts

if (editor.helpers.isMac()) {

  console.log('Use ⌘ + B for bold');

} else {

  console.log('Use Ctrl + B for bold');

}

Adjust keyboard shortcuts dynamically for macOS vs Windows.

🔐 Example 3: Safe Link Insertion

const url = editor.helpers.sanitizeURL(userInput);

if (url) {

  editor.html.insert(`<a href="${url}">${url}</a>`);

}

Always sanitize URLs before inserting them into content.

🚀 Benefits Recap

Here’s what Froala Helpers bring to your development workflow:

Benefit Description
🧠 Simpler Code No need to reimplement device or scroll detection logic.
⚙️ Consistency Unified results across browsers and platforms.
📱 Adaptability Create responsive editor experiences that adjust to devices.
🔒 Security Keep your content safe with sanitized URLs.
Efficiency Lightweight, optimized, and built right into Froala.

 

🏁 Conclusion

Froala Helpers may seem small, but they can make a big impact on your editor customization workflow. Whether you’re optimizing for mobile users, maintaining layout stability while scrolling, or keeping your content secure — these helpers make the process faster, cleaner, and more reliable.

So next time you build a Froala plugin or tweak your editor configuration, remember: 👉 You don’t have to do it alone — let Froala Helpers do the heavy lifting.

✨ Ready to Build Smarter with Froala?

Experience how Froala’s clean design, blazing-fast performance, and developer-friendly APIs make rich text editing effortless.

👉 Download the Editor today and start creating beautiful, responsive editing experiences in minutes!

❓ Frequently Asked Questions (FAQ)

What are Froala Helpers used for?

Froala Helpers are small utility functions that simplify common coding tasks like device detection, scroll handling, and URL sanitization when customizing the Froala Editor.

How do I access helpers in Froala?

All helpers can be accessed through your editor instance:

const editor = new FroalaEditor('#editor');

editor.helpers.isMobile();

Are Froala Helpers available in all versions of the editor?

Yes. Helpers are included in all modern Froala Editor builds and can be used without extra setup or configuration.

Can I combine multiple helpers together?

Absolutely. You can use multiple helpers to create adaptive logic, such as:

if (editor.helpers.isMobile() && editor.helpers.isIOS()) {

  // Apply iPhone-specific UI tweaks

}

Why should I use sanitizeURL()?

sanitizeURL() ensures that any URL added to your editor content is valid and safe. It helps prevent XSS and other malicious code injections.

Are Froala Helpers limited to the editor area?

No. While they’re designed for editor-related tasks, helpers can be used in broader contexts — for example, to detect device types before initializing Froala or to manage layout responsiveness.

Where can I learn more about Froala Helpers?

You can explore the full list of available helpers and examples in the official Froala Editor Documentation.

 

Froala Shortcut Secrets That Supercharge Your Productivity

shortcuts secrets

Imagine this: you’re writing, editing, and formatting text — all flowing smoothly — when suddenly you have to grab your mouse just to make text bold or insert a link. That small break? It disrupts your rhythm.

That’s why keyboard shortcuts are pure magic. They keep users in their creative flow, transforming ordinary typing into an effortless experience. And for developers working with editors like Froala, understanding how to create and customize shortcuts can take user productivity to the next level.

This article will explore why users love shortcuts, and more importantly, how you can register and customize them in Froala Rich Text Editor to make your users feel truly intuitive and efficient.

Users love shortcuts

Why Users Love Shortcuts

The Psychology of Speed and Flow

Humans crave efficiency. Every time we remove friction between thought and action, our brains reward us with a sense of momentum. Shortcuts do exactly that — they reduce micro-delays. You don’t need to stop typing to click a toolbar icon. Instead, your thoughts move directly into your work.

This state is called “flow” — that sweet spot where focus, creativity, and speed align. Keeping hands on the keyboard helps sustain that state.

Boosting Productivity and Efficiency

A few seconds saved per action might not sound like much. But multiply that by hundreds of formatting tasks a day, and you’ll see why writers, coders, and designers swear by shortcuts.

Think of simple ones like:

  • Ctrl + B for bold
  • Ctrl + Z for undo
  • Ctrl + K for inserting a link

Small actions that keep you moving — no pauses, no friction.

Accessibility and Inclusivity

Shortcuts aren’t just about speed — they’re also about accessibility. For users with motor limitations or repetitive strain injuries, relying less on mouse interactions makes writing more comfortable.

Well-designed shortcuts make the interface more inclusive, ensuring everyone can use the editor effectively — regardless of how they interact with it.

Customization and User Empowerment

People love tools that adapt to them. Allowing users to customize shortcuts gives them a sense of ownership — they’re not just using the tool; they’re shaping it. For developers, this translates into higher satisfaction, engagement, and loyalty.

Froala shortcuts

How Froala Handles Shortcuts by Default

The Froala Rich Text Editor already includes a variety of built-in shortcuts — for bold, italic, underline, undo, redo, and more. For example:

  • Ctrl + B → Bold
  • Ctrl + I → Italic
  • Ctrl + U → Underline
  • Ctrl + Z → Undo
  • Ctrl + Y → Redo

These shortcuts are intuitive, consistent across platforms, and designed to match what users expect from other editors like Word or Google Docs.

However, sometimes you’ll want more — a custom command, a unique formatting option, or a plugin action triggered with a keystroke.

That’s where custom shortcut registration comes in.

How To Register Custom Shortcuts in Froala

Let’s walk through how you can register your own shortcuts to make your editor truly yours.

Froala provides a powerful method FroalaEditor.RegisterShortcut() that gives you granular control over keyboard interactions. Let’s break down its parameters:

  • key: The unique decimal code identifying the keyboard button
  • cmd: The editor command to trigger (like ‘bold’, ‘italic’)
  • val→ The name of the option to be triggered In case the command has more than one option.
  • letterThe character shown in tooltip hints.
  • shiftBoolean to require Shift key combination
  • optionBoolean to require Alt (⌥ (Option) on Mac) key combination

Practical Examples: Mastering Froala Shortcuts

Let’s explore how to create and modify shortcuts with precision.

Example of a basic shortcut: Bold Shortcut

The classic bold shortcut demonstrates the method’s simplicity:

FroalaEditor.RegisterShortcut(

  FroalaEditor.KEYCODE.B,  // Decimal code for 'B' key

  'bold',                  // Bold command

  null,                    // No specific option

  'B',                     // Tooltip shows 'CTRL + B'

  false,                   // No Shift key required

  false                    // No Alt/Option key required

)

This single line configures Ctrl + B (Windows) or Cmd + B (macOS) to instantly bold selected text.

Shortcut Variations

Want a different combination? Simply adjust the parameters:

For example, the following code makes selected text bold using the shortcut Ctrl + Shift + B (Windows) or Cmd + Shift + B (macOS).

FroalaEditor.RegisterShortcut(

  FroalaEditor.KEYCODE.B,  

  'bold',                  

  null,                    

  'B',                     

  true,                   // Shift required

  false                   

)

While the following shortcut registration code modification changes the shortcut to Ctrl + ALT + B (Windows) or Cmd + Option + B (macOS)

FroalaEditor.RegisterShortcut(

  FroalaEditor.KEYCODE.B,  

  'bold',                  

  null,                    

  'B',                     

  false,                  // No Shift required

  true                   // Alt/Option required

)

If we want to use both Shift and Alt/Option, then you should modify the code to

FroalaEditor.RegisterShortcut(

  FroalaEditor.KEYCODE.B,  

  'bold',                  

  null,                    

  'B',                     

  true,                  // Shift required

  true                   // Alt/Option required

)

This demonstrates how easily you can customize keyboard interactions. This flexibility allows developers to create intuitive, personalized editing experiences that match specific workflow needs. The ability to fine-tune shortcuts means your Froala editor can feel truly tailored, reducing cognitive load and helping users maintain their creative momentum with minimal friction between thought and action.

Shortcuts for Commands with Multiple Actions

Some commands have multiple actions. For instance, the paragraphFormat offer multiple actions such as H1 for turning the text into heading 1 and H2 for turning the text into heading 2 and so on.

To assign a shortcut for the H1 action, you need to pass H1 as the third parameter in the RegisterShortcut method.

  FroalaEditor.RegisterShortcut(
  72,                         // Decimal code for 'H' key
  'paragraphFormat',          // Command
  'H1',                       // Selected Action 
  'H',
  false,
  false
  );

The above code registers Ctrl + H (Windows) or Cmd + H (macOS) to instantly make selected text a heading paragraph.

Similarly, you can create shortcuts for other paragraph formats like H2 or H3 by adjusting the action parameter.

By mapping specific keystrokes to precise formatting actions, you can dramatically reduce the time spent navigating menus and clicking buttons, making the writing process more fluid and intuitive for users across different skill levels and editing preferences.

Disabling Shortcuts

Sometimes, you might want to disable certain default keyboard shortcuts in Froala to prevent conflicts or customize the editing experience. Froala provides a straightforward way to manage this through the shortcutsEnabled configuration option.

How to Disable Specific Shortcuts

You can disable shortcuts by removing their names from the shortcutsEnabled array.

new FroalaEditor('#editor', {

  shortcutsEnabled: ['bold', 'italic'] // Only these shortcuts remain active

});

Completely Disabling Shortcuts

If you want to turn off all default shortcuts:

new FroalaEditor('#editor', {

  shortcutsEnabled: [] // Disables all default shortcuts

});

Why Disable Shortcuts?

Reasons to disable shortcuts might include:

  • Preventing accidental formatting
  • Resolving conflicts with browser or system-wide keyboard commands
  • Creating a more controlled editing environment

By carefully managing shortcuts, you can create a more tailored and user-friendly editing experience.

Shortcut Hints: Guiding Users Intuitively

Shortcut hints

Understanding Shortcut Hints

Shortcut hints are small, informative tooltips that appear when users hover over buttons in the Froala Rich Text Editor. These hints reveal the corresponding keyboard shortcut for each action, providing a quick reference that helps users discover and remember keyboard commands.

The Importance of Shortcut Hints

Shortcut hints serve multiple crucial purposes:

  • Discoverability: They introduce users to available keyboard shortcuts.
  • Learning: Help users quickly memorize keyboard commands
  • Accessibility: Provide clear guidance for users who prefer keyboard navigation.
  • Efficiency: Encourage users to adopt faster editing techniques

Configuring Shortcut Hints

Froala allows you to control shortcut hints through the shortcutsHint configuration option:

new FroalaEditor('#editor', {

  shortcutsHint: true  // Enables shortcut hints (default)

});

Hints

To disable shortcut hints completely:

new FroalaEditor('#editor', {

  shortcutsHint: false  // Disables all shortcut hints

});

Help Modal: Comprehensive Shortcut Reference

The Help plugin in Froala provides a comprehensive modal that displays all available shortcuts. This modal can be triggered by the help button and offers a complete overview of keyboard shortcuts.

Customizing the Help Modal Content

You can modify the help modal’s content to include custom shortcuts using the helpSets configuration. For example:

const editor = new FroalaEditor('#editor',{
  shortcutsHint: true, //display the shortcut code on hover over the button
}, function(){
  this.opts.helpSets.push({title: "Paragraph Format", commands: [
    {val: "OSkeyH", desc: "Heading 1"},
  ] 
  });
});

This adds a “Paragraph Format” section containing the Heading 1 item and its shortcut, CTRL+H.

Help Modal

Best Practices for Shortcut Hints

  • Keep hints clear and concise.
  • Use standard, intuitive shortcut combinations.
  • Ensure hints are visible but not intrusive.
  • Provide a way for users to view a complete shortcut list.

By thoughtfully implementing shortcut hints, you create a more intuitive, efficient editing experience that empowers users to work faster and more comfortably.

Cross-Platform Considerations

Froala’s shortcut system automatically adapts to different operating systems. The same registration works seamlessly across Windows, macOS, and Linux, handling modifier key differences behind the scenes.

Best Practices for Designing Shortcuts

Handle Shortcut Conflicts

Sometimes, shortcuts can overlap with browser or OS defaults. For instance, Ctrl + S usually saves the page. To avoid confusion:

  • Use combinations less likely to conflict (e.g., Alt + Shift + number keys).
  • Test across Windows, macOS, and Linux, as key modifiers differ (Ctrl vs Cmd).

Keep It Logical and Memorable

If a shortcut’s meaning is obvious, users will remember it.

  • “B” for Bold.
  • “I” for Italic.
  • “L” for Link.

Avoid random or multi-layered key combinations unless absolutely necessary.

Conclusion

Keyboard shortcuts may seem small, but they’re the silent heroes of productivity. They reduce friction, keep users in flow, and turn routine editing into instinctive action.

For developers, Froala’s API makes implementing and customizing shortcuts straightforward — giving you the power to create a truly fluid, user-friendly editing experience.

🚀 Start Free Trial and explore Froala’s full set of customization and productivity tools.

💡 Try it yourself: Experiment with a Froala JSFiddle demo or your local setup.

✨ Final Thought

In the end, shortcuts aren’t just about key combinations — they’re about designing efficiency, empowerment, and joy into the user experience. And with Froala, you can deliver exactly that.

Shortcuts means efficiency, empowerment, and joy

Extending Froala with an APA Website Citation Tool

APA Website Citation Tool

Imagine typing a paragraph, the cursor blinking as you search for the perfect source. You pull up a webpage, draft your sentence, and then hit a wall: you need an APA citation, fast. You don’t want to leave your writing window or disrupt your flow. What if you could summon a perfect APA citation with a single click, right inside your editor?

In this tutorial, you’ll learn how to extend Froala with a lightweight, reusable citation feature. Build a custom toolbar button that opens a popup, collect author/date/title/URL details, and insert a polished APA website citation exactly where you’re writing.

Along the way, you’ll quickly grasp what citations are, why APA matters, and how Froala’s flexibility makes this tool fit real writing workflows.

By the end, you’ll see that Froala isn’t just a text editor—it’s a powerful tool you can shape to fit specialized workflows, whether you’re supporting academic writing, content publishing, or collaborative editing. Get ready to add a professional-grade citation tool to Froala and give your users a smoother, smarter writing experience.

APA Citation Style

Understanding Citations

A citation gives credit to the source of information you use in your work. It helps readers verify facts, find more information, and ensures you avoid plagiarism. Citations apply whether you quote someone directly or paraphrase their ideas.

By contrast, a quotation is when you copy the exact words from a source. Quotations must always be followed by a citation. In short: quotations are the borrowed words, citations are the credit.

Citations appear in academic papers, blogs, reports, and any content where proper credit matters.

What is APA Citation Style?

The American Psychological Association (APA) style is one of the most widely used citation formats, especially in the social sciences.

A typical APA website citation includes:

  1. Author (person or organization)
  2. Date (year, month, and day if available)
  3. Title of the webpage (italicized)
  4. Website name (if different from the author)
  5. URL

Examples:

  • Individual author: Smith, J. (2023, May 10). How to write a research paper. Writing Guide. https://www.writingguide.org/research-paper
  • Organization author: World Health Organization. (2022, March 14). COVID-19 advice for the public. https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public

This structure ensures consistency and clarity for readers.

Why Extend Froala Editor with a Citation Feature?

Froala is more than a text editor—it’s a tool that developers can adapt to almost any content workflow. Writers, students, and professionals often need to insert citations, yet most editors don’t include citation tools by default.

Adding a custom citation button saves time, reduces formatting errors, and improves user experience. It also demonstrates how easily Froala can be tailored for specialized tasks. For example, to work as knowledge publishing or academic writing tool.

Citation Popup

Step-by-Step Guide For Adding A Citation Feature

We will create a custom plugin named “Citation“. This plugin will register a new toolbar button to open the citation popup. The popup collects the citation details. You’ll need form fields for author, date, title, website name, and URL.

On submit, format the input as an APA website citation and insert it at the current cursor position.

Creating the Custom Citation Plugin

Define the popup template and the show/hide popup methods.

// Define popup template.
Object.assign(FroalaEditor.POPUP_TEMPLATES, {
  "citationPlugin.popup": "[_BUTTONS_][_CUSTOM_LAYER_][_CBUTTONS_]",
});

// Define popup buttons.
Object.assign(FroalaEditor.DEFAULTS, {
  citationPopupTopButtons: ["popupClose", "|"],
  citationPopupBottomButtons: ["citationSubmit", "|"],
});

// The custom popup is defined inside a plugin (new or existing).
FroalaEditor.PLUGINS.citationPlugin = function (editor) {
  // Create custom popup.
  function initPopup() {
    // Load popup template.
    var template = FroalaEditor.POPUP_TEMPLATES["citationPlugin.popup"];
    if (typeof template == "function") template = template.apply(editor);

    // Popup buttons.
    var citation_popup_top_buttons = "";

    // Create the list of buttons.
    if (editor.opts.citationPopupTopButtons.length > 1) {
      citation_popup_top_buttons += '<div class="fr-buttons">';
      citation_popup_top_buttons += editor.button.buildList(
        editor.opts.citationPopupTopButtons,
      );
      citation_popup_top_buttons += "</div>";
    }

    var citation_popup_bottom_buttons = "";

    // Create the list of buttons.
    if (editor.opts.citationPopupBottomButtons.length > 1) {
      citation_popup_bottom_buttons += '<div class="fr-buttons">';
      citation_popup_bottom_buttons += editor.button.buildList(
        editor.opts.citationPopupBottomButtons,
      );
      citation_popup_bottom_buttons += "</div>";
    }

    var citationPopupTemplate = `
    <div class="fr-citation-popup">
      <div class="fr-citation-input"> <label>Author:</label><input type="text" id="citation-author"></div>
      <div class="fr-citation-input"> <label>Date:</label><input type="text" id="citation-date"></div>
      <div class="fr-citation-input"> <label>Title:</label><input type="text" id="citation-title"></div>
      <div class="fr-citation-input"> <label>Website:</label><input type="text" id="citation-website"></div>
      <div class="fr-citation-input"> <label>URL:</label><input type="text" id="citation-url"></div>
    </div>`;
    // Load popup template.
    var template = {
      buttons: citation_popup_top_buttons,
      custom_layer: citationPopupTemplate,
      cbuttons: citation_popup_bottom_buttons,
    };

    // Create popup.
    var $popup = editor.popups.create("citationPlugin.popup", template);

    return $popup;
  }

  // Show the popup
  function showPopup() {
    // Get the popup object defined above.
    var $popup = editor.popups.get("citationPlugin.popup");

    // If popup doesn't exist then create it.
    // To improve performance it is best to create the popup when it is first needed
    // and not when the editor is initialized.
    if (!$popup) $popup = initPopup();

    // Set the editor toolbar as the popup's container.
    editor.popups.setContainer("citationPlugin.popup", editor.$tb);

    // If the editor is not displayed when a toolbar button is pressed, then set BODY as the popup's container.
    // editor.popups.setContainer('citationPlugin.popup', $('body'));

    // Trigger refresh for the popup.
    // editor.popups.refresh('citationPlugin.popup');

    // This custom popup is opened by pressing a button from the editor's toolbar.
    // Get the button's object in order to place the popup relative to it.
    var $btn = editor.$tb.find('.fr-command[data-cmd="citation"]');

    // Compute the popup's position.
    var left = $btn.offset().left + $btn.outerWidth() / 2;
    var top =
      $btn.offset().top +
      (editor.opts.toolbarBottom ? 10 : $btn.outerHeight() - 10);

    // Show the custom popup.
    // The button's outerHeight is required in case the popup needs to be displayed above it.
    editor.popups.show("citationPlugin.popup", left, top, $btn.outerHeight());
  }

  // Hide the custom popup.
  function hidePopup() {
    editor.popups.hide("citationPlugin.popup");
  }

  // Methods visible outside the plugin.
  return {
    showPopup: showPopup,
    hidePopup: hidePopup,
  };
};

This popup provides a simple input form for the citation.

Note: The code structure is designed to keep the popup creation lazy (only when needed) for performance.

Add a custom button to open the popup

Register a new command named “citation” and connect it to the plugin. The button lives on the Froala toolbar and triggers the popup when pressed. If the popup is already visible, it hides it.

// Add custom citation button
FroalaEditor.DefineIcon("citation", {
  template: "svgMultiplePath",
  PATHS: `<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g id="network"></g> <g id="connection"></g> <g id="page"></g> <g id="support"></g> <g id="configuration"></g> <g id="cloud_storage"></g> <g id="password"></g> <g id="search_engine"></g> <g id="history"></g> <g id="SEO"></g> <g id="optimization"></g> <g id="backlink"></g> <g id="performance"></g> <g id="analytics"></g> <g id="security"></g> <g id="dark_web"></g> <g id="video_player"></g> <g id="upload_download"></g> <g id="incognito_tab"></g> <g id="bookmark"> <g> <path d="M88.1,55l7.9-19.6c0.1-0.3,0.1-0.7-0.1-0.9C95.6,34.2,95.3,34,95,34h-7V17c0-2.8-2.2-5-5-5H17c-2.8,0-5,2.2-5,5v17H5 c-0.3,0-0.6,0.2-0.8,0.4c-0.2,0.3-0.2,0.6-0.1,0.9L11.9,55L4.1,74.6c-0.1,0.3-0.1,0.7,0.1,0.9C4.4,75.8,4.7,76,5,76h7v7 c0,2.8,2.2,5,5,5h66c2.8,0,5-2.2,5-5v-7h7c0.3,0,0.6-0.2,0.8-0.4c0.2-0.3,0.2-0.6,0.1-0.9L88.1,55z M17,14h66c1.7,0,3,1.3,3,3v5 H14v-5C14,15.3,15.3,14,17,14z M14,24h72v10H14V24z M86,83c0,1.7-1.3,3-3,3H17c-1.7,0-3-1.3-3-3v-7h72V83z M6.5,74l7.5-18.6 c0.1-0.2,0.1-0.5,0-0.7L6.5,36h87l-7.5,18.6c-0.1,0.2-0.1,0.5,0,0.7L93.5,74H6.5z"></path> <circle cx="80" cy="18" r="2"></circle> <circle cx="74" cy="18" r="2"></circle> <circle cx="68" cy="18" r="2"></circle> <path d="M65.5,50H54.4L51,39.4c-0.1-0.4-0.5-0.7-1-0.7s-0.8,0.3-1,0.7L45.6,50H34.5c-0.4,0-0.8,0.3-1,0.7c-0.1,0.4,0,0.9,0.4,1.1 l9,6.5l-3.4,10.6c-0.1,0.4,0,0.9,0.4,1.1c0.4,0.3,0.8,0.3,1.2,0l9-6.5l9,6.5c0.2,0.1,0.4,0.2,0.6,0.2s0.4-0.1,0.6-0.2 c0.4-0.3,0.5-0.7,0.4-1.1l-3.4-10.6l9-6.5c0.4-0.3,0.5-0.7,0.4-1.1C66.3,50.3,65.9,50,65.5,50z M55.3,57.1 c-0.4,0.3-0.5,0.7-0.4,1.1l2.7,8.3l-7.1-5.1c-0.2-0.1-0.4-0.2-0.6-0.2s-0.4,0.1-0.6,0.2l-7.1,5.1l2.7-8.3c0.1-0.4,0-0.9-0.4-1.1 L37.6,52h8.8c0.4,0,0.8-0.3,1-0.7L50,43l2.7,8.3c0.1,0.4,0.5,0.7,1,0.7h8.8L55.3,57.1z">
</path> </g> </g> </g>`,
  VIEWBOX: "0 0 100 100",
});

FroalaEditor.RegisterCommand("citation", {
  title: "Insert Citation",
  undo: false,
  focus: false,
  popup: true,
  // Buttons which are included in the editor toolbar should have the plugin property set.
  plugin: "citationPlugin",
  callback: function () {
    if (!this.popups.isVisible("citationPlugin.popup")) {
      this.citationPlugin.showPopup();
    } else {
      if (this.$el.find(".fr-marker")) {
        this.events.disableBlur();
        this.selection.restore();
      }
      this.popups.hide("citationPlugin.popup");
    }
  },
});

Here, we define a new icon and tell Froala what to do when the user clicks it.

Add a close button for the popup

Define a close icon (popupClose) and wire it to hide the popup.

This button allows users to close the popup without inserting a citation.

// Define custom popup close button icon and command.
FroalaEditor.DefineIcon("popupClose", { SVG_KEY: "back" });
FroalaEditor.RegisterCommand("popupClose", {
  title: "Close",
  undo: false,
  focus: false,
  callback: function () {
    this.citationPlugin.hidePopup();
  },
});

Handle form submission (APA formatting)

Add a new button (citationSubmit). When clicked, it triggers the following actions:

  • Read the form fields.
  • Build the APA website citation string.
  • Insert the citation into the editor at the cursor position.
  • Close the popup afterward.
// Define custom popup close button icon and command.
FroalaEditor.DefineIcon("citationSubmit", {
  template: "svgMultiplePath",
  PATHS: `<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M905.92 237.76a32 32 0 0 0-52.48 36.48A416 416 0 1 1 96 512a418.56 418.56 0 0 1 297.28-398.72 32 32 0 1 0-18.24-61.44A480 480 0 1 0 992 512a477.12 477.12 0 0 0-86.08-274.24z" fill="#231815"></path><path d="M630.72 113.28A413.76 413.76 0 0 1 768 185.28a32 32 0 0 0 39.68-50.24 476.8 476.8 0 0 0-160-83.2 32 32 0 0 0-18.24 61.44zM489.28 86.72a36.8 36.8 0 0 0 10.56 6.72 30.08 30.08 0 0 0 24.32 0 37.12 37.12 0 0 0 10.56-6.72A32 32 0 0 0 544 64a33.6 33.6 0 0 0-9.28-22.72A32 32 0 0 0 505.6 32a20.8 20.8 0 0 0-5.76 1.92 23.68 23.68 0 0 0-5.76 2.88l-4.8 3.84a32 32 0 0 0-6.72 10.56A32 32 0 0 0 480 64a32 32 0 0 0 2.56 12.16 37.12 37.12 0 0 0 6.72 10.56zM230.08 467.84a36.48 36.48 0 0 0 0 51.84L413.12 704a36.48 36.48 0 0 0 51.84 0l328.96-330.56A36.48 36.48 0 0 0 742.08 320l-303.36 303.36-156.8-155.52a36.8 36.8 0 0 0-51.84 0z" fill="#231815"></path></g>`,
  VIEWBOX: "0 0 1024 1024",
});

FroalaEditor.RegisterCommand("citationSubmit", {
  title: "Close",
  undo: false,
  focus: false,
  callback: function () {
    //Read values from inputs: citation-author, citation-date, citation-title, citation-website, citation-url
    var author = document.getElementById('citation-author').value;
    var date = document.getElementById('citation-date').value;
    var title = document.getElementById('citation-title').value;
    var website = document.getElementById('citation-website').value;
    var url = document.getElementById('citation-url').value;
    
    //Build APA string
    var citation = `<p>${author}. (${date}). <cite>${title}</cite>. ${website}. ${url}</p>`;

    // Insert into Froala editor
    this.html.insert(citation);
    // close the popup 
    this.citationPlugin.hidePopup();
  },
});

Optional: style the inserted citation

You can also wrap citations in a consistent container for styling —for example, wrapping it in a <p class="citation">

.citation {
  font-size: 0.9em;
  color: #555;
}

Style the form (popup)

Add basic layout/styling for the form inside the popup.

Example CSS:

.fr-citation-popup {

  padding: 10px;

}

.fr-citation-popup label{

  width: 75px;

  display: inline-block;

}

.fr-citation-popup input{

  padding: 5px;

  margin-bottom: 5px;

  border-radius: 7px !important;

  border: 1px solid #333 !important;

}

Initialize the editor with the new button

Include the citation button in the Froala toolbar.

const editor = new FroalaEditor("#editor", {

  toolbarButtons: [

    ["bold", "italic", "underline", "fontSize", "lineHeight"],

    ["alignLeft", "alignCenter", "alignRight"],

    ["citation", "textColor", "backgroundColor"],

    ["insertLink", "html"],

  ],

});

After you follow our step-by-step guide, you’ll end up with:

  • A single, reusable plugin named “Citation”
  • A toolbar button labeled Citation
  • A popup form to collect author, date, title, website name, and URL
  • APA-formatted website citations inserted at the cursor position
  • Optional styling hooks to ensure consistent appearance

Enhancements and Tips

  • Validation: Require fields like Author and Title to prevent incomplete citations.
  • Support Multiple Citation Formats: Add options for MLA or Chicago to support more audiences.
  • Links: Make URLs clickable so readers can follow sources directly.
  • Citation Block: Insert citations in a styled container for better readability.

Takeaways

  • You can extend Froala with a lightweight, reusable citation tool that inserts APA website citations directly at the cursor.
  • The approach emphasizes a clean, lazy-loaded popup to minimize performance impact.
  • You can adapt the UI and formatter to support additional citation styles and branding requirements.

Conclusion

We started with the basics of citations and APA style, then walked through creating a custom button, building a popup, handling input, and inserting formatted citations. This small feature demonstrates how powerful and customizable Froala really is.

With just a few lines of JavaScript, you transformed Froala into an academic-friendly writing tool. Now, you can extend this feature further—support more citation styles, build citation libraries, or connect to external reference managers.

Froala gives you the building blocks; your creativity defines what’s possible.

Try adding this citation button to your own Froala editor setup. Explore Froala’s documentation to see what else you can customize, and consider expanding the feature to support your users’ unique workflows. With Froala, the editor grows with your needs.

Step-by-Step Guide to Styling Froala Editor with Custom Skins and Icons

editor skins and icon pack

When building modern web applications, every detail of your UI matters—including the editor your users interact with daily. Froala’s WYSIWYG Editor is already known for its clean design and powerful features, but did you know you can take it even further? With customizable skins and icon packs, you can transform the editor’s look and feel to perfectly match your brand or design system.

Whether you want to align it with your company’s style guide, keep up with the latest design trends, or simply create multiple themes you can switch between with ease, Froala makes it possible. From subtle tweaks to complete visual overhauls, the editor becomes a seamless part of your website rather than just an add-on.

In this article, we’ll walk you through two practical, step-by-step examples of customizing both the editor skin and its icons. By the end, you’ll see just how flexible Froala is when it comes to adapting to your design vision—and how these enhancements can elevate the editing experience for your users.

Custom Froala icons and color theme

Why Customize Froala Editor Skins and Icons?

The editor isn’t just a utility—it’s a core part of how users interact with your application. When the design of the editor feels disconnected from the rest of your UI, it can break the flow and reduce engagement. By customizing Froala’s skins and icons, you ensure that your editor feels like a natural extension of your product.

Here’s why it matters:

  • Brand Alignment: Every brand has its own identity, from colors to typography. Custom skins let you bring that identity into the editor, ensuring a cohesive look across your entire platform.
  • Staying on Trend: Design trends evolve quickly. Froala’s flexibility allows you to refresh your editor’s style to stay current with popular design systems such as Material Design, Fluent UI, or Bootstrap themes.
  • Improved User Experience: A familiar, polished editor encourages users to focus on content creation without distractions. Consistent icons and intuitive design make the editing process smoother.
  • Seamless Integration: Whether your editor is embedded in a CMS, SaaS dashboard, or client-facing portal, customization helps it blend in perfectly with the surrounding interface.

Understanding Froala Skins and Icons

Before jumping into customization, it’s important to understand what skins and icons mean:

Skins: Customizing the Editor’s Appearance

Skins define the overall appearance of the Froala editor. This includes the colors, spacing, typography, borders, and the look of the toolbar, dropdowns, and modals.

Since Froala is an HTML component, you can change its skin by overriding the default CSS styles. For example, adding the following CSS will change the background color of the top toolbar to red:

.fr-toolbar.fr-top{

  background: red

}

red toolbar

In order to manage multiple skins, Foala has a “themes” feature that lets you easily switch between different skins using the theme configuration option:

  1. Create a new CSS file, e.g., “my-custom-theme.css”, and add your custom styles.
  2. Include the stylesheet in your HTML  
    <link href='../css/my-custom-theme.css' rel='stylesheet' type='text/css' />
  3. Set the theme configuration when initializing the Froala editor:  
    new FroalaEditor('#editor', {
    
      theme: 'my-custom-theme'
    
    })
  4. This will add the my-custom-theme class to the Froala .fr-box element, allowing you to target your custom styles.

Moreover, there are a few configurations that can be used to customize the editor UI. This includes:

  • toolbarBottom: Position toolbar at the bottom.
  • direction: Enable right-to-left text
  • height: Adjust editing area size
  • documentReady: Create a document-like editor interface

Icon Packs:

Icons are the visual language of your editor. Every toolbar button—bold, italic, add link, insert image—is represented by an icon. Froala’s default icons are clean and professional, but you can swap them out with custom SVGs or font-based icons to match your brand or design system.

Froala’s icons are defined in JavaScript. You can select a predefined icon template or create a custom one. An icon template is an HTML structure that represents the icons, with a placeholder variable that will be replaced with the specific icon identifier. For example, the FontAwesome icon template is defined as:

<i class="fa fa-[NAME]" aria-hidden="true"></i>

For each icon, you need to define a NAME attribute that will replace the [NAME] placeholder. For example, for the “bold” button, you would set:

FroalaEditor.ICONS.bold.NAME = "bold"

This will generate the HTML code:

<i class="fa fa-bold" aria-hidden="true"></i>

Froala provides several predefined icon templates, and you can also define your own custom templates using the FroalaEditor.DefineIconTemplate() method.

Available pre-made icon templates in Froala are

FroalaEditor.ICON_TEMPLATES = {

  font_awesome: '<i class="fa fa-[NAME]" aria-hidden="true"></i>,',

  font_awesome_5: '<i class="fas fa-[FA5NAME]" aria-hidden="true"></i>',

  font_awesome_5s: '<i class="far fa-[FA5NAME]" aria-hidden="true"></i>',

  text: '<span style="text-align: center;">[NAME]</span>',

  image: '<img src=[SRC] alt=[ALT] />',

  svgMultiplePath: '<svg class="fr-svg" focusable="false" viewBox="[VIEWBOX]" xmlns="http://www.w3.org/2000/svg">[PATHS]</svg>',

  svg: '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">[PATH]</svg>'

}

By default, Froala uses the SVG template. You can change the template like

FroalaEditor.ICON_DEFAULT_TEMPLATE = 'material_design';

 How skins and icons work together to shape the editing experience

When combined, skins and icons give you total control over how the editor feels. You can opt for a subtle refresh (e.g., just adjusting colors) or a complete overhaul with a new theme and branded icons.

Example 1: Borderless skin with Line Awesome icons pack

Froala borderless skin

In this example, we modify the editor UI to follow the minimalist design trend by removing the editor outline borders. Also, we will enhance the icon design by replacing the default icons with the Line Awesome icons package.

Create a Borderless Theme

  1. Create a CSS file named “borderless-theme.css” with these styles:  
    .borderless-theme .fr-toolbar.fr-top,
    .borderless-theme .fr-wrapper{
      border: unset !important;
    }
    
    .borderless-theme .fr-second-toolbar{
        background: #f5f5f5;
        border-color: #f5f5f5;
    }
    
    .borderless-theme .fr-toolbar .fr-command.fr-btn i, .borderless-theme .fr-popup .fr-command.fr-btn i, borderless-theme .fr-modal .fr-command.fr-btn i{
      font-size: 23px !important;
    
    
  2. Include the stylesheet in your HTML.
  3. Set the theme configuration when initializing the Froala editor:  
    new FroalaEditor('#editor', {
    
      theme: 'borderless-theme'
    
    })
    

This will add a borderless design to the Froala editor, removing unnecessary borders and creating a more minimalist interface. The CSS targets the top toolbar, wrapper, and second toolbar, stripping away default border styles. Additionally, it adjusts the icon size to create a cleaner, more modern look.

Implement Line Awesome Icons

Line Awesome are flat line icons made by Icons8 to be an alternative to Font Awesome icons. They are used similar to Font Awesome.

To use them in Froala, add the Line Awesome stylesheet to your HTML:

<link rel= "stylesheet" href= "https://maxst.icons8.com/vue-static/landings/line-awesome/line-awesome/1.3.0/css/line-awesome.min.css" >

In your JavaScript:

  1. Define a new icon template for Line Awesome  
    FroalaEditor.ICON_TEMPLATES.line_awesome = '<i class= "las la-[NAME]" ></i>'
  2. Since they are similar to Font Awesome and have the same name, we will take advantage of that using the NAME placeholder which icons already have so we don’t need to define them again.
  3. Switch the editor default template  
    FroalaEditor.ICON_DEFAULT_TEMPLATE = 'line_awesome'

     The editor now is packed with the new skin and icons.

Example 2: Classic skin with Iconography icons pack

Froala classic skin

In this example, we modify the editor UI to follow the classic editor design with straight borders. Also, we will enhance the icon design replacing the default icons with the Iconography icons package.

Classic Theme

  1. Create a new CSS file named classic-theme.css and add these styles to achieve a classic, straight-edged look:  
    .classic-theme .fr-toolbar.fr-top,
    .classic-theme .fr-wrapper{
    border-radius: 0;
        border: 1px solid #CCCCCC;
    }
    
    .classic-theme .fr-toolbar .fr-more-toolbar.fr-expanded{
      border-top: 1px solid #CCCCCC;
    }
    
    .classic-theme .fr-box .fr-second-toolbar{
    border-radius: 0;
        border: 1px solid #CCCCCC;
    }
    
    .classic-theme .fr-toolbar .fr-btn-grp{
      border-right: 1px solid #CCCCCC;
    }
    
    .classic-theme .fr-toolbar .fr-btn-grp.fr-float-right{
      border: unset !important;
    }
    
    .classic-theme .fr-desktop .fr-command.fr-selected:not(.fr-table-cell), .fr-desktop .fr-command:active, .fr-desktop .fr-command:hover:not(.fr-table-cell), .fr-desktop .fr-command:focus:not(.fr-table-cell), .fr-desktop .fr-command.fr-btn-hover:not(.fr-table-cell), .fr-desktop .fr-command.fr-expanded:not(.fr-table-cell), .fr-toolbar .fr-command.fr-btn.fr-open:not(:hover):not(:focus):not(:active),
    .fr-toolbar .fr-more-toolbar{
      background: transparent !important
    }
    
    .classic-theme .fr-toolbar .fr-command.fr-btn span, .fr-popup .fr-command.fr-btn span, .fr-modal .fr-command.fr-btn span{
      font-size: 19px !important;
    
    
  2. Include the stylesheet in your HTML
  3. Set the theme configuration when initializing the Froala editor: 
    new FroalaEditor('#editor', {
    
      theme: 'classic-theme'
    
    });

     

Iconography Icons

Iconography icons come from the Telerik/Kendo UI design system. They consist of more than 400 unique icons. To use them with Froala:

First, add the Iconography font stylesheet in your HTML:

<link rel="stylesheet" href="https://unpkg.com/@progress/kendo-font-icons/dist/index.css" />

Then, in your JavaScript, create a new icon template named iconography:

FroalaEditor.ICON_TEMPLATES.iconography = '<span class="k-icon k-font-icon k-i-[GNAME]"></span>';

Here [GNAME] is a placeholder for the actual Iconography name. You must set a GNAME value for each icon you customize.

Since some icons are added in recent releases, we provided a small compatibility helper to set GNAME only if the icon exists (helps with newer/older Froala versions):

function setIconGNAME(buttonName, customIcon){

  if (FroalaEditor.ICONS[buttonName] !== undefined) {

    FroalaEditor.ICONS[buttonName].GNAME = customIcon;

  }

}

Apply the GNAME mappings for the icons you want.

setIconGNAME("align", "align-middle");

setIconGNAME("align-center", "align-center");

setIconGNAME("align-justify", "align-justify");

setIconGNAME("align-left", "align-left");

setIconGNAME("align-right", "align-right");

setIconGNAME("autoplay", "play-sm");

setIconGNAME("backgroundColor", "pencil");

setIconGNAME("bold", "bold");

setIconGNAME("cancel", "x-outline");

setIconGNAME("centerTableAlign", "table-position-center");

setIconGNAME("centerTableAlignActive", "table-position-center");

setIconGNAME("clearFormatting", "strip-all-formatting");

setIconGNAME("cloudIcon", "cloud");

setIconGNAME("color", "foreground-color");

setIconGNAME("colorsBack", "level-up");

setIconGNAME("deleteAll", "clean-outline");

setIconGNAME("emoticons", "hand");

setIconGNAME("emoticonsBack", "level-up");

setIconGNAME("fileBack", "level-up");

setIconGNAME("filesByURL", "file-bac");

setIconGNAME("filesEmbed", "file-programming");

setIconGNAME("filesUpload", "file-add");

//setIconGNAME("filestackIcon", "align");

//setIconGNAME("filestackIconAdd", "align");

setIconGNAME("findAndReplaceArrowDown", "chevron-down");

setIconGNAME("findAndReplaceArrowUp", "chevron-up");

setIconGNAME("findReplaceIcon", "replace-single");

setIconGNAME("fontFamily", "font-family");

setIconGNAME("fontSize", "font-size");

setIconGNAME("formatOL", "list-ordered");

setIconGNAME("formatOLSimple", "list-roman-big");

setIconGNAME("formatUL", "list-unordered");

setIconGNAME("fullscreen", "fullscreen");

setIconGNAME("fullscreenCompress", "fullscreen-exit");

setIconGNAME("getPDF", "file-pdf");

setIconGNAME("help", "info-circle");

setIconGNAME("html", "html5");

setIconGNAME("image-align", "image-absolute-position");

setIconGNAME("image-align-center", "table-align-middle-center");

setIconGNAME("image-align-left", "table-align-middle-left");

setIconGNAME("image-align-right", "table-align-middle-right");

setIconGNAME("imageAlign", "image-absolute-position");

setIconGNAME("imageAlt", "toolbar-float");

setIconGNAME("imageBack", "level-up");

setIconGNAME("imageByURL", "link");

setIconGNAME("imageCaption", "comment");

setIconGNAME("imageDisplay", "display-block");

//setIconGNAME("imageFilestackOnly", "align");

setIconGNAME("imageLink", "hyperlink-open");

setIconGNAME("imageManager", "folder-open");

setIconGNAME("imageManagerDelete", "trash");

setIconGNAME("imageManagerInsert", "image-add");

setIconGNAME("imageRemove", "trash");

setIconGNAME("imageReplace", "chart-area-stacked");

setIconGNAME("imageSize", "col-resize");

setIconGNAME("imageStyle", "apply-format");

setIconGNAME("imageTransformations", "scale");

setIconGNAME("imageUpload", "image-add");

setIconGNAME("indent", "indent");

setIconGNAME("inlineClass", "css");

setIconGNAME("inlineStyle", "apply-format");

setIconGNAME("inputBack", "level-up");

setIconGNAME("inputEdit", "inputbox");

setIconGNAME("inputStyle", "css3");

setIconGNAME("insert", "plus");

setIconGNAME("insertAll", "file-add");

setIconGNAME("insertFile", "file-add");

setIconGNAME("insertFiles", "images");

setIconGNAME("insertHR", "horizontal-rule");

setIconGNAME("insertImage", "image-add");

setIconGNAME("insertLink", "link-add");

setIconGNAME("insertTable", "table-add");

setIconGNAME("insertVideo", "file-video");

setIconGNAME("italic", "italic");

setIconGNAME("leftTableAlign", "table-position-start");

setIconGNAME("leftTableAlignActive", "table-position-start");

setIconGNAME("lineHeight", "line-height");

setIconGNAME("linkBack", "level-up");

setIconGNAME("linkEdit", "envelope-link");

setIconGNAME("linkList", "list-unordered-square");

setIconGNAME("linkOpen", "hyperlink-open");

setIconGNAME("linkRemove", "unlink");

setIconGNAME("linkStyle", "link-vertical");

setIconGNAME("markdown", "clipboard-markdown");

setIconGNAME("minimize", "window-minimize");

setIconGNAME("moreMisc", "more-vertical");

setIconGNAME("moreParagraph", "more-vertical");

setIconGNAME("moreRich", "more-vertical");

setIconGNAME("moreText", "more-vertical");

setIconGNAME("outdent", "outdent");

setIconGNAME("paragraphFormat", "paragraph-mark");

setIconGNAME("paragraphStyle", "paragraph-height");

setIconGNAME("print", "print");

setIconGNAME("quickInsert", "plus-outline");

setIconGNAME("quote", "right-double-quotes");

setIconGNAME("redo", "redo");

setIconGNAME("remove", "trash");

setIconGNAME("rightTableAlign", "table-position-end");

setIconGNAME("rightTableAlignActive", "table-position-end");

setIconGNAME("save", "save");

setIconGNAME("selectAll", "select-all");

setIconGNAME("specialCharBack", "level-up");

setIconGNAME("specialCharacters", "transactions");

setIconGNAME("strikeThrough", "strikethrough");

setIconGNAME("subscript", "subscript");

setIconGNAME("superscript", "supscript");

setIconGNAME("tableBack", "level-up");

setIconGNAME("tableCellHorizontalAlign", "align-self-end-alt");

setIconGNAME("tableCellProperties", "table-cell-properties");

setIconGNAME("tableCellStyle", "table-wizard");

setIconGNAME("tableCellVerticalAlign", "align-self-start");

setIconGNAME("tableCells", "table-cell");

setIconGNAME("tableColorRemove", "trash");

setIconGNAME("tableColumns", "columns");

setIconGNAME("tableFooter", "file-footer");

setIconGNAME("tableHeader", "file-header");

setIconGNAME("tablePropertiesIcon", "table-properties");

setIconGNAME("tableRemove", "table-delete");

setIconGNAME("tableRows", "rows");

setIconGNAME("tableSelectorIcon", "arrows-move");

setIconGNAME("textColor", "foreground-color");

setIconGNAME("underline", "underline");

setIconGNAME("undo", "undo");

setIconGNAME("video-align", "align-middle");

setIconGNAME("video-align-center", "align-center");

setIconGNAME("video-align-left", "align-left");

setIconGNAME("video-align-right", "align-right");

setIconGNAME("videoAlign", "align-middle");

setIconGNAME("videoBack", "level-up");

setIconGNAME("videoByURL", "link");

setIconGNAME("videoDisplay", "display-inline-block");

setIconGNAME("videoEmbed", "clipboard-code");

//setIconGNAME("videoFilestackOnly", "align");

setIconGNAME("videoRemove", "trash");

setIconGNAME("videoReplace", "replace-all");

setIconGNAME("videoSize", "handle-resize");

setIconGNAME("videoUpload", "upload");

Some icon entries have a template attribute, which may override your custom icon. To ensure your iconography icons render the way you defined, remove the template attribute from those icons:

const iconsWithTemplate = ['quickInsert', 'tableCellProperties', 'tablePropertiesIcon', 'leftTableAlign', 'leftTableAlignActive', 'centerTableAlign', 'centerTableAlignActive', 'rightTableAlignActive', 'rightTableAlign', 'tableSelectorIcon', 'findReplaceIcon'];

iconsWithTemplate.forEach((icon) => {

 delete FroalaEditor.ICONS[icon].template;

})

Some icons should keep their original SVG instead of using Font/Iconography e.g. Filestack icons. For those, add the SVG template:

//Keep Filestack Icons SVG Template

if (FroalaEditor.ICONS.filestackIcon !== undefined) {

  FroalaEditor.ICONS.filestackIcon.template = "svg";

  FroalaEditor.ICONS.filestackIconAdd.template = "svg";

}

Switch Froala’s default icon template to iconography:

FroalaEditor.ICON_DEFAULT_TEMPLATE = 'iconography';

When you reload the editor, the icons should now use the Iconography set.

Notes and tips:

  • You can mix and match: keep some default icons with their templates if you don’t have replacements and fully replace others with Iconography.

Try the demo on this JSFiddle link and experiment with different styles. You’ll see how easy it is to transform the editor into something that feels uniquely yours.

Use Cases

Customization isn’t just about aesthetics—it unlocks practical advantages in real-world scenarios. Here are some common use cases:

  • Corporate Branding: Enterprises often need their tools to reflect strict brand guidelines. Custom skins and icons ensure the editor fits perfectly into corporate websites, intranets, or client portals.
  • SaaS Dashboards: For SaaS applications, consistency across all modules is key. A tailored Froala editor makes the content editing experience feel integrated with the rest of the dashboard UI.
  • White-Label Solutions: Agencies and developers offering white-label platforms can quickly rebrand the editor for different clients. Creating multiple skins and icon packs makes it easy to switch styles without rewriting code.
  • Design System Alignment: Many modern apps follow design frameworks like Material, Fluent, or custom systems. Froala’s flexible customization allows you to match the editor’s look to these standards effortlessly.

Conclusion

Froala is more than just a rich text editor—it’s a customizable UI component that can be molded to fit your exact needs. By taking advantage of skins and icons, you can align the editor with your branding, keep pace with modern design trends, and deliver a seamless user experience.

Whether you need a professional corporate look, a playful theme for creative projects, or multiple styles for white-label solutions, Froala’s customization options give you the freedom to design the editor your users will love.

Ready to transform your editor? 🎨✍️

Start a free trial of Froala and experiment with custom skins and icon packs today. No credit card required — try it on your project and see the difference instantly.

 

Discord-Inspired Spoiler! Spice Up Your Web Editor Content With Hidden Text

text spoiler

Modern editors aren’t just about bold and italic anymore — they’re about creating richer ways to format and present content. One modern feature you’ve likely seen in forums, chat apps, and blogs is spoiler text: content that’s hidden until a reader chooses to reveal it. Whether it’s for plot twists, quiz answers, or sensitive details, spoiler formatting can add both fun and utility to your writing.

In this post, we’ll explore how to implement spoiler text in the Froala WYSIWYG Editor. Instead of inserting raw HTML, we’ll take advantage of Froala’s built-in format.toggle API to wrap the current selection in a <span> element with a custom CSS class. This approach ensures that your spoiler style can be applied and removed just like bold or italic, keeping the editing experience clean and intuitive.

By the end, you’ll have a neat little toggle button in your Froala toolbar that lets users mark text as a spoiler — and some CSS that hides it until revealed.

Froala editor - spoiler feature

Prerequisites

Before we start, make sure you have:

  • A working Froala Editor setup on your page.
  • Basic knowledge of JavaScript and CSS.

If you already have Froala running, you’re good to go.

Step 1: Define the Spoiler Style with CSS

First, let’s create a CSS class that hides text until hovered.

Instead of hiding text with a black background, we’ll use a blur effect. This keeps the text visible but unreadable until the user hovers or focuses on it.

.spoiler-text {
  filter: blur(4px);                /* Blurs the text (adjust blur strength as needed) */
  transition: filter 0.3s ease-in-out; /* Smoothly animates the blur change */
  user-select: none;                /* Prevents copying the hidden text */
  cursor: default;                  /* Keeps cursor neutral (not text-selectable) */
}

.spoiler-text:hover,
.spoiler-text:focus {
  filter: blur(0);                  /* Removes blur on hover or keyboard focus */
}

How it works:

  • filter: blur(4px); → makes the text unreadable by blurring it.
  • transition: filter 0.3s ease-in-out; → ensures the blur fades smoothly when toggled.
  • user-select: none; → prevents people from selecting/copying blurred text.
  • cursor: default; → makes the cursor behave like normal text, not editable text.
  • :hover and :focus states → when the user hovers with a mouse or focuses with the keyboard (Tab), the blur is removed, revealing the text.

This gives a sleek “spoiler reveal” effect, and it also works for keyboard users (important for accessibility).

Step 2: Add a Custom Command to Froala

Next, we’ll teach Froala how to apply this class from a custom toolbar button.

FroalaEditor.ICON_DEFAULT_TEMPLATE = 'font_awesome';

// 1) Define an icon for the toolbar 
FroalaEditor.DefineIcon('spoiler', {NAME: 'eye-slash', template: 'font_awesome'});

// 2) Register a command that toggles a span.spoiler-text
FroalaEditor.RegisterCommand('spoiler', {
  title: 'Sensitive Content',
  icon: 'spoiler',
  focus: true,
  undo: true,
  refreshAfterCallback: true,

  // When clicked: toggle the span with class "my-span"
  callback: function () {
    // 'this' is the editor instance
    this.format.toggle('span', { class: 'spoiler-text' });
  },

  // Called to refresh button state (so it shows active when selection is inside span.my-span)
  refresh: function ($btn) {
    var isActive = this.format.is('span', { class: 'spoiler-text' });
    $btn.toggleClass('fr-active', isActive);
    $btn.attr('aria-pressed', isActive ? 'true' : 'false');
  }
});

What happens here:

  • We create a button with an “eye-slash” icon.
  • The callback applies or removes the <span class="spoiler-text">.
  • The refresh method updates the button state so it lights up when spoiler is active.

Click-to-Reveal For Mobile Users

On the desktop, hover-to-reveal works nicely. But on mobile devices, there’s no hover — so it’s better to let users tap or click to reveal the text.

We can achieve this with a tiny bit of JavaScript:

/* Default blurred style */
.spoiler-text {
  filter: blur(4px);
  transition: filter 0.3s ease-in-out;
  user-select: none;
  cursor: pointer;  /* Cursor indicates clickability */
}

/* When revealed, blur is removed */
.spoiler-text.revealed {
  filter: blur(0);
}
// Toggle reveal on click
document.addEventListener('click', function (e) {
  if (e.target.classList.contains('spoiler-text')) {
    e.target.classList.toggle('revealed');
  }
});

How it works:

  • By default, .spoiler-text is blurred.
  • When the user clicks (or taps) on it, JavaScript toggles the .revealed class.
  • .revealed removes the blur filter, showing the hidden content.
  • Clicking again can re-hide the text (or you can remove the toggle if you want a one-time reveal).

Example in Action:

<p>Answer: <span class="spoiler-text">42</span></p>

Now, on both desktop and mobile, readers can click or tap the blurred text to reveal it smoothly.

Step 3: Add the Button to Your Toolbar

Now tell Froala to include the button in the toolbar.

new FroalaEditor('#editor', {

  toolbarButtons: ['bold', 'italic', 'underline', 'spoiler', 'insertLink']

});

When the editor loads, you’ll see the Spoiler button next to the others.

Step 4: Try It Out

Type some text into the editor, highlight a word or sentence, then click the Spoiler button.

  • The text should now look hidden with a blur effect.
  • Hover over it to reveal what’s inside.
  • Click Spoiler button again to remove the formatting.

Use Cases & Tips

spoiler text use cases

Spoiler text can be used in many different contexts beyond just hiding movie endings. Here are some detailed scenarios where it can really improve the user experience:

1. Hiding Quiz or Homework Answers

If you’re creating an educational platform or blog, spoiler text is perfect for concealing answers until the student is ready.

  • The question or exercise is always visible.
  • The answer remains blurred until the learner hovers over it (or clicks, if you adapt the CSS).
  • This encourages active learning because users first attempt the question before revealing the solution.

Example:

<p>What is 12 × 8?</p>  
<span class="spoiler-text">96</span>

2. Revealing Hints Step by Step

Sometimes you don’t want to give away the full answer immediately — just a nudge. Spoiler formatting lets you add “progressive disclosure” to your content.

  • The first hint might be lightly blurred.
  • A second hint might contain more detail.
  • Finally, the full answer can be revealed.

This is especially useful for puzzle games, coding tutorials, or escape room guides.

Example:

<p>Hint 1: <span class="spoiler-text">It’s a two-digit number.</span></p>  

<p>Hint 2: <span class="spoiler-text">It’s divisible by 12.</span></p>

3. Concealing Story Spoilers in Blogs and Communities

Writers, bloggers, and fan communities often need to discuss books, movies, or TV shows without ruining the experience for readers who haven’t caught up.

  • Spoiler formatting allows discussions without fear of spoiling the fun.
  • Readers who want the details can reveal them on their own.

Example:

<p>The twist in the final episode is <span class="spoiler-text">the detective was the villain all along</span>.</p>

4. Masking Sensitive Information

Spoiler text isn’t just for fun — it can also be a practical way to hide personal or sensitive details in demos or screenshots.

  • For example, showing an API key or password without exposing it directly.
  • You can blur the data but still reveal it when needed.
  • This makes tutorials safer without completely removing important context.

Example:

<p>Your API key is: <span class="spoiler-text">12345-ABCDE</span></p>

5. Styling Variations for Fun

Spoiler text doesn’t have to look the same everywhere. You can:

  • Change the blur strength (subtle vs. strong).
  • Swap blur for pixelation (with a CSS trick).
  • Add hover animations (like fade-in or glow).
  • Require a click instead of hover by toggling a CSS class with JavaScript.

These variations let you adapt spoiler text to the tone of your platform — serious for sensitive info, playful for games or fan discussions.

FAQ: Creating Spoiler Text in Froala Editor

  1. Can I change the blur strength of the spoiler text?
    Yes. In the CSS, adjust the value in filter: blur(4px);. A higher number makes the text harder to read before revealing, while a smaller number makes it faintly visible.
  2. Can I make the spoiler reveal on click instead of hover?
    Absolutely. The article shows a “click-to-reveal” variation that toggles a .revealed class using JavaScript. This is especially useful for mobile devices where hover doesn’t exist.
  3. Will spoiler text be accessible for keyboard users?
    Yes. Since we also support :focus, users navigating with the keyboard (using Tab) can reveal the text. If you want click-only behavior, ensure the element can still be focused (e.g., add tabindex="0" to the spoiler spans).
  4. Can I style the spoiler differently, like fade-in or with a colored box?
    Definitely. The .spoiler-text class is just a starting point. You can add animations, background colors, or even icons. For example:

    .spoiler-text.revealed {   
      animation: fadeIn 0.5s ease-in-out;
    }
  1. Can I prevent users from copying spoiler text before it’s revealed?
    Yes. We added user-select: none; in the CSS so blurred text can’t be highlighted or copied. You can remove this line if you want to allow copying even when blurred.
  2. Does this feature work in all browsers?
    The blur effect (filter: blur) works in all modern browsers (Chrome, Edge, Firefox, Safari). For older browsers, you may want to provide a fallback style, like hidden text with a black background.
  3. Can I use this same technique for other custom formats?
    Yes. The same format.toggle approach in Froala can be used for any custom inline style — like highlights, callouts, or even custom tags. Just swap out the class name and CSS.

Key Takeaways

  • Spoiler text adds interactivity — it’s great for hiding answers, hints, story spoilers, or sensitive info.
  • Use CSS for the hiding effect — blur, background color, or any creative styling you prefer.
  • Froala’s format.toggle API makes spoiler text behave like bold/italic (easy to apply and remove).
  • Click-to-reveal works best for mobile, while hover-to-reveal is fine for desktop.
  • Customizable styles let you adapt spoiler text to your platform’s tone — fun, educational, or professional.

Conclusion

With just a bit of CSS and Froala’s format.toggle API, you can give your editor a spoiler text feature that feels as natural as bold or italic. It’s flexible, easy to maintain, and a great example of extending Froala with your own custom formatting.

Now that you’ve seen how spoiler text works, try experimenting with other styles — like blurred text, tooltips, or even animated reveals. Froala makes it simple to extend the editor to fit your needs.

Try It Yourself 🎉

Want to see spoiler text in action? 👉 Open the live demo on JSFiddle and try adding spoiler formatting to your own text.

Select some text, click the Spoiler button, and watch it blur until you hover or tap to reveal!

✨ Pro tip: After testing, try modifying the CSS to change the blur strength or switch to a background-color reveal. You’ll see how flexible this technique is.

Download Froala for free and test this feature on your site today!

What’s New in Froala 4.6.2: Powerful Table Functionality

text

We are excited to announce the release of Froala 4.6.2, which introduces new Table features. These features were highly requested by our users and we are thrilled to finally bring it to you.

Moreover, this release comes with an enhanced Word Pasting Experience.

Additionally, we’ve made several other improvements to our powerful text editor. We believe this new addition will greatly enhance your editing experience with Froala.

Improved Table Editing Experience

Froala 4.6.2 introduces several new table features that enhance the editing experience. Users can now easily drag and drop tables, copy and paste cells, and resize tables vertically. Let’s find out how.

Flexible Table Positioning: Drag and Drop Tables

This release introduces the ability to easily move tables within the editor by dragging and dropping them. Users can click and hold the draggable handle at the top-left of a table, then drag it to the desired location on the page.

This feature simplifies rearranging tables in your content. You can move a table higher or lower, or shift it to a new section. The drag-and-drop functionality provides an intuitive way to adjust the table’s positioning.

Froala also includes a new configuration option called enableTableSelection. Users can select and drag tables when set to true (the default). Setting it to false disables table selection and dragging, giving you more control over the table positioning.

This draggable table feature works consistently across different table types and layouts, ensuring a seamless editing experience no matter how your tables are structured. This new capability in Froala 4.6.2 empowers content creators to organize and rearrange tabular data within their content quickly.

drag and drop table

Froala 4.6.2 Vertical Table Resizing Feature

We are excited to introduce the highly requested vertical table resizing feature. This new capability allows users to easily adjust the height of rows within a table, giving them more control over the layout and appearance of tabular data.

The vertical resizing functionality works consistently with Froala’s existing horizontal resizing features. Users can simply click and drag the resize handle at the bottom of a table row to adjust its height. This makes it easy to fine-tune the visual presentation of tables to best suit the content.

Froala now applies <colgroup> and <col> tags during table creation and resizing. This provides a cleaner, more consistent resizing experience.

Moreover, Froala has introduced a new configuration option called proportionalTableResize. This allows developers to choose between:

  1. Proportional adjustments: Resizing the table from any side (top, bottom, left, or right) proportionally adjusts all rows or columns. If resizing is done between specific rows or columns, only that row or column is resized.
  2. Targeted resizing: Resizing affects only the individual row or column being adjusted.

With the introduction of vertical resizing, combined with the existing horizontal resizing capabilities, Froala editor empowers content creators to precisely shape and optimize the appearance of tables within their digital content. This feature enhances the overall table management experience, making it easier than ever to create visually appealing and well-structured tabular layouts.

resize table

Effortless Table Data Replication: Froala’s New Copy-Paste Cell Feature

Froala 4.6.2 introduces another powerful new copy-and-paste feature for table cells, including both the content and formatting. This highly requested functionality empowers content creators to quickly replicate and transfer tabular data within their digital content.

To copy cells, users can select multiple cells by holding the Shift key and clicking, or by dragging the mouse over the desired cells. Then, they can copy the cells using the standard Ctrl+C (Windows) or Cmd+C (Mac) shortcuts.

The copied cells retain not only the data but also the formatting attributes, such as font styles, colors, and borders. When pasted, the exact visual representation and structure of the original table cells are preserved.

Pasting is just as simple. Users position their cursor where they want the cells to go, then use Ctrl+V (Windows) or Cmd+V (Mac) to paste.

Click and hold the draggable handle at the top-left of a table before copying if you want to copy the entire table while preserving its original size.

If pasting into an empty area, Froala will automatically create a new table to hold the pasted content, maintaining the original formatting. If pasting into an existing table, Froala will adjust the column widths and row heights as needed to ensure a proper fit, maintaining the visual integrity of the tabular data.

This copy-and-paste functionality empowers content creators to work with tables more efficiently. They can quickly duplicate and transfer data between tables, or even generate new tables from copied content. By preserving the original formatting, this feature streamlines the content creation process, saving time and enhancing the overall user experience.

copy table

More Table Enhancements and Bug Fixes

The 4.6.2 release includes several other table-related improvements and bug fixes. These changes help ensure a more stable and reliable table editing experience across different browsers.

For example, users can now properly align cell content within tables. We also addressed an issue where users were previously unable to select text within table cells due to a Firefox-specific problem.

These updates further solidify Froala’s commitment to providing a robust and user-friendly content creation platform. Content creators can now work with tabular data more seamlessly and create visually appealing, well-structured tables with ease.

By addressing these table-related bugs and enhancing the overall editing experience, Froala continues to improve its text editor capabilities and empower users to produce high-quality content.

Enhanced Word Pasting Experience

In addition to the new table features, Froala 4.6.2 also includes several improvements to the Word pasting functionality. These enhancements deliver a more seamless experience when users copy and paste content from Microsoft Word into the Froala editor.

Support Scrolling to View Comments

Froala 4.6.2 improves the handling of Word comments when pasting content. Now, when users paste content that contains comments, Froala inserts an anchor tag at the location of each comment. The actual comments are then appended to the bottom of the pasted content.

This new functionality allows users to easily navigate to the relevant comments by simply clicking on the anchor tags. The anchor tags provide a clear visual cue, making it straightforward for users to jump to the associated comments quickly.

This enhancement improves the overall flow and organization of the pasted content. Users can now effortlessly review and understand the context of the comments, leading to a more seamless content creation experience.

Optimized Pasting Attribute

Another enhancement in Froala 4.6.2 is the change in the attribute used to identify pasted content. Previously, the editor would add an id="isPasted" attribute to elements that were pasted from Microsoft Word.

In this release, the editor now uses a data-pasted="isPasted" attribute instead. This change provides several benefits:

  1. Semantic Improvement: The use of a data-* attribute aligns better with HTML’s semantic structure, as it indicates that the attribute is for internal use and does not represent a standard HTML attribute.
  2. Compatibility: The id attribute is reserved for unique identifiers within an HTML document, and using it for pasted content could cause conflicts with other elements on the page. The data-* attribute avoids this potential issue.
  3. Accessibility: Screen readers and other assistive technologies are more likely to ignore data-* attributes, reducing the risk of exposing unnecessary information to users.

By making this change, Froala ensures a more robust and accessible handling of pasted content, while also maintaining the ability to identify and process the pasted elements as needed.

Improved Numbered List Alignment

Froala 4.6.2 also addresses an issue related to the alignment of pasted numbered lists. Previously, when copying and pasting numbered lists from Microsoft Word, the list items could sometimes appear misaligned within the Froala editor.

This release includes a fix for this problem, ensuring that the numbered lists are correctly aligned and formatted when pasted into the editor. Users can now seamlessly copy and paste numbered lists from Word, and the list structure and formatting will be preserved without any visual inconsistencies.

These enhancements to the Word pasting functionality in Froala 4.6.2 demonstrate the team’s commitment to improving the content creation experience. By addressing common pain points, such as handling comments and numbered lists, Froala continues to provide a robust and user-friendly platform for content creators to work with.

Much More…

We have addressed several bug fixes to improve the overall performance and stability of the editor.

Here are some of the key improvements:

  1. Pasting from External Sources on Android Chrome: Copied content (text or images) from external sources is now inserted at the cursor position in the Froala Editor when pasted using long-press or system paste on Android Chrome.
  2. Preserving Formatting on Delete: The keepFormatOnDelete configuration now correctly preserves the formatting when deleting characters or entire lines. Users can continue typing using the same style.
  3. Inserting <br> in Empty Table Cells: The issue with the html.wrap(false, true, false) method has been resolved, and it removes the <br> tags in empty <td> elements when called after inserting the table.
  4. Angular Compatibility: The compilation error when referencing FroalaEditor in Angular projects has been addressed.

These bug fixes and enhancements demonstrate Froala’s commitment to continuously improving the editor’s performance and addressing user-reported issues. By resolving these problems, Froala ensures a more reliable and seamless content creation experience for its users.

Please find the complete changelog list here.

How Can I Update?

Update to Froala WYSIWYG Editor 4.6.2 today and experience enhanced editing features and improvements.

Follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.6.2/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.6.2/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

A Step-by-Step Guide to Checking Image and Video Safety Using an HTML Editor Software

The symbol for content safety (an eye with a diagonal slash across), which is an important part of HTML editor software.

As developers, we all want users to feel safe or productive in the applications that we make. This leads to implementing policies that prevent users from seeing or uploading explicit, violent, or distracting content. As a result, content moderation is more important than ever.

Thankfully, accomplishing complex tasks has become much easier using automation, advanced file uploaders, and even DeepSeek API integrations. For instance, in this article, you’ll implement automated SFW (safe for work) checks using HTML editor software and Filestack Workflows. Let’s get to it!

Key Takeaways

  • Ensure uploaded content is appropriate to maintain a professional and comfortable environment.
  • Automatically identify safe-for-work (SFW) content to handle multiple files efficiently.
  • Implement automated content safety checks with Froala Editor and Filestack Workflows.
  • Connect Filestack Workflows to a webhook endpoint to get instant feedback on file status.
  • Combine different file processing tasks in your Workflow.

Why Is Content Safety Important in Web Applications?

User-generated content can significantly impact the tone and reputation of your application. Unsafe or inappropriate content can potentially alienate, harm, or repulse users. This in turn can cause huge problems for your brand’s image, leading to users’ distrust or disgust.

A 2D animated person using a platform with HTML editor software at work. The person can browse safely due to a content safety checker.

In general, you’ll want to scan whether there’s anything unsafe in user content. And in social media and B2B and family-friendly platforms, implementing content safety checking becomes more imperative. By automating SFW checking, you:

  • Maintain a positive user experience.
  • Reduce human or manual content moderation.
  • Increase application scalability in moderating content.

Now, let’s check out the tools that we’ll need for integrating automated safety checking.

What You Need to Implement Automated Safety Checking

Alongside HTML editor software, you’ll also need a file management solution where users can upload files. This will also take care of checking the safety of content. Finally, in this use case, you’ll use a webhook endpoint to receive information about content safety from the upload.

Froala Editor

An HTML editor software, which you’ll use to upload images. Since v4.3, it has natively supported Filestack, making transforming and processing files even easier using the editor. Here, you’ll integrate it into a React application.

Filestack

A complete file management solution that handles everything file-related, from uploads and transformations to storage and even automation. In this example, you’ll use Filestack Workflows to automate SFW checking. Make sure that you have access to Filestack’s Webhooks, SFW checking, and Workflows features.

A workflow executes a set of tasks and logic wired up after an upload to enforce business processes and automate ingest. After configuring a workflow, you can call it with a single reference in your code. And since workflows are asynchronous, you also need to configure a webhook.

Webhook Endpoint

A webhook is similar to an API in the sense that it allows data exchange. However, it’s different in that it automatically triggers after specific events, unlike APIs that require the client to request data first. In your applications, you can configure webhooks to receive information from Filestack using Node.js or PHP.

For simplicity, you can use Beeceptor to receive JSON payloads from Filestack for every file upload.

How to Automatically Check Content Safety Using HTML Editor Software

Checking content safety using HTML editor software is usually a straightforward process. It actually involves little coding and only a bit of setup. Follow the steps below to find out exactly how you can implement this.

Set up Your Filestack Workflow

To get started, log into your Filestack dashboard and navigate to the “Workflows” tab. Create a new workflow (in this case, “SFWChecker”). Add a task and select “sfw” from the list. Name the task “sfw_result.” In the webhook later on, you should see the same task name in the JSON payload.

Afterwards, create 2 events below the SFW task: store and remove. For the “store” task, click the “Add new condition” button. Next, check that the job will only store the image if the value of “sfw” is true. Do the reverse (don’t store if “sfw” is false) for the “remove” task. Here’s how your workflow should look:

Filestack workflow configuration interface

Create Your Endpoint

After setting up your workflow, create your endpoint using the back-end scripting language or framework of your choice. In this case, you can use Beeceptor to test out the SFW checker workflow.

Configure Your Application Webhooks

Once you have the link to your endpoint, go to “Configuration > Webhooks” on the Filestack dashboard. Afterwards, paste your webhook link to the input field and set the dropdown beside it to “Workflow.” Add your webhook, and you should see it among the list of webhooks.

Integrate Your Workflow into Froala HTML Editor Software

Open your React project, create a component called “FroalaComponent.jsx,” and paste the following code to configure Froala Editor:

import React, { useEffect, useState } from 'react';
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import FroalaEditorComponent from 'react-froala-wysiwyg';
import 'froala-editor/js/plugins.pkgd.min.js';
import configData from './config.js';

function FroalaComponent() {
    const [tags, setTags] = useState([]);
    const config = {
        filestackOptions: {
            uploadToFilestackOnly: true,
            filestackAPI: configData.filestackAPI,
            pickerOptions: {
              accept: ['image/*'],
              fromSources: ['local_file_system'],
              storeTo: {
                  workflows: ["YourWorkflowIDHere"]
              }
            },
        },
        events: {
            'filestack.uploadedToFilestack': function (response) {
                console.log(response.filesUploaded[0]);
            }
        },
        heightMin: 500,
        width: 1000
    };

    useEffect(() => {
        const filestackScript1 = document.createElement('script');
        filestackScript1.src = 'https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js';
        filestackScript1.async = true;
        document.body.appendChild(filestackScript1);

        const filestackScript2 = document.createElement('script');
        filestackScript2.src = 'https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js';
        filestackScript2.async = true;
        document.body.appendChild(filestackScript2);

        const filestackScript3 = document.createElement('script');
        filestackScript3.src = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js';
        filestackScript3.async = true;
        document.body.appendChild(filestackScript3);

        const filestackStylesheet = document.createElement('link');
        filestackStylesheet.rel = 'stylesheet';
        filestackStylesheet.href = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css';
        document.head.appendChild(filestackStylesheet);

        return () => {
            document.body.removeChild(filestackScript1);
            document.body.removeChild(filestackScript2);
            document.body.removeChild(filestackScript3);
            document.head.removeChild(filestackStylesheet);
        };
    }, []);

    return (
        <div>
            <div className="editor">
                <FroalaEditorComponent tag='textarea' config={config} />
            </div>
        </div>
    );
}

export default FroalaComponent;

This is your standard Froala implementation in React. What you should focus on, however, is the “storeTo” option, which contains the workflow ID that we created earlier.

No matter the tasks and conditions you have in your workflow, you only need a single line to call it in your application. Pretty cool, right? Now, you can include this component in your App.js and run the application.

Note: Ensure that you keep all API keys secure on the server (e.g., .env files). Furthermore, always validate webhook signatures to confirm authenticity and integrity.

Seeing the Automated SFW Checker in Action

Firstly, select the Filestack picker icon and upload your image.

An image is checked by Filestack's SFW detection once uploaded.

After uploading an image, go to your browser console and look for the result from the log command:

The image shows the results from the Filestack upload from the HTML editor software.

Take note of the file handle and the filename. You should see the same things when you go to the Beeceptor dashboard.

Moreover, notice how you can see the “workflows” property of the result object. This contains the workflow ID of our set of tasks. Now, the task information should appear on Beeceptor, so let’s check that out:

On Beeceptor, click on the latest request and expand it. In this case, the filename and handle remained the same. Additionally, you can see that there’s a new handle, which emerged from the “store” part of your workflow. Most importantly, you now have the “sfw_result” result from your workflow earlier.

And within it lies the “{data: {“sfw”: true}}” result from the content safety checker. This means that the image from earlier is safe for work. If you chain additional tasks to your workflow, you’ll see more results on the webhook.

Ensure Safe Content in Your HTML Editor Software Today

Automating content safety checks enhances your application’s reliability and trustworthiness. With tools like Filestack and Froala, you can efficiently manage content without much manual intervention.

Now that you’ve built a solid and easy content safety checker into your HTML editor software, you can start experimenting some more! For instance, why not add some tasks like red-eye removal, image tagging, or sentiment analysis into the workflow mix?

A Step-by-Step Guide to Froala WYSIWYG Editor PDF Export

3D illustration showing HTML file being converted to PDF, representing Froala WYSIWYG Editor’s PDF export feature

As a tech-savvy user or entry-level developer, you’re always on the lookout for tools that can streamline your workflow and enhance your productivity. Today, we’re excited to introduce you to the Froala WYSIWYG Editor and its powerful PDF export feature.

Froala is a feature-rich, user-friendly text editor that allows you to create and format content with ease. Whether you’re writing blog posts, drafting technical documentation, or designing marketing materials, Froala’s intuitive interface and robust functionality make it a valuable asset in your content creation arsenal.

In this blog post, we’ll dive deep into the PDF export feature of the Froala WYSIWYG Editor, guiding you step-by-step on how to set it up and leverage it to your advantage.

Key Takeaways:

  • Froala Editor offers a built-in PDF export feature for professional documents.
  • Relies on html2pdf.js library for functionality.
  • Customize PDF output with page size, orientation, margins, and more.
  • CSS page-break rules give you precise control over document layout.
  • Boosts productivity for bloggers, developers, and content teams.


Downloading and Setting Up Froala WYSIWYG Editor

To get started, you’ll need to download the Froala WYSIWYG Editor. You can visit the pricing page and choose the plan that best suits your needs. Whether you’re a solo developer or part of a larger team, Froala offers a range of licensing options to accommodate your requirements. If you want to test the editor first, you can also take advantage of the free trial option.

Once you’ve downloaded and installed the Froala WYSIWYG Editor, it’s time to set it up. The process is straightforward and can be completed in a few simple steps:

  1. Include the necessary CSS and JavaScript files in your HTML document.
  2. Initialize the Froala Editor by adding the appropriate HTML element and JavaScript code.
  3. Customize the editor’s appearance and functionality by configuring the available options.

Here’s an example of how you can set up the Froala WYSIWYG Editor:

<!DOCTYPE html>
<html>

<head>
    <title>Froala WYSIWYG Editor</title>
    <!-- Include Froala CSS -->
    <link href="{{editor__download__folder}}/css/froala_editor.pkgd.min.css" rel="stylesheet"
        type="text/css" />
</head>

<body>
    <!-- HTML element where the editor will be initialized -->
    <div id="editor">
        <p>This is the initial content of the editor.</p>
    </div>


    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.pkgd.min.js"></script>

    <script>
        // Initialize the Froala Editor
        new FroalaEditor('#editor');
    </script>
</body>

</html>

This example demonstrates the basic setup for the Froala WYSIWYG Editor. You can further customize the editor by adding additional configurations to suit your specific needs.

Exploring the PDF Export Feature

Now that you have the Froala WYSIWYG Editor set up, let’s dive into the PDF export feature. This powerful functionality allows you to seamlessly convert your content into a professional-looking PDF document, making it easy to share, print, or archive your work.

Since we are using the packaged version of Froala “froala_editor.pkgd.min.js“, this feature is included by default.

If you’re using the basic version of Froala (froala_editor.min.js), you’ll need to include the Froala PDF export plugin in your project.

<script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.min.js"></script>
<script type="text/javascript" src="{{editor__download__folder}}/js/plugins/print.min.js"></script>

Make sure to include the “print” plugin in the list of enabled plugins:

new FroalaEditor('#editor', { 
       pluginsEnabled: ['print'],
});
 With the plugin in place, you can now add the PDF export button to your Froala Editor toolbar. Here's an example of how to do that:
new FroalaEditor('#editor', { 
       pluginsEnabled: ['print'],
       toolbarButtons: ['getPDF'],
});

This configuration will add an “Export PDF” button to your Froala Editor toolbar. However, users will still be unable to export the content as PDF documents. That’s because the PDF export feature depends on the html2pdf.jsopen-source library. You’ll need to include this library in your project as well. The “html2pdf.js” script must be included before the Froala scripts.

    <!-- Include js2htm library -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js"
        integrity="sha512-YcsIPGdhPK4P/uRW6/sruonlYj+Q7UHWeKfTAkBW+g83NKM+jMJFJ4iAPfSnVp7BKD4dKMHmVSvICUbE/V1sSw=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.min.js"></script>
    <script type="text/javascript" src="{{editor__download__folder}}/js/plugins/print.min.js"></script>

Note that, as mentioned on html2pdf.js site, there have been some issues reported with the latest version of html2pdf.js (v0.10), so it’s recommended to use version 0.9.3 for now.

Exporting Content as PDF

Now that you have the PDF export feature set up, let’s walk through the process of exporting your content as a PDF document.

  1. Add Content to the Froala Editor: Start by adding your desired content to the Froala WYSIWYG Editor. This could be a blog post, a technical guide, or any other type of content you want to export as a PDF.
  2. Click the PDF Export Button: Once you’ve finished editing your content, locate the “PDF Export” button in the Froala Editor toolbar and click it.

That’s it! You’ve successfully exported your Froala WYSIWYG Editor content as a PDF document. This feature is particularly useful when you need to share your work with others, print it, or archive it for future reference.

Export Editor Content to PDF Programmatically

The Froala Editor’s Print plugin provides a toPDF() method that allows you to export the editor’s content to a PDF document programmatically. This can be useful when you want to trigger the PDF export after a specific event, such as when the editor initializes.

Here’s an example of how to export the content to PDF right after the editor is initialized:

        // Initialize the Froala Editor
        new FroalaEditor('#editor', {
            pluginsEnabled: ['print'],
            toolbarButtons: ['getPDF'],
        }, function () {
            this.print.toPDF();


        });

The toPDF() method uses the default Froala PDF export options.

Customizing the PDF Export

If you want to customize the exported PDF, such as setting the orientation to portrait instead of landscape, you can use the html2pdf option provided by the Froala Editor.

The html2pdf option returns a function that gives you access to the html2pdf.js Worker object. With this object, you can trigger any html2pdf methods. Read more about how to use it in the html2pdf documentation.

You can use this object to configure the PDF settings and then export the editor’s content following this format editor.opts.html2pdf().set(configration).from(editor.el).save();.

Here’s an example:

        // Initialize the Froala Editor
        new FroalaEditor('#editor', {
            pluginsEnabled: ['print'],
            toolbarButtons: ['getPDF'],
        }, function () {

            let editor = this;

            editor.opts.html2pdf().set({
                margin: [10, 20],
                html2canvas: { useCORS: !0 },
                filename: 'new name.pdf',
                jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
            }).from(editor.el).save();
        });

In this example, we’re setting the following PDF options:

  • margin: Specifies the PDF margins in points.
  • html2canvas.useCORS: Enables CORS (Cross-Origin Resource Sharing) for the HTML2Canvas library, which is used to capture the editor’s content.
  • filename: Sets the name of the exported PDF file.
  • jsPDF: Configures the PDF document settings, such as the unit, page format, and orientation.

After setting the options, we use the from(editor.el) method to specify the editor element as the content to be converted to PDF, and then call the save() method to generate and download the PDF file.

Remember, setting the configuration incorrectly could result in an empty or incorrectly formatted PDF file, so be cautious when customizing the PDF export.

Adding Page Breaks

The html2pdf.js library automatically adds page breaks based on your CSS styles. You can use the break-before, break-after, and break-inside CSS properties to control where the page breaks should occur.

For example, you can add a page break before a specific element by applying the break-before: always style to it. This ensures that the element starts on a new page when you export the content to PDF.

Additionally, you can add the html2pdf__page-break class to any element, and html2pdf.js will insert a page break after that element. This is a legacy feature, but it can still be useful in some cases.

To summarize, make sure to add the appropriate CSS page break styles to your content. When you export the Froala Editor’s content to PDF, html2pdf.js will automatically insert the page breaks based on your CSS rules, resulting in a well-formatted PDF document.

Troubleshooting Common PDF Export Issues

Even with the correct setup, you may encounter issues when using the PDF export feature in Froala. Here are some common problems and fixes:

  • Blank or Empty PDF Output
    • Cause: Missing or misconfigured html2pdf.js library.
    • Fix: Ensure you’re using version 0.9.3 (not 0.10, which has known issues) and that it’s loaded before Froala scripts.
  • Incorrect Page Breaks
    • Cause: Missing CSS break rules.
    • Fix: Use break-before, break-after, or break-inside CSS properties. For finer control, apply the html2pdf__page-break class to elements.

 

.my-section {
  break-before: always; /* Forces this section to start on a new page */
}
  • Fonts or Images Not Loading
    • Cause: CORS restrictions.
    • Fix: Enable html2canvas: { useCORS: true } in your configuration and ensure external assets allow cross-origin requests.

 

editor.opts.html2pdf().set({
  html2canvas: { useCORS: true }
}).from(editor.el).save();
  • File Name Issues
    • Cause: No filename specified in config.
    • Fix: Add filename: ‘yourfile.pdf’ to the html2pdf().set() options.
  • Large File Sizes
    • Cause: High-resolution images or uncompressed content.
    • Fix: Reduce image size before uploading, or use Filestack transformations to optimize assets before export.

Conclusion

In this blog post, we’ve explored the powerful PDF export feature of the Froala WYSIWYG Editor. By following the step-by-step guide, you now know how to download and set up the Froala Editor, as well as how to leverage the PDF export functionality to streamline your content creation and sharing workflows.

Whether you’re a tech-savvy user or an entry-level developer, the Froala WYSIWYG Editor and its PDF export feature can be a valuable asset in your content creation toolkit. By mastering these tools, your users will be able to create professional-looking documents, enhance your productivity, and deliver high-quality content to their audience.

So, what are you waiting for? Download Froala, try out the PDF export feature, and start creating amazing content today!

Why Froala RTE is A Premier Choice for Content Creation in 2025

Froala rich text editor (RTE)

As the demands on rich text editors (RTEs) continue to grow, organizations and individuals are seeking powerful yet flexible content creation tools that can keep pace with their evolving needs. According to a recent industry report, the rich text editors software market is expected to reach a valuation of $2.5 billion by 2033, reflecting the increasing importance of these tools in today’s digital landscape.

In this dynamic landscape, our Froala RTE stands out as a premier choice for content creators in 2025 and beyond. With its exceptional customization capabilities, mobile-friendly design, and comprehensive content management features, Froala empowers users to elevate their work and stay ahead of the curve.

Key Takeaways:

  • Froala RTE stands out for its exceptional ease of implementation, allowing quick and seamless integration into a wide range of projects and applications.
  • Froala’s robust customization capabilities empower users to tailor the editor’s interface, functionality, and features to their unique needs and workflows.
  • The Froala-Filestack integration provides a comprehensive content management solution, streamlining file uploads, cloud-based storage, and asset organization.
  • Froala RTE offers seamless integration with cutting-edge AI tools like ChatGPT, enabling new collaborative and creative possibilities for content creation.
  • Froala’s transparent, fixed-rate pricing model and enterprise-grade support make it an attractive and affordable choice, especially compared to competitors with less transparent pricing.
  • Overall, Froala RTE’s customization, mobile optimization, content management capabilities, and AI integration make it a premier choice for content creation in 2025 and beyond.

Ease of Implementation

One of the key factors that makes Froala RTE an attractive choice is its ease of implementation. In a recent industry survey, 63% of respondents cited ease of implementation as their top priority when selecting a rich text editor (RTE).

Froala RTE excels in this area, offering a wide range of installation methods that make it simple to set up and integrate the editor into your products and applications. Froala supports over 10 popular technologies, including React, Angular, and Vue, allowing it to be seamlessly incorporated into a diverse array of projects.

The setup process is straightforward and requires only a few steps:

  1. Include the Froala CSS and JavaScript files:
<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. Add a DOM element to serve as the editor container:
<div id="example"></div>
  1. Initialize the Froala editor:
var editor = new FroalaEditor('#example');

That’s it! With these simple steps, you can quickly and easily integrate a professional-grade rich text editor into your web application.

Froala’s comprehensive documentation and extensive community support further ensure a smooth onboarding process, allowing developers to seamlessly incorporate the editor into their projects. This ease of implementation makes Froala RTE an excellent choice for organizations looking to enhance their content creation capabilities without the burden of complex integration challenges.

Robust Customization Capabilities

Customization is a critical feature for any rich text editor (RTE). According to a recent industry survey, over 80% of respondents want the ability to customize the toolbar, plugins, and overall appearance of their RTE. Froala RTE excels in this area, providing users with unparalleled control over the editor’s interface and functionality.

Customize the User Interface

With Froala RTE, users have complete control over the editor’s appearance. You can customize everything from the toolbar buttons and icons to the dropdowns, popups, and overall look and feel. This allows you to streamline the content creation experience to match your unique needs and preferences.

Whether you need to strip down the interface for less experienced users or add advanced functionality for power users, Froala’s flexibility ensures the RTE adapts to you, rather than the other way around. By tailoring the editor to your specific workflows and requirements, you can optimize the content creation process and boost productivity.

Extend Functionality with Custom Plugins

Beyond the user interface, Froala RTE also empowers you to customize the editor’s core functionality. The modular plugin architecture makes it easy to develop custom plugins, allowing you to modify existing features, add new capabilities, or integrate with third-party tools and services.

Unlike traditional monolithic RTEs, where everything is tightly coupled, Froala’s modular design gives developers the freedom to build, deploy, and scale custom components independently. This approach brings speed, flexibility, and innovation to the table, ensuring your content creation tools can evolve alongside your needs.

By leveraging Froala’s robust customization capabilities, you can create a tailored RTE that streamlines workflows, increases efficiency, and delivers a truly optimized content creation experience for your users.

Access to the Editor Source Code

For organizations that require the ultimate level of customization and control, Froala offers the “Architect” plan, which provides access to the full source code of the Froala RTE. This gives customers the ability to delve into the core of the editor and make extensive modifications to suit their unique needs.

With the Architect plan, customers can essentially treat the Froala RTE as an in-house developed solution, customizing every aspect of the editor’s functionality, appearance, and integration. This level of access and flexibility is particularly valuable for enterprises, government agencies, and other organizations with complex or specialized content creation requirements.

By owning the Froala RTE source code, customers can:

  • Integrate the editor seamlessly with their existing systems and workflows
  • Develop custom plugins and extensions to add new capabilities
  • Optimize performance and security to meet their specific compliance needs
  • Maintain full control over the editor’s roadmap and future development

The Architect plan empowers customers to truly make the Froala RTE their own, transforming it into a tailored content creation solution that is perfectly aligned with their business goals and user requirements. This unparalleled level of customization and control makes the Architect plan an attractive option for organizations seeking to future-proof their content creation capabilities.

Maintenance and Enterprise Support

Froala RTE offers robust enterprise-level support and maintenance, ensuring your content creation tools stay reliable and up-to-date. With regular updates that add new features, enhancements, and fix bugs, Froala RTE keeps pace with your evolving needs.

This gives content creators peace of mind, knowing their rich text editor will remain a dependable and capable solution. Froala’s extensive documentation and active developer community also provide ample resources for troubleshooting and customization.

Teams can easily get the most out of Froala RTE thanks to this comprehensive support. Instead of worrying about the underlying technology, you can focus your time and energy on creating great content. Froala RTE’s enterprise-grade maintenance and support allows you to future-proof your content creation workflows.

Security and Compliance

Froala RTE places a strong emphasis on security and compliance, ensuring that your users’ data remains protected. One of the key features is robust Cross-Site Scripting (XSS) protection, which guards against malicious code injection.

This security-focused approach allows organizations to meet their data privacy and regulatory requirements without compromising the user experience. By providing a secure rich text editing solution, Froala RTE is particularly well-suited for enterprises, government agencies, and other teams working with sensitive information.

With Froala RTE, you can have peace of mind knowing that your content creation workflows adhere to the latest security standards and compliance guidelines. This makes Froala an ideal choice for organizations that handle confidential data or operate in highly regulated industries.

Transparent and Affordable Pricing

One of the standout features of Froala RTE is its transparent and predictable pricing model. This makes it an attractive option compared to competitors like TinyMCE and CKEditor, which can have hidden fees and unpredictable costs.

Froala’s pricing is straightforward – you pay a  fixed annual fee that covers unlimited editor loads and unlimited end-users. There are no page view limits or overage charges, so you don’t have to worry about your costs spiraling as your usage grows.

This fixed-rate pricing model gives you clarity and control over your budget. You can plan ahead without the risk of surprise bills or hidden fees. Froala’s powerful features and enterprise-grade support make this an excellent value proposition, especially compared to less transparent pricing from other rich text editor providers.

Froala also offers a perpetual licensing option. With this, you make a one-time payment to access Froala updates for one year. After that, you can continue using the last release within that year without any additional fees. This is a great choice for organizations and individuals who want to maximize their investment in a rich text editing solution.

Overall, Froala’s transparent, fixed-rate pricing and perpetual licensing options set it apart in the market. Content creators and developers can adopt Froala RTE with confidence, knowing their content creation costs will be predictable and affordable.

Enterprise Performance

Froala RTE is designed for optimal performance, even in high-intensity applications. Its gzipped core is just 50KB, allowing you to integrate a powerful rich text editor without sacrificing page loading speed. This makes Froala RTE an excellent choice for performance-conscious projects.

One key factor behind Froala’s efficiency is its plugin-based architecture. Users can selectively enable only the features and functionality they require, minimizing the editor’s footprint and improving overall performance. This tailored approach ensures you don’t pay the penalty of unused code.

Moreover, Froala RTE seamlessly handles multiple text editors on the same page without any noticeable performance impact. This is achieved through an intelligent initialization process. The basic editor code is loaded when the page is first accessed, while the remaining functionality is only initialized when the user interacts with the editor.

This “on-demand” loading approach means that whether you have one or ten editors on a page, the user experience remains smooth and responsive, thanks to Froala’s efficient resource management. The editor only loads what’s necessary, when it’s necessary, keeping your application fast and responsive.

By optimizing both its core footprint and initialization, Froala RTE delivers an exceptional rich text editing experience without compromising performance, even in the most demanding applications. This makes Froala an ideal choice for organizations seeking a powerful, yet lightweight, content creation solution.

Unparalleled Mobile Experience

In today’s world, mobile content creation is essential. Froala RTE is designed from the ground up to provide an exceptional mobile experience, allowing users to seamlessly transition between desktop and mobile devices without compromising functionality or efficiency.

Froala’s fully responsive design ensures a consistent, intuitive interface across all devices – from desktops to the latest smartphones and tablets. Whether drafting a blog post on the go or finalizing a presentation on the train, Froala users can maintain their productivity and creative flow without interruption.

One standout feature of Froala RTE is its ability to customize the toolbar for different screen sizes. Using options like toolbarButtons, toolbarButtonsMD, toolbarButtonsSM, and toolbarButtonsXS, you can configure the toolbar buttons that appear on large, medium, small, and extra-small screens. This allows you to optimize the user experience for each device, ensuring critical functionality is always within reach.

new FroalaEditor('div#froala-editor', {
  toolbarButtons: {
    // Toolbar buttons for larger screens
  },
  toolbarButtonsXS: [
    // Toolbar buttons for extra-small screens
  ]
});

This mobile-first approach is particularly valuable in industries where content creation often happens outside the traditional office, such as journalism, marketing, and education. By empowering users to work seamlessly across devices, Froala RTE helps organizations and individuals future-proof their content creation workflows and stay ahead of the curve.

Robust Content Management Capabilities

As the digital landscape evolves, content is becoming increasingly dynamic and complex, with a greater emphasis on multimedia elements, interactive features, and sophisticated formatting. Froala RTE rises to the challenge, offering a comprehensive suite of content management features that empower users to bring their visions to life without having to work around technical limitations.

Froala RTE’s content management capabilities include support for embedded media, advanced tables, and custom styling, providing users with the tools necessary to handle even the most complex content requirements. This comprehensive set of content management features is essential in a world where audiences expect increasingly sophisticated and engaging content experiences.

Froala RTE empowers users to create and publish dynamic, feature-rich content, the editor helps organizations and individuals stand out in an increasingly crowded digital landscape. Whether it’s an interactive product guide, a data-driven infographic, or a visually stunning long-form article, Froala RTE provides the comprehensive content management features to bring these ambitious content projects to life.

Powerful Content Management with Filestack Integration

When it comes to content management we should mention the editor’s seamless integration with Filestack, a leading content management and file upload platform. This powerful combination elevates Froala RTE to the next level, providing users with a comprehensive content creation and management solution.

The Froala-Filestack integration offers a streamlined, end-to-end content workflow. Users can easily upload files from a variety of sources – including local devices, cloud storage, and external websites – directly into the Froala RTE. Filestack’s reliable and lightning-fast file delivery ensures that media assets are quickly available within the editor, boosting productivity and efficiency.

Moreover, Filestack’s cloud-based storage capabilities allow users to securely manage and organize their content assets, ensuring they are easily accessible whenever needed. This tight integration between Froala RTE and Filestack’s content management features empowers users to create, edit, and publish rich, engaging content without having to juggle multiple tools or platforms.

By leveraging the Froala-Filestack integration, content creators can focus on their core tasks, confident that the underlying content management and file handling processes are seamless and efficient. This powerful combination elevates Froala RTE to become a truly comprehensive content creation solution, making it an even more compelling choice for organizations and individuals looking to future-proof their content workflows.

Seamless AI Integration

As the demands on content creators continue to grow, the integration of AI technology is becoming increasingly crucial for rich text editors (RTEs). Froala RTE stands out in this regard, offering seamless integration with cutting-edge AI tools and assistants.

Froala’s flexible architecture allows it to be easily integrated with popular AI platforms like ChatGPT, Anthropic’s Gemini, and DeepSeak. This empowers users to leverage the power of these advanced language models directly within the Froala RTE, transforming it into an “AI-powered” editor.

With these integrations, users can engage in natural language conversations with the AI assistant, asking it to generate, enhance, or expand upon the content they’re working on. The AI can provide suggestions, ideas, and even complete paragraphs or sections, seamlessly integrating with the Froala RTE to deliver a truly collaborative content creation experience.

This AI-powered functionality not only boosts productivity but also introduces new creative possibilities. Users can explore different writing styles, experiment with new approaches, and tap into the AI’s expansive knowledge to elevate their content in ways that were previously unimaginable. By embracing the synergy between Froala RTE and leading-edge AI tools, content creators can future-proof their workflows and stay ahead of the curve in an increasingly competitive digital landscape.

The Froala Advantage

In a rapidly evolving content creation landscape, Froala RTE stands out as a premier choice for users in 2025 and beyond. Froala RTE’s unparalleled customization capabilities, mobile-friendly design, and comprehensive content management tools make it an indispensable asset for organizations and individuals alike.

Froala RTE’s transparent and affordable pricing, with fixed-rate plans that cover unlimited editor loads and users, makes it an excellent value proposition compared to competitors with less transparent pricing models. The editor’s seamless integration with cutting-edge AI tools like ChatGPT further elevates the content creation experience, empowering users to leverage the power of generative AI directly within the Froala RTE.

Froala RTE empowers users to tailor the editor to their specific needs, seamlessly create and edit content on the go, and collaborate effortlessly with team members, helping to future-proof content creation workflows and ensuring that users can stay ahead of the curve.

In a world where content is the lifeblood of modern business and communication, Froala RTE is the essential tool for anyone looking to elevate their content creation capabilities and deliver truly engaging, dynamic, and impactful experiences to their audiences.

Experience the power of Froala RTE for yourself – try it free today.

 

How to Add Virus Detection Capabilities in Your HTML Editor Software

A shield with the "WYSIWYG" text displayed, representing how HTML editor software can help protect against security threats through virus detection capabilities.

Today, HTML editor software goes beyond creating clean code or supporting rich text capabilities. It has transitioned into a gateway where users can introduce files, scripts, and external resources into a system. Without proper safeguards, these entry points turn into opportunities for attackers.

Malicious scripts hidden in HTML, infected file uploads disguised as harmless images, or embedded links are potential threats. These attacks are subtle yet powerful enough to compromise entire websites, spread malware, or even steal sensitive user information. With the rise of these vulnerabilities, protecting your infrastructure and users is a top priority.

Thankfully, some of the best HTML editors come with virus and malware detection software. These transform an HTML editor from a simple content tool into a safer environment. For businesses, developers, and content creators alike, this functionality is essential for preserving trust.

In this article, you’ll discover common HTML editor software security risks and some of the benefits that virus detection brings. Additionally, you’ll learn how to implement this using a file management tool from within the editor. Lastly, you’ll see some useful tips that could help you secure your HTML editors further.

Key Takeaways

  • HTML editor software is a frequent entry point for malware due to file uploads and embedded scripts.
  • Virus detection capabilities protect both end-users and organizations from hidden threats.
  • Cross-site scripting (XSS) and disguised file uploads are two of the most common attack vectors.
  • You can use Filestack’s virus detection feature, embedded into your HTML editor, to scan file uploads for any potential threats.
  • Regular updates, SSL/TLS connections, and penetration testing help strengthen long-term protection.

Understanding Security Risks in HTML Editors

HTML editors handle a variety of content types, which makes them prime targets for attackers.

Cross-site scripting (XSS) is one of the most common risks for HTML editor software. It involves embedding malicious JavaScript through a web application to a different end user. When unsuspecting users view the content, the script executes, potentially stealing cookies, session tokens, and sensitive information in the browser.

A simple explanation of how XSS works.

HTML editors allow users to upload their own files, which led attackers to exploit file uploads. For instance, an attacker might disguise an executable file (.exe) as an image or PDF, slipping it past filters. Once it reaches the server, the malicious file could then spread malware across the server or end-user machines.

External resources, such as scripts or iframes from unsafe domains, also present risks. These can redirect users to phishing pages or inject malware into otherwise trusted websites.

The impact of these common security risks is wide-ranging. For example, these could lead to small-scale site defacement, which hinders UX and even endangers your users. These could also cause large-scale data breaches that can damage brand reputation and create legal liability.

Why Virus Detection Matters in HTML Editor Software

Building virus detection directly into HTML editor software addresses these threats before they spread.

Firstly, it protects end-users by preventing them from unintentionally executing harmful code. For example, if an employee accidentally pastes scripts from untrusted sources into a company knowledge base, virus scanning can catch it before publication.

Virus detection can also shield businesses from the costly consequences of a compromised system. These can range from customer distrust to regulatory fines under GDPR, HIPAA, or other regulations. By ensuring that only sanitized, secure content enters the system, organizations also strengthen compliance while preserving their reputation.

Finally, virus detection creates a safer collaborative environment. Teams can focus on editing, formatting, and publishing without worrying about hidden threats lurking in their content.

Core Features of Virus Detection in HTML Editors

Effective virus protection inside HTML editor software relies on multiple layers of defense.

  • File upload scanning helps ensure that images, PDFs, or documents don’t contain hidden malware from entering shared content libraries.
  • Script validation checks embedded JavaScript, inline events, or external iframes for suspicious behavior. For example, an editor could block inline onload events that might trigger attacks.
  • Real-time monitoring continuously scans content for threats, flagging issues as soon as they occur rather than after files reach the server.
  • Quarantine & alerts isolate harmful files and notify administrators or security immediately. This ensures fast remediation without disrupting normal content workflows.

Any of these can greatly contribute to your infrastructure’s security, but you can combine these together for better effect. For example, you can integrate quarantine and alerts into file upload scanning to automatically isolate potentially infected files.

Technical Approaches to Implement Virus Detection

There are several ways to integrate virus detection into HTML editor software, each with strengths and trade-offs.

Integration with Antivirus Engines

This is the most direct approach, as this involves using ready-made tools. For example, you can use ClamAV, VirusTotal API, or other proprietary SDKs to scan files before storing them. These APIs act as external security services, which can return a “clean” or “infected” result.

Sandboxing & Heuristic Analysis

A sandbox with some viruses inside, signifying the sandboxing process, which contains suspicious files to observe their behaviors, in servers.

This provides advanced protection by executing suspicious files in a controlled environment (sandbox), analyzing behavior instead of signatures. For example, a file that tries to open unexpected network connections would result in a “malicious” flag. As a result, this method helps identify even new and unknown threats. Think of sandboxing like a safe play area for testing suspicious files.

Heuristic analysis uses rules and algorithms to predict whether a file is malicious based on its structure, instructions, or resemblance. For example, if a program has obfuscated code, tries to self-modify, or calls suspicious APIs, heuristics might flag it even before execution.

Signature-based Scanning vs. Behavior-based Detection

Signature-based scanning matches files against known malware fingerprints. It’s fast, but it’s limited by zero-day threats. By contrast, behavior-based detection identifies anomalies in how a file or script acts. A robust system often combines both methods.

Note that behavior-based detection is different from sandboxing and heuristics in that it watches live or real-time behavior of the file on a system. In contrast, sandboxing and heuristics occur in simulations or predictions (pre-check instead of live).

Content Sanitization

This approach helps ensure that only clean or safe HTML survives by stripping out unsafe HTML, JS, and inline events. Tools like DOMPurify or OWASP HTML Sanitizer can help keep your website safe from XSS attacks.

Note: Sanitization is not just a backup measure. You should include it as a default safeguard even if antivirus scanning is in place. Even better, you can opt to use distraction-free HTML editor software that has built-in XSS protection.

Note: Each of these approaches comes with its own limitations or challenges, such as cost or scalability. It’s important to balance these according to your needs, but in general, security is always a good investment.

Step-by-Step Guide to Adding Virus Detection in HTML Editor Software

Building security into your HTML editor follows a structured process.

1. Define Security Requirements

Decide which content types need scanning: file uploads, embedded HTML (or scripts), or external resources. In most cases, you’ll need to protect against vulnerabilities for all three. In this example, we’ll focus more on protecting against malicious file uploads through Filestack’s virus detection feature.

To get started, ensure that you have a Filestack account with the Virus Detection feature active. You should also have access to Filestack Workflows, which lets you automate file processing and chain tasks together. 

Furthermore, you’ll need Filestack’s Webhooks. This allows you to add endpoints to which Filestack will send the result of the virus detection task. This guide also uses Beeceptor, which creates a mock endpoint for webhook or API simulation.

Lastly, you’ll need Froala’s v4.3 or higher, as it natively contains Filestack in the editor.

2. Integrate File Upload Security

We want the application to work so that it doesn’t store suspicious or malicious uploads. This also means that we’ll store safe files normally. To do this, log into your Filestack account through the Dev Portal.

After logging in, click the “Workflows” tab from the menu and click “Create New.” After naming your workflow, click the plus button, and from the “Intelligence” tab, choose “virus_detection.” This creates a new virus detection task in your workflow.

Filestack Workflow's different features/processes. The virus_detection one is highlighted.

Afterwards, create another task by searching for “virus_detection” and adding a new condition through a button above. Set the path to “infected,” the condition to “eq,” and the value to “false.” This makes the workflow store the file if there are no viruses present (the infected field is set to false).

You could also use the same logic to create a condition for removing infected files (the infected field is set to true).

Next, open Beeceptor and create a mock endpoint or server. Go back to Filestack’s dashboard, click “Webhooks” under the Configuration tab, and add the URL of your endpoint. Don’t close your Beeceptor tab yet (if you’re using it), since you’ll revisit this after uploading an image.

Once that’s settled, go to your JavaScript file and paste the following code. Make sure that you have an element in your DOM that has the “#froala-editor” identifier.

new FroalaEditor('#froala-editor',{
    filestackOptions: {
        filestackAPI: 'YourAPIKey',
        uploadToFilestackOnly: true,
        pickerOptions: {
            fromSources: ['local_file_system'],
            storeTo: {
                workflows: ["yourWorkflowID"]
            }
        }
    },
    toolbarButtons: {
        'moreRich': {
            'buttons': ['openFilePickerImageOnly', 'openFilePicker', 'insertLink', 'insertTable', 'emoticons', 'specialCharacters', 'insertHR'],
            'buttonsVisible': 3
        },

        'moreText': {
            'buttons': ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'clearFormatting']
        },

        'moreParagraph': {
            'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
        },
        'moreMisc': {
            'buttons': ['undo', 'redo', 'fullscreen', 'selectAll', 'html', 'help'],
            'align': 'right',
            'buttonsVisible': 2
        }
    },
    events: {
        'filestack.uploadedToFilestack': function (response) {
            console.log(response.filesUploaded[0]);
        },
        'filestack.uploadFailedToFilestack': function (response) {
            console.log(response);
        },
    },
    heightMin: 500,
    heightMax: 1000
});

This code configures Froala Editor as well as the natively integrated Filestack features. Update the fields with your actual API key and Filestack Workflow ID. You can also change, add, or remove different features and plugins here, since Froala follows the standard modular architecture in HTML editors.

3. Run the Application

Using a browser, run your application. Afterwards, click the Filestack icon to upload a file.

An image of an orange cat is uploaded into the editor through Filestack.

Should the file contain any viruses, the virus detection workflow will remove it or not store it. Otherwise, it will store it normally. This example shows the upload of a harmless picture of a cat. Thus, the workflow should allow the storing of this image.

The uploaded image is now on the HTML editor software.

After the upload, the file appears on the editor. This tells you that the file is safe and doesn’t contain any viruses or malware. If you open the browser console, you’ll also see the following file metadata from the uploaded file:

The result of the file upload from within the HTML editor software. From this image, one can imply that the file is safe because of its "Stored" status.

This shows the file’s name, handle, path, and other information. More importantly, we can see that its status is “Stored,” which means that it’s a safe and valid file. From here, you can implement other security measures as well as file processing features (e.g., content safety, image tagging).

Now, go back to your Beeceptor webhook endpoint (or your actual endpoint). You should see a request from Filestack, which may look similar to the following image:

The Filestack request from Workflows to Beeceptor's mock endpoint. This shows the data in a JSON format.

From the Filestack request, you’ll notice the “virus_detection” workflow result, which contains  “infected” and “infections_list” properties. Since the “infected” property is false and the list of infections is empty, the file doesn’t contain any viruses.

Best Practices for Secure HTML Editor Development

Adding virus detection is powerful, but you should maintain it with best practices. Here are some effective and common tips to further secure your application.

  • Keep antivirus signatures up-to-date so your system recognizes the latest threats.
  • Limit accepted file types to reduce risk. Allow only images, PDFs, safe document formats, or only the file formats that you need.
  • Use SSL/TLS encryption for secure communication with antivirus APIs.
  • Sandbox the HTML editor from the underlying operating system to contain and isolate potential exploits.
  • Educate end-users with prompts and warnings about safe file handling. At the same time, check the file sizes, file types, and other metadata of all uploads.
  • Enable real-time threat alerts for both users and administrators.
  • Run regular penetration tests to validate that your defenses hold up against evolving threats.

Note: Even the most advanced scanning system won’t stop every possible threat. Combine virus detection, sanitization, user training, and other methods to create a layered security strategy.

Conclusion

In HTML editor software, you can’t think of security as an afterthought. With users constantly uploading files, pasting external code, and embedding links, actions can turn into possible entry points for malware. Thus, virus detection is vital to secure HTML editors.

By integrating virus detection, sanitization, and real-time monitoring, editors evolve from simple text tools into secure environments that protect both businesses and end-users. For teams building, customizing, or integrating HTML editors, it’s clear that secure editing is better editing.

Looking to enhance your HTML editor with security features? Explore integration-ready tools and start building a safer editing experience.

Optimizing Vue Applications for HTML Code Writers: Initializing Froala Editor on Click

Optimizing Vue Applications for HTML Code Writers

The Froala Vue WYSIWYG Editor is a powerful tool that allows developers to easily incorporate a rich text editing experience into their Vue.js applications. With its user-friendly interface and extensive customization options, the Froala html code writer provides a seamless editing experience for users.

We have covered the integration process of Froala and Vue before. However, in some applications, developers may need to initialize the Froala Vue WYSIWYG Editor by clicking on a certain element. By manually initializing the editor on click, developers can control when the editor appears on the page. This helps optimize your application load speed especially if you have more than one editor on the page.

In this article, we will guide you through the process of initializing the Froala Vue WYSIWYG Editor on click. We will cover the necessary prerequisites, step-by-step instructions, and customization options to help you make the most out of this powerful editing tool.

By the end of this guide, you will have a solid understanding of how to set up and initialize the editor on click. So let’s dive in and explore the benefits and importance of on-click initialization for the Froala Vue WYSIWYG Editor.

Froala Editor
Froala Editor

 

prerequisites

We assume you have a working knowledge of:

  • JavaScript (including some of the newer, ES2015 features)
  • Vue 3
  • How to use the terminal/command line
  • Node and npm

Create a simple Vue project.

To create a new Vue.js project, run the following commands.

npm install -g @vue/cli

vue create my-froala-vue-app

The above commands will install the Vue CLI globally on your machine and then create a new Vue project called “my-froala-vue-app”.

Install the Froala WYSIWYG Editor package.

Next, you need to install the Froala WYSIWYG Editor package. To do this, navigate to your project directory and run the following command:

cd my-froala-vue-app

npm install vue-froala-wysiwyg

This will install the Froala WYSIWYG Editor package and its dependencies into your project.

Import the Froala WYSIWYG Editor Component

To use the Froala WYSIWYG Editor in your Vue application, you need to import the component. Copy the following code into your “main.js” file.

import { createApp } from "vue";
import App from "./App.vue";

//Import Froala Editor plugins
import "froala-editor/js/plugins.pkgd.min.js";

// Import Froala Editor css files.
import "froala-editor/css/froala_editor.pkgd.min.css";
import "froala-editor/css/froala_style.min.css";

// Import Froala Editor component
import VueFroala from "vue-froala-wysiwyg";

const app = createApp(App);

app.use(VueFroala);
app.mount("#app");

This code imports the VueFroala component from the `vue-froala-wysiwyg` package and registers it. This allows you to use the Froala WYSIWYG Editor component in your Vue components.

Initialize the Froala Vue WYSIWYG Editor on Click

We will add the following code to the “app.vue” file.

<template>
  <div id="app">
    <h1>Vue adapter for the Froala WYSIWYG editor</h1>

    <div class="sample">
      <h2>Sample 4: Manual Initialization</h2>
      <button class="manual" v-on:click="createEditor()" v-if="!showEditor">
        Initialize Editor
      </button>
      <button v-on:click="destroyEditor()" v-if="showEditor">
        Close Editor
      </button>
      <button v-on:click="deleteAll()" v-if="showEditor">Delete All</button>
      <froala
        id="sample5"
        :onManualControllerReady="initialize"
        v-model:value="sample3Text"
      >
        <template v-slot>
          <div>
            Check out the
            <a href="https://www.froala.com/wysiwyg-editor">Froala Editor</a>
          </div>
        </template>
      </froala>
    </div>
  </div>
</template>

<script>
export default {
  name: "app",
  data() {
    return {
      // Sample 4
      sample3Text: null,
      initControls: null,
      showEditor: false,
      deleteAll: null,
      destroyEditor: () => {
        this.initControls.destroy();
        this.showEditor = false;
      },
      createEditor: () => {
        this.initControls.initialize();
        this.showEditor = true;
      },
      initialize: (initControls) => {
        this.initControls = initControls;
        this.deleteAll = () => {
          this.initControls.getEditor().html.set("");
          this.initControls.getEditor().undo.reset();
          this.initControls.getEditor().undo.saveStep();
        };
      },
    };
  },
  created() {},
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  margin-top: 60px;
}
body {
  padding: 20px;
}

.sample {
  padding-bottom: 50px;
  margin-left: 30px;
  border-top: 1px solid lightgray;
}

.manual {
  margin-bottom: 20px;
}

.button {
  margin-left: 5px;
}
</style>

Let’s break down the code step by step:

The code above defines three buttons: one for initializing the editor when it is not loaded on the page, and the other two buttons appear when the editor is shown. One button is for destroying the editor, and the other is used to clear the editor’s contents.

<h2>Sample 4: Manual Initialization</h2>
<button class="manual" v-on:click="createEditor()" v-if="!showEditor">
  Initialize Editor
</button>
<button v-on:click="destroyEditor()" v-if="showEditor">
 Close Editor
</button>
<button v-on:click="deleteAll()" v-if="showEditor">Delete All</button>

The showEditor is a data property that determines whether the editor is currently shown or not. It is initially set to false. The createEditor method is called when the “Initialize Editor” button is clicked, and it sets showEditor to true and initializes the editor. The destroyEditor method is called when the “Close Editor” button is clicked, and it destroys the editor and sets showEditor back to false. The deleteAll method is called when the “Delete All” button is clicked, and it clears the editor contents.

Our “app.vue” code also includes the Froala Vue component. It has an id of sample5 and a v-model binding to the sample3Text data property. This :onManualControllerReady is used to bind the initialize method to the Froala editor’s manual controller. This allows us to access the editor’s methods and perform actions such as clearing the editor’s contents.

      <froala
        id="sample5"
        :onManualControllerReady="initialize"
        v-model:value="sample3Text"
      >

The initialize method is called when the editor is initialized, and it receives the initControls object as a parameter. Developers can obtain instances of the FroalaEditor object by using the getEditor() method of the initControls object. This allows them to easily access and utilize any Froala API method.

<script>
export default {
  name: "app",
  data() {
    return {
      // Sample 4
      sample3Text: null,
      initControls: null,
      showEditor: false,
      deleteAll: null,
      destroyEditor: () => {
        this.initControls.destroy();
        this.showEditor = false;
      },
      createEditor: () => {
        this.initControls.initialize();
        this.showEditor = true;
      },
      initialize: (initControls) => {
        this.initControls = initControls;
        this.deleteAll = () => {
          this.initControls.getEditor().html.set("");
          this.initControls.getEditor().undo.reset();
          this.initControls.getEditor().undo.saveStep();
        };
      },
    };
  },
  created() {},
};
</script>

Finally, we have a `template` block inside the Froala component where we can add additional HTML content. In this example, we have simple text and a link to the Froala Editor website.

  <template v-slot>
    <div>
      Check out the
      <a href="https://www.froala.com/wysiwyg-editor">Froala Editor</a>
    </div>
  </template>

That’s it! You have now created a simple Vue project with the Froala html code writer integrated. You can now run your Vue project and see the Froala Editor in action.

Run the Vue App

To run the Vue app and see the Froala Vue WYSIWYG Editor in action, navigate to your project directory and run the following command:

npm run serve

This will start the development server at http://localhost:8080

The benefits of loading Froala on click

Loading the Froala Vue WYSIWYG editor on click offers several benefits for developers. It helps improve the initial loading time of the webpage. By deferring the loading of the editor until it is actually needed, developers can ensure that their web pages load quickly and efficiently. This can lead to a better user experience, as visitors won’t have to wait for the editor to load if they don’t plan on using it.

Additionally, loading the Froala editor on click allows developers to save resources and optimize performance. Since the editor is only loaded when necessary, it doesn’t consume unnecessary memory or processing power. This can help improve the overall performance of the webpage and prevent any unnecessary strain on the user’s device.

Moreover, loading the Froala editor on click provides a more seamless and intuitive user experience. Instead of having the editor visible at all times, it only appears when the user explicitly chooses to use it. This allows for a cleaner and less cluttered interface, making it easier for users to focus on the task at hand.

Conclusion

The Froala WYSIWYG Editor is a powerful tool for creating rich text content in web applications. In this tutorial, we learned how to integrate the Froala Editor with a Vue.js project and initialize it on click. This approach offers numerous benefits in terms of performance, user experience, and resource optimization.

Now that you have learned how to integrate and initialize the Froala Editor on click, why not give it a try in your own Vue.js projects? With its user-friendly interface and extensive customization options, the Froala Editor offers a seamless editing experience for your users. Experience the power of the Froala Editor today and enhance the content creation capabilities of your web applications.

Get started with the Froala Vue WYSIWYG Editor now and unleash the full potential of your web applications!

Embedding Emotion: Emoji Integration with Froala Editor

Emoji Integration with Froala Editor

Emojis have evolved from a niche Japanese communication tool to a global, universal language that transcends linguistic and cultural barriers. When strategically incorporated, these expressive icons can enhance professional communication by clarifying tone, conveying emotional nuance, and improving engagement.

The Froala Editor’s Emoticons plugin provides a robust and customizable solution for seamlessly integrating these emotive elements into web applications. By leveraging this powerful plugin, developers can create more engaging, human-centered digital experiences that resonate with their audience.

Dive into the origins of emoji, explore their cultural impact, and discover how the Froala Emoticons plugin can elevate your web content to new heights of expressiveness and connection.

Key Takeaways

  • Emojis have evolved from a niche Japanese communication tool to a global, universal language that transcends linguistic and cultural barriers.
  • Strategically used emojis can enhance professional communication by clarifying tone, conveying emotional nuance, and improving engagement.
  • The Froala Editor’s Emoticons plugin provides a robust and customizable solution for seamlessly integrating expressive emojis into web applications.
  • By leveraging the Emoticons plugin, developers can create more engaging, human-centered digital experiences that resonate with their audience.

Origins of Emoji

The story of emoji begins in Japan during the late 1990s, a time when digital communication was rapidly evolving. Shigetaka Kurita, working for NTT DoCoMo, a Japanese mobile phone operator, created the first set of 176 emoji in 1999. These simple 12×12 pixel images were designed to enhance mobile communication, providing a way to convey emotions and context that text alone couldn’t capture.

Originally, these icons were a solution to a specific problem: how to make digital communication more nuanced and expressive on the limited screen space of early mobile phones. Kurita drew inspiration from manga, kanji characters, and international symbols, creating a visual language that could transcend traditional text-based messaging.

Technical Evolution

The real breakthrough came with Unicode standardization. In 2010, Unicode began officially encoding emoji, transforming them from a Japanese mobile phone novelty to a global communication tool. This standardization meant that an emoji sent from an iPhone in New York could be correctly displayed on an Android device in Tokyo.

The Unicode Consortium now manages emoji development, with new characters added annually. What started as 176 icons has exploded into hundreds of diverse emoji representing people, objects, activities, and complex emotions. Each new release reflects ongoing efforts to increase representation and cultural inclusivity.

Cultural Impact

Emojis have fundamentally transformed how we communicate digitally. They provide emotional nuance impossible in plain text, allowing users to convey tone, humor, and sentiment with a single character. A thumbs-up, a heart, or a crying face can communicate volumes more efficiently than paragraphs of text.

More significantly, emojis have become a quasi-universal language. They transcend linguistic barriers, enabling communication across cultures and languages. A smile is a smile, regardless of whether you speak English, Mandarin, or Arabic.

Emoji in Professional Communication: Enhancing Content and Engagement

Contrary to early assumptions, emoji have found significant utility in professional communication, particularly in emails. Far from being unprofessional, strategically used emoji can enhance message clarity, emotional intelligence, and engagement.

In email communication, emoji serve several critical functions:

  1. Tone Clarification: In text-based communication, tone is notoriously difficult to convey. An emoji can instantly soften a directive, express gratitude, or add warmth to an otherwise clinical message. A simple 👍 can confirm understanding more effectively than a terse “OK.”
  2. Emotional Nuancing: Emoji allow senders to communicate emotional subtext that might be lost in plain text. A 😊 can transform a routine communication into a more personable interaction, building rapport in professional relationships.
  3. Cross-Cultural Communication: In global business environments, emoji can bridge communication gaps, providing emotional context that might be lost in translation or across different communication styles.
  4. Engagement Metrics: Research has shown that emails and messages with carefully selected emoji have higher open and response rates, particularly among younger professionals.

Practical Examples

  • A thank-you email with a 🙏 feels more genuine than a formulaic message.
  • A project update with a 🚀 suggests enthusiasm and progress.
  • A gentle reminder with a 😊 feels less confrontational than a stern text.

However, emoji use requires cultural sensitivity and contextual awareness. The key is moderation and appropriateness to the professional environment.

The Modern Challenge of Emoji Integration

As emoji have become a fundamental part of digital communication, web developers and content creators face a critical challenge: seamlessly integrating these expressive icons into their content platforms. The Froala Editor emerges as a powerful solution to this challenge, offering sophisticated emoji integration that goes beyond simple icon insertion.

Froala Emoticons Plugin: An Overview

The Froala Emoticons plugin represents a sophisticated approach to emoji integration, providing developers and content creators with a robust toolset for adding and customizing emoji within web applications.

Key Features

  • Comprehensive emoji library
  • Customizable emoji sets
  • Easy integration with web applications
  • Responsive design compatibility
  • Multiple insertion methods

Froala emoji plugin

Installation and Setup of Emoticons Plugin

Plugin Inclusion

The Emoticons plugin is included with the full Froala editor package (`.pkgd`). Custom implementations require manual addition of two files:

  • JavaScript: /js/plugins/emoticons.min.js
  • Stylesheet: /css/plugins/emoticons.min.css

Enabling the Emoticons Plugin

To enable the Emoticons plugin, include emoticons in the pluginsEnabled array when customizing the editor’s enabled plugins.

new FroalaEditor('#editor', { 
       pluginsEnabled: ['emoticons', 'fontFamily', 'image', 'link', 'video']
    });

Adding Toolbar Button

To add an Emoticons button when customizing the editor’s toolbar, include emoticons in your toolbar configuration.

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

The Emoticons Plugin Configuration

Clicking the Emoticons button on the editor toolbar opens a popup containing all available emoticons. This popup can be customized using the following options:

emoticonsSet Option

This configuration allows you to customize the emoji groups displayed in the popup.

This option is an array of objects. Each object represents an emoticon group that has the following properties:

  • id: Unique identifier for the emoji group
  • name: A name or title of the emoticons group. It will appear to the users when they hover over the group icon.
  • code: Unicode for the group’s representative emoji
  • emoticons : An array of objects, each representing an emoticon in the group. Each object contains the emoticon’s code and description. For instance, the Grinning face emoticon is represented as { code: "1f600", desc: "Grinning face" }
new FroalaEditor('div#froala-editor', {
    toolbarButtons: ['bold', 'italic', 'emoticons'],
    emoticonsSet: [{
      id: 'people',
      name: 'Smileys & People',
      code: '1f600',
      emoticons: [
        { 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' }
      ]
    }, {
    'id': 'nature',
    'name': 'Animals & Nature',
    'code': '1F435',
    'emoticons': [
      { code: '1F435', desc: 'Monkey Face' },
      { code: '1F412', desc: 'Monkey' },
      { code: '1F436', desc: 'Dog Face' },
      { code: '1F415', desc: 'Dog' },
      { code: '1F429', desc: 'Poodle' },
      { code: '1F43A', desc: 'Wolf Face' },
      { code: '1F431', desc: 'Cat Face' },
      { code: '1F408', desc: 'Cat' },
      { code: '1F42F', desc: 'Tiger Face' },
      { code: '1F405', desc: 'Tiger' },
      { code: '1F406', desc: 'Leopard' },
      { code: '1F434', desc: 'Horse Face' },
      { code: '1F40E', desc: 'Horse' },
      { code: '1F42E', desc: 'Cow Face' },
      { code: '1F402', desc: 'Ox' },
      { code: '1F403', desc: 'Water Buffalo' },
      ]
    }]
  })

emoticonsUseImage Option

The editor uses EmojiOne SVG images to represent the emoticon by default, but can be configured to use Unicode text instead by setting emoticonsUseImage to false.

new FroalaEditor('div#froala-editor', {
    toolbarButtons: ['bold', 'italic', 'emoticons'],
    emoticonsUseImage: false,
 })

emoticons.insert Method

The plugin also provides a method for programmatically inserting emoticons into the editor, with the following parameters:

  • `code`: The Unicode code point of the emoticon to insert.
  • `image`: Image to be inserted when the emoticonsUseImage option is enabled.
var editor = new FroalaEditor('.selector', {}, function () {
  // Call the method inside the initialized event.
  editor.emoticons.insert("&#x1f600;", "https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/1f601.svg");
})

Frequently Asked Questions About Emoji and Froala Editor

What is the Froala Emoticons plugin?

The Froala Emoticons plugin is a feature that allows developers to easily integrate and customize emojis used in the editor. It allows users to easily insert and manage emojis within the content created by Froala Editor.

Are emojis professional in business communication?

When used strategically and sparingly, emoji can enhance communication by adding emotional nuance and building rapport, especially in digital and global business environments.

Can I customize the emoji set in Froala?

Yes, you can create custom emoji sets using the emoticonsSet configuration option, allowing you to define specific groups and icons.

Does the Emoticons plugin impact website performance?

The plugin is designed to be lightweight and has minimal performance overhead when properly implemented.

Is the Froala Emoticons plugin cross-browser compatible?

Yes, the plugin is designed to work consistently across modern browsers, including Chrome, Firefox, Safari, and Edge.

What’s the future of emoji in web communication?

Emojis are increasingly becoming a universal language, with advanced AI and AR technologies likely to create more sophisticated and contextual emoji integration.

Conclusion

The Froala Editor’s Emoticons plugin represents more than just a technical solution—it’s a bridge between expressive communication and sophisticated web design, enabling developers to create more engaging, human-centered digital experiences.

Take the first step towards more compelling content – explore the Froala Editor’s Emoticons plugin and its comprehensive features and customization options today. Empower your users to communicate with greater emotional depth and connection, and watch as your digital experiences come alive with the power of expressive emojis.

The Developer’s Ultimate Guide to Froala’s Find and Replace Plugin

In the world of web development and text editing, efficiency is key. Whether you’re managing large documents or simply trying to clean up text, having a robust find and replace functionality can save countless hours of manual editing. Enter Froala’s Find and Replace Plugin – a powerful tool designed to streamline text manipulation and enhance user productivity.

This comprehensive guide will walk you through everything you need to know about this essential plugin. We’ll explore:

  • How the Find and Replace plugin operates
  • Step-by-step installation and setup instructions
  • A detailed breakdown of the plugin’s API options and methods
  • Practical use cases and implementation strategies

By the end of this article, you’ll have a complete understanding of how to leverage Froala’s Find and Replace Plugin to transform your text editing workflow.

Key Takeaways

  • Froala Find and replace plugin allowing user to perform comprehensive text search and replacement functionality
  • The plugin supports case-sensitive and whole word matching
  • The plugin has a flexible configuration and customization

How the Find and Replace Works

Froala’s Find and Replace plugin offers a user-friendly interface for searching and modifying text within the editor. Users can access the search and replace popup in two ways:

  • Through the editor toolbar
  • By using the keyboard shortcut (CTRL + F)

Search and Replace Popup Features

The popup provides comprehensive search capabilities, including:

  • Search term input field
  • Replacement word input field
  • Optional match case sensitivity
  • Option to match whole words only

Available Actions

Users can choose from three primary actions:

  1. Find: Locate occurrences of the search term
  2. Replace: Swap a single matched instance
  3. Replace All: Substitute all matching instances

Workflow

Initially, only the “Find” button is active. When you click “Find”, the plugin displays the number of matching occurrences and activates the replacement field and buttons. This allows you to to replace the current match or all matches.

Find and Replace plugin in action

This intuitive design enables efficient text editing with minimal effort.

Installation and Setup of Froala Find and Replace Plugin

Plugin Inclusion

If you’re using the full Froala editor package (`.pkgd`), the Find and Replace plugin is automatically included. For custom implementations, you’ll need to manually add two files:

  • JavaScript: /js/plugins/find_and_replace.min.js
  • Stylesheet: /css/plugins/find_and_replace.min.css

Plugin Configuration

Enabling the Plugin

If you’re customizing the editor’s enabled plugins, include findReplace in the pluginsEnabled array to activate the Find and Replace plugin

new FroalaEditor('#editor', { 
       pluginsEnabled: ['findReplace', 'fontFamily', 'image', 'link', 'video']
 });

Adding Toolbar Button

If you’re customizing the editor’s toolbar buttons and want to display the Find and Replace button, add findReplaceButton to your toolbar configuration:

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

If you are customizing the toolbar buttons for different screen sizes, add findReplaceButton to the used configuration:

  • toolbarButtonsMD (Medium screens)
  • toolbarButtonsSM (Small screens)
  • toolbarButtonsXS (Extra small screens)

By default, these inherit the buttons from toolbarButtons.

The Find and Replace Plugin Configuration

Froala’s Find and Replace plugin provides flexible configuration options, methods, and events that allow developers to customize the search experience.

Plugin Options

The plugin offers three key configuration settings:

  1. Case Sensitivity:
    • Set enableMatchCase: true to make case-sensitive search the default behavior.
  2. Word Matching:
    • Set enableMatchWholeWord: true to match entire words by default.
  3. Automatic Popup Display:
    • Set showFindAndReplace: true to display the Find and Replace popup when the editor initializes.

These options give developers granular control over the search and replace functionality, enabling a more tailored text editing experience.

Plugin Events

Froala’s Find and Replace plugin provides four key events that give developers precise control over text replacement workflows:

1. findandreplace.beforeClose()

Triggered before the Find and Replace popup closes, allowing for any necessary cleanup or validation.

2. findandreplace.beforeOnReplace()

Fires before a replacement occurs, enabling developers to:

  • Validate replacements
  • Implement custom validation logic
  • Prevent replacements if needed

3. findandreplace.onReplace([{ oldValue, newValue }])

Occurs after a single text replacement, providing:

  • The original text (oldValue)
  • The replacement text (newValue)

Useful for:

  • Tracking changes
  • Logging modifications
  • Triggering additional actions

4. findandreplace.onReplaceAll([{ oldValue, newValue }])

Triggered after replacing all matching instances, with similar details to onReplace().

new FroalaEditor('.selector', {
  events: {
    'findandreplace.beforeClose': function () {
      // this is the editor instance.
      console.log(this);
    },
    'findandreplace.beforeOnReplace': function () {
      // Do something here.
      // this is the editor instance.
      console.log(this);
    },
    'findandreplace.onReplace': function (textArray) {
      // Do something here.
      // this is the editor instance.
      console.log(this);
    },
    'findandreplace.onReplaceAll': function (textArray) {
      // Do something here.
      // this is the editor instance.
      console.log(this);
    }
  }
});

These events offer powerful hooks for customizing the Find and Replace plugin’s behavior, enabling developers to create more intelligent and interactive text editing experiences.

Plugin Methods

Froala’s Find and Replace plugin offers a comprehensive set of methods to programmatically control search and replacement functionality:

Search and Match Methods

findReplace.findMatches(searchText)

Locate and highlight all instances of a specific text. Use this when you want to identify all occurrences of a keyword in a document

findReplace.findNextMatch(index)

Navigate to the next matching instance. Allowing to systematically review search results

  • Example: editor.findReplace.findNextMatch(2) moves to the third match

findReplace.findPreviousMatch(index)

Navigate to the previous matching instance in a circular manner. Allowing to Backtrack through search results

  • Example: editor.findReplace.findPreviousMatch(1) moves to the previous match

Replacement Methods

findReplace.replaceMatch(replaceText)

Replace the current matched text. Use it if you want to selectively update specific instances

  • Example: editor.findReplace.replaceMatch("updated term")

findReplace.replaceMatches(replaceText)

Replace all matching instances. Use it to perform bulk text updates

  • Example: editor.findReplace.replaceMatches("new text")

Information and Control Methods

findReplace.getMatchesCount()

Retrieve total number of matches. This helpful to understand search result scope

  • Example: let matchCount = editor.findReplace.getMatchesCount()

findReplace.getCurrentMatch()

Get text of the current match. Use it when you want to inspect current search result

  • Example: let currentText = editor.findReplace.getCurrentMatch()

findReplace.getCurrentMatchIndex()

Get index of current match. Use it to track position in search results

  • Example: let currentIndex = editor.findReplace.getCurrentMatchIndex()

findReplace.showPopup()

Manually display Find and Replace interface. Use it to programmatically trigger search functionality

  • Example: editor.findReplace.showPopup()

findReplace.hidePopup()

Programmatically close Find and Replace popup

  • Example: editor.findReplace.hidePopup()

Each method provides granular control over the Find and Replace functionality, enabling developers to create sophisticated text editing experiences.

Practical Use Cases

1. Large-Scale Documentation Management

Scenario: Technical writers managing extensive documentation repositories

  • Example: Replacing an outdated product name across multiple documents
  • Leverage case sensitivity and whole word matching for precision

2. Internationalization and Localization

Translating and standardizing text across multilingual content

3. Content Compliance and Style Guide Enforcement

Ensuring consistent language and branding across organizational documents

Advanced Implementation Techniques

Programmatic Search and Replace Workflow

// Example: Systematic document review process
function reviewDocument(editor, searchTerms) {
    searchTerms.forEach(term => {
        const matches = editor.findReplace.findMatches(term);
        if (matches.length > 0) {
            // Trigger review workflow
            openReviewModal(matches);
        }
    });
}

By understanding these practical use cases, developers can leverage Froala’s Find and Replace plugin to create more intelligent, efficient, and robust text editing experiences.

Frequently Asked Questions (FAQ)

Is the Find and Replace plugin included in all Froala Editor versions?

The plugin is automatically included in the full Froala editor package (.pkgd). For custom implementations, you’ll need to manually include the JavaScript and CSS files.

Can I track or log text replacements?

Yes, use event handlers like:

  • findandreplace.onReplace()
  • findandreplace.onReplaceAll()

These provide details about the replaced text and allow for custom logging or tracking.

How can I add custom validation before text replacement?

Use the findandreplace.beforeOnReplace() event to implement custom validation logic:

editor.events.on('findandreplace.beforeOnReplace', function(oldValue, newValue) {
    // Custom validation logic
    if (containsSensitiveInformation(oldValue)) {
        return false; // Prevent replacement
    }
    return true;
});

Which browsers support the Froala Find and Replace plugin?

The plugin is compatible with all modern browsers, including:

  • Google Chrome
  • Mozilla Firefox
  • Safari
  • Microsoft Edge
  • Opera

Compatibility is ensured across desktop and mobile platforms.

Is the Find and Replace plugin available in all Froala plans?

Yes, the Find and Replace plugin is available across all Froala licensing plans.

Where can I get additional support?

Conclusion

Froala’s Find and Replace plugin represents a powerful solution for developers and content creators seeking efficient text manipulation. By providing intuitive search capabilities, flexible configuration options, and robust API methods, the plugin transforms text editing from a manual, time-consuming process to a streamlined, programmatic experience.

As web content continues to evolve, tools like Froala’s Find and Replace plugin will remain critical in helping writers maintain accuracy, consistency, and efficiency in their text editing workflows.

Ready to Transform Your Text Editing?

Don’t just read about efficiency—experience it. Froala offers a free trial that lets you explore the Find and Replace plugin and the entire editor ecosystem. Whether you’re a solo developer, part of a team, or managing large-scale documentation, there’s no better time to upgrade your text editing workflow.

Try Froala Editor for Free →

Froala 4.6.0: New Table Editing Features, React 19 Compatibility, and Find & Replace Plugin

icon

Froala Editor 4.6 is here, and it’s packed with exciting new features that will elevate your content creation workflow. From advanced table editing capabilities to React 19 compatibility and the official release of the Find & Replace plugin, this update is a important for developers and content creators alike.

Read on to discover the fantastic improvements that will elevate your content creation workflow.

Key Takeaways

  • Total Table and Cell Customization
  • Stable and Powerful Find & Replace
  • Full React 19 Compatibility
  • Enhanced Workflow and Accessibility
  • New Developer Customization Options

4.6 release with table improvements and React 19 support

What’s New

Find & Replace Graduates from Beta

The Find & Replace plugin is now an official, stable feature. This powerful tool gives developers and content creators a seamless way to search for and modify text across an entire document.

Key Benefits

  • Efficient Editing: Quickly locate and replace text throughout your document
  • Comprehensive Search: Support for case-sensitive and case-insensitive searches
  • Flexible Replacement: Replace single or multiple occurrences of text
  • Intuitive User Interface: Simple and clean design that integrates smoothly with the Froala Editor

Use Cases

  • Content Editing: Streamline large document modifications
  • Localization: Easily replace text during translation processes
  • Compliance and Consistency: Ensure uniform terminology across documents

Important Notes

  • Compatible with all major browsers
  • Works across different content types (rich text, markdown)
  • Minimal performance overhead
  • Fully customizable to match your application’s design

Upgrade to Froala Editor 4.6 to experience the full power of the Find & Replace plugin and enhance your content editing workflow.

React 19 Compatibility; Integrate with the Latest Ecosystem

Froala Editor’s React SDK is now fully updated to support React 19. This ensures you can leverage the latest features and performance improvements in your modern React applications.

Key Benefits of React 19 Support

  • Future-Proofing: Immediate compatibility with the latest React version
  • Performance Improvements: Leverage new rendering optimizations in React 19
  • Enhanced Developer Experience: Smooth integration with modern React applications
  • Zero-Configuration Setup: Plug-and-play support for React 19 projects

What Developers Can Expect

  • Full compatibility with React 19’s new features and APIs
  • Maintained backward compatibility with previous React versions
  • Optimized rendering and component lifecycle management
  • Seamless integration with existing Froala Editor React implementations

Our React SDK continues to provide a robust, flexible solution for developers looking to integrate a powerful rich text editor into their React applications. Whether you’re building complex web applications or simple content management systems, Froala Editor’s React implementation ensures a smooth, efficient editing experience.

Upgrade now and stay ahead of the curve with Froala Editor’s latest React SDK update!

Introducing Advanced Table Properties

Froala Editor 4.6 completely transforms table editing. We are introducing two major upgrades; the Table Properties modal and the Cell Properties popup, giving you complete mastery over every aspect of your tables.

Table Properties Modal: Complete Customization at Your Fingertips

When users click the new “Table Properties” button in the table toolbar, a modal window opens, revealing a suite of advanced customization options:

Background Color

  • Select a background color for the entire table
  • Uses a color picker with full RGB and hex support
  • Applies color uniformly across all table cells.

Border Customization

  • Border Color: Choose a specific color for table borders
  • Border Width: Adjust border thickness (1-10px recommended)
  • Border Style: Select from multiple options:
    • Solid
    • Dotted
    • Dashed
    • Double
    • And more!

Dimensions and Sizing

  • Set table width and height using:
    • Pixels (px)
    • Percentages (%)
  • Maintains table responsiveness across different screen sizes

Table Alignment

  • Align table within the content area:
    • Left
    • Center
    • Right

Alternate Rows

  • Enable/disable alternating row colors
  • Improve table readability with visual separation
  • Perfect for data-heavy tables and complex layouts

Table Properties

Table Properties opened

Customizable Table Defaults: Enhanced Configuration Options

Froala Editor 4.6 introduces a comprehensive set of new configuration options that provide developers with granular control over default table properties during table insertion. These new configurations allow for precise customization of table appearance and behavior right from the initialization.

New Configuration Options

  • Table Alignment: Define the default alignment of newly inserted tables with a single configuration option.
  • Table Dimensions: Easily set a default height for new tables to maintain consistent layout.
  • Color Customization: Control the initial appearance of tables with hex color configurations.
  • Border Styling: Customize border properties to match your design requirements.
new FroalaEditor('.selector', {

  tableDefaultAlign: 'left',

  tableDefaultHeight: '200px',

  tableDefaultBGColor: '#000000',

  tableDefaultBorderColor: '#000000',

  tableDefaultBorderWidth: '2px',

  tableDefaultBorderStyle: 'dashed',

});

New Table Properties Methods

We’ve also introduced two new methods to programmatically manage table properties:

  • Show Table Properties: Programmatically open the table properties popup.
  • Hide Table Properties: Programmatically close the table properties popup.
new FroalaEditor('.selector', {
  events: {
    'table.inserted': function (table) {
      // Do something here.
      // this is the editor instance.
      console.log(this);
      this.table.showTableProperties();
    }
  }
});

Key Benefits

  • Comprehensive Customization: One-stop solution for table styling
  • User-Friendly Interface: Intuitive modal with clear options
  • Flexible Design: Supports various styling needs
  • Intelligent Validation: Prevents incorrect input
  • Responsive Styling: Maintains layout across devices
  • Developer Control: Precise management of table insertion properties
  • Intuitive API: Simple, straightforward configuration options and methods

Developer and User Experience

The new Table Properties feature represents our commitment to providing powerful, yet easy-to-use editing tools. Whether you’re creating documentation, reports, or complex data presentations, these enhanced table editing capabilities will streamline your workflow.

Introducing Advanced Table Cell Properties

We didn’t just improve table editing – we revolutionized it. The new Table Cell Properties provide users with unprecedented control over individual table cell styling and layout.

Cell Properties Toolbar Button

When one or multiple table cells are selected, a new “Cell Properties” button appears in the table toolbar. This button offers instant access to a powerful customization popup that consolidates multiple cell editing functionalities into one convenient location.

Cell Properties Popup: Comprehensive Cell Customization

The Cell Properties popup provides granular control over selected table cells, offering four key customization areas:

Background Color

  • Utilize the integrated color picker to select custom background colors.
  • Full RGB and hex color support
  • Apply colors to single or multiple selected cells

Padding Control

  • Set internal cell spacing with precision
  • Support for both pixel (px) and percentage (%) measurements
  • Adjust top, right, bottom, and left padding independently
  • Ensure optimal content layout and readability

Dimensions Configuration

  • Customize cell width and height
  • Flexibility to use pixels (px) or percentages (%)
  • Automatic pixel (px) conversion for numeric inputs
  • Maintain responsive design across different screen sizes.

Alignment Options

  • Horizontal alignment controls
  • Vertical alignment settings
  • Ensure content is perfectly positioned within each cell.

Table cell Properties

Table cell Properties opened

Key Benefits

  • Unified Interface: All cell properties in one convenient popup
  • Precise Customization: Granular control over cell styling
  • Flexible Measurements: Support for pixels and percentages
  • Intuitive Design: Simple, user-friendly interaction
  • Consistent User Experience: Streamlined cell editing workflow

Developer and User Experience

We introduced a new showCellPropertiesPopup() method that allows developers to programmatically display cell properties popups.

The new Table Cell Properties feature represents our commitment to providing powerful, yet intuitive editing tools. Whether you’re creating complex data tables, reports, or documentation, these enhanced cell editing capabilities will significantly improve your content creation workflow.

Enhanced Keyboard Interaction With Selected Table

In Froala Editor 4.6, we’ve significantly improved keyboard interaction when an entire table is selected, addressing previous limitations and providing a more intuitive, predictable editing experience.

Our latest update ensures that when a table is fully selected, all standard keyboard actions now function seamlessly and logically. Such as: Ensures smooth cursor movement while navigating with arrow keys.

Key Benefits

  • Improved User Experience: Eliminates frustrating interaction limitations
  • Intuitive Editing: Keyboard actions now behave predictably
  • Reduced Friction: Streamlines table editing and management
  • Consistent Interaction: Aligns with user expectations across different editing scenarios

Developer and User Impact

These keyboard interaction improvements represent our commitment to creating a more responsive, user-friendly rich text editing experience. By addressing these nuanced interaction challenges, we’ve made table editing more intuitive and efficient.

Enhanced Accessibility

In our latest release, we’ve implemented targeted accessibility improvements based on direct user feedback:

  • Enhanced Form Controls: Implemented aria-label attributes on checkbox fields to improve screen reader comprehension
  • Dynamic State Representation: Added aria-expanded attribute to accurately communicate expand/collapse states
  • Improved Visual Focus:
    • Introduced background color styles for hover and active states in image dropdowns.
    • Implemented clear focus indication for list dropdowns during keyboard navigation.
  • Keyboard Navigation Optimization:
    • Enabled seamless Tab key navigation within color palette popups
    • Ensured smooth focus transitions between interactive elements
  • Screen Reader Support:
    • Added aria-pressed attributes to tab buttons in specialized popups (Emoticons, Special Characters, Font Awesome)
    • Refined aria-pressed state management for popup trigger buttons

These refinements demonstrate our ongoing commitment to creating an accessible, user-friendly editing environment that meets diverse user needs.

Much More…

We have addressed various issues reported by our users to enhance the overall performance and stability of Froala Editor. These include:

  • Resolved the issue in MS Edge where suggested text does not get replaced correctly on autocorrect.
  • Modified the list creation logic to ensure that if the current line or selected lines have styles applied, those styles are preserved in the list content.
  • Resolved the issue in the Android WebView where when the character limit is set to N, and when typed over N characters, it exceeds the character limit.

Please find the complete changelog list here.

How Can I Update?

Don’t miss out on the benefits of the latest Froala WYSIWYG Editor 4.6 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.6/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.6/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

Real-Time Writing Detection: A Froala WYSIWYG Editor Guide

Real-time writing detection

Every year, millions of users lose their work due to undetected writing sessions. Writing detection is revolutionizing the way we interact with digital content

In this comprehensive guide, we’ll dive deep into the world of writing detection using the Froala WYSIWYG editor. You’ll learn the fundamental concepts, explore practical use cases across various applications, and discover technical implementation strategies. From understanding the core principles to implementing advanced detection techniques, this article will equip developers and product managers with the knowledge to create more responsive and intuitive user interfaces.

Detect users start typing

Takeaways

You can use writing detection feature to:

  • Enhance user experience through intelligent, context-aware interactions.
  • Improves productivity and reduces user friction
  • Creates more engaging and responsive digital environments
  • It’s applicable across diverse platforms (chat apps, email, collaborative documents)

Understanding User Writing Detection

User writing detection aims to identify the precise moment a user begins to write. It’s a sophisticated approach to understanding and enhancing user interaction.

The core purpose of writing detection extends beyond simple tracking. It enables:

  • Personalized user experiences
  • Real-time collaborative features
  • Intelligent content management
  • Performance and engagement analytics

Use Cases

Writing detection finds applications across diverse digital platforms:

Content Creation Platforms

  • Blogs and content management systems can automatically save drafts.
  • Enable seamless collaborative editing across distributed teams
  • Technical documentation tools can provide contextual assistance.

Communication Applications

  1. Chat Applications
    • Implement real-time “typing” indicators
    • Enable intelligent draft saving
    • Suggest contextual responses
    • Provide a seamless message composition experience.
  2. Email Interfaces
    • Auto-save draft functionality
    • Detect abandoned message composition
    • Provide writing assistance

Professional Tools

  • Learning management systems tracking student engagement
  • Customer support platforms monitoring response times
  • Code documentation tools analyzing writing patterns

Technical Implementation in Froala

Event Listeners

Froala provides multiple events to detect changes inside the editor, which can be crucial for content validation and writing detection:

  1. contentChanged Event
var editor = new FroalaEditor("div#froala-editor", {
    events: {
    'contentChanged': function () {
        // Detect when content is modified
       console.log('User started writing');
    }
  }
});
  1. input Event
var editor = new FroalaEditor("div#froala-editor", {
    events: {
    'input': function () {
       // Capture real-time input changes 
       trackUserWriting();
    }
  }
});

While both events can help in detecting user writing, they have crucial differences:

contentChanged Event

  • Triggers after the content in the editor has been modified
  • Captures broader changes, including:
    • Pasting content
    • Deleting content
    • Formatting modifications
    • Drag-and-drop operations
  • Less frequent, more performance-friendly
  • Provides a comprehensive view of content alterations

input Event

  • Fires immediately when the user types or modifies content
  • Captures real-time, granular input changes
  • Triggered for each keystroke or character insertion

Since input event is not triggered when content deleted, we will use the contentChanged event.

Detecting User Writing with Character Count

Froala provides a convenient charCounter.count method that can be used as an additional technique to detect when a user starts writing:

var editor = new FroalaEditor("div#froala-editor", {
    events: {
   'contentChanged': function () {
        // Check the number of characters in the editor 
      const characterCount = editor.charCounter.count(); 
      if (characterCount > 0) { 
        // User has started writing
         console.log('User is writing'); 
        // Trigger your writing detection logic
     }
    }
  }
});

Key Benefits:

  • Simple and straightforward method
  • Provides an immediate indicator of writing activity
  • Works in conjunction with event listeners
  • Helps distinguish between empty and populated editor states

By combining charCounter.count() with event listeners like input and contentChanged, developers can create a robust writing detection system that captures nuanced user interactions.

Using a flag to avoid multiple unnecessary method calls

Add a flag to determine if user writing is already detected. This approach ensures:

  • Avoid multiple unnecessary method calls
  • More efficient writing detection
  • Clean state management for writing status
let isWriting = false;
var editor = new FroalaEditor('div#froala-editor', {
  events: {
    contentChanged: function () {
      // Check the number of characters in the editor
      const characterCount = editor.charCounter.count();

      if (characterCount > 0 && !isWriting) {
        // User has started writing
        isWriting = true;
        console.log('User is writing');
        // Trigger your writing detection logic
      } else if (characterCount === 0) {
        // Reset the flag when editor is empty
        isWriting = false;
      }
    },
  },
});

User Experience Improvements

Immediate Feedback Mechanisms

  • Trigger auto-save when writing begins
  • Provide spelling and grammar suggestions.
  • Offer contextual writing assistance

Privacy Considerations

  • Implement transparent tracking
  • Give users control over interaction monitoring
  • Clearly communicate data usage policies

Performance Best Practices

Optimization Strategies

  • Use lightweight event handlers
  • Minimize performance overhead
  • Ensure cross-browser compatibility

Ethical Considerations: The Human Behind the Cursor

As writing technologies become more sophisticated, we must never forget the human element. Writing detection should feel like a supportive nudge, not an invasive surveillance mechanism. 

While user activity tracking provides valuable insights, it must be balanced with respect for individual privacy. Transparency, user consent, and respect for privacy are paramount.

Designing for Trust

The best writing detection tools are those that feel invisible. They anticipate needs without feeling intrusive. They save work without demanding attention. They provide assistance without undermining the writer’s agency.

The Future of Digital Writing

Writing detection represents more than a technological milestone. It’s a testament to our growing understanding of how humans interact with digital spaces. It acknowledges that writing is an emotional, complex process—not just a mechanical task of inputting text.

As we move forward, these technologies will become more nuanced, more empathetic. They’ll understand not just when we’re writing, but how we’re feeling while we write.

Conclusion

Writing detection in WYSIWYG editors like Froala represents a sophisticated approach to understanding and enhancing user interaction. By implementing intelligent detection mechanisms, developers can create more responsive, intuitive, and user-friendly digital experiences.

Transform your application with cutting-edge writing detection and seamless user interaction. Whether you’re building a chat app, content management system, or collaborative platform, Froala provides the tools you need to create exceptional digital writing experiences. Download Froala WYSIWYG Editor Now

Frequently Asked Questions (FAQ)

What exactly is writing detection?

Writing detection is a technology that identifies when a user starts typing or modifying content in a digital editor, enabling responsive and intelligent user interfaces.

Why is writing detection important?

It enhances user experience by:

  • Enabling auto-save features
  • Providing real-time collaboration indicators
  • Improving performance and engagement tracking
  • Offering contextual assistance

Is writing detection invasive?

No, when implemented ethically. Good writing detection:

  • Respects user privacy
  • Provides transparent tracking
  • Offers user control over data collection
  • Focuses on improving user experience

How accurate is writing detection?

Since charCounter.count() is accurately returning the character count, writing detection can be highly precise.

Does writing detection work across different browsers?

Froala Editor and its events and methods are designed to be cross-browser compatible. Creating a writing detection feature using these events and methods should be cross-browser compatible, but thorough testing across different browsers and devices remains crucial.

The goal is to create a seamless, responsive writing experience that feels natural and intuitive, regardless of the user’s chosen platform.

Can writing detection be used in mobile applications?

Absolutely! Writing detection is crucial in mobile interfaces, helping to:

  • Manage limited screen space
  • Provide real-time feedback
  • Optimize performance
  • Enhance touch-based writing experiences

What are the performance implications?

When implemented correctly, writing detection has minimal performance impact. Best practices include:

  • Using efficient event listeners
  • Implementing debounce techniques
  • Avoiding unnecessary computations

Can writing detection help with accessibility?

Yes, it can:

  • Provide better support for assistive technologies
  • Offer real-time feedback for users with different writing needs.
  • Improve overall digital writing experiences

5 Powerful Table Styles And How To Implement Them In Froala WYSIWYG Editor

table styles

Tables are a ubiquitous feature on the web, but their appearances can vary greatly. Some tables look visually unimpressive, while others display a polished, professional design. This article showcases popular and visually stunning table styles that developers can easily integrate as predefined layouts in the Froala WYSIWYG Editor.

This simplifies table styling for users, enabling them to create professional-looking tables with ease, regardless of their HTML or CSS knowledge. This democratization of design ensures that beautiful, professional-looking tables are just a click away.

beautiful, professional-looking tables

Key Takeaways

  • Table styles go beyond aesthetics; they enhance data communication.
  • Froala offers unprecedented customization for table design.
  • Choose styles that align with your content’s purpose and audience.

Understanding HTML Table Styles Feature in Froala

Before diving into specific styles, it’s crucial to understand how table styling works in Froala.

Applying Preset Table Styles

The Froala WYSIWYG Editor comes with a selection of pre-designed table styles that users can quickly apply to their tables. These preset styles include a variety of color schemes, border styles, and cell formatting options, allowing users to achieve a polished and consistent look across their tabular content.

This feature is particularly useful for users who want to quickly add visual interest to their tables without having to manually configure each individual styling element. By providing a selection of pre-designed styles, Froala helps users save time and ensure a consistent look and feel across their tabular content.

To apply a preset HTML table style, simply select the table you want to format and click on the “Table Styles” button in the editor’s toolbar. This will open a dropdown menu displaying the available style options. Users can then choose the style that best fits their design needs, and Froala will automatically apply the selected formatting to the table.

Developers can extend this Preset list by:

  1. Defining CSS classes for table styles
  2. Registering these styles within the Froala configuration using the tableStyles option. This option is an Object where the key represents the class name and its value is the style name that appears in the dropdown list. It is important to have unique keys otherwise they will not work properly.

For example, to register a table style that creates a striped table.

  1. Define CSS class
  .class1 tbody tr:nth-child(2n) {

    background: #f9f9f9;

  }
  1. Register the new style
  new FroalaEditor('div#froala-editor', {

    // Define new table cell styles.

    tableStyles: {

      class1: 'Class 1',

    }

  })

Styling Tables Examples

Style 1: Minimalist Professional Grid

Design Philosophy

The Minimalist Professional Grid represents clean, corporate design. It emphasizes clarity and readability through subtle design elements.

Minimalist Professional Grid

Implementation Code

FroalaEditor.DEFAULTS.tableStyles = {

  'fr-table-minimalist-professional': 'Minimalist Professional'

};

CSS Implementation:

.fr-view table.fr-table-minimalist-professional {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.fr-view table.fr-table-minimalist-professional th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
  font-weight: 600;
  padding: 12px;
}
.fr-view table.fr-table-minimalist-professional td {
  border-bottom: 1px solid #e9ecef;
  padding: 10px;
  vertical-align: middle;
}

Use Cases

  • Financial reports
  • Corporate documentation
  • Academic presentations

Style 2: Colorful Interactive Grid

Design Philosophy

The Colorful Interactive Grid introduces playful yet professional color gradients that draw attention without overwhelming the data.

Colorful Interactive Grid

Implementation Code

FroalaEditor.DEFAULTS.tableStyles = {

  'fr-table-colorful-interactive': 'Colorful Interactive'

};

CSS Implementation:

.fr-view table.fr-table-colorful-interactive {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
.fr-view table.fr-table-colorful-interactive th {
  background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  padding: 15px;
  text-transform: uppercase;
}
.fr-view table.fr-table-colorful-interactive tr:nth-child(even) {
  background-color: #b3e0fd;
}
.fr-view table.fr-table-colorful-interactive tr:hover {
  background-color: ##03a9f4;
  transition: background-color 0.3s ease;
}

Use Cases

  • Marketing presentations
  • Product comparisons
  • Educational materials

Style 3: Dark Mode Analytics

Design Philosophy

The Dark Mode Analytics style caters to modern HTML table design trends, offering a sleek, contemporary look that reduces eye strain.

Dark Mode Analytics

Implementation Code

FroalaEditor.DEFAULTS.tableStyles = {

  'fr-table-dark-mode-analytics': 'Dark Mode Analytics'

};

CSS Implementation:

.fr-view table.fr-table-dark-mode-analytics {
  background-color: #121212;
  color: #e0e0e0;
  width: 100%;
}
.fr-view table.fr-table-dark-mode-analytics th {
  border-bottom: 2px solid #333;
  padding: 12px;
  font-size: 15px;
  color: #00ad5f;
  line-height: 1.4;
  text-transform: uppercase;
  background-color: #393939;
}
.fr-view table.fr-table-dark-mode-analytics td {
  border-bottom: 1px solid #333;
  padding: 10px;
  font-size: 15px;
  color: #808080;
  line-height: 1.4;
  background-color: #222222;
}

Use Cases

  • Tech presentations
  • Developer documentation
  • Night mode interfaces

Style 4: Responsive Compact Grid

Design Philosophy

The Responsive Compact Grid prioritizes adaptability across different screen sizes while maintaining readability.

Implementation Code

FroalaEditor.DEFAULTS.tableStyles = {

  'fr-table-responsive-compact': 'Responsive Compact'

};

CSS Implementation:

.fr-view table.fr-table-responsive-compact {
  width: 100%;
  font-size: 0.9em;
}
.fr-view table.fr-table-responsive-compact th,
.fr-view table.fr-table-responsive-compact td {
  padding: 8px;
  text-align: left;
}
@media (max-width: 600px) {
  .fr-view table.fr-table-responsive-compact thead {
    display: none;
  }
  .fr-view table.fr-table-responsive-compact tr {
    display: block;
    margin-bottom: 10px;
  }
  .fr-view table.fr-table-responsive-compact td {
    display: block;
    text-align: right;
  }
}

Use Cases

  • Mobile-friendly websites
  • Condensed reports
  • Adaptive design scenarios

Style 5: Elegant Academic Layout

Design Philosophy

The Elegant Academic Layout draws inspiration from scholarly publications, emphasizing structured, formal presentation.

Elegant Academic

Implementation Code

FroalaEditor.DEFAULTS.tableStyles = {

  'fr-table-elegant-academic': 'Elegant Academic'

};

CSS Implementation:

.fr-view table.fr-table-elegant-academic {
  border: none;
  width: 100%;
  font-family: "Georgia", serif;
  border-collapse: separate;
  border-spacing: 0 10px;
}
.fr-view table.fr-table-elegant-academic th {
  border: solid 1px transparent;
  padding: 12px;
  text-align: left;
  font-size: 14px;
  color: #555555;
  line-height: 1.4;
  text-transform: uppercase;
  background-color: transparent;
}
.fr-view table.fr-table-elegant-academic td {
  color: #808080;
  line-height: 1.4;
  background-color: #f7f7f7;
  border: none;
  padding: 10px;
}
.fr-view table.fr-table-elegant-academic td:first-child {
  border-left-style: none;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

Use Cases

  • Research papers
  • Academic journals
  • Scientific publications

Table Styles Implementation in Froala

Let’s combine all these styles altogether.

In your stylesheet, add

#froala-editor {
  margin: 20px;
}
.show-placeholder > div > a,
.fr-wrapper > div > a {
  display: none !important;
}

/* Minimalist Professional Grid */
.fr-view table.fr-table-minimalist-professional {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.fr-view table.fr-table-minimalist-professional th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
  font-weight: 600;
  padding: 12px;
}
.fr-view table.fr-table-minimalist-professional td {
  border-bottom: 1px solid #e9ecef;
  padding: 10px;
  vertical-align: middle;
}

/*  Colorful Interactive Grid */
.fr-view table.fr-table-colorful-interactive {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
.fr-view table.fr-table-colorful-interactive th {
  background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  padding: 15px;
  text-transform: uppercase;
}
.fr-view table.fr-table-colorful-interactive tr:nth-child(even) {
  background-color: #b3e0fd;
}
.fr-view table.fr-table-colorful-interactive tr:hover {
  background-color: ##03a9f4;
  transition: background-color 0.3s ease;
}

/* Dark Mode Analytics */
.fr-view table.fr-table-dark-mode-analytics {
  background-color: #121212;
  color: #e0e0e0;
  width: 100%;
}
.fr-view table.fr-table-dark-mode-analytics th {
  border-bottom: 2px solid #333;
  padding: 12px;
  font-size: 15px;
  color: #00ad5f;
  line-height: 1.4;
  text-transform: uppercase;
  background-color: #393939;
}
.fr-view table.fr-table-dark-mode-analytics td {
  border-bottom: 1px solid #333;
  padding: 10px;
  font-size: 15px;
  color: #808080;
  line-height: 1.4;
  background-color: #222222;
}

/* Responsive Compact Grid */
.fr-view table.fr-table-responsive-compact {
  width: 100%;
  font-size: 0.9em;
}
.fr-view table.fr-table-responsive-compact th,
.fr-view table.fr-table-responsive-compact td {
  padding: 8px;
  text-align: left;
}
@media (max-width: 600px) {
  .fr-view table.fr-table-responsive-compact thead {
    display: none;
  }
  .fr-view table.fr-table-responsive-compact tr {
    display: block;
    margin-bottom: 10px;
  }
  .fr-view table.fr-table-responsive-compact td {
    display: block;
    text-align: right;
  }
}

/* Elegant Academic */
.fr-view table.fr-table-elegant-academic {
  border: none;
  width: 100%;
  font-family: "Georgia", serif;
  border-collapse: separate;
  border-spacing: 0 10px;
}
.fr-view table.fr-table-elegant-academic th {
  border: solid 1px transparent;
  padding: 12px;
  text-align: left;
  font-size: 14px;
  color: #555555;
  line-height: 1.4;
  text-transform: uppercase;
  background-color: transparent;
}
.fr-view table.fr-table-elegant-academic td {
  color: #808080;
  line-height: 1.4;
  background-color: #f7f7f7;
  border: none;
  padding: 10px;
}
.fr-view table.fr-table-elegant-academic td:first-child {
  border-left-style: none;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

In your script, initialize Froala editor

new FroalaEditor("div#froala-editor", {
  tableStyles: {
    "fr-table-minimalist-professional": "Minimalist Professional",
    "fr-table-colorful-interactive": "Colorful Interactive",
    "fr-table-dark-mode-analytics": "Dark Mode Analytics",
    "fr-table-responsive-compact": "Responsive Compact",
    "fr-table-elegant-academic": "Elegant Academic",
  },
  tableMultipleStyles: false,
})

The HTML code

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

<div id="froala-editor">
  <h2>Compare Plans</h2>
  <table style="width: 100%;">
    <tbody>
      		<tr>

			<th>
				Professional
			</th>
			<th>
				Enterprise
			</th>
			<th>
				Custom
			</th>
		</tr>
      <tr>
        <td style="width: 25%;">Self-Hosted</td>
        <td style="width: 25%;">Everything in Professional</td>
        <td style="width: 33.3559%;" rowspan="4">
				Contact Us</td>
      </tr>
      <tr>
        <td style="width: 25%;">Unlimited Active Users</td>
        <td style="width: 25%;">Unlimited Products</td>
      </tr>
            <tr>
        <td style="width: 25%;">Self-Hosted</td>
        <td style="width: 25%;">Everything in Professional</td>
      </tr>
      <tr>
        <td style="width: 25%;">Unlimited Editor Loads</td>
        <td style="width: 25%;">Unlimited Domains</td>
      </tr>
    </tbody>
  </table>
</div>
  <script type='text/javascript'
        src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>

Now, when you open your application, you’ll see a rich, interactive table editing experience with multiple predefined styles. Users can seamlessly switch between different table designs, each optimized for specific contexts and visual requirements. The integrated styles provide a flexible framework for creating professional, responsive, and visually engaging tables that adapt to various design needs and screen sizes, enhancing overall user experience and content presentation.

Frequently Asked Questions

Why is styling tables in Froala important?

Tables are a popular element in web content, used to organize and present data in a structured format. Whether it’s displaying product information, financial reports, or schedule details, tables play a crucial role in effectively communicating information to readers. However, poorly styled tables can detract from the overall user experience, making the content appear cluttered, difficult to scan, and visually unappealing.

This is where the Froala WYSIWYG Editor’s Table Styles feature shines. By providing a user-friendly interface for table formatting, Froala empowers non-technical users to create visually engaging tables that enhance the presentation of their content.

Can I create custom table styles beyond the pre-defined options?

Yes, Froala provides extensive flexibility for creating custom table styles. Developers can define unique CSS classes and register them using the tableStyles configuration option, allowing for virtually unlimited styling possibilities.

How difficult is it to implement custom table styles?

Implementing custom table styles is relatively straightforward. It requires basic knowledge of CSS and JavaScript. The process involves:

  • Creating a CSS class with your desired styling
  • Registering the style in the Froala configuration
  • Applying the style through the editor’s interface

Can I use these styles with dynamic content?

Yes, these table styles work seamlessly with dynamically generated tables. Once registered, the styles can be applied to tables created programmatically or through user input in the Froala editor.

Are there performance implications of using custom table styles?

Custom table styles have minimal performance impact. The CSS classes are lightweight, and Froala is optimized to handle various styling configurations efficiently.

Can I apply multiple table styles simultaneously?

By default, Froala allows you to apply multiple table styles concurrently. However, if you prefer a more controlled approach where only a single style can be active at a time, Froala provides a simple configuration option.

Controlling Style Selection

  • Multiple Styles (Default Behavior):


tableMultipleStyles: true  // Multiple styles can be applied simultaneously

  • Single Style Mode:


tableMultipleStyles: false  // Only one style can be selected at a time

Example Scenario

Consider a table with multiple style requirements:

new FroalaEditor('#myEditor', {

  tableMultipleStyles: false,  // Enforce single style selection

  tableStyles: {

    'professional-grid': 'Professional Grid',

    'dark-mode': 'Dark Mode',

    'compact-view': 'Compact View'

  }

});

In this single-style mode, selecting a new style will automatically deselect any previously applied styles, ensuring a clean, focused presentation.

Pro Tip: Use tableMultipleStyles: false when you want to maintain a consistent, uniform look across your tables and prevent style conflicts.

Do these styles work in all browsers?

The styles demonstrated in this article use modern CSS techniques that are supported in all contemporary browsers. However, it’s always recommended to test your specific implementation across different browser versions.

Conclusion

Froala’s table styling capabilities represent a significant leap in content creation technology. By providing developers with flexible, powerful styling options, the editor transforms tables from mere data containers into compelling visual narratives.

Implementing these styles requires thoughtful consideration of your specific use case, target audience, and overall design language. Experiment, iterate, and find the perfect table style that elevates your content.

Download the editor, embrace these table styles, and watch your data tell more engaging, visually stunning stories.

 

Advanced Integrations for an AI Content Analyzer

In the last post, we introduced our internal content analyzer. That tool is great for a high-level score, but its “input-process-output” model is just the beginning. The real opportunity is to build a more dynamic and integrated experience.

This article is for developers who saw that analyzer and thought, “What’s next?” We’ll explore three practical ways to evolve a content analysis tool using the Froala editor’s deeper API features.

Key Takeaways

  • Embed AI suggestions directly into the editor text using html.set().
  • Use the official Froala Filestack plugin to handle direct .docx file uploads.
  • Leverage the plugin’s events to create a custom document-to-HTML workflow.
  • Use the editor’s contentChanged event to create a “live linting” experience.
  • Debounce editor events to ensure optimal application performance.

Embed Feedback Directly into the Text

A common limitation of analyzer tools is the separation of feedback from the content itself. We can fix this by putting the AI’s suggestions right where they belong, transforming static text into interactive annotations.

The API Implementation

After your application gets a response from the AI, it can parse the suggestions and programmatically rewrite the editor’s content. By wrapping the targeted text in a custom <span> tag using html.set(), you can highlight the area and use a title attribute to show the AI’s note on hover.

 

/**
 * A hypothetical function after receiving AI feedback.
 * Applies suggestions to the Froala Editor's content,
 * highlighting the original text with feedback as a tooltip.
 */
function applySuggestions(suggestions) {
  let modifiedContent = froalaEditor.html.get();

  // Your logic to find and replace text would go here
  suggestions.forEach(suggestion => {
    modifiedContent = modifiedContent.replace(
      suggestion.originalText,
      `<span class="suggestion" title="${suggestion.feedback}">${suggestion.originalText}</span>`
    );
  });

  froalaEditor.html.set(modifiedContent);
}

 

Integrate a Document Upload Workflow

Writers work in document editors. A professional tool should handle .docx files directly, not force a copy-paste workflow. Instead of building a custom uploader, we can use the official Froala Filestack plugin to handle this.

The goal is to use the plugin to upload a .docx file, but instead of inserting a link to that file, we will intercept the upload, convert the document to HTML on our backend, and then load that HTML into the editor.

The API Implementation

This approach relies on using the plugin’s built-in filestack.uploadedToFilestack event. We configure the plugin with our API key and then use the event to trigger our custom conversion logic.

  • The user clicks the ‘Insert File’ button, which is now powered by Filestack.
  • They upload a .docx file using the Filestack picker.
  • The filestack.uploadedToFilestack event fires, providing the URL of the uploaded file.
  • Our custom logic sends this URL to a backend service for conversion.
  • The editor’s html.set() method is called to insert the final, converted HTML.

 

/**
 * Initializes the Froala Editor with the Filestack plugin,
 * configured for a custom DOCX workflow.
 */
new FroalaEditor('#editor', {
  // Ensure the 'insertFile' button is available in the toolbar.
  toolbarButtons: ['bold', 'italic', '|', 'insertFile'],

  // Basic Filestack plugin configuration.
  filestackOptions: {
    filestackAPI: 'YOUR_FILESTACK_API_KEY', // Replace with your actual Filestack API key.
    pickerOptions: {
      accept: ['.docx', '.doc'] // Only allow .docx and .doc files to be picked.
    }
  },

  events: {
    // This plugin event is crucial for our custom workflow.
    // It triggers after a file has been successfully uploaded to Filestack.
    'filestack.uploadedToFilestack': function (response) {
      // The plugin has handled the file upload; now we take over.
      const fileUrl = response.filesUploaded[0].url; // Get the URL of the uploaded file.
      const editorInstance = this; // 'this' refers to the Froala editor instance.

      // This would be your function that calls a backend service
      // to convert the document at the given URL into HTML.
      convertDocxToHtml(fileUrl).then(html => {
        // Once the HTML is received, set it as the editor's content.
        editorInstance.html.set(html);
      });

      // Return 'false' to prevent the default behavior of the Filestack plugin,
      // which would typically insert a link to the uploaded file.
      return false;
    }
  }
});

 

 

Build Real-Time Analysis with Editor Events

A manual “Analyze” button is useful, but we can provide more immediate value with real-time feedback. The goal is to create a “live linting” experience that offers suggestions as the user writes.

The Froala Events API is the foundation for this feature.

The API Implementation

You can listen for the contentChanged event to trigger actions whenever the user types. To avoid performance issues, you must “debounce” this event so your analysis function only runs after the user has paused typing for a moment.

 

// Assumes you have a debounce utility function from a library like Lodash.
// This function delays the execution of 'updateRealtimeFeedback'
// until 1.5 seconds after the user stops typing or making changes.
const debouncedAnalysis = debounce(() => {
  let currentContent = froalaEditor.html.get();
  // Run your lightweight, real-time content analysis here.
  updateRealtimeFeedback(currentContent);
}, 1500); // 1.5 second delay

// Attach the debounced analysis function to the 'contentChanged' event of the editor.
froalaEditor.events.on('contentChanged', debouncedAnalysis);

 

Wrapping up the improvements

A basic content analyzer is a great start, but it’s just one possibility. These examples show how a rich editor with a deep API is not just an input field but a platform for building integrated and powerful applications. By using the API to handle content manipulation, custom UI, and events, you can move beyond simple analysis and create tools that actively improve a writer’s workflow.

HTML Code Writer with Iframe Isolation and How to Inject Styles

HTML Iframe

Looking to seamlessly integrate a rich text editor into your web application without disrupting your existing design or compromising security? Leveraging the power of iframes, the Froala WYSIWYG editor offers a robust solution for achieving just that. This approach provides a clean, isolated environment for the editor, preventing style conflicts and potential security vulnerabilities.

This article delves into the advantages of loading your Froala editor within an iframe, exploring the benefits of content isolation and enhanced customization options. We’ll provide a clear, step-by-step guide on how to effectively embed the Froala editor in an iframe, and discuss techniques for injecting custom styles to maintain brand consistency and a polished user experience.

Key Takeaways:

  1. Using an iframe to embed the Froala WYSIWYG editor provides content isolation, preventing style conflicts between the editor and the main website. This ensures a consistent editing experience regardless of the surrounding website’s CSS.
  2. Froala’s iframe mode allows developers to inject custom styles directly into the iframe, enabling precise control over the editor’s visual presentation to maintain brand consistency.
  3. Embedding the Froala editor in an iframe is a straightforward process.

HTML Code Writer

The Benefits of Using HTML Iframe with Froala Editor

Understanding the Advantages of Iframe Content Isolation

Iframes offer a powerful way to embed external content seamlessly within your web pages while maintaining a clean separation from your core site’s structure and styling. Think of them as miniature windows displaying content from other sources.

With the Froala WYSIWYG editor, utilizing iframe mode provides significant advantages, primarily centered around content isolation. This iframe editor customization ensures that the styling of your Froala editor, embedded within the iframe, won’t clash with the CSS of your main webpage. This is particularly crucial when dealing with complex website designs or when integrating third-party content. This isolation prevents conflicts and ensures a consistent editing experience within the Froala editor, regardless of the surrounding website’s styles.

Furthermore, iframe content isolation enhances security by limiting the impact of potentially malicious scripts within the embedded content, protecting your website’s integrity. Using iframes with the Froala editor allows for a more controlled and predictable integration, contributing to a smoother user experience and simplified development process.

The Froala editor embedding process is straightforward and designed to enhance both UX and DX, aligning perfectly with Froala’s mission to create exceptional editing experiences.

Enhancing Your WYSIWYG Editor with Iframe Customization

The ability to set default styles for framed WYSIWYG editors’ content is particularly beneficial for maintaining brand consistency and ensuring seamless visual integration.

How do you achieve this level of iframe editor customization? It’s simpler than you might think. Injecting styles into the framed Froala editor allows you to precisely tailor the look and feel to match your brand’s guidelines. This precise control extends to fonts, colors, button styles, and virtually every aspect of the editor’s visual presentation.

With Froala’s focus on intuitive design and developer experience, customizing your framed editor becomes a powerful tool for creating a visually appealing and user-friendly editing experience within your web application.

How to Embed Froala Editor in an Iframe Effectively

The Froala WYSIWYG editor, known for its clean design and developer-friendly integration, provides a dedicated iframe mode, further enhancing its versatility and customization capabilities.

First, include the Froala library in your project. Then, when initializing the editor, set the iframe option to true. This creates a contained environment for the editor, preventing style conflicts with the surrounding webpage.

new FroalaEditor('div#froala-editor', {
  iframe: true
})

This isolation is especially beneficial when dealing with complex website designs, ensuring the Froala editor renders perfectly regardless of existing CSS. This method offers several advantages, including iframe content isolation and enhanced iframe editor customization.

How To Inject Styles Inside Froala WYSIWYG Editor

Enabling Froala’s iframe mode brings us to the matter of styling the framed editor. Because of the inherent content isolation, simply adding CSS to your main stylesheet won’t affect the editor within the iframe. This is where the Froala core.injectStyle(style) method comes into play.

This method is used to inject styles directly into the iframe’s document. This approach allows precise control over the editor’s visual presentation within its contained environment, overcoming the limitations posed by iframe SEO impact and ensuring consistent styling regardless of the parent page’s CSS.

For example, by default, the standard browser’s font-size for the H1 tag is 32px. This is the font size that will be automatically applied to H1 elements inside the Froala editor when used in iframe mode. However, you may want to change this default to match your brand’s style guide – for instance, setting the H1 font-size to 40px. In this case, you can use core.injectStyle(style) method like this:

let editor = new FroalaEditor(
  "div#froala-editor",
  {
    iframe: true,
  },
  function () {
    // Call the method inside the initialized event.
    editor.core.injectStyle("h1{font-size: 40px}")
  },
)

The code above sets the font-size for any H1 tags inserted within the Froala editor to 40px, ensuring the editor’s appearance matches your brand’s design guidelines.

With this technique, developers can achieve seamless iframe editor customization while leveraging the benefits of iframe content isolation and enhanced security. This allows for a streamlined user experience that makes Froala a favorite among developers worldwide.

FAQ

1. What are the benefits of using HTML iframe for embedding the Froala Editor?

Using an iframe for the Froala Editor offers several key benefits: content isolation (preventing style conflicts with your main website and enhancing security), enhanced customization (allowing precise control over the editor’s appearance through style injection), and a cleaner separation of content which can potentially improve page load times and thus, SEO. It creates a contained environment, simplifying development and ensuring a consistent editing experience.

2. How can I customize the Froala Editor when loaded in an iframe?

Customize the framed Froala editor by injecting styles directly into the iframe’s document using the core.injectStyle(style) method. This allows precise control over fonts, colors, button styles, and more, ensuring brand consistency.

Conclusion

Embedding the Froala editor within an iframe offers a compelling blend of design flexibility, enhanced security, and improved site stability. While iframe implementation requires careful consideration of SEO implications, the benefits of content isolation and styling customization often outweigh the challenges. By understanding the nuances of iframe integration and leveraging Froala’s intuitive design, developers can create a seamless and visually appealing editing experience that enhances user satisfaction and development workflow. So, take the leap and explore the power of iframe embedding with Froala – you might be surprised at how easily it elevates your web application’s editing capabilities.

Setting Up and Customizing a Dark Mode in Froala Text Editor

Dark mode text editor

The demand for dark mode interfaces has been steadily rising in modern UI/UX design trends. Users actively seek out applications and tools that provide a visually pleasing and comfortable dark mode experience.

Froala, a popular rich text editor, empowers developers to easily customize the user interface and experience, including a captivating dark mode option.

Key Takeaways

  • Dark mode can improve user experience by reducing eye strain, enhancing readability, and creating a more immersive environment.
  • Implementing dark mode can benefit developers by meeting user expectations and improving accessibility.
  • Froala makes it easy for developers to customize the editor’s appearance, including enabling a dark mode theme.

Froala's dark mode

The Benefits of Dark Mode

Enabling Froala’s dark mode offers several advantages for both users and developers.

From a user’s perspective, a dark mode can:

  • Reduce eye strain – The dimmer interface is easier on the eyes, especially in low-light conditions.
  • Improve readability – The high-contrast colors make text more legible.
  • Create a more immersive experience – The dark theme establishes a focused, visually appealing environment.

For developers, implementing a dark mode option can:

  • Enhance the overall user experience – Users increasingly expect and appreciate dark mode functionality.
  • Increase accessibility – The improved contrast benefits users with visual impairments.

By providing a well-designed dark mode, you can deliver a more comfortable and accessible text editing experience for your users.

Step-by-step guide to setting up Froala’s dark mode

Let’s set up a dark mode text editor.

Step 1: Get started

Follow the Froala installation guide to set up your preferred framework. For a simple webpage using Froala’s CDN links, you can use the following code:

<!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>

If you prefer hosting Froala locally, you can download it and start a free trial.

Step 2: Include the theme CSS file

Froala offers several built-in themes, including Black, Gray, and Royal. You need to include the CSS file for the Dark theme to use it in your project.

https://cdn.jsdelivr.net/npm/froala-editor@latest/css/themes/dark.min.css

Step 3: Set the theme in the configuration

To enable editor dark mode, configure the theme option when initializing the Froala editor:

new FroalaEditor('div#eg-dark-theme', {

  theme: 'dark'

});

This will add the dark-theme class to the Froala .fr-box element, allowing the CSS rules defined in the Dark theme to be applied without conflict with other CSS on the page.

Step 4: Run your app

When you run your app, you should see Froala in the dark mode. 

Note: To use Froala in a production environment, don’t forget to get a valid API key.

Dark mode text editor

Customize Your Editor Theme

Froala’s built-in Dark theme only changes the color of the top toolbar. To make the entire editor interface darker, you can add custom CSS rules.

Here’s an example of CSS rules to turn the editor’s editing area and bottom toolbar into a darker color:

.dark-theme.fr-box.fr-basic .fr-element {

  background: #4e4d4d;

  color: #f0efef;

}

.dark-theme .fr-second-toolbar {

  background: #353535;

}

These rules will make the editor’s content area and bottom toolbar adopt a darker background color, with the text displayed in a lighter shade. This creates a more consistent dark mode appearance throughout the editor.

Froala custom theme

By leveraging the flexibility of CSS, you can further customize the Froala editor’s appearance to match the overall branding and design of your application.

Create Your Own Theme

Froala allows developers to create their own custom themes. This empowers you to tailor the editor’s appearance and branding to match your application or website.

To create a custom theme:

  1. Write your CSS rules in a separate file, e.g. “awesome.css”.
  2. Start each CSS rule with “.awesome-theme” to avoid conflicts with other styles.
  3. Place the “awesome.css” file in the themes folder on your server.
  4. Add a link to your theme in your application.

Once you’ve defined your custom theme, you can apply it to the Froala editor by setting the theme option when initializing the editor. For example:

new FroalaEditor('div#eg-dark-theme', {

  theme: 'awesome'

});

This allows you to fully customize the appearance of the text editor, including colors, fonts, and other visual elements. By aligning the editor’s design with your application’s branding, you can create a cohesive and visually appealing user interface.

Detecting User Preferences and Adjusting Themes

You can also detect the user’s system mode (light or dark) and automatically adjust the editor’s theme accordingly. This provides a seamless transition between light and dark modes without requiring the user to manually switch settings.

Using CSS

When creating a new theme, you can use the prefers-color-scheme media query in your CSS. This media query allows you to detect the user’s preferred color scheme and apply different styles based on that preference:

/* Light mode styles */

.custom-theme .froala-editor {

  --text-color: #333;

  --background-color: #fff;

}

/* Dark mode styles */

@media (prefers-color-scheme: dark) {

  .custom-theme .froala-editor {

    --text-color: #f1f1f1;

    --background-color: #333;

  }

}

The default styles are set for a light mode interface. When the media query detects the user’s system is in dark mode, it overrides the text and background colors to create a visually pleasing dark mode experience.

Using JavaScript

Alternatively, you can use the window.matchMedia("(prefers-color-scheme: dark)") expression to check the user’s system mode and set the appropriate theme:

new FroalaEditor('div#eg-dark-theme', {
  theme: window.matchMedia("(prefers-color-scheme: dark)").matches
    ? "dark"
    : "royal"
});

Auto switch between dark and light mode

By leveraging these techniques, you can ensure that Froala’s dark mode is seamlessly integrated into your application, providing users with a consistent and comfortable experience regardless of their system preferences.

Best Practices for Dark Mode in Rich Text Editors

When it comes to best practices for using dark mode in rich text editors like Froala, it’s important to consider factors such as contrast, readability, and accessibility.

Ensuring that the text and background colors provide sufficient contrast, while maintaining legibility, is crucial for providing a comfortable and usable experience for all users. Avoid using low-contrast color combinations, as this can make the text difficult to read and strain the user’s eyes.

Additionally, consider the accessibility implications of your dark mode implementation. Ensure that the color choices and contrast levels meet Web Content Accessibility Guidelines (WCAG) standards to support users with visual impairments or other accessibility needs.

When designing a dark mode theme for your Froala editor, pay close attention to the following:

  • Contrast Ratio: Aim for a minimum contrast ratio of 4.5:1 between the text and background colors to ensure readability.
  • Font Legibility: Choose fonts and font sizes that are easily readable, even in low-light environments.
  • Consistent Styling: Maintain a consistent visual style throughout the editor, including the toolbar, menus, and other UI elements.
  • Accessibility Considerations: Ensure that your dark mode theme meets WCAG guidelines for color contrast, text resizing, and other accessibility requirements.

By following these best practices, you can create a dark mode experience in your Froala editor that is not only visually appealing but also accessible and comfortable for all users.

Conclusion

Froala’s UI customization features, such as creating custom themes, empower developers to deliver a cohesive, visually appealing dark mode experience. By exploring Froala’s dark mode capabilities and implementing best practices, you can create text editors that not only meet the growing demand for dark mode but also enhance the overall user experience and accessibility.

As users increasingly seek out applications with thoughtful dark mode support, incorporating a well-designed and accessible option in your Froala-powered text editor can be a valuable differentiator. It’s a great way to improve the user experience and set your application apart.

So why not try editor dark mode today? Enable it with just a few lines of code and see how it can transform your text editing interface. Provide your users with a comfortable, focused, visually appealing dark mode experience they’ll love.

FAQ

Is dark mode better for your eyes?

Yes, dark mode can be better for your eyes in certain situations. The dimmer interface and higher contrast between text and background can reduce eye strain, especially in low-light environments. The reduced brightness and blue light exposure can also help minimize headaches and fatigue associated with prolonged screen time. However, it’s important to ensure that the dark mode implementation follows accessibility best practices to maintain readability and comfort for all users.

What are the benefits of dark mode on a computer?

Using dark mode on a computer can provide several benefits:

  • Reduced eye strain: The lower brightness and contrast can be easier on the eyes, especially in low-light conditions.
  • Improved battery life: Dark mode can reduce the power consumption of OLED and LCD displays, leading to longer battery life on laptops and mobile devices.
  • Enhanced focus and productivity: The dimmer interface can create a more immersive and focused work environment, helping to minimize distractions.
  • Aesthetic appeal: Many users find dark mode visually appealing and prefer the sleek, modern look it provides.

This explains why dark mode is better than normal mode in many cases. By leveraging the advantages of dark mode, you can create a more comfortable and efficient computing experience for your users.

Why is dark mode bad in some cases?

While dark mode can offer several benefits, it’s important to consider that dark mode may not be suitable for all users or all situations. Some potential drawbacks of dark mode include:

  • Reduced Contrast: In some cases, the high contrast between dark backgrounds and light text can make it difficult for users with visual impairments or certain eye conditions to read the content.
  • Increased Power Consumption: On non-OLED displays, dark mode may not provide significant power savings and could even increase power consumption in some cases.
  • Difficulty Adapting: Users who are accustomed to light mode interfaces may find it challenging to adjust to a dark mode environment, especially if they need to switch between the two modes frequently.
  • Compatibility Issues: Certain websites or applications may not be designed with dark mode in mind, leading to visual inconsistencies or rendering problems.

When implementing dark mode, it’s important to carefully consider the potential drawbacks and ensure that the design provides a comfortable and accessible experience for all users, regardless of their preferences or needs.

Can I create my own custom theme for Froala’s dark mode?

Yes, Froala allows developers to create their own custom themes. This empowers you to tailor the editor’s appearance and branding to match your application or website. You can define your own CSS rules and apply the custom theme when initializing the Froala editor.

How We Built Our Internal E-E-A-T Content Analyzer with Froala

a close up of a toy

Our team launched the E-E-A-T & Helpful Content Analyzer a few weeks ago. You might have noticed it’s built with the Froala editor. We made this key technical decision immediately (and it was a no-brainer).

Our content team needed to move away from subjective, manual content reviews. We wanted an automated tool to check our work against Google’s standards. This project also serves as a great example of how easily Froala integrates into modern, AI-powered applications.

This article details the technical thinking behind the tool. We’ll cover why we built it and how its components, including Froala and the DeepSeek API, work together to provide a seamless experience.

Key Takeaways

  • For AI content analysis, a <textarea> is insufficient; preserving HTML structure with an editor like Froala provides essential context.
  • Getting structured data from an LLM requires strict instructions; embedding formatting rules directly into the prompt is non-negotiable for a predictable response.
  • A simple html.get() method call is all that’s needed to pull clean, complete HTML from the Froala editor for processing.
  • You don’t need complex parsers for LLM responses if you enforce a consistent format; a simple regular expression can extract the data you need.
  • Focus your engineering effort on the core problem—in this case, the AI prompt—not on rebuilding commodity components like a rich text editor.

The Need for an Objective Tool

Our team used to manually check an article against Google’s E-E-A-T and Helpful Content guidelines. It was slow and, worse, subjective. One person’s interpretation of “authoritativeness” could easily differ from another’s.

We needed an objective, automated tool to give us structured feedback. The goal wasn’t to replace our writers but to give them a consistent feedback loop. The tool had to do three things well.

  1. Accept rich text with all its formatting.
  2. Analyze it against specific E-E-A-T criteria.
  3. Present structured, actionable feedback.

How the Analyzer is Structured

The analyzer is a simple two-column layout. Input on the left, results on the right. There’s no need to over-engineer the UI when a clean workflow is the priority. We used basic CSS Flexbox to keep it responsive and straightforward.

 

.main-layout {
    display: flex;
    flex-grow: 1;
    padding: 20px;
    gap: 25px;

}

.column {
    flex: 1;

}

.input-column {
    order: 1;
}

.results-column {
    order: 2;
}

This keeps a clear, logical separation between the user’s content and the AI’s analysis.

Why a <textarea> Wasn’t Enough

For the content input, a standard <textarea> element was a non-starter. Modern articles depend on headings, lists, links, and other formatting. These structural elements are critical for readability and are a key signal in Google’s “Helpful Content” evaluation. If you send plain text to an AI for analysis, you lose half the context.

This is where we plugged in the Froala editor. It’s designed to handle complex, structured content out of the box. This is all the code required to embed the editor and configure its toolbar.

 

document.addEventListener('DOMContentLoaded', () => {
    try {
        new FroalaEditor('#editor', {
            placeholderText: 'Paste your article HTML or text content here...',
            heightMin: 150,
            toolbarButtons: ['bold', 'italic', 'underline', '|', 'align', 'formatOL', 'formatUL', '|', 'insertLink', 'undo', 'redo'],
        });
    } catch (e) {
        console.error("Froala Editor initialization failed:", e);
    }
});

 

With the editor in place, all the important structural elements of an article are preserved. When it’s time to send the content for analysis, grabbing the complete, clean HTML is a single method call.

 

let content = FroalaEditor.INSTANCES[0].html.get();

This line provides the complete HTML content, which is ready for analysis.

Engineering a Predictable AI Prompt

Getting a consistent, structured response from a large language model requires giving it precise instructions. Anyone who has worked with an LLM API knows the pain of getting back unstructured, unpredictable text. We solved this by creating a very strict system prompt that commands the AI’s behavior and a user prompt that injects the article content.

The system prompt tells the AI to act as an expert content analyst and defines the exact output structure, including the use of Markdown and specific Score: and Priority: formats. This formatting is the most critical part. It turns the AI’s free-form response into something we can reliably parse.

Our buildAnalysisPrompt function wraps the article content with these instructions.

 

function buildAnalysisPrompt(content) {
    // The user prompt includes strict formatting instructions.
    return `Please analyze the following article content based on Google's E-E-A-T and Helpful Content guidelines.

    Follow these formatting instructions precisely for each category:
    1. Provide a clear Markdown heading (e.g., "## Content Quality").
    2. Assess the content for that category.
    3. Offer specific, actionable recommendations.
    4. Include the score line EXACTLY as: "**Score: [score]/10**"
    5. Include the priority line EXACTLY as: "**Priority: [High/Medium/Low]**"

    --- START ARTICLE CONTENT ---
    ${content}
    --- END ARTICLE CONTENT ---`;
}

 

The system prompt is a detailed instruction set telling the AI to act as an expert content analyst. It defines the exact output structure, including the use of Markdown headings and the specific Score: and Priority: formats. This strict formatting is crucial because it allows our application to parse the AI’s response and display it in a structured way, like the score table.

The Output: Displaying Actionable Insights

After the analysis is complete, the results are formatted and displayed. The raw Markdown response from the API is processed to create a score table and a detailed feedback section.

We use a regular expression to find and extract the score from each category in the Markdown text.

 

const scoreRegex = /\*\*Score:\s*(\d{1,2})\/10\*\*/;

 

This allows for the automatic creation of a summary table. The detailed text feedback is then converted from Markdown to HTML for clear presentation, providing the specific recommendations that make the tool useful.

A Real Tool for a Real Problem

We built the analyzer to solve an internal bottleneck. It’s a practical example of how a robust front-end component like Froala is critical for building useful, AI-driven tools. By combining a solid editor with a capable API, we created a workflow that helps our team produce better content. It’s not about finding shortcuts; it’s about using the right tools for the job so you can focus on the actual work.

 

Three Ways For Uploading Images in Froala: Which One Should You Use?

Uploading Images in Froala

As a developer, you understand the importance of seamless image uploads in WYSIWYG editors. Froala, a popular rich text editor, offers three distinct methods for handling image uploads.

The right approach depends on your application’s requirements and the level of control you need over the image upload process.

In this article, we’ll explore the pros and cons of the default image uploader, the File Manager, and the Filestack integration, and when you might want to use each one, helping you determine which one best suits your project’s needs.

Key Takeaways

  • The default image uploader is a straightforward option for basic image upload needs, but it requires server-side setup and management.
  • The Froala File Manager offers a more robust and user-friendly image upload experience, with the ability to upload multiple images at once.
  • The Filestack integration provides the most comprehensive set of features, including cloud-based storage, advanced image transformation, and AI-powered image analysis. This makes it the best choice for projects with sophisticated image management requirements.
  • All methods support integrating with cloud storage providers like Amazon S3 to offload image storage from your own server.

Images Upload

The Default Image Uploader

The default image uploader in Froala is a straightforward option. When you click the image icon in the toolbar, you can easily drag and drop an image or browse your local files to select a file. This inserts the image directly into the editor as a BLOB (Binary Large Object).

The image plugin manages this default image upload functionality. Developers can customize various properties of the inserted images, such as the default width, display settings, and more.

To use the default image uploader, you’ll need to set the imageUploadURL option. This tells Froala where to send the uploaded image for processing. You’ll also need to handle the image upload on your server and return the URL of the uploaded image, which Froala can then use to display it in the editor.

Froala provides server-side SDKs to simplify this server-side implementation, making the default image uploader relatively easy to set up.

It also supports integrating with cloud storage providers like Amazon S3 and Azure. This lets you store your uploaded files on external cloud platforms, rather than your own server.

You can filter accepted image file types by setting the imageAllowedTypes option. This is useful if you want to restrict the types of images users can upload. Additionally, you can set maximum file size limits using the imageMaxSize option.

new FroalaEditor("#froala-editor", {
  toolbarButtons: [
    "insertImage",
    "bold",
    "italic",
    "underline",
    "|",
    "undo",
    "redo"
  ],
  pluginsEnabled: ["image"],
  imageUploadURL: "/upload_image",
  imageUploadMethod: "PUT",
  imageAllowedTypes: [
    'jpeg', 
    'jpg', 
    'png'
  ],
  imageMaxSize: 1024 * 1024 * 3
});

Default uploader
Pros:

  • Simple and easy to use
  • No additional costs

Cons:

  • Requires you to set up server-side logic to handle image uploads and storage.
  • Images are stored directly on your own server, which could impact performance and storage management.

Overall, the default image uploader is a straightforward option that works well for basic image upload needs. However, if you require more advanced features, you may want to consider the other options Froala provides, such as the File Manager or Filestack integration.

The File Manager

Froala’s File Manager offers a more robust and user-friendly image upload experience. It allows users to browse, upload, and manage files directly within the editor.

The File Manager utilizes several plugins, including file, image, imageTUI, and video. These plugins need to be enabled in your Froala configuration.

When uploading images, the File Manager leverages specific settings from the image plugin, such as imageDefaultWidth, imageResizeWithPercent, imageDefaultDisplay, and imageDefaultAlign. This allows you to customize the appearance and behavior of the uploaded images.

The File Manager also supports integrating with cloud storage providers like Amazon S3 and Azure. This lets you store your uploaded files on external cloud platforms, rather than your own server.

Additionally, you can use the Froala server SDKs to simplify the server-side implementation. However, keep in mind that this may require more setup and configuration since the File Manager can handle various file types, not just images.

One of the key benefits of the File Manager is its ability to upload multiple images at once. Users can easily browse their local files and select several images to upload in a single action.

Moreover, the File Manager provides a direct way to insert images into your content. Users can browse the available files and simply click to insert the desired image into the Froala editor.

new FroalaEditor('#froala-editor', {
   toolbarButtons: ['insertFiles', 'bold', 'italic', 'underline', '|', 'undo', 'redo'],
   pluginsEnabled: ["filesManager","image", "video","file","imageTUI"],
   filesManagerUploadURL: '/upload_file',
   filesManagerAllowedTypes: [
      'application/pdf', 
      'application/msword',
      'image/png'
   ], 
});

The File Manager

Pros:

  • Offers a user-friendly interface for managing images
  • Supports uploading multiple images at once.

Cons:

  • Requires enabling multiple plugins, which can increase the overall plugin size.
  • Still requires some server-side implementation to handle file uploads and storage.

Filestack Integration

Froala offers seamless integration with Filestack, a powerful file hosting and image upload API service. Filestack allows you to upload images and other file types directly to their cloud storage, relieving your server of the burden of image storage.

Filestack provides an intuitive user interface with over 20 integrated sources, enabling users to upload files from a wide range of platforms, including local devices, cloud storage services, and social media. This makes the file upload process more convenient and versatile.

Beyond images, Filestack supports the upload of various file types, and it allows users to upload multiple files simultaneously. The service’s Content Ingestion Network (CIN) ensures reliable and fast uploads, delivering a 100x improvement in reliability compared to traditional file uploads.

Once an image is uploaded, Filestack instantly generates a CDN-backed URL, ensuring lightning-fast delivery across the web. This eliminates the need for any server-side code to handle image storage, as Filestack manages the entire process on its cloud infrastructure.

Filestack also offers robust image transformation capabilities, allowing you to resize, crop, and apply various effects to your images using their powerful processing API. Additionally, Filestack’s AI features can scan uploaded images for viruses, detect tags and attributes, and perform advanced image analysis, providing valuable insights about your visual content.

Filestack provides developers with a variety of configurations to control the image upload experience. For example, they can limit accepted image file types by setting the Filestack Picker’s accept option.

     var editor = new FroalaEditor('#editor', {
       filestackOptions: {
            /*
            To get your Filestack API, create a free Filestack account
            https://www.filestack.com/signup-free-froala/
            */
            filestackAPI: "**************",
            uploadToFilestackOnly: false,
            pickerOptions: {
                accept: [
                    ".pdf",
                    "image/jpeg",
                    "image/png",
                    "image/*",
                    "video/*",
                    "audio/*"
                ],
                fromSources: [
                    "local_file_system",
                    "url",
                    "facebook",
                    "instagram"
                ]
            },
            transformationOptions: {
                filters: {
                    enabled: [
                        "blackWhite",
                        "sepia"
                    ]
                },
                adjustments: {
                    enabled: [
                        "brightness",
                        "noise"
                    ]
                }
            }
        }
    });

Pros:

  • Offloads image storage to a dedicated cloud service
  • Provides advanced image transformation and optimization tools
  • Offers robust file management capabilities, including support for multiple file types.
  • Delivers fast, CDN-backed image delivery
  • Includes features like virus detection and image analysis powered by Filestack AI

Cons:

  • Requires signing up for a Filestack account.
  • May incur additional costs depending on the Filestack pricing plan.

Overall, the Filestack integration in Froala offers a comprehensive and streamlined solution for managing file uploads, storage, and optimization, freeing you from the hassle of implementing these features on your own server.

Side-by-side comparison

Here’s a side-by-side comparison of the three image upload methods in Froala to help you identify similarities and differences and make informed decisions.

Default Image Uploader The File Manager Filestack Integration
Support multi-image uploads
Support drag and drop image upload
Upload files other than images  
Require server-side setup
Delivery Depends on your server setup. Depends on your server setup. Fast, with CDN link instantly generated
Secure Depends on your server setup. Depends on your server setup. Yes
Image editing Through third-party integration (TUI plugin) Through third-party integration (TUI plugin) Filetsack Transformation UI
Image conversion Images can be converted to different formats using the Filestack Processing API.
Virus Detection
Image tags and AI features
S3 upload (Default)
Additional cost     Free trial

Conclusion

When choosing the best image upload method for your Froala-based application, consider your specific requirements, the level of control you need, and the trade-offs between ease of implementation, performance, and cost. While the default image uploader is a simple option, the Filestack integration offers the most comprehensive set of features and capabilities, making it the best choice for projects that require advanced image management and optimization.

FAQ

Can I restrict the types of images users can upload in Froala?

Yes, you can restrict the types of images users can upload in Froala. For the default image uploader, you can set the imageAllowedTypes option to specify the allowed file extensions. For the Filestack integration, you can set the accept option in the Filestack Picker to control the accepted file types.

Does Froala support uploading multiple images at once?

Yes, the Froala File Manager and the Filestack integration both support uploading multiple images at once. This can be a useful feature for users who need to quickly add several images to their content.

Can I store my uploaded images on a cloud platform like Amazon S3?

Yes, all upload methods support integration with cloud storage providers like Amazon S3 and Azure. This allows you to offload the storage of your uploaded images to a dedicated cloud platform, rather than managing it on your own server.

What features does the Filestack integration offer beyond basic image uploads?

The Filestack integration provides a range of advanced features, including robust image transformation capabilities, virus detection, and image analysis powered by Filestack’s AI. These features can be particularly useful for projects that require more sophisticated image management and optimization.

Inserting merge tags in the Froala editor is easy – find out how?

Insert merge tags in the editor

As a developer, you know the importance of creating engaging and personalized content for your users. One powerful way to achieve this is by leveraging merge tags – dynamic placeholders that can be replaced with unique information for each user or recipient. The Froala WYSIWYG editor provides seamless integration with the Tribute JavaScript library, allowing you to easily enable merge tags and provide a delightful content creation experience for your users.

In this comprehensive guide, we’ll walk you through the step-by-step process of implementing merge tags in the Froala editor. You’ll learn how to display a dropdown list of predefined tags, allow users to select and insert them as non-editable elements, and ensure the tags are easily identifiable within the content. By the end of this article, you’ll have the knowledge to add personalization to your applications.
Insert merge tags in the editor

Key Takeaways

  1. Merge tags are dynamic placeholders that can be replaced with unique information for each user or recipient. This allows you to create highly personalized content and experiences.
  2. Froala WYSIWYG editor integrates seamlessly with the Tribute.js library to enable merge tag functionality. This allows users to easily insert predefined merge tags into the content they create.
  3. Protecting merge tags as non-editable elements is crucial to ensure consistent personalization. By setting the contenteditable="false" attribute, you can prevent users from accidentally modifying or deleting the merge tags.
  4. Merge tags can be leveraged in a variety of applications, including email marketing, CRM systems, e-commerce, and content management. This makes them a powerful tool for enhancing personalization and user engagement.

What are merge tags?

Merge tags, also known as personalization tokens or mail merge fields, are dynamic placeholders that can be replaced with unique information for each user or recipient. These tags are commonly used in email marketing, customer relationship management (CRM) systems, and other applications where personalization is crucial for engagement and conversion.

When a user or recipient interacts with content that contains merge tags, the tags are replaced with the corresponding data, creating a tailored experience. For example, a merge tag like {{first_name}} might be replaced with the recipient’s first name, resulting in a message that feels more personal and relevant.

Implementing merge tags in the Froala WYSIWYG editor can significantly enhance the content creation process. Users can easily insert predefined tags, ensuring consistent and accurate personalization across all generated content.

Integrating Tribute.js with Froala

The Froala WYSIWYG editor provides seamless integration with the Tribute.js library, which enables the display of a dropdown list of predefined tags. Tribute.js is a lightweight, customizable autocomplete library that allows users to easily select and insert tags into the editor.

To get started, you’ll need to include both the Tribute.js and Froala libraries in your web application. You can do this by adding the following script tags to your HTML file:

<script src="https://cdn.jsdelivr.net/npm/tributejs@3.5.3/dist/tribute.js"></script>

<script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

Next, add an HTML element where Froala will initialize:

<div id="froala-editor">

  <p>Froala WYSIWYG Editor can easily be integrated with the awesome <a href="https://github.com/zurb/tribute" target="_blank" rel="nofollow">Tribute.js library</a>. Type an @ to display the autocomplete list.

  </p>

</div>

Then, initialize the Froala editor and configure the Tribute.js integration:

var tribute = new Tribute({
  collection: [
  
    {
      values: [
        { key: "Phil", value: "pheartman" },
        { key: "Gordon", value: "gramsey" },
        { key: "Ethan", value: "ethan" },
        { key: "Emma", value: "emma" },
        { key: "Isabella", value: "isabella" },
      ],
      selectTemplate: function (item) {
        return (
          '<span class="fr-deletable fr-tribute">' +
          item.original.key +
          "</a></span>"
        )
      },
    },
    {
     trigger: '{',
  selectClass: 'mytag',
      values: [
        { key: "username" },
        { key: "email"},
        { key: "sender.phone" },
        { key: "Address" },
        { key: "Date" },
        
      ],
      selectTemplate: function (item) {
        return (
          '<span class="fr-deletable fr-tribute">{{' +
          item.original.key +
          "}}</span>"
        )
      },
    },    
  ],
})

new FroalaEditor("#froala-editor", {
  events: {
    initialized: function () {
      var editor = this

      tribute.attach(editor.el)

      editor.events.on(
        "keydown",
        function (e) {
          if (e.which == FroalaEditor.KEYCODE.ENTER && tribute.isActive) {
            return false
          }
        },
        true,
      )
    },
  },
})

In this example, we’ve set up the Tribute.js integration to display two types of dropdown lists. One list is for user mentions, triggered by typing the @ character. The other list is for merge tags, triggered by typing the { character.

The values array contains the available tags for each dropdown. The selectTemplate function defines how the selected tag will be inserted into the editor. For merge tags, it will insert the tag surrounded by {{ and }}.

Finally, we attach the Tribute.js instance to the Froala editor’s element using the tribute.attach(editor.el) method.

Protecting Merge Tags

Once the user has selected a merge tag from the dropdown, the tag should be inserted into the Froala editor as a non-editable element. This ensures that the tag is easily identifiable and cannot be accidentally modified.

To achieve this, you can edit the custom HTML representation of the inserted tag in the selectTemplate function. Here’s an example:

      selectTemplate: function (item) {
        return (
          '<span class="fr-deletable fr-tribute fr-merge-tag"  contenteditable="false">{{' +
          item.original.key +
          "}}</span>"
        )
      },

In this code, the selected tag will be inserted with a custom HTML element (<span class="fr-deletable fr-tribute fr-merge-tag" contenteditable="false">{{' + item.original.key + "}}</span>).

The contenteditable="false" attribute ensures that the inserted merge tag cannot be accidentally modified by the user.

Additionally, this custom HTML element includes a merge-tag class which you can use to style and interact with the merge tags in your application.

Styling Merge Tags

To make the merge tags visually distinct within the editor, you can style the custom HTML elements using CSS:

.fr-merge-tag {

  background-color: #f0f0f0;

  border: 1px solid #ddd;

  border-radius: 4px;

  color: #333;

  display: inline-block;

  font-weight: bold;

  padding: 2px 6px;

  margin: 0 2px;

}

This will apply a subtle background color, border, and padding to the merge tag elements, making them stand out from the regular text.

By combining the power of Froala’s WYSIWYG editor and the Tribute.js library, you can create a seamless and user-friendly merge tag experience for your content creators. This will not only make it easier to insert personalization tokens but also ensure the final content is visually appealing and easy to maintain.

Experience Merge Tags for yourself

Play with this interactive demo to see how it can improve your app’s content creation, editing, and publishing experiences.

Use Cases for Merge Tags

Merge tags can be leveraged in a variety of applications to enhance personalization and improve user engagement. Here are some common use cases:

  1. Email Marketing: Merge tags are widely used in email marketing campaigns to personalize subject lines, greetings, and email content. Email merge tags help to increase open rates, click-through rates, and overall engagement.
  2. Customer Relationship Management (CRM): CRM systems often utilize merge tags to personalize customer communications, such as welcome messages, invoices, and support inquiries. This creates a more personalized experience for customers.
  3. E-commerce and Retail: Merge tags can be used to personalize product recommendations, order confirmations, and shipping notifications in e-commerce and retail applications. This can lead to increased sales and customer loyalty.
  4. Content Management Systems (CMS): Merge tags can be integrated into CMS platforms to allow content creators to easily insert personalized elements, such as the user’s name or location, into their content.
  5. Web Applications: Merge tags can be used in web applications to personalize user dashboards, account settings, and other user-specific content, enhancing the overall user experience.

A Practical Example of Merge Tags in Email Marketing: Mailchimp Merge Fields

One well-known example of merge tags are the merge fields used in email marketing platforms like Mailchimp. Mailchimp provides a variety of predefined merge fields, such as *|FNAME|* for the recipient’s first name, *|LNAME|* for the last name, and *|EMAIL|* for the email address.

These Mailchimp merge fields can be inserted into email subject lines, body content, and other areas of an email campaign. When the email is sent, Mailchimp will replace the merge fields with the corresponding data for each recipient, resulting in a personalized message.

Integrating Mailchimp merge fields with the Froala WYSIWYG editor can be a powerful way to create highly personalized email content. By allowing users to easily insert these predefined merge tags, you can streamline the email creation process and ensure consistent personalization across all your email campaigns.

Frequently Asked Questions

How can I customize the appearance of the merge tag dropdown?

You can customize the appearance of the merge tag dropdown by modifying the CSS styles applied to the Tribute.js elements. In the example code, we’ve applied some basic styles to the .fr-merge-tag class, but you can expand on this to match the branding and design of your application.

What happens if a user accidentally deletes or modifies a merge tag?

By setting the contenteditable="false" attribute on the merge tag elements, you can prevent users from directly editing or deleting the tags. However, if a user does manage to remove or modify a merge tag, you can implement additional safeguards, such as:

  • Providing a way for users to “undo” their changes and restore the original merge tag.
  • Validating the content before saving or publishing and alerting the user if any merge tags are missing or altered.
  • Automatically replacing any missing or modified merge tags with default values or placeholders.

How can I integrate merge tags with a CRM or user database to enhance personalization?

To take merge tags to the next level, you can integrate them with a customer relationship management (CRM) system or user database. This allows you to pull in dynamic data, such as a user’s name, email, or other personalized information, directly into your content.

When a user interacts with content that contains these merge tags, your application can retrieve the corresponding data from the CRM or database and replace the tags accordingly. This creates an even more personalized experience for your users.

By integrating merge tags with a CRM or user database, you can dynamically populate your content with user-specific information, ensuring each interaction is tailored to the individual. This can lead to increased engagement, higher conversion rates, and an overall more satisfying user experience.

How can I use merge tags to generate personalized documents?

Merge tags can be utilized to generate personalized documents, such as invoices, contracts, or reports. By embedding merge tags within the document template, you can dynamically populate the content with user-specific information, ensuring each document is tailored to the recipient.

This can be particularly useful for automating the creation of custom documents, reducing the manual effort required and ensuring consistency across all generated materials.

Conclusion

In this article, you’ve learned how to enable merge tags in the Froala WYSIWYG editor by integrating the Tribute.js library. You’ve seen how to configure the Tribute.js integration and render and display the merge tags.

By implementing merge tags in your Froala-powered applications, you can empower your users to create highly personalized and engaging content, leading to increased user satisfaction and conversion rates. Remember to continue exploring the vast capabilities of the Froala editor and the Tribute.js library to unlock even more powerful content creation features for your users.

Happy coding!

 

DeepSeek API Integration Guide (2026): Models, Setup, Code Examples & the V4 Migration

Conceptual 3D illustration of an AI model integration representing DeepSeek API capabilities

Quick Answer

The DeepSeek API is an OpenAI-compatible (and Anthropic-compatible) REST API at https://api.deepseek.com that gives developers access to DeepSeek’s large language models – currently deepseek-v4-flash and deepseek-v4-pro, both with a 1-million-token context window. You authenticate with a Bearer API key from platform.deepseek.com and call POST /chat/completions using the standard OpenAI SDK format. Important: the legacy model names deepseek-chat and deepseek-reasoner are retired on July 24, 2026 – new integrations should use the V4 model names.

Introduction

The fast-paced AI environment today enables developers to build applications using large language models (LLMs) and multimodal APIs, resulting in intelligent chatbots and advanced content-generation tools. DeepSeek stands as a powerful innovation that is gaining momentum in the rapidly advancing field of AI development.

So what’s behind the buzz? The DeepSeek platform provides developers with open-weight, high-performance models – headlined in 2026 by the DeepSeek-V4 family (deepseek-v4-pro and deepseek-v4-flash), which pair frontier-level coding and reasoning performance with a 1M-token context window and some of the lowest per-token prices of any major API. The DeepSeek API enables developers to access powerful capabilities that are specifically designed for practical applications when working with text, images, or code.

This guide provides information about DeepSeek and its comparison to other leading APIs, as well as a step-by-step process for project integration. This walkthrough provides step-by-step instructions to help beginners start their first AI application development while showing them how to replace OpenAI or Claude with confidence. It also covers the one thing every existing DeepSeek user needs to act on right now: migrating off the deprecated deepseek-chat and deepseek-reasoner model names before they stop working on July 24, 2026. Start building smarter websites with DeepSeek API integration and unlock endless possibilities for your next project

Key Takeaways

  • The DeepSeek API serves two models in 2026: deepseek-v4-flash (fast, low-cost default) and deepseek-v4-pro (strongest reasoning and agentic coding), both with a 1M-token context window.
  • Deadline: the legacy model names deepseek-chat and deepseek-reasoner are fully retired on July 24, 2026, 15:59 UTC. Migrating is usually a one-line model-name change.
  • The API is OpenAI-compatible and Anthropic-compatible – you can keep your existing OpenAI or Anthropic SDK and just change the base URL, key, and model name.
  • Pricing is usage-based and very low: deepseek-v4-flash costs about $0.14 per 1M input tokens (cache miss) and $0.28 per 1M output tokens, with cache-hit input tokens roughly 1/50th of that. V4-Pro costs more per token for harder tasks.
  • There are no fixed per-account rate limits, but DeepSeek applies dynamic concurrency limits under load and returns HTTP 429 – build in retries with exponential backoff.
  • Easy to use with Python, JavaScript, Postman, or curl via OpenAI-compatible endpoints.
  • No hard rate limits on the official API, but usage may vary with traffic or third-party hosts.
  • Free/self-hosted access available via Hugging Face (V4 weights are MIT-licensed); hosted use via OpenRouter or Together.ai.
  • Follow best practices: secure your API key, cache responses, and optimize prompts.
  • Can be embedded into apps like Froala Editor for AI-assisted content creation.

3D illustration of a robot assembling blocks with a magnet, representing DeepSeek API integration and AI-powered application building.

DeepSeek API at a glance (July 2026)

Item Details
Base URL https://api.deepseek.com (also /v1 for OpenAI-client compatibility)
Current models deepseek-v4-flash (default, low cost) · deepseek-v4-pro (top reasoning/coding)
Context window 1,000,000 tokens (both V4 models)
Deprecated names deepseek-chat & deepseek-reasoner – retired July 24, 2026, 15:59 UTC
API formats OpenAI-compatible Chat Completions + Anthropic-compatible endpoint
Pricing (V4-Flash) ~$0.14 / 1M input tokens (cache miss), ~$0.28 / 1M output; ~$0.0028 / 1M cache-hit input
Rate limits No fixed quotas; dynamic concurrency limits – HTTP 429 under load
Auth Bearer API key from platform.deepseek.com
Open weights / license Yes – Hugging Face, MIT License (DeepSeek-V4 series)

What is DeepSeek?

DeepSeek operates as an open-source AI project that develops large language and vision models for developers, researchers, and tech enthusiasts. DeepSeek presents itself as a clear and fast API solution that provides open access to its capabilities while encouraging community involvement and state-of-the-art functionality.

In 2026, the DeepSeek API is built around the DeepSeek-V4 family, released on April 24, 2026:

  •   deepseek-v4-pro – a 1.6-trillion-parameter Mixture-of-Experts model (49B active parameters) with a 1M-token context. It is the strongest open-weight model available for reasoning, math, and agentic coding, and the right choice when output quality matters more than cost.
  •   deepseek-v4-flash – a 284B-parameter MoE model (13B active) with the same 1M-token context. It approaches Pro-level reasoning at a fraction of the price and latency, making it the default for most production workloads.

Both models support an optional “thinking” mode: the model generates an internal chain of thought before answering, which improves accuracy on math and multi-step coding at the cost of more output tokens.

Earlier open-weight models remain available for self-hosting and research:

DeepSeek-Coder functions as an LLM (Large Language Model) that specializes in code generation, completion, and understanding of multiple programming languages. The system proves beneficial for software development automation, code review support, and the development of AI-based developer tools. On the hosted API, its capabilities have been folded into the V4 models – use deepseek-v4-pro for serious coding work.

DeepSeek-VL functions as a strong vision-language model that accepts multiple input types, including images, charts, documents, and text, to support applications such as visual question answering, caption generation, and document comprehension.

Note that DeepSeek-VL is used via its open weights (e.g., self-hosted from Hugging Face or through third-party hosts); the official DeepSeek API is focused on text and code.

The models within DeepSeek provide users with a wide range of AI application possibilities, including:

  • Coding assistance
  • Research and data analysis
  • Workflow automation
  • Multimodal applications combining text and images
  •   Long-document and long-codebase analysis (the 1M-token context fits entire repositories or book-length documents in a single request)

The open-source community supports DeepSeek as a flexible platform that serves developers who want to implement AI-driven development and users who need intelligent visual interfaces.

Urgent: migrating from deepseek-chat / deepseek-reasoner to V4

If you built your integration before April 2026 (including from an earlier version of this guide), your code probably calls deepseek-chat or deepseek-reasoner. Those names are legacy aliases that currently route to deepseek-v4-flash, and they will be fully retired and inaccessible after July 24, 2026, 15:59 UTC. After that timestamp, requests using the old names fail.

The migration itself is a one-line change:

"model": "deepseek-chat"

"model": "deepseek-v4-flash"

If you used deepseek-reasoner (chain-of-thought mode), switch to deepseek-v4-flash and enable thinking mode in the request body instead of switching model names:

{

  "model": "deepseek-v4-flash",

  "thinking": {"type": "enabled"},

  "reasoning_effort": "high",

  "messages": [{"role": "user", "content": "..."}]

}

Three practical tips:

  1. The base URL and your API key do not change;
  2. V4-Flash is a different model from the V3.2 weights the old alias served, so re-run your evals rather than assuming identical outputs.
  3. Check any gateways (OpenRouter, LiteLLM, etc.) and monitoring dashboards that pin the old model names

Key features of the DeepSeek API

DeepSeek stands apart from other AI APIs through its distinctive features in the expanding AI API market. The DeepSeek API stands out through these distinctive features, which make it an attractive option for developers and researchers:

Advanced language and vision understanding

DeepSeek models surpass traditional LLMs through their ability to merge natural language processing with visual understanding capabilities. DeepSeek delivers state-of-the-art performance through accurate context-aware outputs when you need to analyze code or generate text, or interpret image-text combinations.

1M-token context window

Both V4 models accept up to one million tokens of context – enough for entire codebases, long legal documents, or multi-hour transcripts in a single request. DeepSeek’s hybrid sparse-attention architecture keeps long-context requests fast and affordable compared with earlier generations.

Built-in reasoning (“thinking”) mode

Instead of maintaining a separate reasoning model, V4 exposes thinking as a per-request toggle with adjustable reasoning_effort. You pay for deeper reasoning only on the prompts that need it.

Open-source friendly

The open nature of DeepSeek distinguishes it from proprietary alternatives because it promotes open collaboration among developers. The developer-friendly ecosystem of DeepSeek enables open environment development, model auditing, and contribution and extension through its supportive framework for innovation and trust. The DeepSeek-V4 weights are published on Hugging Face under the permissive MIT License.

Scalable and high-performance

DeepSeek operates at high speeds and maintains low response times, which makes it appropriate for projects ranging from solo work to large enterprise implementations. The robust architecture of this system enables smooth handling of traffic and load regardless of the number of users it serves.

Competitive edge over other APIs

DeepSeek provides distinct advantages compared to proprietary APIs like OpenAI, Anthropic Claude, and Google Gemini through its unique strengths:

  • Open-source architecture with fewer usage limitations
  •   Dramatically lower per-token pricing than comparable frontier APIs, with automatic context-cache discounts
  •   Drop-in compatibility with both the OpenAI SDK and the Anthropic SDK – and direct support in agent tools like Claude Code, GitHub Copilot, and OpenCode

While each API has its strengths, DeepSeek stands out as a flexible and transparent solution, especially for those looking to build with open tools, experiment freely, or fine-tune for specific use cases.

Getting access to the DeepSeek API

The process to integrate DeepSeek API with your system remains simple, whether you are new to AI development or building it into an existing system.

Sign up for an account

The first step involves visiting deepseek.com or the official GitHub page to obtain registration or access instructions. DeepSeek models that are open on Hugging Face platforms do not require direct registration with DeepSeek unless you use their hosted API service.

Sign up for the DeepSeek API at platform.deepseek.com/sign_up.

Generate your API key

If you’re using an official DeepSeek-hosted API endpoint (or accessing via a third-party provider like Together.ai or OpenRouter), you’ll typically need to sign up and retrieve an API key from your dashboard. This key is used to authenticate your requests and track usage.

DeepSeek dashboard
DeepSeek dashboard

Pricing and free access

DeepSeek’s model weights – including the current DeepSeek-V4 series – are openly available on Hugging Face under the MIT License, which permits free research and commercial use, including self-hosting.

On the official hosted API (as of July 2026): deepseek-v4-flash costs about $0.14 per 1M input tokens on a cache miss and $0.28 per 1M output tokens, with cache-hit input tokens priced around $0.0028 per 1M. deepseek-v4-pro is roughly 3× the Flash price and is aimed at the hardest reasoning and agentic tasks. Billing is purely usage-based with no monthly minimum, which makes DeepSeek one of the cheapest ways to prototype and ship AI features. Always check the official pricing page for current numbers, since DeepSeek adjusts prices and runs launch discounts.

If you’re using the models via hosted APIs (e.g., Together.ai or OpenRouter), pricing will vary by provider and usage volume. DeepSeek’s open-source approach makes it a budget-friendly option for testing, development, and even production use when self-hosted.

DeepSeek Models & Pricing

Documentation and resources

The official API documentation provides a centralized reference for DeepSeek API integration. It includes:

  • Quick start guides
  • Input/output formats
  • Supported endpoints
  • Model capabilities
  • Sample scripts and integration examples

You can also find additional resources and real-world usage patterns on platforms like GitHub, Hugging Face model cards, and community forums. These sources offer valuable implementation tips and troubleshooting insights shared by developers.

Understanding the API basics

Before diving into implementation, it’s important to get familiar with the core components of the DeepSeek API. This section walks you through the base URL, authentication process, and any rate limits you should be aware of.

Base URL and endpoint structure

The DeepSeek API is accessible via:

https://api.deepseek.com

(For OpenAI‑compatible clients, you may also use `https://api.deepseek.com/v1`; this “v1” namespace is for compatibility, not model versions.)

DeepSeek also exposes an Anthropic-compatible endpoint, so teams using the Anthropic SDK can point it at DeepSeek without rewriting their integration.

Endpoints follow a consistent RESTful structure. For example:

POST /chat/completions – For generating text completions using models like deepseek-v4-flash or deepseek-v4-pro

Each request typically includes a `model` parameter, a `messages` array, and hyperparameters such as `temperature`, `max_tokens`, `frequency_penalty`, etc. V4 requests can additionally include a thinking object and a reasoning_effort level to control chain-of-thought reasoning.

Authentication methods

Authentication is handled via API keys. Once you create an account or access DeepSeek via a third-party provider (like OpenRouter), you’ll receive a token.

To authenticate a request, include the following header:

Authorization: Bearer YOUR_API_KEY

Never expose your key in client-side applications. Store it securely and rotate it regularly if needed.

Rate limits and usage caps

DeepSeek does not publish fixed per-account rate limits, but it does apply dynamic concurrency limits based on overall server load. When your concurrency ceiling is reached, the API returns HTTP 429 (Too Many Requests) – so production code should always implement retries with exponential backoff, even on the official API.

During periods of high load:

  • Non-streaming requests may return continuous empty lines.
  • Streaming requests may return keep-alive events (e.g., : keep-alive) until a full response is ready.

If a response cannot be completed within 30 minutes, the server will automatically close the connection.

⚠️ If you’re using DeepSeek through a third-party API provider (like OpenRouter or Together.ai), additional plan-based rate limits may apply on top of DeepSeek’s own concurrency behavior.

And if you’re self-hosting (e.g., via Hugging Face), usage is only limited by your compute power (e.g., GPU/CPU/memory).

For up-to-date behavior, check the official DeepSeek API docs or your provider’s dashboard.

Step-by-step integration guide

Let’s learn to integrate the DeepSeek API step by step.

Prerequisites

Before you begin your DeepSeek API integration, make sure you have the following:

  • Basic programming knowledge in a language like Python or JavaScript
  • Access to an API client such as:
    • Postman
    • curl (command-line tool)
    • A language-specific HTTP library like requests (Python) or fetch (JavaScript)
  • An API key from DeepSeek or a third-party provider (e.g., OpenRouter)

Making your first request

Let’s walk through a basic “Hello World”-style text generation request using the /chat/completions endpoint.

Python example:

import requests

url = "https://api.deepseek.com/v1/chat/completions"

headers = {

    "Authorization": "Bearer YOUR_API_KEY",

    "Content-Type": "application/json"

}

data = {

    "model": "deepseek-v4-flash", # legacy name "deepseek-chat" is retired on July 24, 2026

    "messages": [{"role": "user", "content": "Say hello to the world!"}],

    "temperature": 0.7

}

response = requests.post(url, headers=headers, json=data)

print(response.json())

cURL example:

curl https://api.deepseek.com/v1/chat/completions \

  -H "Authorization: Bearer YOUR_API_KEY" \

  -H "Content-Type: application/json" \

  -d '{

        "model": "deepseek-v4-flash",

        "messages": [{"role": "user", "content": "Say hello to the world!"}],

        "temperature": 0.7

      }'

Bonus – using the OpenAI SDK (recommended):

# pip install openai
from openai import OpenAI
 
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.deepseek.com")
 
response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Say hello to the world!"}],
)
print(response.choices[0].message.content)

Response format:

The response will be a JSON object with a choices array. You can extract the generated text like this:

{

  "choices": [

    {

      "message": {

        "role": "assistant",

        "content": "Hello, world!"

      }

    }

  ]

}

Step-by-step setup in Postman

You can run the equivalent of the above request code in Postman by setting up a POST request with the correct headers and JSON body.

Here’s how to do it step by step in Postman:

1. Set the request method to POST

URL:

https://api.deepseek.com/v1/chat/completions

2. Set the headers

Go to the “Headers” tab and add:

Key Value
Authorization Bearer YOUR_API_KEY
Content-Type application/json

Replace YOUR_API_KEY with your actual DeepSeek API key.

Setting HTTP Headers for DeepSeek API Call in Postman
Setting HTTP Headers for DeepSeek API Call in Postman

3. Set the request body

Go to the “Body” tab → Select “raw” → Choose JSON (from the dropdown).

Paste the following JSON:

 

{

  "model": "deepseek-v4-flash",
  "messages": [

    {

      "role": "user",

      "content": "Say hello to the world!"

    }

  ],

  "temperature": 0.7

}
Example JSON Body for a DeepSeek Chat Completion API Request
Example JSON Body for a DeepSeek Chat Completion API Request

4. Send the request

Click the “Send” button.

5. View the response

You’ll get a JSON response like:

{

  "choices": [

    {

      "message": {

        "role": "assistant",

        "content": "Hello, world!"

      }

    }

  ]

}

Example DeepSeek API Response for Chat Completion
Example DeepSeek API Response for Chat Completion

 

Handling errors and debugging

When working with any API, it’s important to know how to handle errors gracefully.

Common error messages:

  • 401 Unauthorized: Check if your API key is missing or incorrect.
  • 400 Bad Request: Often due to malformed JSON or missing parameters – including calling a retired model name such as deepseek-chat after July 24, 2026.
  • 402 Payment Required: Your account has insufficient balance to process this request.
  • 429 Too Many Requests: Returned by the official API when DeepSeek’s dynamic concurrency limit is reached (and by third-party providers when you exceed plan limits). Retry with exponential backoff.
  • 500 Internal Server Error: May occur under heavy load or internal issues.

Retry strategies:

  • Use exponential backoff for retrying failed requests (especially 429, 500, 503 or timeout errors).
  • Avoid retrying 400 or 401 errors unless corrected.

Logging best practices:

  • Log the full request payload and response body (excluding API keys).
  • Tag logs with timestamps and response status codes for traceability.

A quick note on Froala integration

Because DeepSeek is an API-based service, it can be embedded into various applications, including our very own Froala WYSIWYG Editor. While we won’t go deep into this here, the potential is exciting: AI-assisted content suggestions, intelligent grammar corrections, or auto-generated text snippets—all triggered live within the editing interface.

Imagine building a rich-text editor that not only formats your content but also helps generate it. That’s the kind of seamless experience developers can create by combining the Froala Editor with DeepSeek API integration.

For example, you could build a note-taking or documentation app where DeepSeek autocompletes sentences or summarizes content directly inside Froala’s editor frame.

DeepDive: Example use cases

Let’s explore how DeepSeek’s models perform in real-world scenarios—from writing clean code to understanding multimodal content.

Code completion or generation with DeepSeek-Coder

deepseek-v4-pro is DeepSeek’s strongest model for software development tasks such as autocompletion, refactoring suggestions, debugging, and generating functions from plain-text prompts – it currently posts open-source state-of-the-art results on agentic coding benchmarks. For lighter coding tasks, deepseek-v4-flash is usually sufficient and far cheaper.

Input/output sample:

Input prompt:

 

{"role": "user", "content": "Write a Python function to check if a number is prime."}

Output:

def is_prime(n):

    if n <= 1:

        return False

    for i in range(2, int(n**0.5) + 1):

        if n % i == 0:

            return False

    return True

This makes DeepSeek ideal for coding assistants, educational platforms, and documentation generators.

Editor and agent integrations: The DeepSeek API is now supported as a backend model by popular AI coding tools – including Claude Code, GitHub Copilot, and OpenCode – so you can use DeepSeek inside your IDE with no custom wrapper code. See DeepSeek’s Agent Integrations guide for setup.

Multimodal tasks with DeepSeek-VL

DeepSeek-VL enables models to process both visual and text inputs, making it useful for applications involving documents, images, and diagrams.  (Reminder: run DeepSeek-VL via its open weights or a third-party host – the official hosted API is text/code-focused.)

Example input:

  • Image: A scanned document or screenshot
  • Text prompt: “Summarize the key points from this image.”

The model interprets the visual content and responds with a meaningful summary or extracted data.

Sample application:

  • Caption generation: Upload an image and receive an accurate caption like:
    “A group of engineers reviewing a circuit board schematic on a table.”

 

  • Document Q&A: Upload a PDF and ask:
    “What is the main clause in paragraph 3?”
    → DeepSeek-VL reads the image-based document and extracts answers.

 

These use cases show how DeepSeek API integration can power next-gen apps across development, education, productivity, and visual understanding.

Popular DeepSeek API prompts and questions developers are searching

These are the highest-demand questions and prompt patterns people type into Google and AI assistants about the DeepSeek API right now. Each gets a direct answer here (and doubles as a copy-paste starting point).

“How do I migrate from deepseek-chat to deepseek-v4-flash?”

Change the model string from deepseek-chat to deepseek-v4-flash. Your base URL and API key stay the same. If you used deepseek-reasoner, use deepseek-v4-flash with “thinking”: {“type”: “enabled”}. Complete this before July 24, 2026, when the old names stop working.

“How do I use the DeepSeek API with the OpenAI Python SDK?”

Install the openai package, set base_url=“https://api.deepseek.com”, pass your DeepSeek key, and call chat.completions.create with model=“deepseek-v4-flash”. Streaming, function calling, and the messages array work as they do with OpenAI.

“DeepSeek API vs OpenAI API – which is cheaper?”

DeepSeek is substantially cheaper per token: deepseek-v4-flash runs about $0.14/1M input and $0.28/1M output tokens, an order of magnitude below comparable frontier-model pricing, with cache-hit input tokens discounted a further ~50×. For most high-volume text and coding workloads, DeepSeek is the lowest-cost frontier-adjacent option.

“How do I enable thinking / reasoning mode in the DeepSeek API?”

Add “thinking”: {“type”: “enabled”} to the request body (in the OpenAI SDK, pass it via extra_body) and optionally set reasoning_effort to low, medium, or high. Reserve it for math, debugging, and multi-step tasks – it improves accuracy but produces more output tokens.

“What is the DeepSeek API rate limit?”

There is no fixed published rate limit; DeepSeek dynamically limits concurrency based on server load and returns HTTP 429 when the ceiling is hit. Implement exponential-backoff retries and, for bursty workloads, consider a third-party host with guaranteed throughput.

“Write a prompt that makes DeepSeek generate production-ready code”

A pattern that works well with deepseek-v4-pro: “You are a senior [language] engineer. Write a [function/module] that [exact requirement]. Include type hints, docstrings, error handling, and unit tests. Do not include explanations outside code comments.” Being explicit about output structure is the single biggest quality lever.

Best practices for working with DeepSeek API

To get the most out of your DeepSeek API integration, follow these best practices for security, performance, and cost-efficiency.

Token management & security tips

  • Never expose API keys in frontend code or public repositories.
  • Use environment variables or secret managers to store keys securely.
  • Rotate keys periodically and revoke them immediately if compromised.
  • Consider using IP whitelisting if supported by your API provider.

Optimizing input prompts

  • Keep prompts clear and context-rich, especially when working with coding or multimodal tasks.
  • Avoid unnecessary verbosity—it can waste tokens and reduce model accuracy.
  • Test prompt variations to identify the most efficient phrasing for consistent results.

Example:

Instead of saying:

“Please can you help me by writing a function that checks whether a number is prime?”
Try:
“Write a Python function to check if a number is prime.”

Choose the right model (and mode) per task

  • Route routine tasks (summaries, edits, formatting, simple generation) to deepseek-v4-flash in non-thinking mode – it’s the cheapest and fastest path.
  • Escalate hard reasoning, math, and complex debugging to thinking mode or deepseek-v4-pro, where the extra output tokens pay for themselves in accuracy.
  • Keep stable system prompts and shared context identical across requests to maximize context-cache hits – cache-hit input tokens cost roughly 1/50th of cache-miss tokens.

Caching strategies for repeated calls

  • If your app sends the same or similar requests frequently, implement caching at the application level.
  • Cache both input-response pairs and processed outputs to reduce token consumption and latency.
  • Use hash keys of prompt strings as identifiers for quick retrieval.

Rate limiting and efficient usage

Although DeepSeek’s official API does not enforce fixed rate limits, dynamic concurrency limits apply, and usage can still be impacted by:

  • Server congestion
  • Timeout thresholds (e.g., 30-minute max response window)

To ensure efficient usage:

  • Batch smaller queries when possible
  • Use streaming mode for faster response delivery
  • Implement retry logic with exponential backoff for handling transient errors (especially HTTP 429, 500, and 503)

By following these practices, you’ll build more stable, secure, and scalable applications while keeping your DeepSeek usage optimized and cost-effective.

Conclusion

In this guide, we explored everything you need to know about DeepSeek API integration—from understanding its models and features to setting up your first request and handling advanced use cases. Whether you’re shipping high-volume features on deepseek-v4-flash, tackling hard reasoning with deepseek-v4-pro, or self-hosting the MIT-licensed open weights, the API offers flexibility, speed, and open accessibility for modern AI development. And if you’re on the legacy deepseek-chat or deepseek-reasoner names, migrate to the V4 model names before July 24, 2026.

Now it’s your turn. Start small with a simple prompt, or go big by integrating DeepSeek into your next project. There’s a lot to discover—and even more to build.

FAQs

What is the DeepSeek API used for?

The DeepSeek API enables developers to integrate advanced AI models – currently deepseek-v4-flash and deepseek-v4-pro, both with a 1M -token context window-into their applications. It’s ideal for building chatbots, code assistants, and AI‑powered content tools using open‑source, high‑performance models.

How do I get started with DeepSeek API integration?

To start using the DeepSeek API, create an account at platform.deepseek.com and generate an API key, then make API calls using Python, JavaScript, Postman, or curl. DeepSeek supports OpenAI-compatible and Anthropic-compatible endpoints, making it easy to switch from other APIs such as OpenAI or Claude by changing only the base URL, key, and model name.

Is the DeepSeek API free to use?

The hosted API is paid but very inexpensive (usage-based, no subscription – roughly $0.14–$0.28 per million tokens on deepseek-v4-flash). Many DeepSeek models, including the DeepSeek-V4 series, are available for free as open weights on Hugging Face under the MIT License, so you can self-host at no licensing cost. If you use hosted endpoints via providers such as OpenRouter or Together.ai, usage fees may apply depending on your plan and traffic volume.

What happened to deepseek-chat and deepseek-reasoner?

They became legacy aliases when DeepSeek-V4 launched on April 24, 2026 (routing to deepseek-v4-flash’s non-thinking and thinking modes), and they are fully retired on July 24, 2026, 15:59 UTC. After that, requests using the old names fail – update your model strings to deepseek-v4-flash or deepseek-v4-pro.

What is the difference between deepseek-v4-flash and deepseek-v4-pro?

Both have a 1M-token context. deepseek-v4-flash (284B parameters, 13B active) is the fast, low-cost default for most workloads. deepseek-v4-pro (1.6T parameters, 49B active) costs roughly 3× more per token and is the pick for the hardest reasoning, math, and agentic coding tasks.

Does the DeepSeek API have rate limits?

No fixed quotas are published, but DeepSeek applies dynamic concurrency limits based on server load and returns HTTP 429 when they’re hit. Build retry logic with exponential backoff, and note that third-party hosts (OpenRouter, Together.ai) add their own plan-based limits.

Is the DeepSeek API compatible with the OpenAI SDK?

Yes. Point the OpenAI SDK’s base_url at https://api.deepseek.com, use your DeepSeek API key, and pass a DeepSeek model name. An Anthropic-compatible endpoint is also available. Compatibility isn’t identical behavior, though – re-test outputs, tool calls, and JSON reliability after switching.

What is the DeepSeek API context window?

Both deepseek-v4-flash and deepseek-v4-pro support a context window of 1,000,000 tokens – large enough for entire codebases or book-length documents in a single request.

Step-by-Step Guide to Building a Responsive Website with a Bootstrap WYSIWYG Editor

A responsive website layout displayed on desktop, tablet, and mobile devices, built using a Bootstrap WYSIWYG editor.

The digital world demands responsive web design as an essential requirement. Users now access websites from phones, tablets, and desktops—your site must deliver a smooth experience across all screen sizes. 

One of the best solutions is Bootstrap, the popular front-end framework for building mobile-first designs. But writing code manually isn’t for everyone. That’s where a Bootstrap WYSIWYG editor comes in—combining drag-and-drop simplicity with Bootstrap’s responsive grid system. With these editors, you can create professional, mobile-friendly websites without starting from scratch.

What is Bootstrap, and why use it?

Bootstrap is a popular front-end framework originally developed by Twitter in 2011. It was built to help developers create consistent, responsive designs more efficiently. Today, it powers millions of websites and is currently in its fifth major version (Bootstrap 5), offering modern features and a mobile-first approach.

Key features

  • Grid System: Bootstrap’s 12-column layout makes it easy to create responsive page structures.
  • Components: Prebuilt elements like buttons, navbars, cards, and modals speed up development.
  • Utility Classes: Apply spacing, colors, alignment, and more directly in HTML.
  • Mobile-First Design: All components are designed to look great on small screens first.

Why choose Bootstrap?

Bootstrap stands out for its ease of use and flexibility. You can build sleek, functional websites without starting from scratch or writing a lot of custom CSS.

Pros:

  • Fast prototyping with reusable components.
  • Built-in responsiveness.
  • Strong community and documentation.
  • Easy to integrate with most editors and tools.

Cons:

  • May include more code than needed for small projects.
  • Customizing deeply can be challenging.
  • Websites can look similar if not styled further.

Overall, Bootstrap is a solid choice for building responsive sites quickly, especially when paired with a visual editor to simplify the process.

Check out all the Bootstrap classes here.

Overview of Bootstrap WYSIWYG editors

When building responsive websites with Bootstrap, many developers also want to offer live editing capabilities — whether it’s for a content management system, admin panel, or inline content editing experience. That’s where WYSIWYG Bootstrap editors come into play.

These are not standalone site builders — instead, they are embeddable editors that integrate into your Bootstrap-based website, allowing users to edit content directly on the page while preserving Bootstrap’s layout and styling.

What is a Bootstrap-compatible WYSIWYG editor?

A Bootstrap-compatible WYSIWYG (What You See Is What You Get) editor is an embeddable content editor that works seamlessly with Bootstrap’s grid system, components, and utility classes. These editors let users update text, images, media, and layout blocks inside a live Bootstrap site without breaking responsive design.

WYSIWYG vs. Code-based editors

  • WYSIWYG editors like Froala are designed for non-technical users or content editors who need to make real-time updates without writing code. They’re often integrated into CMSs, admin dashboards, and SaaS applications.
  • Code-based editors, in contrast, are used by developers to manually write and maintain HTML/CSS/JS. They’re ideal for full-code control but aren’t suitable for non-technical content editing.

Bootstrap-compatible editors to consider

Here are some WYSIWYG editors that integrate well into Bootstrap-based websites:

  • Froala – A clean, lightweight, and highly customizable WYSIWYG HTML editor. Froala is Bootstrap-aware, supports inline editing, offers a responsive UI, and can be embedded directly into any Bootstrap project. It also supports custom toolbars, image uploads, code view, and works well in modern JavaScript frameworks.
  • TinyMCE – Another popular embeddable WYSIWYG editor that can be styled to match Bootstrap. Offers plugin-based customization and responsive layouts.
  • CKEditor – A rich editor that integrates with responsive frameworks, including Bootstrap. It has collaboration features and enterprise-ready tooling.

Note: Tools like Bootstrap Studio or Pinegrow are layout builders, not embeddable editors for Bootstrap websites. They are great for prototyping, but they don’t offer live, in-browser editing like Froala does.

How to choose the right Bootstrap WYSIWYG editor

When picking an editor for your Bootstrap website, consider:

  • Bootstrap Compatibility – Does the editor respect your existing layout and CSS classes?
  • Ease of Integration – Can it be easily embedded with minimal setup?
  • Responsiveness – Does it adapt across devices like your Bootstrap site?
  • Customizability – Can you extend or modify its UI and features?

If you’re looking to add live, responsive content editing to your Bootstrap website, Froala offers one of the smoothest and most developer-friendly integrations available.

Preparation: setting up your project

Before we dive into building our website, we need to set up a clean development environment. In this tutorial, we’ll create a dog adoption agency website to demonstrate how you can embed a WYSIWYG editor like Froala, use Bootstrap for layout and responsiveness, and integrate Filestack for handling images.

These tools work seamlessly together:

  • Bootstrap handles layout and design.
  • Froala provides inline content editing.
  • Filestack simplifies uploading and managing media.

Choosing a bootstrap-compatible editor

For this guide, we’re using Froala Editor. It’s a lightweight, embeddable WYSIWYG editor that fits perfectly into modern responsive websites. Froala is Bootstrap-aware — it respects your layout, classes, and components — and it allows users to edit content directly inside styled elements like cards, columns, or even modals.

Creating a new project

Start by organizing your files with a simple directory structure:

/bootstrap-froala-site

  ├── index.html

  ├── /css

  │   └── style.css

  ├── /js

  │   └── script.js

  └── /assets

      └── images/

This setup makes it easier to manage your code, styles, scripts, and media as your site grows.

Overview of bootstrap file structure

When building with Bootstrap 5, the core files you’ll need are:

  • bootstrap.min.css – for responsive styling and layout utilities.
  • bootstrap.bundle.min.js – includes Bootstrap’s interactive JavaScript components (like modals and dropdowns) and dependencies like Popper.js.

In addition, we’ll include:

  • Froala CSS/JS – to enable rich-text editing.
  • Filestack SDK – to enable media upload and processing.

Importing Bootstrap, Filestack, and Froala

Below is the basic HTML skeleton you can use. Notice that we’ve included Bootstrap, Filestack, and Froala scripts. These files enable you to leverage Bootstrap for responsive layout, work with Filestack for image handling, and embed Froala for live content editing:

index.html

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Dog Adoption Agency</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap CSS -->

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">

    <!-- Froala Editor CSS -->

    <link href='https://cdn.jsdelivr.net/npm/froala-editor@4.3/css/froala_editor.pkgd.min.css' rel='stylesheet'

        type='text/css' /> <!-- Filestack JS and CSS (Picker, Drag-and-Drop, Transforms) -->

    <script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"> </script>

    <script

        src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"> </script>

    <script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"> </script>

    <link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />

    <!-- Froala Editor JS -->

    <script type='text/javascript'

        src='https://cdn.jsdelivr.net/npm/froala-editor@4.3/js/froala_editor.pkgd.min.js'> </script>

</head>

<body> <!-- Content goes here --> <!-- Bootstrap JS -->

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"> </script>

</body>




</html>

With this setup, you’re ready to start building your dog adoption agency website with embedded editing, responsive layout, and modern media capabilities.

Step-by-step: Building your responsive website

With our project environment set up and Bootstrap, Froala, and Filestack integrated, let’s start building the dog adoption agency website section by section. We’ll walk through how to structure the layout, embed interactive components, and bring the site to life using Bootstrap’s utility classes and JavaScript components — all while enabling rich content editing and image uploads.

Step 1: Build a sticky navbar

Start with a Bootstrap sticky navbar that stays fixed to the top as users scroll. It contains anchor links that smoothly guide users to each section of the page.

index.html – inside the <body> tag

<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">

  <div class="container-fluid">

    <a class="navbar-brand" href="#">DogAdopt</a>

    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">

      <span class="navbar-toggler-icon"></span>

    </button>

    <div class="collapse navbar-collapse" id="navbarNav">

      <ul class="navbar-nav ms-auto">

        <li class="nav-item"><a class="nav-link active" href="#">Home</a></li>

        <li class="nav-item"><a class="nav-link" href="#adopt">Adoptable Dogs</a></li>

        <li class="nav-item"><a class="nav-link" href="#pricing">Pricing</a></li>

        <li class="nav-item"><a class="nav-link" href="#comment">Comment</a></li>

      </ul>

    </div>

  </div>

</nav>

Step 2: Create a hero section

Use a simple Bootstrap hero layout to grab attention with a clear message and call to action.

index.html – inside the <body> tag

<section class="bg-light text-dark py-5 text-center">

  <div class="container">

    <h1 class="display-4">Save a Life, Adopt a Dog</h1>

    <p class="lead">Join our community and give a loving home to these adorable companions.</p>

    <a href="#adopt" class="btn btn-primary btn-lg">Find Your Companion</a>

  </div>

</section>

So far, your page should look something like this:

Froala Bootstrap website - after adding hero section

Step 3: Add an image carousel

Bootstrap’s carousel component highlights adoptable dogs using high-quality Filestack-transformed images.

index.html – inside the <body> tag

<!-- Add an image carousel -->
    <div id="dogCarousel" class="carousel carousel-dark slide" data-bs-ride="carousel">
        <div class="carousel-indicators"> <button type="button" data-bs-target="#dogCarousel" data-bs-slide-to="0"
                class="active" aria-current="true"></button> <button type="button" data-bs-target="#dogCarousel"
                data-bs-slide-to="1"></button> <button type="button" data-bs-target="#dogCarousel"
                data-bs-slide-to="2"></button> </div>
        <div class="carousel-inner">
            <div class="carousel-item active"> <img
                    src="https://cdn.filestackcontent.com/resize=width:1200,height:500/hmzhYgUSZiIA0Ju2ocMo"
                    class="d-block w-20" alt="Friendly Dog 1"> </div>
            <div class="carousel-item"> <img
                    src="https://cdn.filestackcontent.com/resize=width:1200,height:500/xsFLOcdRYKQOz4oQpmgg"
                    class="d-block w-20" alt="Friendly Dog 2"> </div>
            <div class="carousel-item"> <img
                    src="https://cdn.filestackcontent.com/resize=width:1200,height:500/e0DUJOjTjWmUQm0FxL7e"
                    class="d-block w-20" alt="Friendly Dog 3"> </div>
        </div> <button class="carousel-control-prev" type="button" data-bs-target="#dogCarousel" data-bs-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span
                class="visually-hidden">Previous</span> </button> <button class="carousel-control-next" type="button"
            data-bs-target="#dogCarousel" data-bs-slide="next"> <span class="carousel-control-next-icon"
                aria-hidden="true"></span> <span class="visually-hidden">Next</span> </button>
    </div>

Update the image URLs with your Filestack handles or transformed links.

To center the images within the carousel, add the following CSS. You can place it in your style.css file (if you’re using a separate stylesheet) or directly in your index.html file, just inside the <style> tag and placed within the <head> section.

Style.css

 

<style>

    .carousel-inner img {

        margin: auto;

    }

</style>

Here’s how your page should be shaping up so far:

Froala Bootstrap page after adding carousel

Step 4: Enable image upload with Filestack

Embed a Filestack picker to let users upload new dog images:

index.html – inside the <body> tag

<!-- Filestack Mini-Section -->

    <section class="py-4 text-center">

        <div class="container">

            <h3>Upload a picture of your own dog</h3>

            <p>Upload and transform images directly, then embed them on your site.</p>

            <button class="btn btn-secondary" onclick="openFilestackPicker()">Upload a New Dog Image</button>

        </div>

    </section>

<script>

    const client = filestack.init('YOUR_API_KEY'); // Replace 'YOUR_API_KEY' with your actual Filestack API key. 

    function openFilestackPicker() {

        client.picker({

        onUploadDone: (res) => {

            console.log('Uploaded file handle:', res.filesUploaded[0].handle);

        }

        }).open();

    }

 </script>

Replace ‘YOUR_API_KEY’ with your actual Filestack API key.

Sign up for free today to get your Filestack API key.

You can also place the script in a separate script.js file and reference it in the <body> section of your index.html file like this:

<script src="js/script.js"></script>

Make sure the path matches your folder structure (e.g., js/ in this case).

Froala Bootstrap webpage after adding Filestack file uploader

Step 5: Display adoptable dogs with cards

Showcase adoptable dogs using Bootstrap cards:

index.html – inside the <body> tag

<!--Display adoptable dogs with cards-->    

<section id="adopt" class="py-5">

        <div class="container">

            <h2 class="mb-4 text-center">Meet Our Adorable Dogs</h2>

            <div class="row">

                <div class="col-md-6 col-lg-4 mb-4">

                    <div class="card"> <img

                            src="https://cdn.filestackcontent.com/resize=width:1200,height:500/hmzhYgUSZiIA0Ju2ocMo"

                            class="card-img-top" alt="Buddy">

                        <div class="card-body">

                            <h5 class="card-title">Buddy</h5>

                            <p class="card-text">A playful pup who loves belly rubs and afternoon walks.</p> <a href="#"

                                class="btn btn-primary">Adopt Buddy</a>

                        </div>

                    </div>

                </div>

                <div class="col-md-6 col-lg-4 mb-4">

                    <div class="card"> <img

                            src="https://cdn.filestackcontent.com/resize=width:1200,height:500/xsFLOcdRYKQOz4oQpmgg"

                            class="card-img-top" alt="Lucy">

                        <div class="card-body">

                            <h5 class="card-title">Lucy</h5>

                            <p class="card-text">A gentle soul who gets along with children and other pets.</p> <a href="#"

                                class="btn btn-primary">Adopt Lucy</a>

                        </div>

                    </div>

                </div>

                <div class="col-md-6 col-lg-4 mb-4">

                    <div class="card"> <img

                            src="https://cdn.filestackcontent.com/resize=width:1200,height:500/e0DUJOjTjWmUQm0FxL7e"

                            class="card-img-top" alt="Max">

                        <div class="card-body">

                            <h5 class="card-title">Max</h5>

                            <p class="card-text">A loyal companion who enjoys fetch and lazy afternoons.</p> <a href="#"

                                class="btn btn-primary">Adopt Max</a>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </section>

Froala Bootstrap webpage displaying adoptable dogs with cards

Step 6: Add a pricing section with cards

Showcase your adoption packages using Bootstrap cards combined with utility classes for spacing and layout.

index.html – inside the <body> tag

<!--Add Pricing section-->

    <section id="pricing" class="bg-light py-5">

        <div class="container text-center">

            <h2 class="mb-4">Adoption Packages</h2>

            <div class="row">

                <div class="col-md-4 mb-4">

                    <div class="card h-100">

                        <div class="card-body">

                            <h5 class="card-title">Basic</h5>

                            <p class="card-text">$50 Donation</p>

                            <ul class="list-unstyled">

                                <li>Initial Checkup</li>

                                <li>Vaccinations</li>

                            </ul> <a href="#" class="btn btn-primary">Adopt Now</a>

                        </div>

                    </div>

                </div>

                <div class="col-md-4 mb-4">

                    <div class="card h-100">

                        <div class="card-body">

                            <h5 class="card-title">Standard</h5>

                            <p class="card-text">$100 Donation</p>

                            <ul class="list-unstyled">

                                <li>All Basic Perks</li>

                                <li>Pet Insurance (6 months)</li>

                            </ul> <a href="#" class="btn btn-success">Adopt Now</a>

                        </div>

                    </div>

                </div>

                <div class="col-md-4 mb-4">

                    <div class="card h-100">

                        <div class="card-body">

                            <h5 class="card-title">Premium</h5>

                            <p class="card-text">$150 Donation</p>

                            <ul class="list-unstyled">

                                <li>All Standard Perks</li>

                                <li>Lifetime Vet Support</li>

                            </ul> <a href="#" class="btn btn-warning">Adopt Now</a>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </section>

Froala Bootstrap webpage after adding Pricing

Step 7: Add a comment section with Froala

Enable live WYSIWYG editing using Froala Editor for user comments.

<!--Adding a Bootstrap Editor WYSIWYG Froala-->
    <section id="comment" class="py-5">
        <div class="container">
            <h2 class="mb-4 text-center">Leave a Comment</h2>
            <div id="editor"></div>
        </div>
    </section>
    <script> var editor = new FroalaEditor('#editor', {
        imageEditButtons: ['imageReplace', 'imageAlign', 'imageCaption', 'filestackIcon', 'imageTUI'], filestackOptions: {
            uploadToFilestackOnly: false, filestackAPI: '***', // Replace with your Filestack API key 

            pickerOptions: { fromSources: ['local_file_system', 'imagesearch', 'url', 'googledrive', 'facebook'], accept: [".pdf", "image/jpeg", "image/png", "image/webp", "video/*", "audio/*"], transformations: { crop: true, rotate: true } }
        },
    }); 
    </script>

Add a comment section with Froala

With these steps, your responsive website now includes:

  • A mobile-friendly layout with Bootstrap
  • Live content editing powered by Froala
  • Image uploads and transformations via Filestack

Check out the full example on our GitHub repo!

Next, we’ll look at testing, optimization, and going live.

Testing and optimization

Before going live, ensure your site looks great and performs well across all devices.

Preview and test

  • Use Chrome DevTools or built-in browser tools to preview different screen sizes.
  • Test on major browsers like Chrome, Firefox, Safari, and Edge.
  • View your site on real phones or tablets when possible.
Responsive preview of the dog adoption website built with Bootstrap, Froala and Filestack (iPad view)
Responsive preview of the dog adoption website built with Bootstrap, Froal, and Filestack (iPad view)

Optimize performance

  • Minify your HTML, CSS, and JS files to reduce load time.
  • Compress and resize images using Filestack or similar tools.
  • Use lazy loading for images and videos to boost speed, especially on mobile.

Exporting and going live

Once your dog adoption website is complete, it’s time to bring it online. This final step outlines how to export your project, host it, and make it accessible to users worldwide.

Exporting your project

If you’ve been working in an online editor, download your full project as a .zip file or copy the HTML, CSS, and JS files manually. If you’re developing locally, your index.html, css/, and js/ folders are already ready to deploy.

Hosting options

You can host your site for free using services like:

  • GitHub Pages – Ideal for static HTML/CSS projects and version control.
  • Netlify – Offers drag-and-drop deployment, custom domains, and CI/CD support.
  • Vercel – Great for frontend developers; supports instant previews and easy deployment.

Connecting a domain

After hosting your site, you can connect a custom domain:

  • Purchase a domain from registrars like Namecheap or GoDaddy.
  • Point the domain’s DNS to your hosting provider (e.g., add A records for Netlify or GitHub).
  • Most platforms provide step-by-step domain setup guides.

This example guide is provided by Namecheap.

Basic SEO and meta tags

To improve visibility and search performance:

  • Add a <title> tag and a descriptive <meta name=”description”> to your HTML <head>.
  • Use semantic HTML (e.g., <header>, <main>, <section>).
  • Include alt text for images and ensure the site is mobile-friendly.

Example:

 

<!-- Example meta tags -->

<title>DogAdopt – Adopt a Dog Today</title>

<meta name="description" content="Find and adopt your perfect dog companion. Browse dogs, learn about adoption, and support a great cause.">

With these steps, your Bootstrap + Froala-powered website is live and ready to help dogs find their forever homes.

Advanced tips and next steps

Once your Bootstrap website with Froala and Filestack is up and running, you may want to take it a step further. Here are a few ways to level up your skills and make your site even more powerful, customized, and accessible.

Integrate with modern frameworks

If you’re building a more dynamic or scalable project, consider integrating Bootstrap with popular JavaScript frameworks like:

  • React (with react-bootstrap or reactstrap)
  • Angular (using ng-bootstrap)
  • Vue (with bootstrap-vue)

These integrations allow you to combine Bootstrap’s styling with framework-specific component logic and interactivity.

Use Bootstrap themes and templates

Speed up design by using pre-built Bootstrap themes or UI kits. You can:

Learn SCSS for deeper customization

Bootstrap is built with Sass, and learning it unlocks powerful features:

  • Change default colors, spacing, and breakpoints.
  • Import only the components you need to reduce file size.
  • Build fully custom design systems on top of Bootstrap.

Prioritize accessibility

Make your site usable for everyone by applying accessibility best practices:

  • Use semantic HTML and ARIA roles.
  • Maintain color contrast for readability.
  • Ensure full keyboard navigation for all interactive elements.

You can test accessibility with tools like Lighthouse, Axe DevTools, or WAVE.

Conclusion

In this tutorial, we walked through how to build a fully responsive dog adoption website using Bootstrap, Froala, and Filestack. You learned how to:

  • Set up your project structure and import essential tools
  • Create a clean, mobile-friendly layout with Bootstrap
  • Enable inline content editing with Froala
  • Upload and manage media using Filestack
  • Test, optimize, and publish your site with ease

This guide highlights the power and efficiency of modern web development when combining Bootstrap with embeddable editors like Froala and tools like Filestack.

Now it’s your turn to experiment! Try adding new sections, customizing styles, or integrating this layout into a CMS or app. The best way to learn is by building, breaking, and rebuilding.

If you have questions, want to share your own version, or need help with the next step—feel free to drop a comment or open an issue in the GitHub repo.

Happy coding, and happy adopting!

Effortless Control Over Multiple Editors with Shared Toolbar

graphical user interface, application, table

Are you tired of juggling multiple toolbars and switching between different editing interfaces just to manage your content? The solution may lie in the power of a shared toolbar – a centralized control hub that allows you to seamlessly manage content across multiple rich text editors on a single page.

In this article, we’ll explore the benefits of managing multiple editors with shared toolbar, demonstrate how to implement this feature, and uncover use cases that showcase its versatility in modern content management systems.

The Power of a Shared Toolbar Controlling Multiple Editor Instances

Traditionally, when working with multiple editable areas on a webpage, each editor would have its own dedicated toolbar, leading to a cluttered and disjointed user experience. However, the ability to leverage a single, shared toolbar across multiple editors can offer a range of benefits that optimize the content creation and management workflow.

Consistency and Predictability

By managing multiple editor instances with a shared toolbar, you can ensure a uniform editing experience across all content sections on a page. All editors will share the same toolbar configuration, making the interface predictable and intuitive for users. This consistency helps reduce cognitive load and enables seamless transitions between different editing areas.

Resource Efficiency

Only one instance of the toolbar is created and reused for multiple editor instances. This reduces the overall DOM complexity of the page.

Only one instance of the toolbar is created and reused for multiple editor instances. This reduces the overall DOM complexity of the page, potentially improving performance and reducing resource consumption.

By minimizing the duplication of toolbar elements, you can streamline the codebase and optimize the user experience.

For more on DOM optimization, see MDN’s guide on performance best practices

Simplified Maintenance

When you need to update the toolbar layout or the available buttons, making changes in one place automatically updates all editors sharing that toolbar. This centralized control simplifies the maintenance and evolution of the content management system, as any enhancements or modifications to the toolbar are instantly reflected across all associated editors.

Improved User Experience

A shared toolbar provides a cohesive and seamless editing environment, making it easier for users to switch between different content sections without disrupting their workflow. This level of integration and consistency can lead to increased user satisfaction and productivity, as they don’t have to reorient themselves with a new toolbar every time they shift their focus.

Implementing a Shared Toolbar

Implementing a shared toolbar for multiple editors is a straightforward process; the Froala WYSIWYG Editor provides built-in support for this functionality. Let’s walk through an example of how to set up a shared toolbar using the Froala Editor:

<!-- HTML -->
<div id="toolbar-container"></div>
<div id="editor1" class="froala-editor"></div>
<div id="editor2" class="froala-editor"></div>
// JavaScript
new FroalaEditor('.froala-editor', {
  toolbarContainer: '#toolbar-container',
  toolbarButtons: [
    'fullscreen', 'bold', 'italic', 'underline', 'strikeThrough',
    'subscript', 'superscript', '|', 'fontFamily', 'fontSize', 'color',
    'inlineStyle', 'paragraphStyle', '|', 'paragraphFormat', 'align',
    'formatOL', 'formatUL', 'outdent', 'indent', 'quote', '-',
    'insertLink', 'insertImage', 'insertVideo', 'insertFile',
    'insertTable', '|', 'emoticons', 'specialCharacters', 'insertHR',
    'selectAll', 'clearFormatting', '|', 'print', 'help', 'html', '|',
    'undo', 'redo', 'trackChanges', 'markdown'
  ]
});

In this example, we have two editor instances on the page, #editor1 and #editor2, both of which are initialized with the Froala Editor. The key configuration is the toolbarContainer option, which is set to the CSS selector #toolbar-container. This tells the Froala Editor to use the #toolbar-container element as the shared toolbar for both editor instances.

By leveraging this shared toolbar approach, any actions performed on the toolbar will be reflected in the active editor, ensuring a seamless and consistent editing experience for the user.

Use Cases for Shared Toolbars

The ability to control multiple editors with a single shared toolbar can be particularly beneficial in a variety of scenarios:

Multi-section Editing Pages

Websites or web applications that have multiple editable content sections, such as an article body, sidebar notes, or call-to-action areas, can benefit from a shared toolbar. This ensures a uniform editing experience across the entire page, making it easier for users to navigate and format content consistently.

Content Management Systems (CMS)

In content management systems, editors often need to switch between different areas of content, such as the main article body, metadata, or related resources. A shared toolbar can provide a centralized and efficient way to manage the formatting and styling of these various content sections, streamlining the editing workflow.

Collaborative Editing Platforms

In collaborative editing environments, where multiple users may be working on different parts of a document simultaneously, a shared toolbar can help maintain a consistent formatting and styling experience. This can be particularly useful in scenarios like online document collaboration, project management tools, or online whiteboards.

Dynamic Forms

Websites or web applications that incorporate rich text fields within forms can benefit from a shared toolbar approach. By using a single toolbar to control the formatting options across multiple form fields, you can avoid cluttering the interface and provide a more organized and intuitive editing experience for users.

Example: Create fully-templated documents with shared toolbar

Building on the concept of a shared toolbar, you can also leverage the ability to designate certain content sections as “locked” or “editable.” This gives you the power to control which parts of the document users can modify, ensuring the overall structure and branding remain consistent, while still allowing for targeted editing where needed.

Let’s say you’re building a company brochure template that has both static, branded content and dynamic, editable areas. Using the Froala Editor, you can create a template that has the following structure:

<div class="template-container">
  <dev id="toolbar-container"></dev>
  <br />
  <div class="header"></div>
  <dev id="editor1" class="editable-section">
    <h1>Zymexi Corp</h1>
  </dev>
  <div class="non-editable separator"></div>
  <div class="non-editable">
    <h2>About the Company</h2>
  </div>
  <!-- Editable main content section -->
  <div class="editable-section" id="main-content">
    <p>We are a leading provider of high-quality products and services.</p>
  </div>
  
    <div class="non-editable">
    <h2>Our Products</h2>
  </div>
  <!-- Editable main content section -->
  <div class="editable-section" id="products">
<ul>
	<li>First Product: product summary</li>
	<li>Second Product: product summary</li>
	<li>Third Product: product summary</li>
</ul>
  </div>
  
    <div class="non-editable separator"></div>

  <!-- Non-editable footer section -->
  <footer class="non-editable">
    <p>&copy; 2025 Acme Corp. All rights reserved.</p>
  </footer>
</div>

In this example, some sections are marked as “non-editable” using the non-editable class, while other sections are designated as “editable” with the editable-section class and a unique ID.

We can now initialize Froala on the editable section and control them with one toolbar:

let editor = new FroalaEditor(".editable-section", {
  toolbarContainer: "#toolbar-container",
  toolbarInline: true,
  charCounterCount: false,
  wordCounterCount: false,

  toolbarVisibleWithoutSelection: true,
  toolbarButtons: [
    "bold",
    "italic",
    "underline",
    "strikeThrough",
    "|",
    "fontFamily",
    "fontSize",
    "color",
    "|",
    "paragraphFormat",
    "align",
    "formatOL",
    "formatUL",
    "outdent",
    "indent",
    "quote",
    "-",
    "insertLink",
    "insertImage",
    "insertVideo",
    "insertFile",
    "insertTable",
    "|",
    "clearFormatting",
    "html",
    "|",
    "undo",
    "redo",
  ],

})
 Adding some CSS code to style the template and make the toolbar visible all the time
.fr-toolbar{
  display: block !important;
  background:#eee
}

.header{
  width:100%;
  height: 100px;
  background-color: greenyellow
}

.separator{
  background-color: greenyellow;
  width: 60px;
  height: 7px;
  
}
.editable-section{
  border: 2px solid transparent;
}
.editable-section:hover{
  border: 2px solid #eee;
}

By using the shared toolbar and locking down specific sections, your users will have a seamless editing experience where they can focus on the content that requires updates, without accidentally modifying the static, branded elements. This ensures that the overall structure, branding, and layout of the document remain consistent, while still allowing for targeted editing where needed.

With this approach, you eliminate the need for your users to constantly preview their changes, as they’ll see the exact 1:1 representation of the final output, streamlining the content creation and management workflow.

Optimizing the Shared Toolbar Experience

While the concept of a shared toolbar is relatively straightforward, there are a few additional considerations and best practices to keep in mind when implementing this feature:

Lazy Loading Editors

When using multiple instances of the Froala Editor on the same page, it’s recommended to set the initOnClick option to true.

As we discussed in Froala tips and tricks article, this lazy-loads the editors, improving the initial page load performance and reducing the overall resource footprint.

Customizing the Toolbar

The Froala Editor allows for extensive customization of the toolbar, enabling you to fine-tune the available buttons and their arrangement to suit the specific needs of your application or user base. This level of control allows you to create a tailored editing experience that aligns with your content management requirements.

Seamless Editing Experience

By combining the shared toolbar with the Froala Editor’s inline editing capabilities, you can create a truly seamless editing experience. Users can click directly on the content they want to edit, without the need to navigate to a separate editing window or preview mode. This “what-you-see-is-what-you-get” (WYSIWYG) approach can significantly enhance the user’s productivity and content management workflow.

Conclusion

Mastering the use of a shared toolbar to control multiple rich text editors on a single page can be a powerful tool in your content management arsenal. By leveraging this feature, you can streamline the editing experience, improve resource efficiency, and maintain consistency across your digital content.

Whether you’re working on a multi-section website, a complex content management system, or a dynamic form-based application, the shared toolbar approach can help you create a more intuitive, efficient, and user-friendly editing environment.

As you continue to refine and optimize your content management strategies, exploring the capabilities of shared toolbars and integrated editing experiences can be a game-changer in delivering a superior content creation and collaboration experience for your users.

Introducing Froala 4.5.2: Now with Find & Replace, Enhanced Colors, and More

Froala 4.5.2 is now available, introducing the long-awaited Find & Replace plugin (beta), expanded alpha color support, and a series of critical usability fixes. This update enhances editing flexibility while preparing the foundation for future stable features.
Dive into what’s new, test the beta plugin, and help shape the next release by sharing your feedback.

Froala 4.5.2 release

Spotlight on the New Find and Replace Plugin

 The highlight of version 4.5.2 is the new Find and Replace plugin. Please note: This feature is currently in beta and disabled by default, giving you the opportunity to test it and provide feedback before its stable release, targeted for our next update by the end of June.

paste and replace

When enabled, this plugin introduces a range of capabilities that our users have been eagerly awaiting:

  • Search Functionality: Users can now search for specific text or words within the editor and see the total number of occurrences, even in styled text like bold or italic.
  • Replace Options: The plugin provides the ability to replace a specific occurrence or all occurrences of the searched text with new replacement text.
  • Highlighted Matches: Each instance of the searched text is highlighted, making it easy for users to identify and navigate the matches.
  • Advanced Search: Users can enable options to match case or restrict the search to whole words only.
  • Draggable Popup: The search and replace interface is presented in a fully draggable popup, allowing users to position it wherever is most convenient.
  • Keyboard Shortcuts: Opening the search popup can be performed using customizable keyboard shortcuts. Default is (CTRL + F).
  • Undo Functionality: Users can easily revert any changes made through the Find and Replace plugin by using the undo feature or the (Ctrl + Z) shortcut.
  • Intuitive Design: The plugin features an intuitive and user-friendly interface, making it accessible for both novice and advanced users.

Developers can further customize the Find and Replace behavior using its dedicated options, events, and methods.

To enable the plugin, its resource file must be loaded separately in each application where it’s needed. The method for loading it depends on the type of application you’re working with. Here are a few examples:

  1.  For Web Applications (using a <script> tag):
    <script src="froala-editor/js/plugins/find_and_replace.min.js"></script>
  2. For JavaScript Modules (using import):
    import 'froala-editor/js/plugins/find_and_replace.min.js';
  3. For Node.js/CommonJS (using require):
    require('froala-editor/js/plugins/find_and_replace.min.js');

Ensure that the plugin file is included and loaded correctly in the application’s runtime environment for the plugin functionality to be available.

Here is an example of Froala with find and replace plugin enabled

Alpha Color Support

One of the notable improvements in this Froala 4.5.2 release is the enhanced support for alpha colors (RGBA) in text coloring. This ensures that users can now properly apply transparency to the text within the editor.

For example, let’s say you want to apply a semi-transparent blue color to a section of text. Developers can now add the RGBA color value rgba(0, 0, 255, 0.5) or the Hex color value #0000ff80 to the colorsText array. This enables users to select the desired color from the text color popup in the editor. The text will then be displayed with the specified level of transparency, allowing the background to partially show through.

new FroalaEditor('div#froala-editor', {

    colorsText: [   

    'rgba(255, 220, 59, 0.7)', 'rgba(255, 220, 59, 0.5)',

    '#ffdc3bb3','#ff1e001a','#ff1e0040','#ff1e0059','#ff1e0080','#ff1e00a6',

    '#ff960026','#ff96004d','#ff960066','#ff96008c','#ff9600bf',

    '#ffdc3b26','#ffdc3b40','#ffdc3b66','#ffdc3b80','#ffdc3bb3',

    'REMOVE'

],

});

This improvement in alpha color support empowers users to create more visually striking and nuanced content within the Froala editor. Whether you’re designing eye-catching headings, highlighting important information, or creating subtle textual effects, the enhanced color capabilities give you greater creative control and flexibility.

Other Improvements and Bug Fixes

While the Find and Replace plugin is the highlight of this release, we’ve also addressed several other issues and made various improvements to the Froala editor:

  • Increase Indent button and keyboard shortcut functions Synchronization: Fixed an issue where the Increase Indent button and keyboard shortcut were not correctly synchronized, leading to inconsistent behavior.
  • Handling URLs with Hyphens: When pasting a URL that ends with a hyphen (e.g., https://example.com/-) into the Froala Editor as plain text (Ctrl + Shift + V), the editor incorrectly removed the hyphen from the hyperlink, resulting in a broken or incorrect link.
    Now, the full URL, including the trailing hyphen, is preserved when pasted as plain text.
  • Table Formatting Consistency: Addressed inconsistent behavior with selection and clear formatting for tables, ensuring a uniform experience regardless of the presence of text after the table.
  • Ordered List Button Error: Fixed an error that occurred when clicking the Ordered List button, which previously threw a “querySelectorAll is not a function” error.
  • Shadow DOM Compatibility:
    Fixed an issue where tooltips were rendering outside the Shadow DOM scope, causing styles not to apply correctly.
    Moreover, resolved an issue where inputs were not editable when working inside a shadow DOM, making the editor more versatile in various environments.
  • Fixed console errors appeared after clicking the Ordered List button while htmlUntouched is true.
  • Addressed a problem where the image resize box would expand to full width when a caption was added with htmlUntouched: true, avoiding unexpected layout shifts.

Please find the complete changelog list here.

How Can I Update?

Don’t miss out on the benefits of the latest Froala 4.5.1 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.5.2/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.5.2/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

10 Projects to Improve Your Bootstrap Design Skills

170 Responsive Bootstrap Design Blocks Project Has Over 13000 GitHub Stars

Web development moves fast. Frameworks come and go, tooling stacks evolve, and what felt modern a few years ago can quickly start to look outdated. Bootstrap, however, has remained a reliable constant. Despite the rise of newer tools and frameworks, it continues to power millions of websites and remains a practical choice for building responsive user interfaces.

Gone are the days of needing third-party plugins for dark mode or hunting down CSS overrides for color theming. Bootstrap 5.3 introduced native color modes, a fully CSS-variable-driven architecture, and improved utility classes that make customisation faster and cleaner. Bootstrap 6 is in active development and expected to push the framework further toward a CSS-first, Sass-optional model.

This article walks through ten practical projects you can build today to sharpen your Bootstrap skills, not just by placing components on a page, but by understanding why they work and how to adapt them to real-world requirements.

Key Takeaways

  • Bootstrap 5.3 makes dark mode and custom theming much easier with CSS variables.
  • Building projects is the fastest way to learn Bootstrap’s components and utilities.
  • Modern Bootstrap relies less on custom CSS and more on built-in utility classes.
  • Responsive, accessible, and theme-aware interfaces can be built with minimal code.
  • The skills you learn in Bootstrap 5.3 will carry forward to Bootstrap 6.

Before You Start: The 2026 Skeleton

Bootstrap 5 uses a CDN-delivered stylesheet that loads faster than ever. Your base HTML should look like this:

<!DOCTYPE html>

<html lang="en" data-bs-theme="light">

  <head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>My Bootstrap Project</title>

    <link

      href="<https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css>"

      rel="stylesheet"

    >

    <link

      rel="stylesheet"

      href="<https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css>"

    >

  </head>

  <body>

    <!-- Your content here -->

    <script src="<https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js>"></script>

  </body>

</html>

Notice data-bs-theme="light" on the <html> tag. That’s Bootstrap 5.3’s color mode system; flip it to “dark”, and every component adapts automatically, no extra CSS required.

1. Marketing Landing Page with a Dark/Light Mode Toggle

What you’ll learn: Navbar layout, hero sections, CSS variables, color mode toggling

One of the best components to practice on is a classic landing page. A lander is the sum of its elements–namely a logo, headline, and CTA, as well as social proof to encourage click-throughs. And it’s easy to achieve with Design Blocks using the Content template, where each section can be filled in with your images and text. You will learn how Bootstrap designs contribute to business marketing methods by making a landing page.

The key insight here is that Bootstrap 5.3’s components reference CSS custom properties like --bs-body-bg and --bs-body-color. When the theme attribute changes, those variables update across the entire page automatically.

<nav class="navbar navbar-expand-lg sticky-top bg-body-tertiary">

<div class="container">

<a class="navbar-brand fw-bold" href="#">Brand</a>

<button id="themeToggle" class="btn btn-outline-secondary btn-sm ms-auto">

<i class="bi bi-moon-stars-fill"></i> Dark Mode

</button>

</div>

</nav>
document.getElementById('themeToggle').addEventListener('click', () => {

const html = document.documentElement;

html.dataset.bsTheme = html.dataset.bsTheme === 'dark' ? 'light' : 'dark';

});

Visual Diagram representing marketing manding page with a dark/light mode toggle

This single pattern teaches you more about Bootstrap’s underlying architecture than a dozen static pages would.

2. Restaurant Site with an Offcanvas Image Gallery

What you’ll learn: Offcanvas component, responsive grid, object-fit utilities

Restaurant websites live or die on strong visuals. Rather than a basic carousel, try building an image gallery that opens in an Offcanvas panel, a component added in Bootstrap 5 that slides in from any edge of the screen without a page reload.

Use Bootstrap’s grid to display a thumbnail row, then wire each thumbnail to open the Offcanvas with a full-size version. For a more realistic build, Filestack can handle image uploads, transformations, and delivery, while Bootstrap controls how those images appear in the gallery. The ratio utility classes (ratio ratio-16×9, ratio ratio-1×1) keep images perfectly proportioned across devices without any custom CSS.

<div class="row g-3">

<div class="col-6 col-md-4">

<div class="ratio ratio-1x1">

<img src="dish1.jpg" class="img-fluid rounded object-fit-cover"

data-bs-toggle="offcanvas" data-bs-target="#galleryPanel" role="button">

</div>

</div>

</div>

<div class="offcanvas offcanvas-end" id="galleryPanel">

<div class="offcanvas-header">

<h5 class="offcanvas-title">Gallery</h5>

<button class="btn-close" data-bs-dismiss="offcanvas"></button>

</div>

<div class="offcanvas-body" id="galleryContent">

<!-- Dynamically populated -->

</div>

</div>

3. SaaS Pricing Page with Comparison Highlights

What you’ll learn: Cards, badges, color-mode-aware utilities, table-responsive

A pricing table is a rite of passage for any front-end developer. In 2026, most SaaS products use a three-tier model (Starter / Pro / Enterprise), often with an annual/monthly toggle. Build yours using Bootstrap’s card grid, and use the new semantic color utilities (bg-primary-subtle, text-primary-emphasis, border-primary-subtle) that automatically adapt to dark mode without any overrides.

Add a <table class="table table-striped table-hover"> beneath the cards to show a detailed feature comparison, the kind that helps users understand what they’re actually paying for.

<div class="col">

<div class="card h-100 border-primary shadow">

<div class="card-header bg-primary text-white text-center">

<span class="badge bg-warning text-dark">Most Popular</span>

<h4 class="mt-2 mb-0">Pro</h4>

</div>

<div class="card-body text-center">

<p class="display-5 fw-bold">$29<small class="fs-6 text-body-secondary">/mo</small></p>

<ul class="list-unstyled text-start mt-3">

<li><i class="bi bi-check-circle-fill text-success me-2"></i>Unlimited projects</li>

<li><i class="bi bi-check-circle-fill text-success me-2"></i>Priority support</li>

<li><i class="bi bi-x-circle text-danger me-2"></i>Custom domain</li>

</ul>

</div>

<div class="card-footer text-center">

<a href="#" class="btn btn-primary w-100">Get Started</a>

</div>

</div>

</div>

4. Footer with an Accordion FAQ

What you’ll learn: Accordion component, grid columns, Bootstrap Icons

A well-structured footer does double duty: it’s navigation and a trust signal. Build one with a four-column layout (company info, links, social icons, and a contact form), then add an Accordion component above it for an FAQ section.

Bootstrap 5’s Accordion is fully accessible out of the box: keyboard navigable, with proper ARIA attributes handled for you. This is a good moment to explore aria-expanded and understand how Bootstrap JS manages it.

<div class="accordion" id="faqAccordion">

<div class="accordion-item">

<h2 class="accordion-header">

<button class="accordion-button collapsed" data-bs-toggle="collapse"

data-bs-target="#faq1">

How does billing work?

</button>

</h2>

<div id="faq1" class="accordion-collapse collapse" data-bs-parent="#faqAccordion">

<div class="accordion-body text-body-secondary">

You're billed monthly. Cancel anytime with no hidden fees.

</div>

</div>

</div>

</div>

5. eCommerce Product Page with a Cart Toast

What you’ll learn: Toasts, modals, floating labels, form validation

Build a product detail page with an image, description, size selector, and an “Add to Cart” button. When the button is clicked, trigger a Bootstrap Toast notification in the corner of the screen, a lightweight, non-blocking confirmation pattern that’s become standard in modern eCommerce UX.

Use floating labels on the checkout form for a polished feel, and explore Bootstrap 5’s built-in HTML5 form validation classes (.was-validated, :valid, :invalid pseudo-classes) to handle empty field errors without writing a single line of validation JavaScript.

<div class="toast-container position-fixed bottom-0 end-0 p-3">

<div id="cartToast" class="toast align-items-center text-bg-success border-0" role="alert">

<div class="d-flex">

<div class="toast-body">

<i class="bi bi-bag-check me-2"></i> Added to cart!

</div>

<button class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast"></button>

</div>

</div>

</div>

6. Freelancer Portfolio with a Scrollspy Sidebar

What you’ll learn: Scrollspy, sticky positioning, list groups, testimonial cards

A single-page portfolio is the perfect Scrollspy playground. Bootstrap’s Scrollspy component watches the user’s scroll position and automatically highlights the corresponding nav link, making long pages feel navigable and professional.

Build a two-column layout: a sticky left sidebar with a list-group acting as an in-page nav, and a right content area with sections for Work, Skills, and Testimonials. Testimonials belong in bordered cards using the blockquote typography pattern Bootstrap provides natively.

<body data-bs-spy="scroll" data-bs-target="#portfolioNav" data-bs-offset="80">

<nav id="portfolioNav" class="list-group position-sticky" style="top: 80px">

<a class="list-group-item list-group-item-action" href="#work">Work</a>

<a class="list-group-item list-group-item-action" href="#skills">Skills</a>

<a class="list-group-item list-group-item-action" href="#testimonials">Testimonials</a>

</nav>

</body>

7. “Meet the Team” Page for a Consulting Firm

What you’ll learn: Cards with hover effects, CSS variable overrides, responsive flex layout

Employee profile pages teach you Bootstrap’s card component in depth. Build a grid of team member cards, each with a circular avatar, name, title, and social links, and add a subtle CSS hover lift using --bs-card-border-color and box-shadow CSS variable overrides.

This project is also a good introduction to custom theming in Bootstrap 5.3: override the framework’s CSS variables inside a :root block (or scope them to a specific component) without touching Sass or rebuilding anything.

:root {

--bs-card-border-radius: 1rem;

--bs-card-box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);

}


.team-card:hover {

transform: translateY(-4px);

transition: transform 0.2s ease;

box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);

}

8. Contact Page with an Embedded Map Placeholder and Validation

What you’ll learn: Ratio utilities, floating labels, server-side form patterns

A contact page sounds simple, and it is, but the details matter. Use Bootstrap’s ratio utility to embed a Google Maps iframe at a consistent aspect ratio, floating labels for the form inputs, and the framework’s built-in validation states to give users real-time feedback.

A good contact form in 2026 also thinks about accessibility: proper <label> associations, aria-describedby for error messages, and keyboard-navigable fields. Bootstrap’s form components handle most of this automatically, which is exactly why studying them here is valuable.

<div class="ratio ratio-16x9 mb-4 rounded overflow-hidden">

<iframe

src="<https://www.google.com/maps/embed?.>.."

loading="lazy"

referrerpolicy="no-referrer-when-downgrade">

</iframe>

</div>

<div class="form-floating mb-3">

<input type="email" class="form-control" id="email" placeholder="name@example.com" required>

<label for="email">Email address</label>

<div class="invalid-feedback">Please enter a valid email.</div>

</div>

9. Healthcare CTA Page with a Multi-Step Form

What you’ll learn: Progress bar, tab panels, modal dialogs, form layout

A Call to Action in a high-trust context like healthcare needs to feel structured and calm. Build a multi-step form: collecting contact info, appointment type, and availability, using Bootstrap’s tab panels for step navigation and a progress bar to show completion. Use a modal to confirm the submission with a clear summary before the user commits.

This project exercises several Bootstrap JS components together, which is where real fluency develops. Managing state between steps, updating the progress bar, and controlling modal visibility are all achievable with vanilla JS and Bootstrap’s public APIs.

<div class="progress mb-4" style="height: 6px;">

<div class="progress-bar bg-primary" id="formProgress" style="width: 33%"></div>

</div>

<div class="tab-content">

<div class="tab-pane fade show active" id="step1"><!-- Contact info --></div>

<div class="tab-pane fade" id="step2"><!-- Appointment type --></div>

<div class="tab-pane fade" id="step3"><!-- Availability --></div>

</div>

10. Admin Dashboard with a Collapsible Sidebar

What you’ll learn: Offcanvas (desktop sidebar pattern), data tables, d-grid, responsive breakpoints

Admin dashboards are where Bootstrap utility classes really shine. Build one with a collapsible sidebar (using Offcanvas on mobile and a static column on desktop via responsive display utilities), a stat card row at the top, and a table-responsive data table below.

Use Bootstrap Icons throughout; the icon library maintained by the Bootstrap team has grown to over 2,000 icons and integrates seamlessly. This project will cement your understanding of Bootstrap’s breakpoint system (d-none d-lg-block, col-lg-3 col-xl-2) and how to build layouts that adapt genuinely, not just technically.

<div class="d-flex">

<!-- Sidebar: hidden below lg, visible above -->

<nav class="d-none d-lg-flex flex-column bg-body-tertiary border-end p-3"

style="width: 240px; min-height: 100vh;">

<ul class="nav flex-column">

<li class="nav-item">

<a class="nav-link active" href="#"><i class="bi bi-house me-2"></i>Dashboard</a>

</li>

<li class="nav-item">

<a class="nav-link" href="#"><i class="bi bi-people me-2"></i>Users</a>

</li>

</ul>

</nav>


<!-- Main content -->

<main class="flex-grow-1 p-4">

<div class="row g-4 mb-4">

<div class="col-sm-6 col-xl-3">

<div class="card text-center p-3">

<h6 class="text-body-secondary">Total Users</h6>

<p class="display-6 fw-bold mb-0">12,480</p>

</div>

</div>

</div>

</main>

</div>

What’s Coming in Bootstrap 6?

Bootstrap 6 is in active development, with community discussion pointing toward dropping jQuery compatibility entirely, deeper native CSS integration (:has(), container queries, cascade layers), and a leaner core that leans harder on CSS custom properties. There’s no official release date yet, but the patterns you practice in 5.3: CSS variables, semantic utilities, and component APIs are exactly what will translate forward.

Conclusion

These ten projects cover the full range of what Bootstrap 5.3 offers, from its component library to its theming system to its JavaScript APIs. The goal isn’t to memorise Bootstrap’s classes; it’s to understand what problems they solve and develop judgment for when to use them.

The best way to get there is to build real things. Pick a project, start with the skeleton above, and iterate. The framework’s documentation on Bootstrap is thorough and has been rebuilt on Astro for better performance and navigation. It’s worth keeping a tab open.

Easily Add Powerful Table Sorting with DataTables Plugin

a person posing for the camera

Introduction to the Froala Editor Integration

Do you find the Froala editor the perfect rich text editor for your project, but require robust table sorting capabilities? No problem! The Froala editor is a highly extensible WYSIWYG HTML editor, making it remarkably easy for developers to add the specific table sorting functionality you need using a suitable plugin.

Many developers rely on the Froala editor for its powerful features and ease of use when constructing HTML pages. This editor simplifies the content creation experience.

This article demonstrate how straightforward it is to integrate a table sorting feature into the Froala editor. We’ll achieve this by leveraging the popular DataTables JavaScript library, acting as a powerful plugin. This example showcases how the flexibility of the Froala editor allows developers to enhance this excellent editor with the exact tools their project requires – even if a specific capability isn’t in the core editor.

This example should provide a clear path for many developers looking to add advanced table controls. We will provide essential code examples below, showing how developers can implement this feature. The editor becomes much more powerful with this plugin.

You’ll see how the Froala editor empowers users and developers to create sophisticated editable content. This specific example focuses on table manipulation within the editor, using external library code. The goal is to improve how users interact with table data within the editor.

Froala Table Sorting

Key Takeaways

  • Implementing Froala table sorting significantly improves data usability and the overall user experience for manipulating table data within the Froala editor.
  • Integrating the DataTables plugin enhances the core functionality of Froala editor tables, adding sorting to each column. This plugin is a great example for developers. Using this plugin requires including specific code.
  • Performance optimization is essential when the editor needs to handle tables with numerous rows and large data sets; developers must consider this when adding custom code.

The Power of Froala Tables in a WYSIWYG Editor

The Froala WYSIWYG editor already includes robust table editing functionality out of the box. People using the editor can easily create, modify, and format tables directly within the rich text editor.

Native capabilities like multi-cell selection, cell merging, and custom style options (even controlling border collapse or font family) make Froala tables a cut above many other editor solutions.

But the native table features in the Froala editor can be further enhanced by integrating with the powerful DataTables library integration. DataTables provides advanced sorting, filtering, paging (rows per page), and other table management capabilities that complement Froala’s built-in table edit tools within the editor.

This plugin adds significant ability through its JavaScript code. This plugin is a popular choice for developers working with tables in web applications and the Froala editor. The editor becomes a more complete tool for data presentation.

Importance of Table Sorting within the Rich Text Editor

Okay, so you’ve used the editor to create a table. Great! But what if users need to find specific data within its rows? That’s where sorting comes in. Table sorting is important because it lets users quickly organize data in a way that makes sense within the editor.

Imagine a table with a list of customers. Without sorting, users would have to manually scan all the rows to find someone. But with sorting enabled by the plugin, users can instantly arrange the table by name, order date, or whatever column they need. This saves a ton of time and makes your table data way more useful for anyone using the editor.

It’s not just about finding stuff faster, though. Sorting tables can also help users highlight trends and patterns in their data that they might otherwise miss inside the editor. For example, sorting a sales table by revenue could quickly highlight your top-performing products. The editor makes managing this table data easier for users.

Here are some reasons why sorting within the editor is important for developers and end-users:

  • Faster data retrieval from tables for users.
  • Improved data analysis within the editor by users.
  • Enhanced user experience for those interacting with the editable content in the Froala editor. This example clearly shows the benefit of adding this plugin code. The editor feels more interactive.

Froala Table Sorting – How it works

There are several ways developers can add table sorting support to the Froala editor using any JavaScript HTML table enhancing library or plugin. In this guide and code example, we’ll use the popular DataTables library.

DataTables provides advanced sorting, filtering, and pagination features that complement the Froala editor’s built-in table edit tools. We select this plugin due to its extensive features, good documentation for developers, and ease of integration with the editor via simple code additions.

This JavaScript library is a common choice for enhancing HTML tables. Its code is widely used by developers. It interacts directly with the table elements within the editor.

The approach or method we’ll take has the following key steps:

  1. Add a new custom button to the Froala editor table edit popup (menu) that initializes the DataTables plugin on the selected table. The necessary code is shown below.
  2. This will enhance the table, adding sorting buttons (visual signs) to each column header cell.
  3. Users can then click these buttons to sort the table data in ascending or descending order. The underlying code handles the table row manipulation directly in the editor.
  4. This tutorial serves as a good starting point example for integrating the Froala editor with the DataTables library plugin. However, developers may need to optimize the provided code further to handle certain scenarios, such as when a user adds new rows and columns to the table after initializing the DataTables on it. In this case, developers may need to re-initialization the DataTables on the modified table.

Adding the Froala Table Sorting Feature: A Code Example

Adding this table sorting capability via the DataTables plugin to your Froala editor setup is a straightforward process. Here are the key steps involved in this setup:

Step 1: Include the Required Libraries (CSS & JS Code)

To get started with this editor enhancement, developers must include the following CDN links in their web page:

  • Froala WYSIWYG Editor Stylesheet and JavaScript CDN links
  • DataTables JavaScript library (which requires jQuery)
  • Font Awesome stylesheet for custom button icons

<!-- Font Awesome library for icons -->
<link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.5.0/css/all.min.css' rel='stylesheet' type='text/css' />

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

<!-- DataTables stylesheet -->
<link href='https://cdn.datatables.net/2.2.2/css/dataTables.dataTables.min.css' rel='stylesheet' type='text/css' />

<!-- jQuery script -->
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js'></script>
<!-- DataTables script -->
<script type='text/javascript' src='https://cdn.datatables.net/2.2.2/js/dataTables.min.js'></script>
<!-- Froala script -->
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>

Step 2: Create a New Custom Button For Froala

Let’s create a custom button within the Froala editor system to enable the sorting function on the selected table.

We will use the “filter” Font Awesome icon (font) to represent our button in the editor toolbar. Add this JavaScript code before initializing the Froala editor.

// Use Font Awesome icons
FroalaEditor.ICON_DEFAULT_TEMPLATE = "font_awesome_5" 

//Define icon for "advancedTable" buttton
FroalaEditor.DefineIcon("advancedTable", { NAME: "filter" })

This code tells the editor how to display the button icon using the specified font.

2.2 Define the Button Function (Command Code)

Now, let’s register one of the Froala editor commands that executes our table sorting logic using the DataTables plugin. This code defines the button’s action. Place this code before the editor initialization.

The following code block shows the command registration.

FroalaEditor.RegisterCommand("advancedTable", {   
   title: "Advanced Table",   undo: true,
   callback: function callback(cmd) {
     let table = this.$el.find(".fr-selected-cell").closest("table");
     if (table[0] && table[0].getElementsByTagName("thead").length > 0) {
       let advTable = new DataTable(table, {
         searching: false,
         paging: false,
       });
     } else {
       alert("You should add a table header first.");
     }
   },
 });

In the above JavaScript code:

  • We registered a new Froala editor button command with the name “advancedTable”.
  • The button will be represented by the font icon we defined in the previous step using separate code. It will appear on the table edit menu.
  • It has a title attribute shown as a tooltip in the editor.
  • The callback function contains the core logic. This function code runs when the button is clicked by a user in the editor.
  • It finds the parent table HTML element from the currently selected table cell within the editor. This part of the code uses jQuery selectors provided by the Froala editor.
  • Crucially, it checks if the selected table has a header row (<thead> tag). This is a requirement for the DataTables plugin code to identify columns for sorting.
  • If a header row exists, it initializes the DataTables plugin (new DataTable(…)) on the HTML table DOM element. Note the options object uses false for searching and paging in this specific code example. This code line activates the plugin. The boolean value false turns those features off.
  • If no header row is found, it displays an alert message. This ensures the DataTables plugin functionality works as expected.
  • This code provides the essential mechanism for developers to trigger the plugin. It’s the core integration code.

Step 3: Initialize the Froala Editor

Finally, developers need to setup the Froala Editor instance on their page. This usually involves targeting a textarea HTML element or a div. Add the new “advancedTable” button to the tableEditButtons array in the editor configuration options.

This code integrates our custom button into the editor’s table edit menu. The following code block shows the editor initialization. This code makes the editor appear on the page.

new FroalaEditor("#editor", {
  tableEditButtons: [
    "tableHeader",
    "tableRemove",
    "|",
    "tableRows",
    "tableColumns",
    "tableStyle",
    "-",
    "tableCells",
    "tableCellBackground",
    "tableCellVerticalAlign",
    "tableCellHorizontalAlign",
    "tableCellStyle",
    "|",
    "advancedTable",
  ],
})

This final block of code:

  • Creates the Froala editor instance, targeting an HTML element (e.g., <textarea id="editor"></textarea> or <div id="editor"></div>). This HTML element becomes the editor element where users edit content.
  • Crucially, advancedTable is added to the tableEditButtons array. This makes our custom button appear in the table edit menu within the editor.
  • Developers can add many other options to this initialization code to customize the editor (e.g., license key, height, available font size, font family options like sans serif, event handlers, other plugins). This example code shows only the essential part for adding the button. The Froala documentation lists all available code options.
  • This editor setup code should run after the page’s HTML body is loaded and the previous JavaScript code (icon and command definition) has executed. Ensure all prerequisite code is loaded.

Testing the Froala Table Sorting Feature

Once the Froala editor is set up with the new “Advanced Table” button using the provided code, users and developers can test it:

  1. Insert a new table into the editor’s editable content area using the toolbar.
  2. Add content to the table rows and columns. Make sure to add a header row using the editor’s table menu. Each table cell should contain appropriate data. The table needs a <thead> for the plugin code to work.
  3. Click inside any table cell of the table you want to sort within the editor.
  4. The table edit toolbar / popup menu should appear. Find and click the “Advanced Table” button (the one with the filter font icon).
  5. The DataTables plugin code will execute, enhancing the table. Users should see sorting icons (a visual sign) appear in each column header cell. These icons are often added via CSS defined in the plugin’s stylesheet code.
  6. Click these column headers to sort the table data within that column in ascending or descending order. The rows will rearrange directly within the editor, handled by the plugin’s code.


This integration allows Froala editor users to leverage the advanced table management features of the DataTables plugin while still maintaining the rich edit capabilities of the Froala WYSIWYG HTML editor. This enhances the content creation experience. Try pasting data into the table as well. Users can edit table cell content freely after sorting. The editor remains fully functional.

Advanced Configurations for Froala Table Sorting

While the default DataTables plugin integration (using the minimal code shown) provides a great baseline table sorting functionality, developers may want to further customize the experience. DataTables offers a wide range of configuration options in its code API.

Developers can modify the initialization code (example: the options object { searching: false, paging: false } passed to new DataTable(…) in the command’s code) to:

  • Implement pagination by setting paging to true instead of false and control the number of rows displayed per page. The plugin code handles this display logic.
  • Customize the applied CSS classes for different table states. Apply custom border styles or width controls using your own CSS code. The plugin adds specific CSS classes that developers can target.
  • Define custom sorting functions (function code) for specific data types (e.g., dates, currency) if the default plugin sorting isn’t sufficient. This involves writing more JavaScript code for the plugin.
  • Change the sorting mode (e.g., multi-column sorting). Requires different options in the initialization code.
  • Control the position of elements like the search box or pagination controls relative to the table using CSS code.

Leveraging these configurability options in the code requires more effort from developers but allows tailoring the table sorting experience within the Froala editor to perfectly fit the needs of your project and the people using the editor. Consult the DataTables plugin documentation for full details and more code examples. Many developers find the plugin very flexible. You can find many code examples online for this plugin.

Handling Dynamic Table Changes (Developer Considerations for Table Columns and Cells)

One potential challenge for developers when integrating the Froala editor and the DataTables plugin using the provided code is handling scenarios where the user adds, removes, or modifies table rows, table columns, or table cell content after the DataTables plugin initialization code has run. The sorting state might become inconsistent with the actual table data in the editor.

To address this, developers must implement more sophisticated code:

  1. Store References: Keep track of the DataTables instances initialized on each table within the editor. Developers could use JavaScript code to manage this, perhaps using a Map keyed by table IDs.
  2. Listen to Froala Events: Use the Froala editor’s event system (like contentChanged, table.inserted, commands.after, etc.) by adding event handlers in the editor initialization code. These editor events signal changes to the HTML. Developers need to write listener code.
  3. Update or Re-initialize DataTables: When relevant editor events fire for a specific table, get the corresponding DataTables instance using your tracking code. Developers might need to write code to:
  • Destroy the existing DataTables instance (table.destroy()) and re-initialize the plugin on the modified HTML table structure using the original initialization code. This is often the simplest method for developers to ensure the plugin sees all HTML changes, including new rows or changes affecting border or width. This requires careful execution of code.

Developers must test these scenarios thoroughly in different browser environments. Look for code examples online or in documentation for handling these dynamic updates in the editor.

Frequently Asked Questions about the WYSIWYG HTML Editor and Plugin

What is Froala WYSIWYG HTML Editor?

Froala is a powerful, front-end WYSIWYG HTML editor (a type of rich text editor) that allows people (users) to easily create and edit HTML content directly in a web page, often replacing a standard textarea. It’s known for its clean interface and extensive API (code methods and events) for developers. It provides a great content creation experience. The editor renders HTML tags visually.

Why use DataTables with the Froala Rich Text Editor?

Using the DataTables plugin with the Froala editor adds powerful features for managing HTML tables, like sorting by column, filtering data, and pagination across multiple rows. This makes it much easier for people using the editor to work with large amounts of table data. It enhances the core editor functionality via external code. This plugin makes the editor more suitable for data-heavy content.

How do I integrate DataTables into my Froala editor setup?

Developers can integrate the DataTables plugin by including the necessary DataTables CSS and JavaScript library code (https links) in their project’s HTML page (often in the <head> or before the </body> tag).

Then, write JavaScript code (like the example in this article) to initialize the plugin on specific HTML table elements within the Froala editor’s editable content area, usually triggered by a custom button defined with editor API code.

Does Froala integrate with DataTables in Inline Editor mode?

Yes, the Froala-DataTables integration can also be used in Froala’s Inline Editor mode. The inline editor mode is used when the user wants to minimize the disruptions and maintaining the page layout during the editing process.

Does Froala support multiple table cell editing?

Yes, Froala does support multiple cell table editing. Users can select multiple cells and apply formatting, styles, or other operations across the selected range. This enables powerful table management capabilities within the Froala WYSIWYG editor. By leveraging DataTables sorting alongside Froala’s multi-cell editing, users can efficiently organize and structure tabular data to meet their specific requirements. The combination of these features provides a robust and flexible table editing experience within the Froala editor.

Does Froala support image uploads within tables?

Yes, Froala allows users to insert images directly within table cells, providing a seamless way to incorporate visual elements alongside tabular data. This flexibility enables content creators to build rich and visually engaging tables that blend text, numbers, and imagery. The integration of image uploads within Froala’s table editing capabilities empowers users to create more dynamic and informative tabular content, enhancing the overall presentation and effectiveness of the information being conveyed.

How to modify table cell font family and size?

To modify the font family and size of table cells in the Froala WYSIWYG editor, you can use the editor toolbar. Moreover, you can set a specific font family and size in a CSS class and apply that class to the desired cell using the “tableCellStyles” button.

Conclusion

Integrating the Froala editor with the DataTables JavaScript library plugin is an excellent method for developers to provide a comprehensive table management experience for users. Froala’s built-in table edit capabilities, combined with the advanced sorting provided by the DataTables plugin, create a powerful solution for content-rich web applications needing sophisticated table interactions within a rich text editor. The ability to sort rows by column is crucial for data analysis within the editor.

By following the simple steps and the code examples outlined in this article, and further customizing the integration code and CSS style to meet your specific needs, developers can quickly add this valuable feature to their projects using the Froala editor. This empowers people using the editor with a best-in-class table editing and data exploration experience, improving the overall content creation experience.

Froala vs. VisualEditor in 2026: Best WYSIWYG HTML Editor Comparison

Froala vs. VisualEditor in 2026: Best WYSIWYG HTML Editor Comparison

WYSIWYG HTML editors like Froala and VisualEditor have shaped how people create and edit content online, long before “AI-assisted writing” became a checkbox on every editor’s feature page. That’s the most useful lens for revisiting this comparison in 2026: one of these editors has spent the past year adding AI capability, and the other has spent it doing something almost the opposite, building in checks that flag when content might have been generated elsewhere.

Wherever you go on the internet, as long as you see content, you’re most likely interfacing with a WYSIWYG editor. Choosing between them still comes down to fit: Froala remains the lightweight, feature-rich commercial option, and VisualEditor remains the open-source editor purpose-built for MediaWiki.

Let’s see what’s actually changed since our last update.

Key Takeaways

  • Froala offers built-in AI writing tools, while VisualEditor focuses on AI content governance rather than generation.
  • Froala is designed for websites, apps, LMS platforms, and blogs; VisualEditor is optimised for MediaWiki projects.
  • VisualEditor remains free and open source, while Froala provides commercial support and advanced features.
  • Froala includes Markdown, file management, code view, and extensive framework integrations.
  • If AI-assisted content creation is important, Froala is the stronger choice in 2026.

What is Froala Editor?

Froala is still a modern WYSIWYG editor for developers who want a lightweight, robust, customizable solution, supporting rich text, Markdown, HTML code, and full page or blog creation, with integration across most popular languages and frameworks.

History and development of Froala

Launched in 2014, Froala has grown to over 50,000 customers and millions of end users, and continues to appear in G2’s WYSIWYG editor rankings. The most significant addition since our last update is the AI Assist plugin, introduced in Froala v5.1: two toolbar buttons for chatting with AI, adjusting tone, and translating content, without leaving the editor. It’s built to work with any AI provider – OpenAI, Gemini, Claude, or a self-hosted model – rather than locking you into one, with developer hooks to validate AI output before it’s inserted.

Key Froala features

Rich text editor features: Supports basic and advanced text formatting, Markdown, and real-time collaboration via a Codox.io integration, which remains active and is the same straightforward setup as before: a small JavaScript snippet wired into Froala’s initialisation event.

Media management: File upload and management, with Filestack integration (since v4.3) for OCR, safe-for-work detection, and workflow automation, requiring a separate Filestack account.

Code view: Integrates with CodeMirror for direct HTML editing.

AI Assist: Chat, tone adjustment, and translation, configurable to any AI backend, added in v5.1.

Plugins: Spell check, emoticons, and other extensions, customizable and reusable.

Responsive design and accessibility: Consistent across devices and browsers, compliant with Section 508 and WCAG 2.0.

Security: Includes measures against XSS attacks.

Froala user interface and experience

Unchanged in substance: a modern, polished, responsive interface that avoids overwhelming users with controls and remains highly customizable for toolbar contents, themes, and editor behaviour.

Froala supported platforms and integrations

Still cross-platform and cross-browser, with JavaScript-core compatibility across Angular, React, Vue, .NET, Django, Laravel, and other frameworks, extended through plugins and APIs.

What is VisualEditor?

VisualEditor is still the open-source rich-text editor developed by the Wikimedia Foundation for MediaWiki, built to let people edit wiki pages without learning wikitext markup.

History and development of VisualEditor

Introduced in 2012, VisualEditor remains under active development by the Wikimedia Foundation, which distinguishes it from many open-source editors that quietly stop receiving updates.

The most notable recent addition is “Edit checks,” a feature now shown to new editors that prompts them when they forget to add a reference or when they copy in text from elsewhere, a check that exists in part because copied text might violate Wikipedia’s large language model guideline. It’s a defensive, governance-oriented response to AI-generated content rather than an AI feature itself, but it’s a meaningful 2026-era addition worth knowing about if you’re evaluating VisualEditor’s trajectory.

Key VisualEditor features

Rich text editor features: Basic formatting suited to wiki content.

Linking and citation tools: Simplified internal/external links and citations.

Template editing: Visual interface for editing and using templates.

Collaborative editing: Built for multi-user wiki environments.

Edit checks: Prompts for missing references or pasted content, including AI-generated text flagged under Wikipedia’s LLM guideline.

There is still no AI writing or editing assistance in VisualEditor itself. Its 2026-era development effort has gone toward governance around AI-generated content, not toward adding AI capability to the editor.

VisualEditor user interface and experience

Still, a simpler, minimalist UI prioritising ease of use for contributors unfamiliar with code. It remains less customizable than Froala but is well-suited to wiki-style needs.

VisualEditor supported platforms and integrations

VisualEditor is still primarily designed for MediaWiki. It can be installed outside MediaWiki, but this remains explicitly experimental (the project’s own documentation describes it as “at your own risk”), and requires significant setup work and codebase familiarity. Its integration options outside the Wikimedia ecosystem haven’t broadened.

Froala vs. VisualEditor: In-depth comparison

Here’s an in-depth comparison between Froala and VisualEditor:

User interface

Feature Froala VisualEditor
Intuitive interface Excellent Moderate
Customizable UI Yes Yes (limited)
Responsive design Yes Yes
Toolbars and themes Full control Predefined

Froala still leads in UI flexibility and aesthetics for general-purpose website-building tasks. VisualEditor’s UI still suits simplified, wiki-like environments better.

Features and AI capabilities

Feature Froala VisualEditor
Rich text editing Yes Yes
Markdown Yes No
AI Assist (chat, tone, translate) Yes (v5.1+) No
AI-content governance (edit checks) No Yes
Media and file manager Yes (stronger since v4.3) Limited
Code view/source code Yes Limited
Real-time collaboration Via Codox.io integration Built-in (wiki-style)
Plugins Yes No

The AI row is the one genuinely new addition to this table, and it’s worth reading carefully rather than as a simple win for Froala. Froala added AI as a writing tool: an assistant the user actively invokes to generate, rewrite, or translate content.

VisualEditor added AI awareness as a moderation tool: a prompt that fires when a contributor’s behaviour looks like it might involve AI-generated text, in service of Wikipedia’s editorial integrity policies. They’re solving different problems for different audiences, and the comparison only really tells you something if AI-assisted writing is what you’re after, in which case Froala is the only one of the two that offers it. This fundamental split between generative assistance and editorial policing helps clarify how Froala compares to Tiptap when developers weigh advanced AI automation against modular flexibility.

Performance

Froala remains known for speed: a sub-40ms load and a roughly 50KB core, with consistent performance across browsers and mobile devices.

VisualEditor can still lag on larger pages and complex entries, an effect that hasn’t changed materially since our last update.

Integration and developer support

Froala continues to offer broad framework integration alongside comprehensive documentation, an active community, video tutorials, and commercial support.

VisualEditor still doesn’t publish a list of integrations with modern web frameworks, has limited documentation for use outside MediaWiki, and remains harder to find tutorial content for if you’re trying to deploy it elsewhere.

Pricing and licensing

Froala is still a commercial product with tiered pricing and a fully featured free trial. Current published tiers run Professional (around $899/year) and Enterprise (around $1,599–1,999/year depending on source and promotion), with AI Assist included across plans rather than gated as a separate add-on; you’ll still need your own API key or budget for whichever AI provider you connect it to.

VisualEditor remains free and open source, which is attractive for budget-conscious projects but comes with the same feature ceiling and lack of commercial support as before.

Froala vs. VisualEditor: Pros and Cons

Froala Pros and Cons

Advantages: Modern interface with full feature control; works well with Bootstrap or Tailwind CSS; integrates with multiple platforms; advanced features including Markdown, file management, code editing, and now AI Assist; strong developer documentation and support; SEO-friendly, responsive, and accessible.

Disadvantages: Paid license required; AI Assist requires your own provider API key and budget.

VisualEditor Pros and Cons

Advantages: Free and open source; simple, accessible UI; well-suited to wikis and collaborative content; actively maintained by the Wikimedia Foundation, with ongoing governance-focused development (such as edit checks for AI-generated content).

Disadvantages: Basic rich text features only; no AI writing assistance; minimal integration support outside MediaWiki; difficult to customise.

Use cases and recommendations

When should you choose Froala?

If you’re building scalable websites, social platforms, an LMS, or blogs, and want AI-assisted content creation alongside rich formatting, file management, and real-time collaboration, Froala remains the stronger fit. It’s the only one of the two editors where AI is something your end users can actively use to write or revise content.

When should you choose VisualEditor?

If you’re building a wiki, educational site, or knowledge base, particularly one already inside the MediaWiki ecosystem, VisualEditor is still the natural choice. Its 2026 development has focused on protecting editorial integrity in an AI-saturated content landscape rather than adding AI capability, which is arguably the right call for its specific mission, but it does mean VisualEditor isn’t the editor to reach for if AI-assisted writing is part of what you need.

Which WYSIWYG editor is better in 2026?

Froala vs. VisualEditor Comparison in 2026

In terms of features, documentation, compliance, and usability, Froala still takes the lead, and the gap has widened slightly now that AI-assisted writing is part of the comparison. VisualEditor remains the better choice if you’re building a wiki or need a free, simple editor for a small, code-light project, and its continued active maintenance (unlike a lot of older open-source editors at this point) is a real point in its favour for that specific use case. For anything past that scope, the best WYSIWYG editors for web developers in 2026 is the more useful shortlist.

“Better” still depends entirely on what you’re building. Try both and see which fits. Ready to choose the right WYSIWYG HTML editor for your project? Try Froala today and explore its rich text editing features, AI Assist, framework integrations, media tools, and developer-friendly setup before committing to a license.

FAQs

Is Froala Editor free?

Froala has a free trial, but it’s a commercial product with pricing tiers based on features and usage. AI Assist is included in the trial.

Is VisualEditor easy to set up outside MediaWiki?

Not really. It’s primarily built for MediaWiki, and while it can technically be installed elsewhere, the project’s own documentation flags this as experimental and requires significant setup effort.

Can you use Froala with Bootstrap 5 or Tailwind CSS?

Yes, Froala integrates cleanly with Bootstrap, Tailwind, or plain CSS for consistent design across your app.

Which rich text editor is better for real-time collaboration?

Froala adds real-time co-editing through its Codox.io integration, which is still active and straightforward to set up. VisualEditor offers collaborative editing natively, built around the wiki-editing model rather than general document co-editing.

Does either editor offer AI-assisted writing?

Froala does, via its AI Assist plugin (v5.1+), which supports chat, tone adjustment, and translation against any AI provider. VisualEditor does not offer AI writing assistance; its AI-related development has gone toward edit checks that flag potentially AI-generated or improperly sourced content.

Which WYSIWYG HTML editor is better for developers?

Froala, due to its documentation, framework integrations, and developer-facing tools like code editing, Markdown, and configurable AI Assist.

Which rich text editor is better for building informative pages?

If you’re building wiki-style pages for an organisation or community knowledge base, VisualEditor remains a solid, purpose-built choice.

How to Get Content and Set Content in HTML Editor Software

getter and setter Text Thumbnail

Content manipulation is the central core of a web application that involves text editing. Regarding apps, two functions are essential for good performance in this software engineering area: get content and set content for the HTML editor software.

To see how this works, you must understand how the mechanics of these functions are elementary.

  1. App users want their content saved in a database when interacting with the editor. However, the editor must obtain the content to enable this saving process. This behavior is the function of the getContent() method.
  2. The other function the user may need is to edit previously saved content in a database. The setContent() method does this.

In this guide, we’ll explore how to harness the content manipulation capabilities of Froala  WYSIWYG Editor to accomplish these tasks effectively.

Key takeaways

  • html.get() retrieves the HTML content inside the Froala Editor instance.
  • Passing false to html.get(false) returns plain text without HTML tags.
  • html.set() allows you to populate the editor with HTML content programmatically.
  • For dynamic updates, use event-based triggers like button clicks or data loading.
  • Always initialize the editor before calling content methods to avoid errors.
  • Use arrays or identifiers to manage multiple editor instances efficiently.
  • Leverage Froala’s clean API and event hooks to create responsive content workflows.

The Froala editor get-content and set-content methods

Froala provides developer-friendly methods to manipulate content inside the editor. Let’s start with the basics: getting and setting content.

How to use the get-content and set-content methods

To get content from Froala Editor, use the html.get() method. This allows you to retrieve the HTML content within the editor instance.

 

new FroalaEditor('.selector', {}, function () {

  const content = this.html.get();   

console.log(content);

});

Here is the complete example:

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Froala Get Content Example</title>

  <!-- Froala Editor CSS -->

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

</head>

<body>

  <!-- Editor Container -->

  <div id="froala-editor">

    <p>Edit this content. Check the console after it loads.</p>

  </div>

  <!-- Froala Editor JS -->

  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.15/js/froala_editor.pkgd.min.js"></script>

  <!-- Custom Script -->

  <script>

    // Initialize Froala Editor

    new FroalaEditor('#froala-editor', {}, function () {

      // Get content on initialization

      const content = this.html.get();

      console.log('Initial editor content:', content);

    });

  </script>

</body>

</html>

get a content example in Froala html editor software - input text

get-content example in Froala html editor - output

To set content, use the html.set() method. This lets you dynamically populate the editor with HTML.

<!-- HTML -->

<div class="selector"></div>

<!-- JavaScript -->

<script>

  new FroalaEditor('.selector', {}, function () {

    this.html.set('<p>Welcome to Froala Editor!</p>');

  });

</script>

Here is the complete example:

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

  <title>Froala Set Content Example</title>

  <!-- Froala Editor CSS -->

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

</head>

<body>

  <!-- Editor Container -->

  <div class="selector"></div>

  <!-- Froala Editor JS -->

  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.15/js/froala_editor.pkgd.min.js"></script>

  <!-- Custom Script -->

  <script>

    // Initialize Froala Editor and set content

    new FroalaEditor('.selector', {}, function () {

      this.html.set('<p>Welcome to Froala Editor!</p>');

    });

  </script>

</body>

</html>

When you open this file in your browser, you’ll see Froala Editor with the content:

“Welcome to Froala Editor!”

set-content example in Froala editor an html editor software

These methods are essential for loading saved content or exporting editor data to a backend database.

How to set content dynamically in Froala

When building responsive and interactive applications, you often need to dynamically update the content inside your HTML editor software. Whether it’s loading saved drafts, switching between templates, or reacting to user input—Froala Editor makes this process seamless using the html.set() method.

Use Case:

Imagine you’re building a blogging platform. When a user clicks “Load Template,” you want the editor to instantly populate with a predefined blog structure. This is a perfect case for using html.set() dynamically.

Example: Set content on button click

Here’s how you can dynamically insert content into Froala Editor in response to a user interaction like clicking a button.

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

  <title>Froala Dynamic Set Content Example</title>

  <!-- Froala Editor CSS -->

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

</head>

<body>

  <!-- Froala Editor Container -->

  <div id="froala-editor"></div>

  <!-- Button to Insert Dynamic Content -->

  <button onclick="insertTemplate()" style="margin-top: 20px; padding: 10px 20px;">Load Blog Template</button>

  <!-- Froala Editor JS -->

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.5.0/js/froala_editor.pkgd.min.js"></script>

  <!-- Custom JS -->

  <script>

    let editor;

    // Initialize Froala Editor

    editor = new FroalaEditor('#froala-editor', {}, function () {

      console.log('Editor is ready.');

    });

    // Set content dynamically on button click

    function insertTemplate() {

      const templateHTML = `

        <h2>My Blog Title</h2>

        <p>Welcome to my blog! This is a dynamic template loaded into Froala Editor.</p>

        <p>Feel free to customize it as you like.</p>

      `;

      editor.html.set(templateHTML);

    }

  </script>

</body>

</html>

What’s happening here?

  • The editor is initialized with a target element (#froala-editor)
  • A button is provided to trigger the insertTemplate() function
  • When the button is clicked, Froala dynamically replaces the current content with the predefined HTML

Output

It will load the template when you click the button.

set content dynamically example in Froala editor - output

Real-World Applications

  • Draft loaders in CMS platforms
  • Template switchers for emails, blogs, or reports
  • Live previews of form-generated content
  • AI-generated text insertion based on user selections

By integrating dynamic content-setting capabilities using html.set(), you enhance the flexibility and user experience of your HTML editor software—making Froala Editor a powerful choice for interactive web applications.

How to set content with multiple editors

When your application uses multiple Froala Editor instances on a single page—such as in forums, CMS dashboards, or multi-input forms—managing them efficiently is key. Fortunately, Froala Editor makes it simple to initialize and set content individually for each instance.

In this section, you’ll learn how to loop through multiple editors, manage them in a list, and dynamically insert content into a specific one when needed.

Example: Multiple Froala editors with individual content setters

Let’s say you have three editable sections on your page, each needing its own Froala Editor instance. You also want to insert unique content into one of them dynamically.

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

  <title>Froala Multiple Editors Example</title>

  <!-- Froala Editor CSS -->

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

  <style>

    .editor {

      margin-bottom: 20px;

    }

    button {

      margin-right: 10px;

      margin-bottom: 20px;

    }

  </style>

</head>

<body>

  <!-- Editor Containers -->

  <div class="editor" id="editor-1"></div>

  <div class="editor" id="editor-2"></div>

  <div class="editor" id="editor-3"></div>

  <!-- Control Buttons -->

  <button onclick="setEditorContent(0)">Set Content in Editor 1</button>

  <button onclick="setEditorContent(1)">Set Content in Editor 2</button>

  <button onclick="setEditorContent(2)">Set Content in Editor 3</button>

  <!-- Froala Editor JS -->

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.5.0/js/froala_editor.pkgd.min.js"></script>

  <!-- Custom Script -->

  <script>

    const editors = [];

    // Initialize Froala Editor on all .editor divs

    document.querySelectorAll('.editor').forEach((el, index) => {

      editors[index] = new FroalaEditor(el, {}, function () {

        console.log(`Editor ${index + 1} initialized.`);

      });

    });

    // Function to dynamically set content in a specific editor

    function setEditorContent(index) {

      const contentTemplates = [

        "<p>This is content for <strong>Editor 1</strong>.</p>",

        "<p>Welcome to <em>Editor 2</em>. Here's your dynamic text!</p>",

        "<p>Editor 3 has <u>fresh content</u> just for you.</p>"

      ];

      if (editors[index]) {

        editors[index].html.set(contentTemplates[index]);

        console.log(`Content set in Editor ${index + 1}`);

      }

    }

  </script>

</body>

</html>

What’s happening here?

  • We select all .editor elements and loop through them with forEach.
  • Each element gets initialized with a Froala Editor instance, stored in an array called editors.
  • When a button is clicked, it calls setEditorContent(index), which sets unique HTML content in the corresponding editor instance.

Real-world use cases

  • Content management systems (CMS) with multiple editable blocks
  • Admin dashboards managing multiple article or section inputs
  • Interactive forms with rich text input in different areas
  • E-learning platforms for instructors writing multiple responses or feedback fields

By storing each Froala Editor instance in an array and referencing them by index or ID, you gain full control over setting content dynamically across a multi-editor interface—enhancing both user experience and application flexibility.

Output

Set content in multiple editors - after clicking the buttons

See the output when you click 3 buttons:

Froala setContent not working: Common fixes

You might run into a situation where the setContent() method just… doesn’t work. Maybe you see the frustrating Cannot read properties of undefined (reading ‘set’) or nothing appears in the editor at all.

This is a common issue in HTML editor software when the script tries to call html.set() before the Froala Editor instance is fully initialized.

Fix it with these steps:

  • Check the initialization order. Make sure you’re calling html.set() inside the Froala init callback or after the editor has finished loading.
  • Avoid calling set() on a null or undefined editor instance. This happens when you’re referencing the editor too early in the page lifecycle.

NOTE: The best practice is to only run editor.html.set() inside the initialization callback or after the editor is ready via Froala editor events like initialized.

new FroalaEditor('#editor', {}, function () {

  this.html.set('<p>This works perfectly!</p>');

});

If you’re using multiple editors or setting content dynamically, make sure:

  • You’re referencing the correct editor instance from your array
  • The DOM is fully loaded before initializing
  • You handle re-renders if you’re using frameworks like React or Vu

How to set Froala content on initialization

If you need to preload content as soon as the editor starts, either use the html.set() method in the callback, or set it as the default HTML using the editor config.

new FroalaEditor('#editor', {

  html: {

    default: '<p>Preloaded content</p>'

  }

});

Following these simple practices will ensure you avoid the common “Froala setContent not working” errors and keep your content flowing smoothly.

How to get plain text content from Froala (No HTML tags)

Sometimes, you just need the text content without any HTML—especially for search indexing, summaries, or plain-text exports. Froala makes this simple with a small tweak to the html.get() method.

Use the following code:

const plainText = editor.html.get(false);

console.log(plainText); // Outputs content without any HTML tags

By passing false to html.get(), the method returns clean text without formatting tags—perfect for lightweight processing or storage.

Best practices for managing content in Froala editor

When it comes to working with HTML editor software, mastering how to get and set content effectively is crucial for building intuitive and flexible web applications. Froala Editor simplifies this with clean, developer-friendly methods that can be adapted for everything from simple blogs to enterprise-level platforms.

Here’s a summary of the key points we covered:

  • Use html.get() to retrieve content from the editor. Pass false if you need a plain text with no HTML tags.
  • Use html.set() to inject or update content within the editor, whether on page load or user interaction.
  • Always ensure you’re calling these methods after the editor is initialized. The safest approach is to use them inside the editor’s initialized callback or through Froala Editor events.
  • For multiple editors, store instances in an array and manage content individually with index-based referencing.
  • Handle edge cases and errors by checking for null references and ensuring the DOM is fully loaded.

Whether you’re building a CMS, a documentation editor, or an e-learning tool, understanding how to get and set content properly ensures your Froala integration is seamless, dynamic, and powerful.

Now that you’ve learned how to control content flow with Froala, you’re ready to build smarter, cleaner, and more flexible editing experiences.

FAQs

Q1: How do I get only the text from Froala without HTML?

 Use editor.html.get(false). This returns a plain text version of the content.

Q2: Why isn’t my html.set() working?

Make sure the editor is fully initialized. Use the method inside the init callback or after the initialized event fires.

Q3: Can I use Froala Editor in multiple elements on one page?

Yes! Just initialize each instance separately and manage them in an array for easy access and control.

Q4: Can I load content into the editor from a database?

Absolutely. Fetch the content via an API or backend call, then use html.set() to populate the editor dynamically.

Q5: Is it safe to use html.set() repeatedly?

Yes, but ensure the editor is still active and not destroyed. For React or Vue apps, re-check initialization after each render.

Got Questions?

If you have more questions about working with Froala Editor or want us to cover a specific topic, feel free to reach out at support@froala.com. We’d love to hear from you—and who knows? Your question might inspire our next blog post!

Happy editing!

Froala Editor V4.5.1: Enhanced Filestack, Styling Non-editable Content, and More

a group of people that are standing in the snow

We are excited to announce the release of Froala Editor 4.5.1. This version includes several new features and improvements, such as enhanced performance, bug fixes, and new customization options. Users can now enjoy a more seamless editing experience with increased stability and efficiency.

By upgrading to Froala Editor V4.5.1, users will benefit from using the Filestack plugin on all browsers, the ability to easily style contenteditable="false" elements, and much more!

Let’s dive in and explore the key highlights.

Filestack Plugin now works across all browsers

Froala Editor 4.3 introduced the powerful Filestack plugin, allowing users to easily upload and manage files from various cloud storage providers.

The Filestack integration offers a complete file upload management solution. When a user uploads a file, a CDN link is created instantly, providing optimized and rapid file delivery.

However, the previous version had some browser compatibility restrictions, limiting its usage.

With Froala Editor V4.5.1, the Filestack plugin now works seamlessly across all browsers and operating systems. Users can now enjoy a consistent and reliable file management experience, regardless of their browser of choice.

Configuring the Filestack plugin is easy. Check out these guides for more details:

With the cross-browser compatibility of the Filestack plugin, users can now confidently manage their files from any device or browser, saving time and hassle. This improvement further enhances the flexibility and reliability of the Froala Editor, making it an even more powerful tool for content creation and management.

Easily Style Non-Editable Content

Froala Editor 4.5.1 introduces a powerful new feature that gives you more control over styling your content. The update adds a new configuration option called (allowStylingOnNonEditable). When you set this to true, users will be able to style contenteditable=”false” elements. If a user styles content partially within a non-editable element, the entire element’s content will be styled.

new FroalaEditor('#editor', {

allowStylingOnNonEditable: true

});

By default, this configuration is set to false, maintaining the old behavior where non-editable element styling is not allowed.

By unlocking the ability to style non-editable content, Froala Editor 4.5.1 gives you greater creative control and a more streamlined editing experience. No more workarounds or compromises – just the freedom to format your content exactly how you want it.

Table Formatting Enhancements

This release supercharges table formatting, dramatically boosting user productivity. The new features streamline content management and editing, saving time and reducing frustration.

Multi-cell Content Formatting

You can now select and format multiple table cells at once. Simply click and drag, or use the (Shift + Arrow) keys shortcut. Then, apply text styles like font size, bold, italics, alignment, and background color across all selected cells with a single action.

Multi-cell Content Formatting

Improved table content alignment

If the user wants to align content within a table cell, he can select the cell and align the content from the table popup alignment option or from the editor toolbar alignment options.

Previously, the table popup alignment applies styles directly to the <td> elements, while toolbar alignment targets the content inside these cells. This discrepancy leads to conflicts when switching between the two alignment methods, causing the alignment to stop working as expected.

Froala V4.5.1 syncs the two alignment methods for a seamless experience. Now, if a cell is selected and a style is applied from the toolbar, it is applied to the entire td element. However, if a specific text or element within the cell is selected, the style from the toolbar applies only to that selected text/element.

Additional Table Improvements

Froala V4.5.1 also addresses other table-related issues. It removes the unnecessary .fr-table-selector overlay that appeared when hovering over the editor inside a table, even without a table inside the editor. And it fixes table resizing problems when using Froala within the Fluent UI 8 Dialog component.

These table formatting enhancements make Froala Editor an even more powerful tool for organizing and presenting your content. With these time-saving features, you can focus on creating great work instead of wrestling with formatting.

Track Content Movements with Ease

Froala Editor 4.5.1 introduces an exciting new feature that allows you to track content movements. When you enable the Track Changes plugin, the editor will now visually indicate whenever users drag and drop content within the document.

The ability to track drag and drop actions further enhances Froala Editor’s capabilities. Now, you can confidently rearrange content, knowing you can monitor and understand the changes. This makes Froala an even more powerful tool for efficiently expressing your ideas and keeping your content organized.

To take advantage of this feature, simply enable the Track Changes plugin by including its button in the toolbarButtons option. Refer to the plugin’s documentation to learn more about its configuration and usage.

new FroalaEditor('#froala-editor',  {

toolbarButtons: ['bold', 'italic', 'underline','fontFamily', 'color',  'paragraphStyle','trackChanges', ]

});

Bug Fixes

Additionally, the team has addressed various bug fixes and stability improvements to ensure a seamless and reliable editing experience for all Froala Editor users. These include:

  • The release resolves an issue that caused the editor to freeze when users inserted an image as a base64 string and then switched to the Code View. This fix ensures a smooth transition between the visual and code editing modes, saving users from frustrating interruptions.
  • The team removed a duplicate identifier runtime error in the TypeScript type definition file index.d.ts. This issue had previously caused problems with TypeScript compilation, making integration with TypeScript-based projects more challenging. By addressing this bug, the Froala team has improved the editor’s overall compatibility and reliability for developers.

Please find the complete changelog list here.

How Can I Update?

Don’t miss out on the benefits of the latest Froala 4.5.1 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.5.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.5.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

Add Multilingual Translation to Froala with Translate Plus API from APILayer

Multilingual Translation API

Modern apps need to work for users everywhere. If you’re building tools like chat apps or collaborative editors, language barriers can quickly get in the way. People want to read, write, and communicate in their own language — without copying text into external translators.

That’s why adding a Multilingual Translation API directly into your editor can make a huge difference.

In this tutorial, I’ll walk you through how I added real-time translation to my Froala-based chat editor. I used the Translate Plus API from APILayer to build a simple, clean, and one-click translation experience. With this integration, users can understand each other instantly, no matter what language they speak.

Let’s get started.

Translate Plus API

Exploring a Multilingual Translation API on the APILayer Marketplace

As I was building a new Froala editor demo for a multilingual chatting application, I needed to add high-quality translations to enable users from diverse linguistic backgrounds to communicate with each other. While existing translation tools like the Google Translate API are popular, I wanted to explore alternatives that could offer accurate translations with broader language support at a much lower price.

While exploring the APILayer marketplace, which offers a wide range of APIs to help you build modern, feature-rich applications with real-time translations, I discovered the Translate Plus API, which seemed like the perfect solution to my problem.

APILayer Marketplace

What is APILayer?

APILayer is a popular API marketplace that provides access to a wide range of APIs, not limited to translation services. It also offers APIs that integrate with the Google Cloud ecosystem and other technical content service providers.

As a developer, I appreciated the ease of integration for the APIs provided by APILayer, which made it straightforward to incorporate new features into my applications.

Why Choose APILayer?

Utilizing APILayer includes several benefits, such as:

  • Wide Variety of APIs: It offers APIs for currency conversion, IP geolocation, weather data, email validation, and much more, catering to a broad spectrum of use cases, including machine translation.
  • Ease of Integration: Their APIs are designed to be user-friendly, with straightforward documentation and code samples that allow for quick and seamless integration.
  • Cost-Effectiveness: Many of their APIs are affordable and come with tiered pricing models, making it accessible for both startups and enterprises working on large-scale projects.
  • Reliability: All the APIs are thoroughly reviewed for high accuracy before they are listed by the APILayer team, ensuring customer satisfaction.

Why Use the Translate Plus API?

The Translate Plus API from APILayer stood out to me as a powerful tool that could seamlessly integrate with the Froala Editor to provide translation capabilities for multiple languages. The language detection feature was particularly impressive, as it could automatically determine the source language.

One of the key features of using the Translate Plus API from the APILayer marketplace is the extensive language support. Unlike some other APIs that are limited in their support for language pairs, this service truly excels.

The Translate Plus API supports over 100 languages, catering to a diverse global audience. This flexibility enables my users to translate content into their preferred languages, ensuring that information is accessible and understandable to all, even when dealing with industry jargon or technical terms.

The comprehensive documentation and intuitive API design made it easy for me to quickly implement the translation feature in my application. Additionally, the competitive pricing and reliable performance of the Translate Plus API were key factors that influenced my decision to leverage this solution over other alternatives.

How the Translation Feature Works

I wanted to make the translation process seamless and intuitive for users. To achieve this, I aimed to add a new toolbar button to the Froala Editor. When users click this button, they’ll see a dropdown menu displaying all the languages supported by the Translate Plus API.

Users can then select their preferred language from the list. Once they make their selection, the API automatically detects the original language of the content and translates it into the user’s chosen language. The editor then instantly updates, displaying the translated text.

Froala integration with translation API

This straightforward interaction allows users to quickly and easily access content in their native tongue, fostering a more inclusive and accessible experience within the chatting application.

Integrating the Translate Plus API into the Froala Editor

Step 1: Get a Translate Plus API Key

I began by signing up for a Translate Plus account (multilingual translation API in APILayer marketplace) and obtaining an API key. This would be required to authenticate my API requests. This process was similar to what you’d experience with other APIs.

Step 2: Create a starter template

Next, I included the necessary Froala scripts and stylesheets in my HTML file. Additionally, I added an HTML element to serve as the editor’s container. This is where the Froala editor would be rendered.

To enhance the visual appeal of the editor’s toolbar, I also included the Font Awesome 5 stylesheet. This allowed me to use the iconic Font Awesome 5 library to represent the toolbar buttons’ icons.

<!DOCTYPE html>
<html>

<head>
    <title>Froala WYSIWYG Editor</title>
    <!-- Include Froala CSS -->
    <link href="{{editor__download__folder}}/css/froala_editor.pkgd.min.css" rel="stylesheet"
        type="text/css" />
        
    <!-- Include Font Awesome 5 -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.5.0/css/all.min.css" rel="stylesheet"
        type="text/css" />
</head>

<body>

    <!-- HTML element where the editor will be initialized -->
    <div id="editor">
    </div>

    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.pkgd.min.js"></script>
 
</body>

</html>

Step 3: Get Translate Plus Multilingual Translation API Supported Languages

var myHeaders = new Headers()
myHeaders.append("X-API-KEY", "b2430***************************19be00")
myHeaders.append("Content-Type", "application/json")

var requestOptions = {
  method: "GET",
  redirect: "follow",
  headers: myHeaders,
}

fetch("https://api.translateplus.io/v1/supported-languages", requestOptions)
  .then((response) => response.json())
  .then((result) => initFroala(result.supported_languages))
  .catch((error) => console.log("error", error))

To get the list of supported languages for the Translate Plus API, I made a GET request to the /supported-languages endpoint. This provided me with a comprehensive list of all the languages that the API supports. I then passed this information to the initFroala function, which I will use to create the translation toolbar button and initialize the Froala Editor.

By obtaining the full list of supported languages, I could ensure that my users would have access to a wide range of translation options, catering to diverse linguistic needs. This flexibility would be a key differentiator for my chatting application, allowing users from all over the world to communicate effectively, regardless of their native tongue.

The straightforward API documentation and intuitive response format made it easy for me to parse and utilize the language data. This streamlined the development process, allowing me to quickly move on to the next steps of creating the custom toolbar button and integrating the translation functionality.

Step 4: Create the Translation toolbar button

Now, I need to add a new custom button to the editor’s toolbar. When clicked, this button would display a dropdown menu with the list of available translation languages.

The dropdown menu would allow the user to select the desired target language for translation. When a language is selected, I would use the Translate Plus API to fetch the translated content and update the editor’s text accordingly.

Step 4.1 Define the Translation toolbar button icon

To define an icon for the translate toolbar button, I did the following:

  // Set Font Awesome 5 as the default toolbar icon library.
  FroalaEditor.ICON_DEFAULT_TEMPLATE = "font_awesome_5"

  // Set the Font Awesome's language symbole as icon for the "translate" button
  FroalaEditor.DefineIcon("translate", { NAME: "language" })

By using the recognizable language icon, I ensured that users would instantly understand the purpose of the translation button, enhancing the intuitiveness of the feature.

Step 4.2 Craft the Translation Toolbar Button

To create the new “translate” button, I defined an object with several key properties:

title

The title represents the label of the button.

title: "translate",

type

The type property defines the button’s behavior. In this case, I set it to “dropdown” since it will open a list of translation options.

type: "dropdown",

options

The options property holds an object containing the supported translation languages, which I obtained from the Translate Plus API in step 3. I can access this object later using the FroalaEditor instance at FroalaEditor.COMMANDS.translate.options.

html

The html property is a method that returns the HTML code for the dropdown menu. Here, I used the FroalaEditor.COMMANDS.translate.options object to dynamically generate a list of the supported translation languages.

    html: function html() {
      var c = '<ul class="fr-dropdown-list" role="presentation">'
      var options = FroalaEditor.COMMANDS.translate.options

      for (var val in options) {
        if (options.hasOwnProperty(val) && val!=="Auto Detect") {
          c += `<li role="presentation"><a class="fr-command fr-title" tabIndex="-1" role="option" data-cmd="translate" data-param1="${this.language.translate(options[val])}" title="${this.language.translate(val)}"> ${this.language.translate(val)} <span class="fr-sr-only">${this.language.translate(val)}</span></a></li>`
        }
      }

      c += "</ul>"
      return c
    },

callback

The callback property defines the action executed when the user selects a language from the dropdown menu.

First, I check if the editor is empty using the core.isEmpty() method. If the editor has content, I select all the text using the commands.selectAll() method and save it to a variable using selection.text().

Then, I call a translate() function, passing the selected text and the user’s chosen language as arguments. This function handles the translation process and returns the translated content. Finally, I update the editor’s content with the translated text using the html.insert() method.

callback: async function callback(cmd, param1) {
    	if(this.core.isEmpty()) return;
    
      this.commands.selectAll();
      const text = this.selection.text();   
      const result = await translate(text, param1);
      this.html.insert(result.translations.translation, true);

      
    },

Step 4.3 Handling the Translation Process

The translate function receives the current content of the Froala Editor and the desired target language. It then sends a request to the Translate Plus API, passing both parameters.

Importantly, I set the source parameter to "auto". This tells the Translate Plus API to automatically detect the original language of the content. This ensures a seamless translation experience for the user, as they don’t need to worry about specifying the source language.

The API then responds with the translated content, which the translate function returns. Here’s the code:

 async function translate(text, translateTo) {
    var requestOptions = {
      method: "POST",
      redirect: "follow",
      headers: myHeaders,
      body: JSON.stringify({
        text,
        source: "auto",
        target: translateTo,
      }),
    }
    let data = false
    try {
      const response = await fetch(
        "https://api.translateplus.io/v1/translate",
        requestOptions,
      )
      // Check if the response is okay
      if (!response.ok) {
        throw new Error(`HTTP error! Status: ${response.status}`)
      }

      // Parse the response JSON
      data = await response.json()
    } catch (error) {
      console.log("error", error)
    }
    return data
  }

The automatic language detection and the straightforward API response make the translation process effortless for the user, especially when dealing with context-specific content.

Step 5: Initialize The Froala Editor

Finally, I called the FroalaEditor constructor and passed an object with the necessary configurations, including the custom translation button I defined earlier.

new FroalaEditor("#editor", {
    wordCounterCount: false,
  	charCounterMax: 5000,
    toolbarBottom: true,
    toolbarButtons: ["bold", "italic", "underline", "strikeThrough", "|", "formatOL", "formatUL", "|", "textColor", "backgroundColor", "fontSize", "|", "insertLink", "translate"],
  })
}

I set the charCounterMax to 5000, which is the maximum number of characters that can be translated using the Translate Plus API in one call. For larger projects, you might consider implementing batch processing to handle more extensive content.

The translation feature is now seamlessly integrated into the Froala Editor, allowing users to effortlessly translate content within the application. The custom translation button in the toolbar provides a clear and recognizable interface for users to access the translation functionality, further improving the overall usability of the editor. This feature is particularly useful for mobile apps that need to support global audiences.. Try it now.

Conclusion

Adding the Translate Plus API (multilingual translation API in APILayer marketplace) to the Froala Editor gave my app instant multilingual support with just a few lines of code. Users can translate text on the spot, making communication smoother and more inclusive.

If you’re building anything for a global audience — chat apps, editors, dashboards, or internal tools — this is one of the easiest upgrades you can add.

To try it yourself, explore the Translate Plus Multilingual Translation API on the APILayer marketplace and check the Froala documentation to extend your editor even further.

Start integrating multilingual translation today and build apps that speak to everyone.

FAQs

Q1: Does the Multilingual Translation API detect languages automatically?

Yes. The Translate Plus API includes automatic language detection. When you set the source parameter to “auto”, the API identifies the original language automatically and returns the correct translation.

Q2: How many languages does the Translate Plus API support?

The Translate Plus API supports over 100 languages. This includes widely used languages as well as niche and regional languages, making it ideal for global applications.

Q3: Can I translate large documents with Froala?

Yes, but with a limit. Translate Plus allows up to 5,000 characters per request. If you need to translate larger documents, you can split the content into smaller chunks and process them in batches.

Choosing a Free WYSIWYG HTML Editor to Build Your Website

A team of developers collaborating at a computer while reviewing code, illustrating the use of a free WYSIWYG HTML editor for web development.

If you’re building a website, one of the easiest ways to create content is with a free WYSIWYG HTML editor. These editors let you design pages visually — no hand-coding required. What you type and style on-screen is exactly what appears on your website.

This makes them perfect for beginners, content writers, marketers, and even developers who want to save time.

In this guide, we’ll break down what WYSIWYG editors do, who needs them, and the best free options you can start using today. We’ll also compare free vs. paid editors and help you pick the right tool for your workflow.

What Is a Free WYSIWYG HTML Editor?

A WYSIWYG editor — short for What You See Is What You Get — is a tool that lets you format text, insert images, create layouts, and build HTML pages without writing code.

Instead of typing <p>, <h2>, or <strong>, you just click buttons. Bold looks bold. Headings look like headings. Images appear right where you place them.

A free WYSIWYG HTML editor gives you all these visual editing features without needing a paid license. Many also offer access to the HTML source code if you want full control.

Why Use a WYSIWYG Editor?

Here are the biggest benefits:

✔ It saves time.

You can create content quickly without switching between code and preview modes.

✔ No coding expertise needed.

Non-technical team members can edit pages confidently.

✔ Clean workflows.

Writers, marketers, and developers can collaborate without confusion.

✔ Real-time preview.

You instantly see how your page will look in the browser.

✔ Faster prototyping.

Developers can use these editors to mock up layouts before building full components.

Whether you’re building documentation, landing pages, blog posts, or full websites, a WYSIWYG editor helps you work faster and focus on what matters: the content.

Top Free WYSIWYG HTML Editors (2025)

These are the most popular free and open-source editors today. Let’s see their key features.

1. Froala WYSIWYG Editor

Froala is known for its beautiful interface and lightweight design.

While the full version is commercial, the free trial or lite usage is excellent for testing.

Key features:

  • Cleanest UI among editors
  • Fast performance
  • Inline editing
  • Modern toolbar design

Best for: developers who want a high-end editor experience before upgrading.

2. TinyMCE (Free Tier)

TinyMCE is one of the most widely used WYSIWYG editors in the world.

It powers many CMS platforms and SaaS products.

Key features:

  • Rich text editing tools
  • Image handling (with plugins)
  • Clean HTML output
  • A plugin-based architecture
  • Developer-friendly API

Best for: content-heavy websites, documentation tools, and enterprise use.

3. CKEditor (Open Source)

CKEditor is another long-time leader in the WYSIWYG world.

The open-source version is free and powerful.

Key features:

  • Block-based editing
  • Collaborative editing (premium)
  • Excellent accessibility
  • Clean, semantic HTML

Best for: teams needing stability, accessibility, and long-term support.

4. Summernote (Open Source)

Summernote is a simple, powerful, open-source WYSIWYG editor.

Key features:

  • Super lightweight
  • jQuery-friendly
  • Easy to customize
  • Image uploads

Best for: small websites and simple projects.

5. Quill.js (Open Source)

Quill is a modern, API-driven rich text editor.

It focuses on clean structure and developer flexibility.

Key features:

  • JSON-based Delta format
  • Modular architecture
  • Clean, predictable output

Best for: web apps that need controlled, structured content.

6. Trix Editor

Developed by Basecamp, Trix is minimal, clean, and perfect for basic editing.

Key features:

  • Automatic formatting
  • Undo/redo history
  • Drag-and-drop attachments

Best for: simple CMS systems and form-based editing.

WYSIWYG vs HTML-Only Editors

Here’s a quick comparison to help you understand the difference clearly:

 

Feature WYSIWYG Editor HTML-Only Editor
Editing Style Visual editing Code-only editing
Skill Needed Beginner-friendly Requires HTML/CSS knowledge
Speed Faster Slower
Collaboration Easier for teams Harder for non-coders
Output Auto-generated HTML Handwritten HTML
Best For Writers, marketers, mixed teams Developers who prefer full control

Why Developers Love Free WYSIWYG HTML Editors

Even experienced developers enjoy using visual editors.

Why? Because they cut down on repetitive work.

Writing every paragraph tag or formatting rule manually takes time.

If you’re working under deadlines, a free WYSIWYG HTML editor helps you stay fast and efficient.

With a good editor, you can:

  • Prototype layouts quickly
  • Format blog posts without switching to preview
  • Insert images and code blocks faster
  • Clean the HTML using the source view

Developers get the best of both worlds: speed + control.

Free vs Paid WYSIWYG Editors

Not sure whether you need a free editor or a commercial one? Here’s a quick breakdown:

Choose a free editor if:

✔ You’re learning or experimenting

✔ You’re building small websites

✔ Your editing needs are basic

✔ You don’t need advanced plugins

Choose a paid editor if:

✔ You need collaboration

✔ You want deep customization

✔ You require enterprise security

✔ Your site needs advanced media tools

✔ Your team needs premium support

Free website editor tools are great — but paid versions often offer major productivity upgrades.

How to Choose the Right WYSIWYG Editor

Here’s what you should consider:

1. Your skill level

Beginners → Froala, TinyMCE, CKEditor 

Developers → Quill, Trix

2. Type of project

Blogs → TinyMCE, Summernote

Documentation → CKEditor

Web apps → Quill

UI-driven apps → Froala

3. Performance needs

If you need speed, look for lightweight editors with minimal scripts.

4. Customization

If you need custom toolbars or plugins, choose open-source or API-friendly editors.

5. Output quality

Some editors generate cleaner HTML than others.

CKEditor, Froala, and Quill are excellent here.

6. Framework compatibility

Check for integrations with React, Vue, Angular, or your backend language.

Top Features to Look For

Here are the most important features in a modern WYSIWYG HTML editor:

  • Clean HTML output
  • Image handling
  • Source-code view
  • Tables and lists
  • Keyboard shortcuts
  • Plugin support
  • Autosave
  • Code snippets
  • Accessibility support
  • Mobile editing

A well-rounded editor should give you at least these essentials.

Conclusion

A free WYSIWYG HTML editor is one of the simplest ways to build pages, create content, and collaborate with your team — without touching raw HTML. Whether you’re a beginner or an experienced developer, these tools can dramatically speed up your workflow.

Experiment with a few options.

Find the editor that fits your style.

And once you’re ready for more advanced capabilities, you can always upgrade to a full-featured editor like Froala for even better performance, cleaner HTML, and a smoother editing experience.

FAQs

1. What is the best free WYSIWYG HTML editor for beginners?

TinyMCE and Summernote are usually the easiest for beginners because they feel like standard document editors. Froala also offers a free trial / lite version with a very clean interface, making it a great beginner-friendly option for modern web projects.

2. Which free HTML editor produces the cleanest code?

CKEditor and Froala usually generate the cleanest, most semantic HTML.

3. Can I use these editors in commercial projects?

Yes — but check each editor’s license. Many open-source editors allow commercial use, but some require attribution or have premium features locked.

Why Froala V4.5 Remains the Best WYSIWYG HTML Editor for Developers

a screen shot of a computer

It’s been a few weeks since we launched Froala Editor V4.5, and I wanted to take a moment to reflect on the journey behind this release and highlight what makes these new features so significant for our users. As the best WYSIWYG HTML editor on the market, Froala continues to evolve with developers’ needs in mind, offering a rich text editor experience that simplifies the web development process.

The Vision Behind V4.5

When we began planning for V4.5, we focused on addressing the real-world challenges our users face during web development. Our approach always starts with listening – to our customers, our community, and our team members who work directly with the product.

Three key themes emerged from this feedback:

  1. Flexibility in configuration – Users needed more granular control over which plugins are active in the WYSIWYG interface
  2. Improved workflow efficiency – Especially when working with data across different applications like Google Docs
  3. Enhanced customization – Giving developers more control over the presentation and behavior of HTML markup

These themes guided our development priorities and shaped the features that ultimately made it into V4.5, reinforcing Froala’s position as a feature-rich editor for professionals of all skill levels who need to design web pages efficiently.

Why Developers Choose Froala Over Other HTML Editors (Key Takeaways)

  • User-Driven Enhancements: The update was guided by real user feedback, focusing on flexibility, workflow efficiency, and extensive customization of the WYSIWYG HTML editor.
  • Simplified Plugin Management: The new pluginsDisabled option allows developers to easily disable unnecessary plugins, reducing the complexity of the coding process.
  • Seamless Excel Integration: Enhanced Excel-to-table paste functionality streamlines the content creation process, automatically adjusting table formats while preserving CSS code.
  • Improved User Experience: Orderable line heights offer precise control over display options and font sizes, addressing previous ordering issues in the text editor.
  • Ongoing Commitment: Froala Editor is dedicated to continuous improvement in performance, accessibility, and integration with other frameworks for creating responsive pages.

Advanced Features That Make Froala the Best WYSIWYG HTML Editor

Froala stands out as a top-tier WYSIWYG HTML editor thanks to its advanced features designed to streamline development and enhance user experience. From intuitive plugin management with the pluginsDisabled option to seamless Excel-to-table pasting and customizable line height ordering, Froala prioritizes efficiency, flexibility, and ease of use. These innovations not only save time but also empower developers to create polished, professional content with minimal friction.

The pluginsDisabled Option: A Small Change with Big Impact

The new pluginsDisabled option might seem like a minor enhancement at first glance, but its impact on development workflows is substantial. Before this feature, developers who wanted to disable just one or two plugins in the WYSIWYG HTML editor faced a tedious process – they had to explicitly list every single plugin they wanted to keep active.

With over 40 plugins available, this created unnecessary complexity and increased the risk of incorrect syntax. Now, developers can simply specify which plugins they don’t need, making configuration more intuitive and maintenance far less cumbersome during the web development process.

Excel-to-Table Paste: Bridging Content Silos

The enhanced Excel paste functionality addresses a common frustration point. Previously, moving data between Excel and Froala tables required manual reformatting or rebuilding tables from scratch – a tedious process that consumed valuable time.

By enabling seamless pasting with automatic table expansion and format preservation, our WYSIWYG HTML code editor has eliminated this friction point. What’s particularly satisfying about this feature is how it intelligently handles the various paste scenarios – whether the Excel content is larger, smaller, or differently formatted than the target table, all while maintaining proper HTML markup and CSS code.

Orderable Line Heights: Details Matter

The ability to control the order of line height options might seem like a small refinement, but it reflects our commitment to thoughtful user friendly interface design. The previous behavior, where JavaScript’s object property ordering would unexpectedly reorder these options, created confusion and friction for both developers and end-users of the rich text editor.

By implementing an array-based approach, we’ve given developers complete control over this presentation detail. This change exemplifies our philosophy that even small improvements to usability and developer experience can have a meaningful impact when multiplied across thousands of daily interactions with an easy to use editor.

How Our WYSIWYG HTML Code Editor Overcomes Common Development Challenges

Developing these features wasn’t without challenges. The Excel paste functionality, in particular, required solving several complex technical problems:

  • Accurately parsing Excel’s clipboard format for the rich text editor
  • Mapping Excel’s formatting to Froala’s content model and CSS code
  • Handling the various edge cases when merging content of different dimensions in the WYSIWYG interface
  • Preserving the right balance of source formatting while respecting target styling for a cohesive web page

Our approach focused on creating an intuitive experience that “just works” without requiring users to understand the underlying complexity.

Looking Forward: What’s Next for Froala Rich Text Editor

V4.5 represents another step in our ongoing journey to create the most powerful and easy to use WYSIWYG HTML editor available. While some may prefer a free version with basic capabilities or an open source WYSIWYG editor with community support, our professional solution offers many benefits that justify the investment for serious websites and applications.

  • Further enhancing performance across every browser and tech stack for seamless web development
  • Expanding our plugin ecosystem for advanced features and inline editing capabilities
  • Improving integration with popular frameworks and platforms including WordPress and block styled editor environments
  • Continuing to refine the balance between power and simplicity with features like live preview and split screen editing
  • Developing pre-built templates to help users design websites more efficiently with our feature rich editor

Your Role in Froala’s Evolution

The improvements in V4.5 would not have been possible without the feedback and suggestions from our user community. Your insights drive our roadmap and help us prioritize the features that will make the most difference in your work, whether you’re creating responsive pages or complex web applications.

We encourage you to continue sharing your experiences, challenges, and ideas with us. Whether through GitHub, our support channels, or community forums, your input is invaluable in shaping the future of Froala.

As always, we’re excited to see what you’ll create with these new capabilities, and we’re already hard at work on the next set of improvements to make your content creation experience with this easy to use editor even better. From novices looking for a good WYSIWYG editor to experts demanding a working WYSIWYG HTML editor for their development team, Froala continues to deliver an easy to use interface without compromising on power, collaborative editing features, and extensive customization options.

Step-by-step Guide To Add a Custom Export from Markdown Button to Froala

Custom Export Markdown Button

The Froala Markdown feature allows users to write content using a simplified markup language that is easy to read and write. This feature is important because it enables users to format their text with headings, lists, links, and other elements quickly, without needing to use complex HTML tags. Markdown’s simplicity also boosts productivity, making it a favorite among content creators and developers.
 Add a Custom Export from Markdown Button to Froala
We covered how the Markdown feature is working in previous articles:

Today, we’ll show developers how to add a custom export from markdown button. This will let users easily save their work as a markdown file while maintaining the format of their markdown document. The Froala Editor provides a powerful way to extend its functionality, making this implementation straightforward.

Why Add a Custom Export to Markdown Button?

Markdown is a lightweight markup language that has become increasingly popular among developers and writers alike. It offers a simple and efficient way to format text, making it a preferred choice for tasks such as writing documentation, creating README files, and composing blog posts. By adding a custom button to your Froala-powered application, you provide users with a seamless way to export their content in the Markdown format, enabling them to:

  • Easily share their work with others who prefer the Markdown syntax
  • Integrate their content into other tools that support Markdown
  • Maintain a clean and organized workflow by keeping their documents in a standardized format

Creating the Custom Button

Froala makes it easy to add a new toolbar button to the editor. Let’s create a custom “Export to Markdown” button step-by-step:

Step 1: Include Froala in your Project:

To include Froala in your project, follow the setup instructions in the Froala documentation according to your programming language and framework. For this demo, I only used the core Froala editor and the Markdown plugin to keep my project simple, avoiding unnecessary features. Here’s the resulting template:

<!DOCTYPE html>
<html>

<head>
    <title>Froala WYSIWYG Editor</title>
    <!-- Include Froala CSS -->
    <link href="{{editor__download__folder}}/css/froala_editor.min.css" rel="stylesheet"
        type="text/css" />
    <link href="{{editor__download__folder}}/css/plugins/markdown.min.css" rel="stylesheet"
        type="text/css" />
</head>

<body>
    <!-- HTML element where the editor will be initialized -->
    <div id="editor">
    </div>


    <!-- Include Froala Editor JS files -->
    <script type="text/javascript" src="{{editor__download__folder}}/js/froala_editor.min.js"></script>
    <script type="text/javascript" src="{{editor__download__folder}}/js/plugins/markdown.min.js"></script>
 
</body>

</html>

Step 2: Define an Icon for the Button:

With Froala, you can easily define icons for toolbar buttons. You can define the icon using one of the wide range templates Froala provides. I prefer using SVG icons. First, I’ll add the SVG path for the “Export” icon to the FroalaEditor.SVG object:

FroalaEditor.SVG.export  ="M15.293 5.293L12 8.586V2h-1v6.586L8.707 5.293 7.293 6.707 12 11.414l4.707-4.707zM18 11h-1v4H7v-4H6v5h12v-5z";

Then, I’ll register the icon using the FroalaEditor.DefineIcon method:

FroalaEditor.DefineIcon("export", { NAME: "Export", SVG_KEY: "export" });

Step 3: Define the Custom Button:

To create the new “Export to Markdown” button, I’ll define a new object with the following properties:

title

The title represents the label of the button. It is set to “Export from Markdown”.

title: "Export from Markdown",

type

Defines whether this is a button or a dropdown. In this case, it is set as a button.

type: "button",

plugin

Associate the button with a specific plugin. Here, it is linked to the Markdown plugin.

plugin: "markdown",

undo

Since the button’s function doesn’t need to be added to the undo stack, this is set to false.

undo: false,

showOnMobile

To make the button visible on mobile devices, this is set to true.

showOnMobile: true,

disabled

Determines the initial state of the button—whether it should be disabled or enabled. Since the button should only be available when the editor is in Markdown mode, I set it to true.

disabled: true,

refreshAfterCallback

When set to true, the editor will refresh all toolbar buttons after the button’s callback is executed.

refreshAfterCallback: true,

refresh

Defines the function executed during the toolbar button refresh process. The button is initially disabled, I will utilize this function to enable the button when the Markdown feature is active. I will use themarkdown.isEnabled() method to check the state of the Markdown feature:

  • If true, I will enable the button.
  • If false, I will disable the button.
  refresh: function refresh($btn) {
    if (this.markdown.isEnabled()) $btn[0].classList.remove("fr-disabled").setAttribute('aria-disabled', 'true');
    else $btn[0].classList.add("fr-disabled").setAttribute('aria-disabled', 'false');
  },

forcedRefresh

To ensure the button’s refresh method is triggered whenever the user clicks any toolbar button, forcedRefresh is set to true.

forcedRefresh: true,

Callback Function

Defines the action executed when the button is clicked. In this case, it handles Markdown export, allowing users to save their content as a downloadable .md file.

Steps to Export Markdown

Markdown feature

Follow these steps to enable users to export content from the Froala Editor in Markdown format. This process involves retrieving the editor content, creating a Markdown file, and providing a seamless download option via a custom toolbar button.

1. Retrieve Editor Content

To obtain the content in Markdown format:

  • Use commands.selectAll() to select all text.
  • Extract the text with selection.text().
  • Ensure the cursor position remains unchanged using selection.save() and selection.restore().
    this.selection.save();
    this.commands.selectAll();
    const markdownContent = this.selection.text();
    this.selection.restore();

2. Create a File with Markdown Content

  • Utilize the Blob constructor to create a file.
  • Set the type to text/markdown;charset=utf-8.
  • Generate a downloadable URL using URL.createObjectURL().
    const blob = new Blob([markdownContent], {
      type: "text/markdown;charset=utf-8",
    })
    const url = URL.createObjectURL(blob)

3. Download the File

  • Create an <a> element and assign the Blob URL.
  • Set the download attribute to specify the filename.
  • Trigger a click event to start the download.
  • Use URL.revokeObjectURL(url) to release the memory.
    const a = document.createElement("a")
    a.href = url
    a.download = "markdown.md"
    a.click()
    URL.revokeObjectURL(url)

Step 4: Register the Custom Button:

With the button object defined, I’ll use the FroalaEditor.RegisterCommand method to register it as a custom button.

FroalaEditor.RegisterCommand("export", {
  title: "Export from Markdown",
  type: "button",
  undo: false,
  refreshAfterCallback: true,
  forcedRefresh: true,
  disabled: true,
  plugin: "markdown",
  showOnMobile: true,
  refresh: function refresh($btn) {
    if (this.markdown.isEnabled()) $btn[0].classList.remove("fr-disabled").setAttribute('aria-disabled', 'true');
    else $btn[0].classList.add("fr-disabled").setAttribute('aria-disabled', 'false');
  },
  callback: function () {
    this.selection.save();
    this.commands.selectAll();
    const markdownContent = this.selection.text();
    this.selection.restore();
    const blob = new Blob([markdownContent], {
      type: "text/markdown;charset=utf-8",
    })
    const url = URL.createObjectURL(blob)
    const a = document.createElement("a")
    a.href = url
    a.download = "markdown.md"
    a.click()
    URL.revokeObjectURL(url)
  },
})

Step 5: Initialize the Froala Editor:

Now I’m ready to initialize the Froala Editor and display it to the users.
new FroalaEditor('#editor');

6. Add the Custom Button to the Froala Toolbar:

To make the custom button available in the Froala toolbar, add it to the toolbarButtons configuration option:

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

This adds the “Export to Markdown” button to the Froala toolbar alongside other buttons. When users click it, their markdown document will be downloaded as an .md file to their device. See the code in action.

Benefits of Adding the Custom Button

Integrating a custom “Export to Markdown” button into your Froala-powered application offers several benefits:

  1. Increased Flexibility: Users can easily export their content in the Markdown format, which is widely supported by various platforms. This allows them to write content once and use it across multiple systems.
  2. Improved Workflow: By providing a way to export to Markdown, you’re streamlining your users’ workflow. They can focus on content creation, knowing they can easily export their work in the desired format.
  3. Enhanced User Experience: The addition of the custom button enhances the overall user experience. Being able to convert and download their work directly from the editor saves time and reduces the need to copy/paste between applications.

Additional Customization Options

You can further enhance this functionality to:

  • Allow users to specify a filename before download
  • Add support for exporting to other formats like HTML file or PDF file
  • Include syntax highlighting in the exported code blocks
  • Apply custom CSS to the markdown editor
  • Add options to import content from external sources

Integrating with External Services

Beyond basic exporting, you can extend your Markdown functionality to integrate with popular development platforms:

GitHub Integration

Adding GitHub integration to your custom Markdown export button allows users to directly push their content to repositories. This is particularly useful for teams working on documentation or README files. You can implement a workflow that lets users select a target repository, specify the file path, and upload their markdown content with a single click from the editor.

Document Storage Solutions

For teams that need more robust document management, you can integrate with various storage solutions to help users organize their markdown files. This allows for better version control and collaboration. When implementing this feature, consider how search functionality could enhance the user experience, making it easier to find and reuse previously created content.

eBook Publishing Extensions

For content creators who want to publish longer-form content, adding EPUB export capabilities can be valuable. This feature allows users to convert their markdown documents into properly formatted eBooks that can be rendered on various devices. The process involves converting markdown to HTML and then packaging it with the necessary metadata into an EPUB file, complete with custom CSS styling.

By implementing these extensions, you provide users with a complete solution for their content creation and publishing needs, reducing the need to switch between multiple applications and streamlining their workflow across multiple pages of content.

Advanced Editor Configurations

Take your Markdown editing experience further with advanced configurations. Customize the textarea for better usability, implement additional command options, and enhance functionality to cater to specific Markdown editing needs.

Custom Textarea Enhancements

When working with Markdown in Froala, you can customize how the textarea appears and functions to make editing more comfortable. This includes adjusting the default appearance, implementing custom keyboard shortcuts, and defining specialized editing behaviors for markdown-specific syntax.

Supporting Additional Command Options

Enhance your export functionality by adding additional command options that give users more control. These could include the ability to insert predefined templates, search within the markdown content, or generate an index of headings. Each command can be configured to process the markdown in different ways depending on the user’s needs.

Conclusion

In this blog post, you’ve learned how to add a markdown button to the Froala WYSIWYG HTML Editor. By leveraging Froala’s customization features, you can easily extend the editor’s functionality to meet specific needs. This enhancement allows users to seamlessly export their markdown content as a file, improving their document management workflow.

The process demonstrates how toolbar buttons can be defined, customized, and integrated into the Froala editor, showcasing its flexibility as a powerful and extensible text editor. Implement this feature in your Froala-powered application to give users more control over their content.

Top 5 Online JavaScript Editors – A Beginner’s Guide

chart

Online JavaScript editors are invaluable assets for developers of all levels. An online JavaScript editor (online JS editor) streamlines coding by allowing you to write JavaScript directly within your web browser, just like you would in a traditional code editor. This flexibility is especially beneficial for beginners and those seeking collaboration with other developers.

With so many online JS editors available, choosing the right one can seem daunting. Don’t worry – this article will guide you through the process! We’ll cover:

  • Understanding Online JS editor: How does it differ from WYSIWYG HTML editor and full-fledged IDEs (Integrated Development Environments)?
  • Benefits of an Online JavaScript Editor: Explore the advantages an JS online editor offers, from accessibility to collaboration features.
  • Finding the Perfect Fit: Learn how to select an online JavaScript editor that matches your specific needs.

Let’s dive into the world of online JavaScript editing!

Key takeaways

  • Online JavaScript editors (JSEs) provide a browser-based environment for coding, testing, and running JavaScript without installation.
  • They offer essential features such as syntax highlighting, auto-completion, error checking, and real-time collaboration.
  • Top online JavaScript editors include CodePen, JSFiddle, CodeSandbox, JS Bin, and W3Schools Editor, each with unique strengths for different use cases.
  • Online editors are ideal for quick prototyping, sharing code snippets, and collaborative development.
  • Choosing the right online JavaScript editor depends on project size, collaboration needs, and feature requirements—some focus on lightweight testing, while others offer IDE-like experiences.

By leveraging online JavaScript editors, developers can enhance productivity, streamline coding workflows, and collaborate efficiently in a cloud-based environment. 

What is an online JavaScript editor?

A marble desk with a tablet in the top left corner and a keyboard on the right, with Scrabble tiles spelling "JAVASCRIPT" in the center.

Online JavaScript editors (JSEs) are just what they sound like: browser-based tools for writing, editing, running, and even sharing your JavaScript code. They pack core features found in traditional code editors – syntax highlighting, error checking, and auto-completion – into a convenient online environment. You’ll often find multiple windows within a JavaScript editor, dedicated to your HTML, JavaScript, CSS, output, and console. While these browser-based environments focus on raw code, our analysis of WYSIWYG editor comparisons demonstrates how visual-centric tools handle content differently for end users.

Online JavaScript editor and the world of HTML editors

Understanding JavaScript Editor also means knowing a bit about HTML editors. These come in two flavors: As these basic coding environments evolve into more complex interfaces, developers often need to weigh the technical differences found in our Froala vs CKEditor for rich text editing comparison.

  • WYSIWYG Editors: These let you build web content visually, with minimal coding. Think of them as drag-and-drop website builders.
  • HTML Code Editors These are text-based, perfect for directly writing HTML and related languages – JavaScript is where JSEs shine!

JSEs vs. IDEs: What’s the Difference?

While both help you build projects, an online JSE (JavaScript Editor) is generally more lightweight than a full-fledged IDE (Integrated Development Environment). IDEs are often desktop software with advanced features like in-depth debugging, testing tools, and version control integration.

Related: JS Editor Features

Let’s learn more about the difference between JS Editor (JSE) and IDE in the next section.

What’s the difference between a JSE and an IDE?

Both JSEs and IDEs have the same goal of making development easier, and they do have their similarities. The main difference between them is that IDEs are much larger tools that consist of a code editor and more. JavaScript editors are typically lightweight and focused on code editing. IDEs, however, also deal with compilation, version control, directory management, testing, and more. Some IDEs even have WYSIWYG functionality within them, letting users write code and use a toolbar for generating components.

Both JavaScript editors and IDEs provide many benefits to users, and neither is better than the other overall. When choosing between the two, you have to assess your needs and what you’re most comfortable with. For instance, if you want to build large applications easily without coding much, then use IDEs or WYSIWYG editors. Similarly, if you’re more comfortable with purely writing code, then JavaScript Editors (JSEs) could work.

But for now, we’ll focus on JSE, specifically the online JS editor, which is even more lightweight and portable. So, why don’t we explore the benefits that these online editors bring to developers?

What are the benefits of JavaScript online editors?

Here are some of the best benefits that developers can get when using online JavaScript editors:

  • Convenience – With online JSEs, developers can access their codes from anywhere provided they have an internet connection. Furthermore, developers won’t have to set up or install anything. This makes prototyping, testing, and helping others with their codes more efficient. That’s why developers also call these editors cloud-based editors.
  • Collaboration features – Excellent online JSEs allow multiple developers to work on shared JS codes in real-time. This makes collaboration easier for teams or support groups of developers.
  • Versioning – Sometimes, people use online editors once (for something like testing) and never come back. However, there are developers who write large amounts of code using online editors. Luckily for them, some online editors have version tracking, revision history, and version rollback features for smoother maintenance.
  • Code sharing – Most online JS editors let their users easily share their code by generating a unique link or embedding it. When you go to Stack Overflow or other developer forums, you’ll see plenty of people sharing their prototype codes.
  • Cost-free – One of the best things about editors is that most of them are free. I mean, most HTML code editors are as well, but it’s always nice to have as many free tools as possible, right?

What are the top online JavaScript editors?

I’m sure that you’ve encountered at least one of the top editors we have today. But there are other great ones aside from the most popular editors (you know, the ones we always see on Stack Overflow). Here are the top online JS editors:

Codepen.io

A screenshot of CodePen, a popular online JavaScript editor

Codepen is one of the two most popular editors. A “social development environment,” it lets users build, deploy, test, and share their work. It has a clean interface, which by default shows the HTML, CSS, and JS windows separately, with the output and console below. It has the following features:

  • Syntax highlighting
  • Autocomplete
  • Theming and font styling
  • Various editor options (format on save, line numbers, etc.)
  • Support for customizable code embedding
  • Drag-and-drop asset hosting
  • Project directory management (IDE-like experience)
  • Real-time collaboration
  • Private codes with access control

Tutorial example of Codepen

Here’s a basic example to demonstrate how to use CodePen’s JS editor effectively. This example creates a button that changes text and background color when clicked.

Steps to Use CodePen’s JS editor
  1. Go to CodePen.io and create a new Pen.
  2. Use the HTML, CSS, and JS panels to structure your code.
  3. Write the following code in the respective sections:

HTML (Add this in the HTML panel)

<div class="container">
    <h2>Click the Button!</h2>
    <button id="changeButton">Click Me</button>
</div>

CSS (Add this in the CSS panel)

body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    padding: 50px;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #0056b3;
}

JavaScript (Add this in the JS panel)

// Select the button
const button = document.getElementById("changeButton");

// Array of colors for background change
const colors = ["#ff4757", "#1e90ff", "#2ed573", "#ff7f50", "#a29bfe"];

let index = 0;

// Add click event listener to the button
button.addEventListener("click", function () {
    // Change button text
    button.innerText = "Clicked!";

    // Change background color
    document.body.style.backgroundColor = colors[index];

    // Cycle through colors
    index = (index + 1) % colors.length;
});

Try it out in CodePen!

JS Editor - Codepen Example Screen 1

JS Editor - Codepen Example Screen 2

JSFiddle

The interface of the JSFiddle online JavaScript editor

JSFiddle is another highly popular online JS editor. It’s simple, lightweight, and intuitive. It has four windows (HTML, CSS, JavaScript, and result with console). JSFiddle also supports frameworks like Vue, libraries like React, and even similar languages like TypeScript. Here are some of its features:

  • Syntax highlighting
  • Autocomplete
  • Theming
  • Various editor options (line numbers, auto-run code, etc.)
  • Different available window layouts
  • Import resources
  • Asynchronous requests simulation
  • Real-time collaboration
  • Private codes with access control

Simple JSFiddle example: Interactive counter button

Here’s a basic example to demonstrate how to use JSFiddle’s JS editor effectively. This example creates a button that increments a counter when clicked.

Steps to use JSFiddle’s JS editor
  1. Go to JSFiddle.net and create a new Fiddle.
  2. Use the HTML, CSS, and JavaScript panels to structure your code.
  3. Ensure the “JavaScript” setting is set to “onLoad” (so the script runs after the page loads).
  4. Write the following code in the respective sections:

HTML (Add this in the HTML panel)

<div class="container">
    <h2>Counter: <span id="counter">0</span></h2>
    <button id="incrementBtn">Increase</button>
</div>

CSS (Add this in the CSS panel)

body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    padding: 50px;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #218838;
}

JavaScript (Add this in the JavaScript panel)

// Select the counter and button elements
const counterElement = document.getElementById("counter");
const incrementButton = document.getElementById("incrementBtn");

let count = 0;

// Add event listener to the button
incrementButton.addEventListener("click", function () {
    count++; // Increase count
    counterElement.innerText = count; // Update the counter display
});
How this works in JSFiddle
  • The HTML panel creates a counter inside a <span> and a button to increase its value.
  • The CSS panel styles the button and container.
  • The JavaScript panel adds a click event listener to update the counter when the button is pressed.

Try it out in JSFiddle!

JS editor online - JSFiddle - JavaScript fiddle Example Output

CodeSandbox

This screenshot shows the modern interface of the CodeSandbox online JavaScript editor

CodeSandbox is another heavyweight online JavaScript editor when it comes to features. It promises to supercharge developers’ workflows with its cloud development capabilities. It also supports frameworks and libraries like Angular, React, and more. Here are some of the things it can do:

  • Syntax highlighting
  • Autocomplete
  • Templates
  • Import from GitHub
  • A modern browser-like results window
  • Support for testing
  • Project directory management
  • Real-time collaboration
  • Private codes with access control

Simple CodeSandbox example: Interactive React counter app

This example demonstrates how to use CodeSandbox effectively by creating a simple React app with a counter button.

Steps to use CodeSandbox’s editor
  1. Go to CodeSandbox and create a new sandbox.
  2. Select the “React” template to start a React project.
  3. In the src folder, open App.js and replace its content with the following:

Code for App.js (React component)

import React, { useState } from "react";
import "./styles.css"; // Import styles

export default function App() {
  const [count, setCount] = useState(0); // State for counter

  return (
    <div className="container">
      <h2>Counter: {count}</h2>
      <button onClick={() => setCount(count + 1)}>Increase</button>
    </div>
  );
}

Code for styles.css (Styling the app)

body {
  font-family: Arial, sans-serif;
  text-align: center;
  background-color: #f4f4f4;
  padding: 50px;
}

.container {
  background: white;
  padding: 20px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #0056b3;
}
How this works in CodeSandbox
  • The JSX (React) code defines a simple counter with a button.
  • The CSS file adds styling to make it look neat.
  • Clicking the button updates the state (count), which triggers a re-render.

Try it out on CodeSandbox!

JS editor online - CodeSandbox Example

JS Bin

The classic, simple interface of the JS Bin online JavaScript editor

JS Bin is a simple yet handy. It might not look as great as the others, and it might not have a lot of features, but it’s perfect for simple tests. Aside from HTML, it also supports Markdown and conversion to HTML. Here are its capabilities:

  • Syntax highlighting
  • Auto-run code
  • Export as gist (Git repository)
  • Save as template
  • Easy inclusion of JS libraries and frameworks
  • Private codes with access control

Simple JS Bin example: Interactive button with JavaScript

This example demonstrates how to use JS Bin effectively by creating a button that changes color when clicked.

Steps to Use JS Bin’s JavaScript editor
  1. Go to JS Bin.
  2. Ensure the “HTML“, “CSS“, and “JavaScript” panels are enabled (you can enable them from the dropdown at the top-right).
  3. Enter the following code in the respective panels:

HTML (Add this in the HTML panel)

<div class="container">
    <h2>Click the Button!</h2>
    <button id="colorButton">Change Color</button>
</div>

CSS (Add this in the CSS panel)

body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    padding: 50px;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #0056b3;
}

JavaScript (Add this in the JavaScript panel)

// Select the button
const button = document.getElementById("colorButton");

// Array of colors for background change
const colors = ["#ff4757", "#1e90ff", "#2ed573", "#ff7f50", "#a29bfe"];

let index = 0;

// Add click event listener to the button
button.addEventListener("click", function () {
    // Change background color
    document.body.style.backgroundColor = colors[index];

    // Cycle through colors
    index = (index + 1) % colors.length;
});

How this works in JS Bin

  • The HTML panel creates a simple button inside a div.
  • The CSS panel styles the button and background.
  • The JavaScript panel adds a click event that cycles through different background colors.
Try it out!
  1. Copy and paste this code into JS Bin.
  2. Click “Run” (or Ctrl + Enter) to execute the script.
  3. Click the button and watch the background color change!

JavaScript editor online - JS Bin Example

W3Schools online editor

This is a screenshot of W3School's built-in online JavaScript editor for learning

When developers start their web coding journey, they will probably visit W3Schools at some point. What’s good about the site, aside from its tutorials, is that it has a built-in online editor. Unlike the other editors on this list, its online editor is primarily focused on learning. Thus, it’s more lightweight; however, it’s on this list because of its usefulness to beginners and experienced developers alike. Its features include:

  • Syntax highlighting
  • Basic theming
  • Basic layout choices (portrait or landscape)
  • Code saving

Simple example: Using W3Schools online editor

W3Schools provides an interactive online editor where you can edit HTML, CSS, and JavaScript and see the live output instantly.

Steps to Use W3Schools Online Editor
  1. Go to W3Schools TryIt Editor.
  2. Click “Edit and Run” to modify and execute the code.
  3. Enter the following code in the editor and click Run.
Example: Interactive button with JavaScript

This example creates a button that changes the text and background color when clicked.

Code for W3Schools online editor

<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            background-color: #f4f4f4;
            padding: 50px;
        }

        .container {
            background: white;
            padding: 20px;
            border-radius: 10px;
            display: inline-block;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
        }

        button {
            background: #007bff;
            color: white;
            border: none;
            padding: 10px 20px;
            font-size: 16px;
            border-radius: 5px;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        button:hover {
            background: #0056b3;
        }
    </style>
</head>
<body>

    <div class="container">
        <h2>Click the Button!</h2>
        <button onclick="changeText()">Click Me</button>
    </div>

    <script>
        function changeText() {
            let button = document.querySelector("button");
            button.innerText = "Clicked!";
            document.body.style.backgroundColor = "#ffcc00";
        }
    </script>

</body>
</html>

Try it out!

Simple Example - Using W3Schools Online Editor

Ideal features of an editor

Choosing an online JSE involves the same steps as choosing any other helpful tool. You should assess your requirements, check the editors’ features, and then check their pricing. Usually, the free features can handle most development or testing needs. At the very least, you should ensure that the editor has syntax highlighting. If you’ll use it for your business or to test out confidential codes, then you can try those with the private codes feature. When your project requirements shift from pure code to more visual-centric content management, consulting our list of the best WYSIWYG editors for developers in 2026 provides a necessary alternative.

How to run code in an online JSE

Running code takes very little time in online JavaScript editors. Once you have your code ready, you should click the run, save, or play button (depending on how the editor calls it). Afterwards, the editor will run the code and produce the output in the result window. If the code has any errors, the editor will display them on the console. Some editors also have an auto-run feature.

Conclusion

The online JavaScript editor tool has blessed developers with its convenience since its introduction. And these tools are likely to stay because of that. In fact, they’re getting better with each passing year. As developers, we have to improve productivity with JSE and other tools. In this article, we talked about the top five online JS editors. Always remember that the best among them is the one that fits your project the most.

Froala Blog Call To Action

FAQs

Can I run JavaScript online?

Yes! You can run JavaScript online using online JavaScript editors (JSEs). These browser-based tools allow you to write, test, and execute JavaScript code without installing any software.

Some of the best online JavaScript editors for running JavaScript include:

CodePen – Great for frontend development with live previews.
JSFiddle – Supports JavaScript, HTML, and CSS with real-time collaboration.
CodeSandbox – Ideal for React, Vue, and Angular projects.
JS Bin – Simple and lightweight for quick JavaScript testing.
W3Schools TryIt Editor – Beginner-friendly for running JavaScript code snippets.

These tools provide an instant coding environment where you can type JavaScript and see the output immediately, making them perfect for testing, debugging, and learning JavaScript.

How do I edit JavaScript in my browser?

You can edit JavaScript directly in your browser using:

Browser Developer Tools – Open the Console (Ctrl + Shift + J in Chrome) to write and test JavaScript.
Online JavaScript Editors – Use CodePen, JSFiddle, or W3Schools TryIt Editor to write and run JavaScript instantly.

These options let you edit, test, and execute JavaScript without any setup.

Froala vs. TinyMCE: Which Is the Best WYSIWYG Editor?

Comparing Froala Editor with TinyMCE, highlighting differences and functionalities.

If you need to add a rich-text editing feature to your product, you’ve probably come across two major contenders: TinyMCE and Froala. You may wonder which solution is the best choice for your project.

To make the right decision, you need to compare many aspects, like key features, performance, customization options, and pricing. This article breaks down and compares everything important to choosing the best WYSIWYG editor based on your requirements.

Let’s dive in!

Key takeaways

  • Froala and TinyMCE are among the top JavaScript WYSIWYG editors for rich-text editing. TinyMCE is a widely used open-source option, while Froala is known for its modern UI and lightweight performance.

  • Key features: Both editors provide rich-text formatting, media embedding, and math equation support. Froala includes over 100 built-in features along with a plugin system for additional enhancements, while TinyMCE offers an extensive plugin ecosystem to extend its functionality.
  • Customization & scalability: Both editors allow theme and toolbar customization. Froala’s toolbar is fully customizable, allowing developers to define custom buttons and group actions and adjust the layout based on screen size for a responsive editing experience. TinyMCE also offers configurable toolbars and themes, providing flexibility for different use cases.

  • Integration & performance: Both integrate with React, Angular, and Vue. Froala provides server-side SDKs for backend support, while TinyMCE offers various hosting options. Froala is lighter, potentially offering faster load times.

  • Pricing: TinyMCE has a free plan but limits editor loads on paid tiers. Froala follows a transparent pricing model with unlimited editor loads, making it cost-effective for high-usage scenarios.

Want to explore Froala? Try the free trial today!

Introduction to Froala and TinyMCE

When it comes to rich-text editing, TinyMCE is one of the most popular JavaScript WYSIWYG editors and Froala is a great TinyMCE alternative. Both of these editors offer a wide range of features to enhance text formatting, media embedding, and customization for web applications. But we need to compare and carefully see which option is the best fit for your project.

What is TinyMCE?

TinyMCE is an online open-source WYSIWYG editor under the General Public License (GNU). This WYSIWYG editor offers a free editor with basic features and advanced features that are included in the paid plans. Its features include basic and advanced formatting options, plugins for enhanced functionality, and cloud-based hosting options. It can convert HTML textarea fields or any other HTML element into editor instances.

TinyMCE is widely used in content management systems (CMS) and many other platforms that require rich-text editing.

What is Froala?

Froala is a modern, lightweight, and highly customizable WYSIWYG editor. It is known for its sleek design and powerful functionality. This JavaScript rich-text editor offers over 100 features, including inline editing, real-time collaboration, advanced media handling, and an intuitive user interface. 

This is one of the best TinyMCE alternatives to provide a better editing experience to your users. Froala is also recognized for its fast performance and responsive design. You can integrate this editor with frameworks like React, Angular, and Vue easily.

Both TinyMCE and Froala provide extensive rich-text editing capabilities. But the real question is: Which editor is the best choice for your product? To help you decide, let’s dive into their key features, design, scalability, integration options, and pricing.

Comparing key features

By all means, both editors have a long list of prominent features. For example, look at the Froala +100 feature list. Obviously, it would be impossible to include all of them in this post. Instead, we will focus on important features that benefit all users.

Without a doubt, both editors include all the basic features for rich content editing. For example, both of them handle images and tables flawlessly. Moreover, they both also support advanced functionalities like Math Equation insertion and editing.

With that in mind, we will focus instead on editor design, scalability, customization, and load time. We will also look at the ease of integration with your products.

Design and user experience

When evaluating WYSIWYG editors, user experience plays a crucial role in ensuring seamless content creation. Both Froala and TinyMCE offer well-structured interfaces, but they take different approaches to design and usability.

Interface and usability

TinyMCE provides a classic and familiar interface, making it easy for users accustomed to traditional text editors. It allows developers to customize toolbars and configure UI elements to fit specific application needs.

On the other hand, Froala takes a modern and minimalistic approach. Its flat design, SVG icons, and clean UI components, including dropdowns and pop-ups, create a visually appealing experience. What sets Froala apart is its Smart Toolbar, which categorizes actions into four groups. It prevents users from feeling overwhelmed by too many options while keeping essential features within reach.

Froala HTML WYSIWYG editor
Froala editor (Source: https://froala.com/ )

Mobile-friendly experience

Mobile usability is another critical aspect of editor design. While both Froala and TinyMCE support mobile editing, Froala was the first WYSIWYG editor to introduce pop-up formatting controls that appear consistently on both mobile devices and desktops. This ensures a seamless user experience across all screen sizes.

Additionally, Froala is the first WYSIWYG HTML editor to offer image and video resizing on mobile devices, making content editing more flexible for users working on different platforms.

While both editors provide customizable and feature-rich interfaces, Froala stands out with its sleek design, structured toolbar, and enhanced mobile editing experience—making it a preferred choice for modern web applications.

Scalability and customization

When choosing a WYSIWYG editor, scalability and customization are crucial factors. Whether you’re building a small application or an enterprise-level solution, the ability to tailor the editor’s design, functionality, and integration to meet your needs can make a big difference. Both Froala and TinyMCE offer customization options, but they take different approaches to flexibility and ease of use.

Styling and theme customization

Both TinyMCE and Froala allow developers to modify themes, toolbars, and UI elements to align with their application’s branding. TinyMCE offers a range of built-in themes and supports extensive UI customizations through its configuration settings. Developers can adjust colors, fonts, and layouts to create a consistent look and feel.

Froala, however, goes a step further by offering responsive toolbar configurations for different screen sizes. Developers can set toolbarButtons, toolbarButtonsMD, toolbarButtonsSM, and toolbarButtonsXS to ensure the editor remains fully functional across large, medium, small, and extra-small screens. This makes Froala one of the most responsive editors on the market, ensuring an optimal experience across devices.

Functionality and API customization

Customization also extends to functional modifications, such as adding new features, integrating plugins, or modifying the editor’s behavior.

  • TinyMCE provides a structured API with an extensive list of plugins that can be enabled or disabled based on user needs. However, its documentation is class-based, requiring developers to navigate through multiple sections to find relevant details on methods and properties.
  • Froala, on the other hand, offers a simplified and well-organized API where all options, events, and methods are available on a single page. Additionally, Froala provides extensive live code examples, making it easier for developers to implement custom buttons, plugins, and integrations without spending extra time searching through documentation.

Which editor offers better customization?

Both editors allow a high degree of customization and scalability, but Froala stands out for its user-friendly approach. With responsive toolbars, a cleaner API structure, and real-time code examples, Froala makes it easier for developers to customize and scale their editing experience efficiently.

Integration with technologies

When selecting a WYSIWYG editor, seamless integration with your tech stack is essential. Whether you’re working with frontend frameworks or need backend support for file storage and server-side processing, both Froala and TinyMCE offer integration solutions—but they differ in their approach.

Frontend frameworks and compatibility

Both Froala and TinyMCE provide SDKs for popular frontend frameworks, including React, Angular, and Vue. This allows developers to integrate the editor into modern web applications with minimal setup.

  • TinyMCE offers a robust set of APIs and plugins that allow developers to extend functionality within these frameworks. It also provides a cloud-based solution, making it easier to manage updates and configurations without manual installations.
  • Froala, while also offering React, Angular, and Vue SDKs, is designed for a lightweight and modular approach. Developers can enable only the necessary features, ensuring faster load times and better performance.

Server-side support and backend integration

While both editors focus on frontend integration, Froala distinguishes itself with server-side SDK libraries that enhance backend interaction.

  • TinyMCE requires developers to manually configure backend support for handling image uploads, file storage, and security protocols. While it offers documentation for server-side implementation, it doesn’t provide dedicated SDKs for backend tasks.
  • Froala, on the other hand, offers server-side SDKs for Node.js, Python, Java, PHP, and more, simplifying the process of storing images, managing files, and computing Amazon S3 signatures. This makes backend integration much more efficient for developers who need a complete end-to-end solution.

Performance: Speed and Efficiency

Froala is lighter than TinyMCE, resulting in a smaller impact on page load speed. Additionally, Froala’s modular architecture enables you to include only the necessary JavaScript and stylesheet files for the plugins you intend to use, making it more efficient for your product page speed.

Cost analysis: Froala vs. TinyMCE

Taking a quick look at the TinyMCE pricing page, you find that the first plan is free, and the Essential plan is $79 per month. On the other hand, Froala’s first plan is $899 per year ($74.90 per month). Also when you dig deeper into the plan details, you will eventually say, “Froala looks 10x cheaper. Why is that?”

Let’s do some analysis and discover why Froala is much cheaper.

First, is your product eligible for the TinyMCE free plan?

Firstly, the TinyMCE free plan is not for every use case and is not suitable for every product. If you need any of the following, you can’t use the free plan:

  • Need to use one of the premium features, which includes:
    • Markdown
    • Inline CSS
    • Export your content as a PDF
    • Spell Checker.
    • Accessibility Checker
    • Math Equations
    • … and more
  • Need Professional support
  • Want to sub-license TinyMCE under a different license than GPL2+; each user who receives TinyMCE from you has the same rights as you do
  • Want to remove the “Powered by Tiny” branding
  • Don’t want to state or share any changes you have made to TinyMCE
  • Don’t want to include the copyright notices
  • Don’t want to include the full text of the LGPL v2.1
  • Want to use White Label, Commercial Agreement, Dual Deployment or Custom Licensing
  • Want to use over 1000 editor loads per month when using the cloud hosting feature.

Why should I consider Froala if I’m eligible for a free TinyMCE plan?

No one wants to pay money when they have a free option, however, going the free route could cause you to miss out on better opportunities. Look at the Froala perpetual license, for example—it gives you the right to use the latest version of the editor plus all its plugins forever with affordable fees. It is cheaper than creating a similar editor from scratch. In addition, access to updates and professional support for a year makes it an incredible offer!

Plan Professional Enterprise
Perpetual License cost $2,699 $5,999

Want to explore Froala’s pricing plans in detail? See the latest Froala pricing here.

This is your chance to get an intuitive and well-maintained editor with all of its advanced functionality. Moreover, Froala is a lightweight and fast editor with a clean, pluggable coding architecture – all for a one-time fixed cost.

You can consider buying Froala under a perpetual license as an investment in your product. It will be your editor with no limitations or mandatory brand text. You are free to customize it for your brand.

In addition, Froala supports new businesses by providing an Ignition discount. If you have fewer than 50 active monthly users, request a discount.

What about Froala vs. TinyMCE subscription plans?

Let’s start with a quick general comparison between Froala and TinMCE subscription plan features:

TinyMCE Froala
Free (Cloud-hosted )
Essential Professional Enterprise Professional Enterprise
$0 $79 $145 Custom $74.90 $166.60
per month per month per month per month
editor loads per month 1000 5000 20000 Custom Unlimited Unlimited
Domains 1 1 1 Multiple domains 3 Unlimited
Products 1 1 1 Multiple 1 Unlimited
Hosting Cloud-hosted Cloud-hosted Cloud-hosted Cloud or Self-hosted Cloud or Self-hosted Cloud or Self-hosted
Redistribution/OEM Yes Yes Yes Yes No Yes
SaaS / Subscription Yes Yes Yes Yes No Yes
Is ALL Features/Plugin included No NO NO Yes Yes Yes

Based on the above table, here are some use cases:

  1. You want to use the editor in multiple domains:
    1. In case you will use it on one product that is not SaaS or OEM, then you are eligible to choose the Froala Professional plan ($74.90 / month) or the TinyMCE Enterprise plan (Custom price – expected to be  $170+  / month)
    2. In case you will use your editor on multiple products or in SaaS or OEM products, then you can choose the Froala Enterprise plan ($166.60 / month) or the TinyMCE Enterprise plan (Custom price – expected to be  $170+  / month)You can see, in both cases, that Froala is a much cheaper choice with no limitation on editor loads.
  2. You want to use the editor for one domain and one product that is not SaaS or OEM:
    Here, you can select the Free, Essential, or Professional plan from TinyMCE or the Professional plan from Froala. Before you say TinyMCE is cheaper in this case, you should first calculate the real TinyMCE plan prices. This is because TinyMCE doesn’t use transparent pricing models like Froala. For instance, the TinyMCE Essential plan limits its editor to 5,000 loads per month. In the event your usage fluctuates above the editor load limit for your plan, TinyMCE will charge your credit card $40 for each additional block of 1,000 editor loads at the end of the month. This means that if you expect, for example, 6,000 views per month on pages that use TinyMCE, you will end up paying $119 instead of $79 per month, which is $44.10 per month above the Froala Professional plan cost. Moreover, each time a user views or refreshes one of those pages, you will pay more. Let’s see this graph to demonstrate that Froala is the cost-efficient tool in most cases

See the Pen
Froala VS TinyMCE Additional Cost 2024
by Froala Marketing (@Froala_marketing)
on CodePen.

The above graph lists Froala and TinyMCE plans cost/month against different editor loads. It shows that the Froala Professional plan is more cost-effective than TinyMCE plans, except in the following cases:

    1. You will subscribe to the TinyMCE Free plan and will keep editor loads at 2,999 times or fewer.
    2. You will subscribe to the TinyMCE Essential plan and will keep editor loads at 5,999 times or fewer.
  1. You want to use the editor for one domain and one product, that is SaaS or OEM:

In this case, you can select the Free, Essential, or Professional plan from TinyMCE or the Enterprise plan from Froala. Looking at the same above graph we can figure that the Froala Enterprise plan is more cost-effective than TinyMCE plans except in the following cases:

    1. You will subscribe to the TinyMCE Free plan and will keep editor loads at 5,999 times or fewer.
    2. You will subscribe to the TinyMCE Essential plan and will keep editor loads at 7,999 times or fewer.
    3. You will subscribe to the TinyMCE Professional plan and will keep editor loads at 20,999 times or fewer.

It’s worth noting that SaaS and OEM projects usually have a very large user base. Most likely, your editor will be loaded over 20,000 times. Moreover, Froala usually provides discounts (20%) on all plans for new clients.

Cost Savings

Whether you need an editor for a simple personal application, a blog, SaaS, an intranet, a mobile app or you want to use it on an enterprise scale, Froala provides significant cost savings. For an average use case (30,000 loads), Froala plans can save 217% or higher when compared with similar TinyMCE plans.

Calculate Your Cost Saving when using Froala instead of TinyMCE.

Why is Froala 10x cheaper?

It is because  Froala’s plans use transparent and all-inclusive pricing. With every Froala subscription plan, you also get unlimited editor loads. In contrast, TinyMCE limits editor loads and any excess load costs you more money. TinyMCE also doesn’t give you access to all plugins. All in all, Froala subscription plans pricing is much cheaper for all the features it provides:

✔  Unlimited active users 

Froala doesn’t restrict usage on the number of users or servers

✔  All features included

No hidden fees for additional plugins or features

✔  Unlimited editor loads

Use Froala as much as you want

✔  Perpetual licensing with free updates for one year 

Froala makes it easy for teams to collaborate with hassle-free licensing

Why isn’t the Froala editor an open-source WYSIWYG editor?

The Froala editor team once thought about making it an open-source WYSIWYG editor and offering commercial support, but we believe that people have some misconceptions about open-source products, such as:

  • Open source is free.
  • Open source is better maintained.
  • Open source is all about the community.
  • Open source lacks support.
  • Open source is enterprise-grade.

Eventually, we realized that growing a product based on the misconceptions people have that open source means free software is wrong.

Choosing the Right Editor for Your Needs

Froala has succeeded in becoming one of the top WYSIWYG editors. It is also clear that Froala is the G2’s Top WYSIWYG Editor For Three Years in a Row. It is unsurprising because Froala is a lightweight WYSIWYG editor with an incredibly clean design. Its intuitive interface also accommodates 100+ features without overwhelming users with a complex and complicated GUI. In addition, Froala has easy-to-follow documentation and easily integrates with your products. Simply put, your users will love it. Overall, Froala Editor is the best choice for your editing requirements, and with its affordable pricing plans, it is a “do more, pay less” editor.

Can I test Froala before I buy it?

We decided to make the entire product transparent for you, and offer you hands-on experience with our editor—test the Froala Editor yourself by downloading the free trial.

How can I migrate to Froala from TinyMCE?

Migration from TinyMCE to Froala is easy, it takes less than five minutes. Follow the step-by-step guide to migrate to the best WYSIWYG editor out there. You can certainly migrate to Froala now and choose to buy later.

Are you ready to buy the next-generation WYSIWYG HTML editor?

Choose the plan that’s right for you.

FAQs

What is the best WYSIWYG?

The best WYSIWYG editor depends on your needs, but Froala and TinyMCE are among the top choices.

  • TinyMCE is a well-known open-source editor with a robust feature set, making it a great option for traditional rich-text editing.
  • Froala is a modern, lightweight, and highly customizable editor with faster performance, a sleek UI, and server-side SDKs for seamless integration.

If you need a fast, feature-rich, and cost-effective editor with unlimited editor loads, Froala is an excellent choice.

How do Froala and TinyMCE compare in pricing??

TinyMCE offers a free plan with limited features, while paid plans charge extra based on editor loads. Froala, on the other hand, provides transparent pricing with unlimited editor loads, making it a more cost-effective option for growing businesses.

Can I integrate Froala and TinyMCE with my tech stack?

Yes! Both editors support React, Angular, and Vue. However, Froala offers server-side SDKs for Node.js, Python, Java, PHP, and more, making backend integration much easier.

What are the best TinyMCE alternatives?

If you’re looking for TinyMCE alternatives, Froala is one of the top choices. It offers a modern UI, faster performance, and a transparent pricing model with unlimited editor loads. Other alternatives include CKEditor and Quill, but Froala stands out with its lightweight design, powerful features, and easy integration with frontend and backend technologies.

Explore Froala as a TinyMCE alternative – Try it for free

Try Froala for free and see how it enhances your editing experience!  Explore Froala

Understanding WYSIWYG Editors: A Developer’s Overview

what is a wysiwyg editor

Hey there, tech enthusiasts and aspiring developers! Get ready to embark on an exciting journey into the realm of WYSIWYG editors! Prepare for an amazing adventure into the world of WYSIWYG HTML editors! But wait, what is WYSIWYG and what is a WYSIWYG editor exactly? Let’s break it down in terms you can understand. 

Have you ever wondered how you can design beautiful web pages without typing a single line of code? That’s when WYSIWYG editors come in handy. WYSIWYG, or “wizzy wig,” is an acronym that stands for “What You See Is What You Get.” These handy tools are like magical portals that allow you to generate web content without delving into the deep, dark world of code. You may design and customize webpages with a WYSIWYG editor simply by visually manipulating components on the screen. Simply put, it allows you to see how your website will look as you construct it without having to write complex lines of code. It’s as if you have your own virtual design studio right at your fingertips!

In this article, we’ll demystify the magic behind these tools and explain how they make web creation a breeze, even for non-techies. So, get ready to unleash your creativity and craft stunning webpages like a pro without getting tangled in the intricacies of coding. WYSIWYG editors are here to make your web design dreams come true!

Key Takeaways

  • WYSIWYG stands for “What You See Is What You Get” – It allows users to create and format content visually, eliminating the need for manual coding.
  • These editors rely on HTML, CSS, JavaScript, and the DOM – They structure content with HTML, style it using CSS, and provide interactivity through JavaScript while offering real-time previews.
  • Core features include rich text formatting, drag-and-drop functionality, media embedding, and real-time previews – Making content creation seamless and user-friendly.
  • WYSIWYG editors streamline web development by improving efficiency and accessibility – Developers can quickly prototype and design, while non-technical users can edit content without coding knowledge.
  • They are widely used in website builders, content management systems (CMS), email marketing tools, and document collaboration platforms – Enabling businesses and individuals to create professional content easily.
  • Common challenges include formatting inconsistencies, cross-browser compatibility, and content-saving issues – But these can be resolved through proper editor configuration, browser testing, and API integration.
  • Integrating a WYSIWYG editor like Froala is simple – By including the necessary JavaScript and CSS files, initializing the editor, and customizing it to fit project needs.
  • The future of WYSIWYG editors is evolving – With better customization, AI-powered enhancements, and improved collaboration features, making content editing even more intuitive.

what is a wysiwyg editor_4

What is a WYSIWYG editor? The Working Mechanics of a WYSIWYG Editor

Let’s understand how WYSIWYG editors work.

HTML and CSS: The Building Blocks

WYSIWYG editors structure content with HTML (Hyper Text Markup Language) and style it with CSS (Cascading Style Sheets). They complement each other like peanut butter and jelly. Consider HTML to be the architect of the web world.  Furthermore, it organizes all of the content on web pages. CSS, like a fashion designer, adds pizazz with colors, fonts, and sizes. It’s like having a personal assistant who instantly turns your creative input into HTML with some gorgeous CSS sprinkled on top in a WYSIWYG editor. You don’t have to be a coding genius to make your site content seem amazing!

The Role of the Document Object Model (DOM)

The Document Object Model (DOM) acts as the blueprint of a webpage, structuring every element in a hierarchical order. When you use a WYSIWYG editor, you’re interacting with the DOM in real time. Each change you make—whether adding text, inserting images, or adjusting styles—gets instantly reflected in the preview.

Think of the DOM as a conductor leading an orchestra, ensuring all elements work in harmony. Your WYSIWYG editor seamlessly translates your input into HTML elements, giving you instant visual feedback on how your page will look.

JavaScript: Bringing Interactivity to Life

JavaScript is the powerhouse that makes WYSIWYG editors interactive. Every time you apply formatting, resize an image, or adjust a layout, JavaScript dynamically updates the DOM.

It’s like having a smart assistant that listens to your commands and applies them instantly. Whether you’re adjusting text alignment, embedding media, or fine-tuning layouts, JavaScript ensures the editor responds smoothly, giving you a real-time, code-free editing experience.

The Magic Behind WYSIWYG Editors

Now that you know the essentials—HTML, CSS, DOM, and JavaScript—you can see how WYSIWYG editors simplify web design. They transform complex coding into an intuitive visual experience, allowing you to create beautiful web pages effortlessly.

Essential Features of WYSIWYG Editors

A WYSIWYG editor isn’t just about writing text—it’s a powerful tool designed to streamline web content creation. Whether you’re a developer or a content creator, these editors offer intuitive features that make designing and formatting web pages a breeze. Let’s explore the key functionalities that set WYSIWYG editors apart.

1. Rich Text Editing and Formatting

The core of every WYSIWYG editor is the ability to format text effortlessly. You can:

  • Apply bold, italics, underline, and strikethrough
  • Adjust font styles, sizes, and colors
  • Create structured content with headings (H1-H6)
  • Align text left, center, right, or justify

With these options, you can style content just as you would in a word processor—without touching any code.

2. Drag-and-Drop Functionality

Modern WYSIWYG editors allow you to drag and drop elements onto the page effortlessly. Whether you’re adding images, buttons, or sections, the editor visually updates in real time, letting you see changes as they happen.

3. Image and Media Embedding

Need to add visuals? WYSIWYG editors let you:

  • Upload and insert images (JPG, PNG, GIF)
  • Embed videos from platforms like YouTube and Vimeo
  • Add audio files for podcasts or music

Some editors even provide image editing tools, allowing you to crop, resize, or apply filters directly.

4. Tables, Lists, and Special Elements

Structuring content is easy with built-in tools for:

  • Tables – Organize data without writing HTML table code
  • Bullet and numbered lists – Perfect for easy readability
  • Blockquotes and code snippets – Great for technical documentation

5. Real-Time Preview and Live Editing

Unlike traditional coding environments, WYSIWYG editors show you the final look of your content as you create it. Changes update instantly, giving you a true “what you see is what you get” experience.

6. Collaboration and Multi-User Support

Many advanced WYSIWYG editors offer real-time collaboration features. Multiple users can:

  • Edit documents simultaneously
  • Leave comments and suggestions
  • Track version history

This feature is especially useful for teams working on web projects, blogs, or documentation.

7. Mobile-Friendly and Responsive Design Support

With mobile browsing on the rise, WYSIWYG editors ensure your content adapts to different screen sizes. Many editors offer:

  • Responsive preview modes to see how content appears on desktops, tablets, and phones
  • Adjustable layouts and breakpoints for seamless mobile optimization

How WYSIWYG Editors Work Behind the Scenes

Client and Server-side Rendering

WYSIWYG editors mostly rely on client-side rendering, in which your web browser generates the HTML document. Some editors, however, prefer server-side rendering for specialized purposes such as previewing or rendering saved content. The rendering style selected can have a significant impact on performance and user experience. It’s like choosing between a fast sports car or a relaxing cruise.

APIs and Data Exchange

The unsung heroes of real-time editing are APIs (Application Programming Interfaces). They improve communication between editor elements and even allow interaction with other systems. APIs provide smooth data communication, making your editing experience a snap, from saving drafts to collaborating with others.

Use Cases for WYSIWYG Editors

what is a wysiwyg editor_1

WYSIWYG editors find their magical touch in several domains:

  • Website Builders: Create stunning websites without coding, thanks to WYSIWYG editors. Design pages, add images, and style content effortlessly.
  • Content Management Systems (CMS): CMS platforms like WordPress leverage the power of WYSIWYG editors, allowing non-techies to manage their website content hassle-free.
  • Email Marketing Tools: Crafts eye-catching email campaigns with ease using WYSIWYG editors. No HTML knowledge is required, yet you can create professional-looking newsletters that grab attention.
  • Document Collaboration and Editing Tools: WYSIWYG editors enable multiple users to collaborate on documents simultaneously. No more tedious back-and-forth with track changes; work together seamlessly.

Benefits of Using WYSIWYG Editors in Development

WYSIWYG editors have revolutionized the way developers and designers create web content. Whether you’re a beginner or an experienced coder, these tools streamline workflows, enhance productivity, and make web development more accessible. Let’s dive into the key benefits of using a WYSIWYG editor.

1. No Coding Knowledge Required

One of the biggest advantages of WYSIWYG editors is that you don’t need to write code manually. These editors provide a visual interface where you can:

  • Drag and drop elements
  • Apply styles and formatting
  • Insert images, videos, and tables

All without touching a single line of HTML, CSS, or JavaScript. This makes web development accessible to beginners while still being a powerful tool for professionals.

2. Faster Development and Prototyping

WYSIWYG editors significantly speed up the design process. Instead of writing code from scratch, you can:

  • Quickly build layouts using pre-designed elements
  • Preview changes instantly without refreshing the browser
  • Create prototypes rapidly, helping teams visualize designs before development

This is particularly useful for projects with tight deadlines, as it allows developers to experiment and iterate quickly.

3. Consistent and Clean Code Output

While WYSIWYG editors primarily focus on visual editing, many of them generate structured, standards-compliant HTML and CSS. Some even offer:

  • Code view mode – Letting developers fine-tune the code when needed
  • Auto-formatting – Ensuring clean and organized code output
  • Syntax highlighting – Making manual edits easier for advanced users

4. Responsive Design Made Easy

With mobile-friendly web design being essential, WYSIWYG editors often include:

  • Responsive preview modes – See how your content looks on different screen sizes
  • Adaptive layouts – Automatically adjust elements to fit various devices

This eliminates the need for manual media queries and speeds up the mobile optimization process.

5. Simplifies Collaboration and Content Management

For teams working on websites or content-heavy platforms, WYSIWYG editors provide:

  • Multi-user collaboration – Allowing teams to work together in real-time
  • Version control – Tracking changes and restoring previous edits
  • Integration with CMS platforms – Seamless connection with WordPress, Joomla, or other systems

This makes WYSIWYG editors ideal for businesses, bloggers, and content creators who need a streamlined workflow.

How to Integrate WYSIWYG Editors with Web Projects

Integrating a WYSIWYG editor into your web project can significantly enhance your content editing experience. One of the most popular editors available is Froala, a lightweight and powerful WYSIWYG editor. In this guide, you’ll learn how to integrate Froala into an HTML, CSS, and JavaScript project with a simple setup.

Step 1: Include Froala’s CSS and JavaScript Files

To use Froala, you need to include its required CSS and JS files in your project. You can either download these files or use a CDN (Content Delivery Network) for easier integration.

Add the following lines inside the <head> section of your HTML file:

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

And include the Froala JavaScript file before the closing </body> tag:

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

Step 2: Create DOM Element

The Froala Editor is quite flexible and you can initialize it to ‘attach’ to any standard HTML DOM element, such as a DIV, or a TEXTAREA. In this example I will use a DIV element, 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

Let’s initialize the Froala Editor on our empty element created in the previous step.

var editor = new FroalaEditor('#example');

Full Initialization Code Example to Create a Simple HTML Text Editor

Let’s follow all the above steps to create a simple HTML Text Editor.

<!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>

Here is the output:

Froala WYSIWYG editor integration to Web Project - Output

Customizing Your WYSIWYG Editor

Froala allows you to customize toolbars, styles, and plugins. Below is an example of enabling only specific features like bold, italic, and underline:

var editor = new FroalaEditor('#example', {
    toolbarButtons: ['bold', 'italic', 'underline'],
    heightMin: 200,
    heightMax: 400
});

You can add more customizations like uploading images, adding tables, or integrating with a database.

Save the Editor’s Content

To retrieve and save the content written in the WYSIWYG editor, you can use JavaScript to extract the HTML content:

document.querySelector("#saveBtn").addEventListener("click", function() {
    let editorContent = document.querySelector(".fr-element").innerHTML;
    console.log("Saved Content:", editorContent);
});

This content can then be stored in a database or sent to a server using an AJAX request.

Here’s the updated code with the save button functionality added:

<!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' />
    <title>Froala WYSIWYG Editor Example</title>
</head>

<body>

    <h2>Froala WYSIWYG Editor</h2>

    <!-- Editor Container -->
    <div id="example"></div>

    <!-- Save Button -->
    <button id="saveBtn">Save Content</button>

    <!-- Froala JS -->
    <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>  
    <script> 
        // Initialize Froala Editor
        var editor = new FroalaEditor('#example');

        // Save Button Functionality
        document.querySelector("#saveBtn").addEventListener("click", function() {
            let editorContent = document.querySelector(".fr-element").innerHTML;
            console.log("Saved Content:", editorContent);
            alert("Content Saved! Check the console for output.");
        });
    </script>

</body>

</html>

Your output will look like this:

Froala WYSIWYG editor integration to Web Project - Output with more functionalities

On a mobile device:

Froala WYSIWYG editor on a mobile device

Learn more about Froala WYSIWYG editor in our comprehensive documentation.

Troubleshooting Common Issues

Even though WYSIWYG editors simplify content creation, you may encounter occasional issues while using them. Below are some of the most common problems along with their causes and solutions to help you resolve them quickly.

1. Formatting Issues (Extra Spaces, Incorrect Styling)

Problem: Text formatting appears inconsistent, with extra spaces, unexpected font changes, or incorrect styles.

Cause:

The editor may be inserting unnecessary HTML tags.

Copying and pasting content from external sources (like Microsoft Word or Google Docs) can introduce unwanted formatting.

Solution:

✅ Use the “Clear Formatting” option in the editor before applying new styles.

✅ Paste content using Ctrl + Shift + V (Windows) or Cmd + Shift + V (Mac) to remove external styling.

✅ Switch to code view and manually remove unnecessary tags if needed.

2. Cross-Browser Compatibility Issues

Problem: The editor works fine in one browser but breaks or behaves differently in another.

Cause:

Some browser engines handle JavaScript and CSS differently.

Outdated browser versions might not support certain editor features.

Solution:

✅ Test the editor on multiple browsers (Chrome, Firefox, Edge, Safari) to identify inconsistencies.

✅ Keep your browser and WYSIWYG editor version updated.

✅ Use developer tools (F12 > Inspect Element) to debug rendering issues.

3. Editor Not Loading or Freezing

Problem: The WYSIWYG editor fails to initialize or gets stuck while loading.

Cause:

JavaScript errors or missing dependencies.

Slow internet connection affecting CDN-based editors.

Browser extensions interfering with the editor.

Solution:

✅ Check the browser console (F12 > Console) for JavaScript errors.

✅ Ensure that all required JavaScript and CSS files are properly linked.

✅ Try loading the editor in incognito mode or disabling extensions to check for conflicts.

✅ If using a CDN version, test with a locally hosted version to rule out network issues.

Conclusion

WYSIWYG editors are like magic wands that transform anyone into a web design wizard. They use HTML, CSS, and JavaScript to bring your creations to life, and their architecture and APIs make editing a breeze. From website builders to content management systems, they find use in various domains. Despite challenges, these editors continue to evolve, promising an even brighter future for effortless web creation. So, get ready to wave goodbye to coding worries and unleash your creativity with WYSIWYG editors!

FAQs

Which two features make WYSIWYG editors useful for web development?

WYSIWYG editors are valuable for web development mostly because of two main factors:

  • Real-time visual editing eliminates the need for manual code writing by allowing you to view changes right as you design.
  • Drag and Drop Functionality: Web design becomes quicker and easier when elements like text, photos, and buttons can be added and arranged with ease and without the need for code.

What is a visual editor?

Visual editors are computer programs that allow users to edit text files using a textual or graphical user interface. Typically, these programs render the material according to embedded markup code, such as HTML or Wikitext, instead of presenting the text in its raw form.

Also see: What Is A WYSIWYG Editor? 

What is the function of WYSIWYG editor?

A WYSIWYG (What You See Is What You Get) editor allows users to create and format content visually, displaying the final output in real time without requiring knowledge of HTML, CSS, or other coding languages. It simplifies web design, word processing, and content management by offering an intuitive interface with drag-and-drop elements, text styling, image embedding, and layout adjustments. This ensures that what you see during editing accurately reflects how the content will appear once published, making it an essential tool for developers, designers, and content creators alike.

 

Download Froala Editor

 

 

Froala Editor V4.5: Disable Plugins, Excel Paste, & New Features!

Froala Release 4.5

As a top-rated WYSIWYG editor, Froala is dedicated to consistently delivering innovative features that elevate the content creation experience for our users. Today, we’re thrilled to unveil the latest version of our powerful editor – Froala Editor V4.5.

This release includes several exciting new features that enhance the user experience and provide greater flexibility. Imagine being able to effortlessly disable specific plugins, allowing you to tailor the editor to your unique needs. Or how about the ability to seamlessly paste multiple cells from Excel directly into your content? These are just a few of the remarkable enhancements that make Froala Editor V4.5 a must-have for Froala users.

We recommend updating your editor today – it will take less than 5 minutes, and you’ll enjoy an even better editing experience. To help you update your editor as smoothly as possible, we’ve added a detailed section at the end of the post.

What’s New in Froala 4.5 – At a Glance

Froala Editor V4.5 packs powerful updates for developers and content creators alike. Here’s a quick look:

  • Disable Plugins: Easily turn off specific plugins with the new pluginsDisabled option—no need to manage long plugin lists.
  • Custom Line Heights: Control the order of line-height options for a cleaner, more intuitive dropdown.
  • Excel Paste Upgrade: Paste multiple Excel cells directly into tables—Froala adjusts formatting and layout automatically.
  • Smarter Performance: Enjoy bug fixes and enhancements across plugins, toolbar behavior, and content formatting.

It’s Froala customization, smarter pasting, and smoother editing—all in one update.

Froala release with new feature

What’s New in Froala Editor V4.5

Let’s take a closer look at what’s new in Froala Editor V4.5. From plugin control to smoother Excel pasting, these updates are designed to give developers and content creators more power and flexibility.

1. Disable Specific Froala Plugins Easily

Froala’s modular plugin structure is a powerful feature that allows developers to include only the plugins they need. This Froala plugin disabling feature makes the editor more efficient, easier to understand, and simpler to extend and maintain. Instead of loading all 40+ plugins by default, developers can use the pluginsEnabled option to specify which plugins are active.

However, using this way to disable one or two plugins could be cumbersome. Developers had to list all the plugins they wanted to keep enabled, which became tedious as the number of plugins grew.

With the new pluginsDisabled option, you can easily turn off specific plugins without hassle. Simply list the plugins you want to disable, and Froala takes care of the rest—no need to manage a long list of enabled plugins.

Now, developers can easily exclude specific plugins without needing to maintain a comprehensive list of enabled plugins. This streamlines the configuration process, giving you greater control over the editor’s functionality.

For example, let’s say you want to disable the “emoticons” and “fullscreen” plugins. You can simply set pluginsDisabled: ['emoticons', 'fullscreen'], and those plugins will be disabled regardless of how the pluginsEnabled option is configured.

This new feature makes it effortless to customize Froala to your specific needs, leading to a more efficient and optimized implementation.

2. Customize Line Height Dropdown Order

Take control of your content’s layout! Froala Editor V4.5 now lets you customize the order of line height options in the dropdown menu, ensuring a more intuitive and user-friendly experience.

Previously, when setting the lineHeights option as an object, the order of the options would be determined by the natural order of the object’s elements in JavaScript. This meant the order was not necessarily intuitive or consistent with how the developer had intended to present the options.

Now, with Froala Editor V4.5, you can set the lineHeights option as an array of objects. When you do this, the editor will display the line height options in the exact order you specify in the array. This gives you complete control over the presentation of these options, ensuring a seamless and intuitive user experience.

For example, let’s say you want to offer your users the following line height options 1, 1.15, 1.5, 2, 3. If you used the object-based approach

new FroalaEditor('.selector', {

  lineHeights: {
    '1': '1',
    '1.15': '1.15',
    '1.5': '1.5',
    '2': '2',
    '3': '3'
  }

});

The options will be displayed in the following order: 1, 2, 3, 1.15, 1.5 due to the way JavaScript objects are structured. But now, with the new array-based approach:

new FroalaEditor('.selector', {

 lineHeights: [

  {label: '1', value: 1},

  {label: '1.15', value: 1.15},

  {label: '1.5', value: 1.5},

  {label: '2', value: 2},

  {label: '3', value: 3},

 ]

});

The options will be shown exactly as you defined them, preserving your intended order and layout.

This enhancement empowers you, the developer, to create a more polished and customized editing experience for your users. By controlling the order of line height options, you can ensure your content authors have easy access to the most relevant and useful formatting choices.

3. Paste Multiple Excel Cells into Tables

Pasting Excel data into an existing table just got easier! Now, you can seamlessly merge Excel content into existing tables in Froala. Whether your data has more rows, columns, or different formatting, Froala adapts automatically—saving you time and effort.

Here’s how it works:

When you hover over a table in the Froala editor, you’ll see a new selection icon in the top-left corner. Clicking this icon selects the entire table, allowing you to paste content from Excel directly into it.

pasting from Excel into Froala

If the copied Excel content has more rows or columns than the selected table, the table will automatically expand to accommodate the new data. The formatting from Excel, such as text styles, colors, and cell borders, will carry over seamlessly.

Conversely, if the pasted content is smaller than the existing table, the extra cells will remain intact. This ensures you never lose any of your carefully crafted table structure.

4. Additional Improvements & Fixes

We have made additional enhancements and addressed various issues reported by our users to improve the overall performance and stability of the Froala Editor, ensuring that the content is in the correct format. These include:

  • Files Manager plugin now supports uploading .hex files.
  • Enhance the Word Paste plugin to retain the Roman Numerals in numbered lists.
  • Improve the link plugin to ensure the right display of the Link Edit popup in the Full Page mode.
  • Update the URL plugin to enhance URL and email detection in pasted content.
  • Apply the fontSizeUnit option value to the editor content by default.
  • Addresses improvements to ensure proper toolbar positioning and visibility handling in sticky mode.
  • Resolved the issue where clear formatting removes video from the content.

These enhancements demonstrate Froala’s commitment to continuously improving the editor’s functionality and addressing user feedback to provide a superior content creation experience.

Please find the complete Froala changelog list here.

How to Update to Froala Editor V4.5

Don’t miss out on the benefits of the latest Froala 4.5 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.5/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.5/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check the Get Started page for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try Froala Editor V4.5 Today

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are committed to providing the best possible experience for all our users. We believe this release, meant to enhance TypeScript support, is a stepping stone towards that commitment. We encourage you to try this improved TypeScript support and provide us with your valuable feedback. 

Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.

To learn more about previous updates, check out the related blog pages for Froala 4.4 and Froala 4.3. We would love to hear your thoughts on the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes by following our get-started guide.

Technical Questions

If you have a technical question, you can check whether we have already answered it in our help center. If not, contact our Support team.

Build a Note‑Taking App with Flask, Froala, and DeepSeek AI in 30 Minutes

3D illustration of a digital hand writing notes with floating graphs and checklists, symbolizing an AI-powered note-taking app built with DeepSeek AI, Flask, and Froala Editor integration.

Hey everyone! Earlier, I shared a general guide on Deepseek API Integrations in web apps. This time, I want to walk you through how I used the DeepSeek API for an AI-powered note-taking app to build a simple yet modern note-taking app with Flask, Froala, and (of course) DeepSeek AI—all in just 30 minutes.

Spoiler: Yes, DeepSeek AI actively helped me build this! I used prompt engineering to have it generate boilerplate Flask code, offer suggestions for integrating Froala, and even refine my Python functions. If you’re a developer looking for a quick and functional starting point with a sleek design, this tutorial (and DeepSeek) has you covered. Let’s dive in!

Illustration of a developer writing notes on a tablet with a digital interface in the background, symbolizing a Flask note-taking app enhanced with DeepSeek AI integration for AI-powered writing, summarization, and text improvement.

What We’re Building

We’ll create a note-taking app where users can:

  1. Write and format notes using the Froala WYSIWYG editor.
  2. Save notes to a local JSON file (simple, lightweight storage).
  3. Use DeepSeek’s API Integration to generate suggestions or improve their notes (e.g., “Help me summarize this note” or “Make this note more concise”).

The app will feature a modern Material UI design powered by the Materialize CSS framework. Everything will reside in a single app.py file for simplicity.

How I Used DeepSeek to Build It

1. Creating a Starter Flask App

I started by asking DeepSeek AI for a simple Flask starter app. Here’s a condensed version of my prompt:

Prompt to DeepSeek AI:
“Help me create a starter Flask app with a single route that returns a home page. Please use Python best practices, and initialize a JSON file if it doesn’t exist.”

DeepSeek responded with a skeleton code snippet, which I adapted. It even reminded me to handle the case where the JSON file might not exist.

2. Integrating the Froala Editor

Once my Flask starter was in place, I wanted to embed the Froala WYSIWYG editor into my front end. I asked DeepSeek:

Prompt to DeepSeek AI:
“Show me how to integrate the Froala Editor into a Flask template with Materialize CSS. I want a minimal example that includes a text editor and a button to save the content via a POST request.”

DeepSeek returned a neat HTML snippet that used both Froala and Materialize CSS from CDN links. With just a bit of tweaking, it fit perfectly into index.html.

3. Hooking Up DeepSeek for AI-Powered Notes

Finally, I wanted to let users improve or summarize their notes with AI. I asked DeepSeek:

Prompt to DeepSeek AI:
“How do I make a POST request to my own Flask route and then call the DeepSeek Chat API with the user input? Include an example of the JSON payload and how to handle the response in Flask.”

DeepSeek walked me through constructing the API request, including the headers and payload. It also showed me how to process the result and return it to the client.

Let’s Build It: Step-by-Step Code

Below is the final, consolidated code. I’ve included the relevant DeepSeek calls, which you can adapt as needed.

Prerequisites

  • Python installed.
  • Flask installed (pip install flask).
  • A DeepSeek API key (get one from their website).
  • Basic knowledge of Flask and HTML.

Step 1: Setting Up Flask

Create a file called app.py and add the following code:

from flask import Flask, render_template, request, jsonify
import json
import os
import requests

app = Flask(__name__)

# DeepSeek API endpoint and key
DEEPSEEK_API_URL = "https://api.deepseek.com/v1/chat/completions"
DEEPSEEK_API_KEY = "yourapikey_here"

# File to store notes
NOTES_FILE = "notes.json"

# Ensure the notes file exists
if not os.path.exists(NOTES_FILE):
    with open(NOTES_FILE, "w") as f:
        json.dump([], f)


@app.route("/")
def home():
    return render_template("index.html")

This creates:

  • A simple Flask app with a / route pointing to index.html.
  • A local JSON file called notes.json to store your notes.
  • Variables for the DeepSeek API URL and key.

(DeepSeek’s suggestion helped me remember to handle the file check gracefully.)

Step 2: Adding the Froala Editor and Materialize CSS

Inside a templates folder, add index.html with the following code:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Note-Taking App</title>
    <!-- Materialize CSS -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet" />
    <!-- Froala Editor CSS (using the official CDN) -->
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet"
        type="text/css" />
</head>

<body>
    <div class="container">
        <h1 class="center-align">My Note-Taking App</h1>
        <div class="row">
            <div class="col s12">
                <!-- Froala Editor Target (using a DIV as recommended) -->
                <div id="froala-editor"></div>
            </div>
        </div>
        <div class="row">
            <div class="col s12">
                <button class="btn waves-effect waves-light" onclick="saveNote()">
                    Save Note
                </button>
                <button class="btn waves-effect waves-light" onclick="askDeepSeek()">
                    Improve Note with DeepSeek
                </button>
            </div>
        </div>
        <div class="row">
            <div class="col s12">
                <h3>Saved Notes</h3>
                <ul id="notes-list" class="collection"></ul>
            </div>
        </div>
    </div>

    <!-- jQuery (if you need it for other parts of your app) -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <!-- Materialize JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
    <!-- Froala Editor JS -->
    <script type="text/javascript"
        src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

    <script>
        // Global variable to hold the editor instance
        let editorInstance;

        // Initialize Froala using the constructor API when the DOM is ready
        document.addEventListener("DOMContentLoaded", function () {
            if (typeof FroalaEditor === "function") {
                editorInstance = new FroalaEditor("#froala-editor", {
                    // Optional configuration options go here.
                });
                loadNotes();
            } else {
                console.error("FroalaEditor is not loaded correctly.");
            }
        });

        // Save note to server using the editor instance API
        function saveNote() {
            // Use the Froala Editor instance to get HTML content.
            const content = editorInstance.html.get();
            console.log("Saving note:", content);
            fetch("/save_note", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({ content: content }),
            })
                .then((response) => response.json())
                .then((data) => {
                    alert("Note saved!");
                    loadNotes();
                })
                .catch((error) => {
                    console.error("Error saving note:", error);
                });
        }

        // Ask DeepSeek for AI suggestions using the editor instance API
        function askDeepSeek() {
            const content = editorInstance.html.get();
            console.log("Sending note to DeepSeek:", content);
            fetch("/ask_deepseek", {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({ content: content }),
            })
                .then((response) => response.json())
                .then((data) => {
                    // Update the editor content with the response from DeepSeek
                    editorInstance.html.set(data.response);
                })
                .catch((error) => {
                    console.error("Error with DeepSeek:", error);
                });
        }

        // Load saved notes from the server
        function loadNotes() {
            fetch("/get_notes")
                .then((response) => response.json())
                .then((data) => {
                    const notesList = $("#notes-list");
                    notesList.empty();
                    data.forEach((note) => {
                        notesList.append(
                            `<li class="collection-item">${note.content}</li>`
                        );
                    });
                })
                .catch((error) => {
                    console.error("Error loading notes:", error);
                });
        }
    </script>
</body>

</html>

 This integrates:

  • Froala Editor for rich text editing.
  • Materialize CSS for a modern look and feel.
  • Buttons for saving notes and asking DeepSeek for improvements.
  • A list (<ul>) that displays all the saved notes.

Step 3: Adding Backend Logic (Saving Notes + DeepSeek)

Finally, we add routes to save notes, retrieve them, and request help from DeepSeek. In app.py, place the following below the existing code:

@app.route("/save_note", methods=["POST"])
def save_note():
    data = request.json
    with open(NOTES_FILE, "r") as f:
        notes = json.load(f)
    notes.append({"content": data["content"]})
    with open(NOTES_FILE, "w") as f:
        json.dump(notes, f)
    return jsonify({"status": "success"})


@app.route("/get_notes", methods=["GET"])
def get_notes():
    with open(NOTES_FILE, "r") as f:
        notes = json.load(f)
    return jsonify(notes)


@app.route("/ask_deepseek", methods=["POST"])
def ask_deepseek():
    data = request.json
    # Modify the prompt to instruct the API to return only the improved note text.
    prompt = f"Return only the revised note: {data['content']} dont add any ** ** or any formatting that would look weird just return it with plain text"

    headers = {
        "Authorization": f"Bearer {DEEPSEEK_API_KEY}",
        "Content-Type": "application/json"
    }
    payload = {
        "model": "deepseek-chat",
        "messages": [
            {"role": "user", "content": prompt}
        ]
    }

    response = requests.post(DEEPSEEK_API_URL, headers=headers, json=payload)
    if response.status_code == 200:
        return jsonify({"response": response.json()["choices"][0]["message"]["content"]})
    else:
        return jsonify({"response": "Error contacting DeepSeek API."})

Here’s what’s happening:

  1. /save_note: Takes the note from the user, loads existing notes from notes.json, appends the new note, and saves it back.
  2. /get_notes: Returns the JSON array of all saved notes.
  3. /ask_deepseek:
    • Prepares a prompt by adding the user’s note content.
    • Calls the DeepSeek API with the user’s text.
    • Returns the AI-generated response to the front end.

(DeepSeek initially gave me the code in smaller pieces, and I combined them into one final function.)

Step 4: Run and Test the App

Save all files.

In your terminal, run:

python app.py

Open your browser and go to:

http://localhost:5000

You’ll see your new note-taking app, with a WYSIWYG editor and buttons to save or improve your notes with AI.

Sample Prompts to Try

  • “Help me summarize this note”
    For instance:
    “I need to buy groceries. I want apples, bananas, and bread.”
    DeepSeek might return a concise list like:
    “Grocery list: apples, bananas, bread.”
  • “Make this note more concise”
    Takes a lengthy paragraph and returns a more streamlined version.
  • “Rewrite this note with a friendlier tone”
    Makes an abrupt list or instructions sound more inviting.

Lessons Learned (Thanks to DeepSeek)

  • Prompt Engineering: The better your prompt, the more helpful DeepSeek is. Experiment with “Rewrite,” “Summarize,” “Shorten,” or “Explain like I’m 5.”
  • Rapid Prototyping: Generating boilerplate code quickly lets you focus on logic instead of syntax.
  • UI Integration: Materialize + Froala looks elegant with very little CSS or JavaScript overhead.

Final Thoughts

In just 30 minutes—with a bit of help from DeepSeek—I built a modern, AI-powered note-taking app. The synergy of Flask for quick server setup, Froala for rich text editing, Materialize for design, and DeepSeek for AI suggestions made the experience seamless.

Here’s what it looks like when you run it in your local browser:

deepseek api - ai powered note taking app screenshot

Ready to customize your app further? Here are some ideas:

  • Add user authentication for private note-taking.
  • Tag or categorize notes for organization.
  • Search capabilities with DeepSeek’s semantic understanding.

If you haven’t tried DeepSeek yet, give it a shot—it’s a powerful addition to your dev toolkit. Let me know in the comments or on social media if you build something cool.

FAQs

What is DeepSeek AI used for in this AI-powered note-taking app?

DeepSeek AI enhances your notes with capabilities such as summarization, grammar improvement, and rewriting. By integrating DeepSeek’s API, your app can offer smart note suggestions in real-time — making it more than just a text editor.

Can I use DeepSeek AI with other Python frameworks besides Flask?

Yes, DeepSeek AI can be integrated with any Python framework, including Django, FastAPI, or a CLI-based app. The important part is making HTTP requests to DeepSeek’s API endpoint, which works universally across Python projects.

Is this note-taking app beginner-friendly for Python developers?

Absolutely. This project uses simple Python file operations, Flask routing, and basic API requests—making it ideal for beginners who want to learn about backend development, AI integration, and building full-stack apps with tools like Froala and DeepSeek AI.

Integrating Froala HTML Editor Software in Angular 19 With SSR Enabled

3D illustration of a digital data pipeline with glowing circuit paths and tech modules, set against a green-blue gradient background.

Froala has recently upgraded its Angular SDK to support Angular 19. With this update, developers can now integrate the Froala WYSIWYG Editor into their Angular 19 applications with server-side rendering (SSR) enabled. This allows for improved performance, better SEO, and enhanced user experience.

The updated SDK provides a seamless integration process, making it easier for developers to incorporate the feature-rich Froala Editor into their Angular projects. This integration enables users to create and edit content within the Angular application while benefiting from the advantages of server-side rendering.

In this article, we will explore the step-by-step process of integrating the Froala WYSIWYG Editor into an Angular 19 application with server-side rendering enabled. We will cover the necessary setup, configuration, and implementation details to ensure a seamless integration. By the end of this guide, you will have a comprehensive understanding of how to leverage the power of Froala within your Angular 19 project.

Getting Started with Your Angular App

First, make sure you have the Angular CLI installed. The CLI is a powerful command-line tool that lets you create, develop, and manage Angular projects right from your terminal.

Don’t have the CLI installed yet? No problem, just run this command:

npm install -g @angular/cli

Now you’re ready to start building your Angular app. Let’s create a new project called “froala-app” by running:

ng new froala-app

You’ll be asked a couple of questions along the way:

  1. Which stylesheet format would you like to use? Choose your preferred CSS preprocessor, like SCSS or Sass.
  2. Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? This is an important one! Enabling SSR and SSG will make your Angular app more performant and SEO-friendly. Go ahead and type “Y” to turn it on.

Once you’ve answered these questions, an Angular project structure will be created in a new folder called “froala-app”. Navigate into the project directory using

cd froala-app

Install the Froala Angular SDK

Alright, let’s get the Froala Angular rich-text editor installed into your Angular application. The Froala Angular SDK has all the essential tools and components you need to easily integrate the Froala editor functionality into your Angular app.

Just run this command to get it installed:

npm install angular-froala-wysiwyg

Create a Standalone Component for Handling The Editor

Now, let’s create another component that we can use to integrate the Froala editor. We’ll call it the “my-editor” component.

ng generate component myEditor

This will create a new folder called “my-editor” inside the “src/app” directory. Inside you’ll find these files for the “my-editor” component:

  • my-editor.component.css
  • my-editor.component.html
  • my-editor.component.spec.ts
  • my-editor.component.ts

Import Froala Components

Open up the my-editor.component.ts file and let’s import the necessary Froala SDK components:

import { Component } from '@angular/core';

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';




@Component({

  selector: 'app-my-editor',

  standalone: true,

  imports: [FroalaEditorModule, FroalaViewModule],

  templateUrl: './my-editor.component.html',

  styleUrl: './my-editor.component.css'

})

export class MyEditorComponent {}

Insert Froala Editor HTML Code

Now let’s add the Froala editor HTML code to the my-editor.component.html file:

<div [froalaEditor]>Hello, Froala!</div>

 

Styling the Froala Editor

To make sure the Froala editor looks good, we need to include the necessary stylesheets. In the angular.json file, add these Froala stylesheets under the “styles” array:

            "styles": [

              "src/styles.css",

              "node_modules/froala-editor/css/froala_editor.pkgd.min.css",

              "node_modules/froala-editor/css/froala_style.min.css"

            ],

The froala_editor.pkgd.min.css includes the styles for the core editor and all Froala plugins. The froala_style.min.css includes the styles needed for displaying the content created by the editor outside the editor.

Displaying Froala on the main page

Finally, let’s import the MyEditorComponent into the app.component.ts file so we can use it in the main app template:

import { Component } from '@angular/core';

import { CommonModule } from '@angular/common';

import { RouterOutlet } from '@angular/router';

import { MyEditorComponent } from './my-editor/my-editor.component';




@Component({

  selector: 'app-root',

  standalone: true,

  imports: [CommonModule, RouterOutlet, MyEditorComponent],

  templateUrl: './app.component.html',

  styleUrl: './app.component.css'

})

export class AppComponent {

  title = 'froala-app';

}

And in the app.component.html file, replace the main section with:

<main class="main">

  <div class="content">

    <app-my-editor></app-my-editor>

  </div>

</main>

Start your App

Alright, now you can serve the app by running ng serve. This will compile the application and serve it locally, usually at http://localhost:4200/. You can now open your Angular app in a web browser and you should see the Froala editor displayed on the homepage.

Froala in Angular 19

Displaying More Froala’s Features

You may have noticed that the Froala editor is displayed with just its basic features. That’s because we haven’t included the plugin’s JavaScript files in the ngOnInit() method yet. Let’s take care of that now.

Open up the “my-editor.component.ts” file and let’s start adding some Froala plugins one by one:

import { isPlatformBrowser } from '@angular/common';

import { Component, Inject, PLATFORM_ID } from '@angular/core';

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';




@Component({

  selector: 'app-my-editor',

  standalone: true,

  imports: [FroalaEditorModule, FroalaViewModule],

  templateUrl: './my-editor.component.html',

  styleUrl: './my-editor.component.css'

})

export class MyEditorComponent {

  constructor(@Inject(PLATFORM_ID) private platformId: Object) { }




  ngOnInit() {

    // Import Froala plugins dynamically only in the browser context

    if (isPlatformBrowser(this.platformId)) {




      // Import a single Froala Editor plugin.

      // @ts-ignore

      import('froala-editor/js/plugins/align.min.js');




      // Import a Froala Editor language file.

      // @ts-ignore

      import('froala-editor/js/languages/de.js');




      // Import a third-party plugin.

      // @ts-ignore

      import('froala-editor/js/third_party/font_awesome.min');

      // @ts-ignore

      import('froala-editor/js/third_party/image_tui.min');

      // @ts-ignore

      import('froala-editor/js/third_party/spell_checker.min';

      // @ts-ignore

      import('froala-editor/js/third_party/embedly.min');

    }

  }

}

Alternatively, if you want to load all the Froala features with a single call, you can import the plugins.pkgd.js file instead:

import { isPlatformBrowser } from '@angular/common';
import { Component, Inject, PLATFORM_ID } from '@angular/core';
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';

@Component({
  selector: 'app-my-editor',
  standalone: true,
  imports: [FroalaEditorModule, FroalaViewModule],
  templateUrl: './my-editor.component.html',
  styleUrl: './my-editor.component.css'
})
export class MyEditorComponent {
  constructor(@Inject(PLATFORM_ID) private platformId: Object) { }

  ngOnInit() {
    // Import Froala plugins dynamically only in the browser context
    if (isPlatformBrowser(this.platformId)) {
      // Import all Froala Editor plugins.
      // @ts-ignore
      import('froala-editor/js/plugins.pkgd.min.js');

    }
  }
}

In the code above, we’re using the isPlatformBrowser component to make sure we only import the Froala plugins in the browser context. This is important for server-side rendering (SSR) scenarios.

The // @ts-ignore is used to suppress any TypeScript errors that might come up due to the dynamic import statements. This allows the code to compile without issues, and the plugins will be loaded at runtime.

How to Setup Froala if Server-side Rendering is disabled

If you’ve disabled server-side rendering (SSR) in your Angular application, the way you import the Froala SDK components may be a bit different. Instead of importing SDK components in my-editor.component.ts, we’ll update the my-editor.module.ts file as follows:

// Import all Froala Editor plugins.
// import 'froala-editor/js/plugins.pkgd.min.js';

// Import a single Froala Editor plugin.
// import 'froala-editor/js/plugins/align.min.js';

// Import a Froala Editor language file.
// import 'froala-editor/js/languages/de.js';

// Import a third-party plugin.
// import 'froala-editor/js/third_party/font_awesome.min';
// import 'froala-editor/js/third_party/image_tui.min';
// import 'froala-editor/js/third_party/spell_checker.min';
// import 'froala-editor/js/third_party/embedly.min';

// Import Angular plugin.
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
...

@NgModule({
   ...
   imports: [FroalaEditorModule.forRoot(), FroalaViewModule.forRoot() ... ],
   ...
})

Customizing The Editor

Now that we’ve set up the Froala editor in our Angular application, it’s time to start customizing it to fit our needs. We can enable additional features and plugins, adjust the toolbar buttons, and even create custom functionality.

The Froala SDK provides a wide range of options to tailor the editor to our specific requirements. By leveraging the power of Angular and the flexibility of Froala, we can build a robust and feature-rich text editing experience for our users.

Let’s open the my-editor.component.ts file and define a public options object in the MyEditorComponent class with some customizations from the Froala API options, events, and methods:

export class MyEditorComponent {

  public options: Object = {

    toolbarButtons: ['alignRight', 'bold', 'insertImage'],

    events: {

      'froalaEditor.contentChanged': function () {

        console.log('Content updated!');

      },

    },

  };

  .....

And in the my-editor.component.html file, we’ll assign the options object to the Froala component:

<div [froalaEditor]="options">Hello, Froala!</div>

Is it possible to store uploaded files in the cloud with Froala?

Absolutely! Froala offers two convenient ways for uploading files:

  1. Built-in File Upload: Froala’s built-in file upload functionality seamlessly integrates with your Angular application, and you can configure it to upload files directly to your S3 bucket.
  2. Filestack Integration: Froala also integrates with Filestack, a powerful upload and cloud storage solution. This integration gives you advanced file handling capabilities, allowing you to securely store and manage your application’s files. The Filestack integration streamlines the file upload experience within your Angular-powered app and offers easy integration with various cloud storage services.

The Filestack integration requires minimal configuration – you’ll need to create a Filestack account to get an API key.

Both options make it easy to incorporate file upload functionality into your Angular application, enhancing the content creation experience for your users.

Conclusion

In this article, we’ve explored the seamless integration of the Froala HTML Editor software into an Angular 19 application with server-side rendering (SSR) enabled. By leveraging the updated Froala Angular SDK, we were able to quickly set up the editor.

The step-by-step guide covered the necessary setup, configuration, and implementation details to ensure a smooth integration process. We also discussed how to customize the Froala editor to fit the specific needs of your Angular application including enabling additional features and plugins.

Moreover, we highlighted the two convenient options for storing uploaded files in the cloud – the built-in file upload functionality and the Filestack integration. Both of these solutions make it easy to incorporate secure and scalable file management into your Angular-powered application.

By following the instructions in this article, you now have the knowledge and tools to integrate the powerful Froala WYSIWYG Editor into your Angular 19 project, while taking advantage of the benefits of server-side rendering. Start enhancing your users’ content creation experience today!

Try Froala in your Angular 19 application and see the difference it can make. Get started with the Froala Angular SDK now.

FAQs

1. What is an HTML Editor Software, and why use it in Angular 19?

An HTML Editor Software like Froala allows developers to easily create, format, and manage HTML content within Angular 19 applications. It provides a visual interface for writing content, supports custom plugins, and integrates seamlessly with server-side rendering (SSR) for better performance and SEO.

2. How do I integrate Froala HTML Editor Software with SSR in Angular 19?

You can integrate the Froala HTML Editor Software in Angular 19 by installing the Froala Angular SDK (angular-froala-wysiwyg), importing its modules, and configuring them in a standalone component. When SSR is enabled, use Angular’s isPlatformBrowser to ensure the editor plugins load only in the browser context.

3. Can I use Froala HTML Editor Software for file uploads in Angular apps?

Yes! Froala HTML Editor Software supports both built-in file upload functionality and integration with Filestack for cloud storage. This enables developers to securely upload, preview, and manage images or documents directly within the Angular application.

 

Set Up a Custom Visual HTML Text Editor in 5 Easy Steps with a No-Code Tool

3D illustration of a custom HTML text editor interface with no-code tools for setup and customization

Setting up a custom WYSIWYG HTML text editor can seem challenging, especially if you’re not comfortable with coding. Many users want their editor to match their workflow, design, and feature needs—but creating one from scratch often feels too complex. With Froala’s Customizer tool, however, you can build a tailored editor in just a few clicks, without writing a single line of code.

In this guide, we’ll walk you through the simple, five-step process of creating a custom HTML text editor using Froala. By the end, you’ll have a fully personalized editor that saves development time, improves usability, and supports a smoother content creation workflow.

Why Choose Froala?

Froala is a powerful WYSIWYG HTML text editor designed to be both flexible and user-friendly. Whether you need:

  • A basic text editor for comments or quick notes
  • Or a feature-rich content management tool for professional projects

Froala has the tools to meet your needs.

Key reasons to choose Froala for building a custom HTML text editor:

  • No-code customization: Use the Froala Customizer tool to set up your editor without writing a single line of code.
  • Faster setup: Build a fully tailored editor in minutes, rather than coding one from scratch.
  • Complete flexibility: Adjust toolbar buttons, plugins, and layout to create the perfect editing experience.
  • User-friendly: Works for both developers and non-technical users who want more control.

Setup Visual HTML Text Editor with no code tool

Access the Froala Customizer

To get started, head over to the Froala Customizer. This user-friendly interface allows you to customize every aspect of the Froala Editor, from toolbar buttons to interface language.

no code tool

Step 1: Select Your Editor Preset

To set up your custom text editor, first choose an editor preset from the five available options, each of which has a brief description. Read more details on the differences between modes here.

Froala offers five editor presets, each designed for different use cases:

  • Classic: A go-to option for simple text areas like blog comments, forum replies, or feedback forms.
  • Document-ready: Optimized for creating online documents with export/print capabilities, similar to Microsoft Word or Google Docs.
  • Inline: Moves the toolbar next to the selected text block, instead of fixing it at the top, making it ideal for inline content editing in CMS platforms.
  • Edit in pop-up: Great for short text edits. Clicking text opens a small pop-up editor for quick, single-line editing.
  • Full Page: Provides full control with HTML, HEAD, BODY tags, and DOCTYPE declaration—best for building complete HTML pages.

Understanding these differences helps you choose the right starting point before customizing your custom HTML text editor further.

After selecting a preset, a demo will be shown. Take a moment to review the options and see how it looks. Click “Next” once you’ve found your preferred option.

Step1

Step 2: Customize Features

Froala Text Editor provides a comprehensive range of options, from basic formatting tools to advanced features such as image and video insertion. These features are delivered through plugins, creating a powerful, modular architecture.

In this step, Froala’s Customizer also allows you to configure advanced features, such as file upload options, language settings, and more. Depending on your needs, you can enable or disable these features to create a tailored editing experience. This allows you to customize the editor’s functionality and appearance without any coding knowledge.

For example, expand the “General” tab and select the “height” option. A text field will appear where you can enter a value, like “300”. Just like that, you’ve customized the editor’s height.

As you make changes, you’ll see all your selected options listed under “Selected options.” This makes it easy to review your customizations before moving on.

Step 2

Once you’re satisfied, click “Next” to continue setting up your custom text editor.

Step 3: Customize Toolbar

Once you’ve selected the features you want to include, you can customize the toolbar layout. Drag and drop the buttons to arrange them in the desired order. You can also add, remove, or group buttons as needed to create a streamlined and intuitive interface for your users.

Step 3

Step 4: Customize The Editor Interface Language

The final step in setting up your custom text editor is to select the language for the editor interface. Froala supports over 35 languages, allowing you to choose the one that best suits your users’ needs. Simply select the desired language from the dropdown menu, and the editor’s buttons, tooltips, and other interface elements will be displayed in that language.

Step 4

For Right-To-Left languages, the editor toolbar buttons will automatically adjust to display from right to left.

Step 5: Download Your Custom Code

By reaching this step, you have completed all the customization steps. Fill the displayed form and click “Download” to download the custom Froala Editor code. 

Extract the downloaded folder, and you will find the HTML, CSS, and JavaScript code for your custom text editor in the index.html file. This code can then be integrated into your website or application, enabling your users to utilize the tailored text editor you’ve created.

Step 5

The Froala Customizer makes it easy to iterate on your design, so you can continue refining the editor as your needs evolve. With this no-code tool, you can quickly and easily build a custom text editor that perfectly fits your project requirements.

Pro Tips for Building a Custom HTML Text Editor with Froala

Based on real-world usage, here are some best practices when using Froala’s Customizer tool:

  • Enable autosave: Helps prevent content loss during editing.
  • Limit toolbar options for focus: Too many buttons can overwhelm users. Keeping only essential formatting tools improves usability.
  • Use inline mode for collaboration apps: Inline editing feels more natural when users need to edit directly inside a page.
  • Set height constraints: Define a minimum editor height for consistency across devices.
  • Test performance with plugins: Only enable plugins you actually need; disabling unused ones keeps the editor fast.

Troubleshooting Common Issues with Your Custom HTML Text Editor

Even with Froala’s no-code setup, you might run into a few small challenges when integrating your custom HTML text editor into your site or app. Below are common issues and detailed steps to fix them:

Editor Not Loading Properly

Issue: The editor doesn’t appear on the page or remains blank.

Resolution:

  • Confirm that you’ve included both Froala CSS and JS files in your HTML.
  • These should be linked correctly in the <head> and before the closing </body> tag.
  • Ensure the file paths are accurate and accessible (especially if you’re hosting locally).
  • Wrap your editor inside a container <div> with a defined height/width to avoid rendering issues.

Missing Toolbar Buttons

Issue: Some buttons are missing or not appearing in the toolbar.

Resolution:

  • Go back to the Froala Customizer and make sure the corresponding plugins are enabled.
  • For example, the “Insert Image” button requires the image plugin to be active.
  • After generating the code, open your index.html and verify the list of included plugins and buttons.

Language Not Updating

Issue: You selected a different language in the Customizer, but the editor still shows English.

Resolution:

  • Make sure the correct language JS file (e.g., fr.js, es.js) is loaded in your HTML.
  • The language option in your config should match the loaded file.
  • Example:
language: 'fr'

And include:

<script src="js/languages/fr.js"></script>

Learn more about Froala language support.

Unexpected Layout or Style Issues

Issue: The editor’s layout breaks or doesn’t match the preview from the Customizer.

Resolution:

  • Conflicts may arise from external CSS (e.g., Bootstrap, Tailwind, custom global styles).
  • Wrap the editor in a class or container like:
<div class="froala-wrapper">
  <!-- editor code -->
</div>

Download Not Working

Issue: After customization, clicking “Download” doesn’t generate the custom editor package.

Resolution:

  • Ensure your browser allows file downloads and pop-ups from the Froala site.
  • Double-check that you filled in all required form fields (like email or project name).
  • Try using a different browser or clearing your cache if the button is unresponsive.
  • You can also use the “Preview Code” option to manually copy and test.

Bonus Tip: Enable Developer Tools

Use browser dev tools (Inspect Element → Console/Network tab) to debug:

  • Missing files (404 errors)
  • JS syntax errors
  • Plugin load failures

Need More Help?

Explore Froala’s comprehensive documentation for advanced setup tips and plugin configurations.

Froala Pricing Considerations: Free vs. Paid Features

While the Froala Customizer tool is free to use for building and downloading your custom HTML text editor, some features you enable during customization may require a Froala license to work in production.

Free Usage Includes:

  • Building and previewing editors using the Customizer
  • Downloading the generated HTML/CSS/JS code
  • Using core formatting features and UI customization

Paid Features May Include:

  • Advanced plugins like real-time collaboration, Markdown support, or file uploads
  • Commercial use rights and white-labeling
  • Priority support and feature updates
  • Integrations with Filestack, image hosting, and cloud storage

For full details, review Froala’s pricing plans to determine what license you need based on your project type—personal, open-source, or commercial.

Conclusion

By using the Froala Customizer, you can create a custom text editor that perfectly fits your needs, all without writing a single line of code. This powerful tool allows you to easily configure the editor’s toolbar, appearance, and advanced features, saving you valuable time and resources.

This no-code tool makes the Froala setup process incredibly easy, as the generated code is ready-to-use and requires minimal setup. This means you can have your custom text editor up and running in no time, without the need for extensive development work.

Whether you’re a content creator, a web developer, or simply someone who wants a more personalized editing experience, the Froala Customizer is an excellent choice. Give it a try today and see how it can streamline your text editing workflow.

FAQs

​​What is a custom HTML text editor, and why should I use one?

A custom HTML text editor lets you tailor features, toolbar options, and design to match your project’s needs, improving usability and workflow.

Can I build a custom HTML text editor without coding?

Yes. With Froala’s no-code Customizer tool, you can configure and download a ready-to-use editor in just a few steps—no coding skills needed.

How does Froala’s Customizer compare to other no-code editor tools?

Unlike many editors, Froala offers plugin-level control, real-time previews, and lightweight, production-ready code, making it highly efficient for developers and non-developers.

 

Integrating Froala as a Functional Component in React 18

Froala and React logos on a blue gradient background symbolizing the Froala React rich text editor integration with React 18

As a React developer, choosing the right rich text editor can make or break your content editing experience. In this guide, you’ll learn how to integrate Froala, a powerful and lightweight React rich text editor, into your React 18 application as a functional component. With full support in Froala v4.4, setting up and customizing the Froala React SDK is now easier than ever—giving you everything you need to build a seamless, modern content editing interface.

Froala 4.4 and React 18 Support

Froala, a leading provider of content editing solutions, has recently released version 4.4, which now fully supports React 18. This means that you can easily incorporate the Froala Editor v4.4 into your React 18 projects, taking advantage of the latest features and improvements in the React ecosystem.

Benefits of Updating to Froala 4.4

By updating your application to use the Froala React SDK, you’ll be able to:

  • Leverage the latest features and enhancements in the Froala Editor
  • Ensure compatibility with the latest version of React (18)
  • Improve the overall performance and user experience of your application.

Integrating Froala as a Functional Component

To get started with integrating Froala as a functional component in your React 18 application, follow these steps:

  1. Install the Froala 4.4 React SDK:
npm install react-froala-wysiwyg --save
  1. Create a functional component that uses the Froala Editor. Create a new directory in the src directory called components and create a file called MyEditorComponent.jsx in that directory.
  2. Open MyEditorComponent.jsx and import the Froala Editor component and the necessary CSS files.
import React from "react";

// Require Editor CSS files.

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import FroalaEditorComponent from "react-froala-wysiwyg";

// Import all Froala Editor plugins;

// import 'froala-editor/js/plugins.pkgd.min.js';

// Import a single Froala Editor plugin.

// import 'froala-editor/js/plugins/align.min.js';

// Import a language file.

// import 'froala-editor/js/languages/de.js';

// Import a third-party plugin.

// import 'froala-editor/js/third_party/image_tui.min.js';

// import 'froala-editor/js/third_party/embedly.min.js';

// import 'froala-editor/js/third_party/spell_checker.min.js';

// Include font-awesome css if required.

// install using "npm install font-awesome --save"

// import 'font-awesome/css/font-awesome.css';

// import 'froala-editor/js/third_party/font_awesome.min.js';
  1. Render the Froala SDK component
// Render Froala Editor component.

function MyEditorComponent() {

  return (

    <div class="editor">

      <h3> Froala's React WYSIWYG Editor</h3>

      <FroalaEditorComponent tag="textarea" />

    </div>

  );

}

export default MyEditorComponent;
  1. Add to other components. For example, to add in `src/App.js`
import "./styles.css";

import MyEditorComponent from "./components/MyEditorComponent";

export default function App() {

  return (

    <div className="App">

      <h1>Hello CodeSandbox</h1>

      <h2>Start editing to see some magic happen!</h2>

      <MyEditorComponent />

    </div>

  );

}

By following these steps, you can easily integrate the Froala Editor as a functional component in your React 18 application, allowing your users to create and edit rich content with ease.

Froala Editor Customization In React

To further customize the Froala Editor in your React 18 application, you can leverage the various configuration options and event handlers provided by the Froala API.

Add a config attribute to the FroalaEditorComponent utilizing the Froala options, events, and methods to customize the editor to your needs.

function MyEditorComponent() {

  let config = {

    documentReady: true,

    heightMin: 300,

    events: {

      contentChanged: function (e, editor) {

        console.log("test");

      },

    },

  };

  return (

    <div class="editor">

      <h3> Froala's React WYSIWYG Editor</h3>

      <FroalaEditorComponent tag="textarea" config={config} />

    </div>

  );

}

This allows you to tailor the editor’s appearance, functionality, and behavior to match the specific needs of your project.

Additionally, you can integrate third-party plugins and language files to extend the editor’s capabilities, ensuring a seamless and feature-rich content editing experience for your users.

By leveraging these customization options, you can create a truly unique and engaging rich text editing solution within your React 18 application.

Explore more in the Froala documentation.

You can learn React here.

Common Froala + React Integration Issues (and How to Fix Them)

Even with a straightforward setup, you may encounter a few hiccups. Here are some common issues developers face when integrating Froala with React, along with their solutions.

1. CSS Not Loading Properly

Issue: Editor appears unstyled or broken.

Solution: Make sure you’ve imported both required CSS files:

import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';

If using a bundler like Webpack or Vite, ensure that CSS is configured to be imported from the node_modules directory.

2. Plugins Not Working

Issue: Plugin features (e.g., align, embed, spell-check) don’t appear in the toolbar.

Solution: You likely forgot to import the specific plugin:

import 'froala-editor/js/plugins/align.min.js';

Or, you may not have enabled it in your config:

config: {
  toolbarButtons: ['align']
}

3. FroalaEditorComponent is Not Defined

Issue: Runtime error saying the component is undefined.

Solution: Check the import:

import FroalaEditorComponent from 'react-froala-wysiwyg';

If you’re using ES modules and get a default export error, try:

import * as FroalaEditorComponent from 'react-froala-wysiwyg';

4. File Upload Not Working

Issue: Images don’t upload or return a 400/500 error.

Solution: You need to configure either:

  • Froala’s native image upload endpoint

Or use Filestack by integrating their API key and setting the upload URL

Why Should I Use Froala With React in 2025?

Using Froala with React in 2025 offers several key advantages. Firstly, the tight integration between the Froala Editor and the React ecosystem ensures seamless compatibility with the latest React features and best practices. This allows you to leverage the full power of React 18 and beyond, delivering a highly responsive and performant content editing experience.

Additionally, Froala’s robust plugin ecosystem and extensive customization options enable you to tailor the editor to your specific requirements, ensuring a unique and engaging user interface for your application.

Froala Editor V4 integrates with Filestack to provide a seamless cloud storage solution for images, videos, and other file types.

By embracing Froala and React in 2025, you can future-proof your content management solutions and provide your users with a cutting-edge rich text editing experience.

How Easy Is It to Upload Images in the Froala React Rich Text Editor?

Froala makes it easy to upload images in your React application. They offer two convenient options:

  1. Built-in Image Upload: Froala’s built-in image upload functionality seamlessly integrates with your React app. All you need to do is configure the Froala Editor’s image upload options, and your users can upload images directly from their devices or external sources. The only additional step is setting up a server to store the uploaded images.
  2. Filestack Integration: Froala also integrates with Filestack, a powerful upload and cloud storage solution. This integration gives you advanced file handling capabilities, allowing you to securely store and manage your application’s media assets. The Filestack integration streamlines the image upload experience within your React-powered app. Plus, you can apply image transformations directly within the Froala Editor, before or after uploading the images.

The Filestack integration requires minimal configuration – you’ll just need to create a Filestack account to get an API key.

Both options make it easy to incorporate rich image functionality into your React application, enhancing the content creation experience for your users.

Why is Froala Significantly Cheaper than TinyMCE?

Froala’s transparent pricing model provides a fixed annual fee for using the editor and all its features. Unlike TinyMCE, Froala does not impose limits on the number of editor loads or charge extra for additional features. Consequently, Froala is significantly cheaper than TinyMCE in many use cases.

This cost-effectiveness, combined with Froala’s robust customization capabilities and seamless integration with React, makes it an attractive choice for developers seeking a high-quality WYSIWYG editor for their React 18 applications.

How to Migrate from TinyMCE to Froala in React?

Migrating from TinyMCE to Froala in a React application is a straightforward process. The key steps involve removing the TinyMCE SDK, installing the Froala SDK, importing the necessary components, and configuring the editor to match your existing setup.

By following this comprehensive migration from TinyMCE to Froala in React guide, you can seamlessly transition your content editing experience, preserving your users’ familiarity while benefiting from Froala’s features, customization options, and cost-effective pricing model.

Conclusion

Integrating the Froala Editor as a functional component in your React 18 application is a powerful way to enhance your content creation and management capabilities. By leveraging the latest version of Froala and taking advantage of its seamless compatibility with React 18, you can deliver a cutting-edge rich text editing experience to your users.

The step-by-step guide provided in this article walks you through the process of setting up the Froala React rich text editor as a reusable component, allowing you to easily customize it to match the unique needs of your project. With Froala’s robust plugin ecosystem, extensive configuration options, and tight integration with cloud storage solutions like Filestack, you can create a truly unique and engaging content editing workflow within your React 18 application.

If you’re a React developer looking to elevate your content management capabilities, we encourage you to try integrating Froala Editor into your next project. Froala is an excellent choice that will help you deliver a superior user experience for your application’s content creators.

If you have any questions or need further assistance, don’t hesitate to reach out to the Froala team or explore the comprehensive documentation.

How to add Froala HTML Editor Software in Django in 2025

add HTML editor software in Django

Django is a powerful Python web framework that helps developers build web applications quickly and efficiently. Froala 4.4 release adds support for the popular Python framework, Django 5.

Integrating Froala HTML Editor Software into a Django project allows users to create and edit rich text content within the application. By combining the flexibility of Froala and the rapid development capabilities of Django, you can create dynamic, user-friendly web applications that meet the evolving needs of your audience.

In this step-by-step guide, you’ll learn how to integrate the Froala HTML Editor Software into a Django form, allowing your users to create and edit rich text content within your application. Whether you’re building a blog, a content management system, or any other web application, this Django HTML editor integration will enhance the user experience and unlock new possibilities for your project.

Integrate Froala into Django

Prerequisites

Being a Python web framework, Django requires Python. We’re assuming:

  • You are familiar with Python and have it installed on your computer. If not, please install python and come again.
  • You have Django installed already.

Versions Used in This Tutorial

  • Froala Editor V4.4
  • Python V3.13.1
  • Django V5.1.5

Step 1: Getting started

From the command line, cd into a directory where you’d like to store your code and create a new directory named froaladjangotutorial.

mkdir froaladjangotutorial
 Then, run the following command to bootstrap a new Django project:
django-admin startproject myapp froaladjangotutorial

This will create a project called myapp inside the froaladjangotutorial directory.

Step 2: Creating a Demo app

To create your app, jump into the created directory:

cd froaladjangotutorial

Type the following command:

py manage.py startapp demos

That’ll create a directory demos which will contain our demo code.

Step 3: Install Froala

To begin, you’ll need to install the Froala Django package. You can do this using pip.

pip install django-froala-editor

Install Froala Django SDK

After successfully installed, open myapp/settings.py and add froala_editor into the INSTALLED_APPS array.

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'froala_editor'
]

Then open the myapp/urls.py file and include the Froala Editor URLs.

from django.contrib import admin
from django.urls import include,path

urlpatterns = [
    path("demos/", include("demos.urls")),
    # Froala Editor URLs
    path('froala_editor/', include('froala_editor.urls')),
    path('admin/', admin.site.urls),
]

Step 4: Create a form with a Froala

Create a new file demos/forms.py and add the following code:

from django import forms
from froala_editor.widgets import FroalaEditor

class FroalaForm(forms.Form):
    content = forms.CharField(widget=FroalaEditor)
 In the above code, we've created a Django form with a FroalaEditor widget. 

Step 5: Configure Froala

You can also customize the editor’s appearance and behavior by passing various options to the FroalaEditor widget.

For example, to initialize the Froala Editor with an inline toolbar, you can use the following code:

from django import forms
from froala_editor.widgets import FroalaEditor

class FroalaForm(forms.Form):
    content = forms.CharField(widget=FroalaEditor(options={
      'toolbarInline': True,
    }))

This will create a Froala Editor instance with an inline toolbar, allowing users to format the content as needed. You can further customize the editor by modifying the options passed to the FroalaEditor widget.

Step 6: Create a template to render the form

You’ll need to configure the Froala Editor in your Django templates. In the demos app, create a new file called froala_form.html in the /templates directory. In this file, you’ll add the necessary HTML and Django template tags to integrate the Froala Editor.

 

<!DOCTYPE html>
<html>

<head>
    <title>Froala Editor</title>
    {{ form.media }}


</head>

<body>
    <h1>Froala Editor</h1>
    <form method="post">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit">Submit</button>
    </form>

</body>

</html>

Make sure to update your settings.py to include the templates directory in the TEMPLATES setting:

import os

# ...existing code...

ROOT_URLCONF = 'mysite.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'demos', 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

Step 7: Update the view to render the template

Update your demos/views.py file to render the form in the template:

from django.shortcuts import render
from .forms import FroalaForm

def index(request):
    if request.method == 'POST':
        form = FroalaForm(request.POST)
        if form.is_valid():
            # Process the form data
            pass
    else:
        form = FroalaForm()
    
    return render(request, 'froala_form.html', {'form': form})

Step 8: Map The URLs

Define a URLconf for the demos app by creating a file demos/urls.py with the following content:

from django.urls import path

from . import views

urlpatterns = [
    path("", views.index, name="index"),
]

The next step is to configure the global URLconf in the myapp project to include the URLconf defined in demos.urls.

To do this, add an import for django.urls.include in myapp/urls.py and insert an include() in the urlpatterns list, so you have:

from django.contrib import admin
from django.urls import include,path

urlpatterns = [
    path("demos/", include("demos.urls")),
    path('admin/', admin.site.urls),
]

Step 9: Test the demo app

Verify the demo app is working with the following command:

python manage.py runserver

You can now access the demo app by visiting `http://127.0.0.1:8000/demos/` in your web browser. This will display the form you created, including the Froala Editor.

Froala into Django

With the Froala Editor integrated into your Django application, users can now create and edit rich text.

Learn more in the official Froala documentation and Django documentation.

Troubleshooting: Common Django–Froala Integration Issues

1) Editor doesn’t appear (just a plain textarea)

Symptoms: No toolbar, no styling; browser console shows 404s for CSS/JS.

Checks & Fixes:

  • Ensure the app is installed: add ‘froala_editor’ to INSTALLED_APPS. 
  • Include form media in the template:

    {{ form.media }}

     

  • Place it inside <head> or before </body>. 
  • Don’t mix CDN and local assets from different versions. Use the assets that ship with django-froala-editor (recommended) or keep all Froala files on the same version. 

2) 404 on /froala_editor/…URLs

Symptoms: Toolbar icons missing; media uploads or plugins fail; 404 for paths under /froala_editor/.

Fix: Make sure you included Froala’s URL patterns in your project URLs:

# myapp/urls.py
from django.urls import include, path

urlpatterns = [
    path("demos/", include("demos.urls")),
    path("froala_editor/", include("froala_editor.urls")),  # required
    path("admin/", admin.site.urls),
]

3) Static files load in dev but not in production

Symptoms: Works locally, breaks after deploy (no CSS/JS).

Fixes:

  • Set static settings and collect static assets:
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
  • Then run:

 

python manage.py collectstatic
  • Make sure your web server (e.g., NGINX) serves STATIC_ROOT. 

4) Images/files don’t upload from the editor

Symptoms: The Upload button shows errors, 403, or 404 on upload endpoints.

Checks & Fixes:

  • Ensure Froala’s upload endpoints are enabled by including froala_editor.urls (see #2). 
  • Configure media settings and URL patterns:

    MEDIA_URL  = "/media/"
    MEDIA_ROOT = BASE_DIR / "media"
    

     

  • In your project URLs (development only), serve media:

    from django.conf import settings
    from django.conf.urls.static import static
    
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    

     

  • CSRF: If you see 403 CSRF errors on upload, ensure your template includes {% csrf_token %} in forms, and that AJAX requests include the CSRF token (Django’s default CSRF cookie + header). 

5) “Toolbar icons missing,” but editor loads

Symptoms: Editor renders; icons appear as empty squares.

Fix: Font files (e.g., .woff, .ttf) not served correctly. Verify your static files setup (see #3) and that icon/font MIME types are allowed on your server/CDN.

Security Best Practices for Rich Text Input

When integrating HTML Editor Software like Froala into Django, it’s important to handle user-generated content securely:

  • Sanitize input server-side: Use libraries like bleach to remove unsafe tags, scripts, and attributes before saving or rendering. 
  • Limit editor features: Configure Froala to allow only the formatting and media options your app supports. 
  • Validate uploads: Check file type and size, and scan for malware if image or document uploads are enabled. 
  • Apply CSP (Content Security Policy): Restrict scripts and assets to trusted sources using tools like django-csp. 
  • Enforce Django security settings: Always use HTTPS, secure cookies, CSRF protection, and set headers like X_FRAME_OPTIONS = “DENY”. 

Example: Sanitizing Rich Text with bleach

import bleach

def sanitize_content(content):
    allowed_tags = ['p', 'b', 'i', 'u', 'ul', 'ol', 'li', 'a', 'blockquote', 'br']
    allowed_attrs = {'a': ['href', 'title']}
    
    return bleach.clean(content, tags=allowed_tags, attributes=allowed_attrs, strip=True)

# Usage in a Django view
if form.is_valid():
    raw_content = form.cleaned_data['content']
    safe_content = sanitize_content(raw_content)
    # Save safe_content to the database

This ensures only safe HTML tags and attributes are stored, reducing risks like XSS (Cross-Site Scripting).

Conclusion

Integrating the Froala WYSIWYG Editor into your Django application is a powerful way to enable rich text editing for your users. By following the steps outlined in this article, you can quickly add a feature-rich text editor to your Django forms.

The Froala Editor provides a wide range of customization options, allowing you to tailor the editor to your specific needs. Whether you want an inline toolbar, custom buttons, or advanced formatting options, the Froala Editor has you covered.

Now that you know how to add the Froala Editor to your Django project, why not give it a try? Start by creating a new Django project and follow the steps in this guide. Before long, you’ll have a dynamic, user-friendly text editing experience integrated into your web application.

Our 4.4 Update: Why The React and Angular Updates Are a Big Deal

icon

As the Product Marketing Manager here at Froala, I’ve had the privilege of working closely with our engineers and product leads to bring you the latest version of our WYSIWYG Editor—Froala 4.4. One of the things I’m most excited about is how we’ve aligned our React and Angular SDKs with the newest versions of these frameworks. I know it might not seem glamorous at first, but let me show you why these updates truly matter for our html editor software.

React SDK: Our Journey with React 18

1. Smoother User Experiences

One of the biggest highlights of React 18 is Concurrent Rendering. Picture a busy highway that magically widens during rush hour, allowing more cars to move quickly. That’s sort of how Concurrent Rendering feels. It helps your apps stay responsive by splitting up work, so your interface doesn’t freeze or stutter—even when you’re handling heavy operations, like text editing with Froala.

2. Performance Gains with Automatic Batching

React 18’s Automatic Batching feature combines multiple state updates into a single render pass. If you’ve ever struggled with too many re-renders bogging down your app, this update is a game-changer. Combine that with Froala’s own optimizations, and you’ll see faster load times and smoother text editing for your end users.

3. Better Data Fetching with Suspense

We also love how React 18 enhances Suspense for data fetching. Think of Suspense as your safety net for loading states. It makes it easier to show a “loading” view while your app fetches data behind the scenes. When you pair Suspense with the Froala Editor, you can handle big blocks of content more elegantly without awkward screen flickers.

4. Marking Non-Urgent Updates

Finally, the startTransition API allows you to mark certain state updates as non-urgent. In other words, if you’re typing an article in Froala while your app quietly syncs data, the user-facing experience stays smooth. The important edits still happen instantly, and the less critical stuff runs in the background.

Angular SDK: Embracing Angular 19

1. Speed You Can Feel

Angular 19 delivers performance enhancements that make everything from component rendering to change detection more efficient. Because Froala is tightly integrated with Angular, these improvements trickle down to our editor. Tables load quicker, images embed faster, and your overall editing process feels snappier.

2. Modern Features, Less Hassle

Each Angular release adds new features and updated APIs that can simplify your code. With Angular 19, you’ll find it easier to manage dependencies, create reusable components, and tap into powerful directives. And when Froala is part of your project, you won’t have to worry about missing out on these fresh capabilities.

3. Built-In Security Patches

Security always matters, especially when users are creating and sharing content. Angular 19 includes fixes that protect against known vulnerabilities. By aligning Froala’s codebase with Angular 19, we help ensure that your app remains on solid ground—and that you have one less thing to stress about.

4. Fewer Version Conflicts

Keeping up with the latest Angular release means fewer headaches when adding or updating third-party libraries. Because our new Froala SDK is built with Angular 19 in mind, you’ll spend less time wrestling with compatibility and more time building amazing experiences for your users.

From Our Team’s Perspective: Why These Upgrades Matter

A Smoother Development Cycle

At Froala, we’re constantly talking to developers who want their tools to “just work.” With our React and Angular updates, we’ve aimed to reduce friction in your workflows. The cleaner your integration process, the faster you can spin up features or fix bugs—everyone wins.

Future-Proofing Your Projects

We know that once you’re locked into an older framework version, upgrading can feel overwhelming. We want to help you avoid that situation. By providing up-to-date SDKs, we’re ensuring you can adopt the latest React and Angular releases without worrying that Froala will break your app.

Better End-User Experience

When developers use frameworks efficiently, end users benefit. Faster load times, smoother text editing, and fewer page refreshes keep your audience engaged. We’ve seen these improvements firsthand while testing our own demos, and we’re confident you’ll notice them too.

Tips for a Successful Upgrade

  1. Check Your Dependencies: Make sure other libraries and tools in your project are also compatible with React 18 or Angular 19.
  2. Use Our Documentation: We keep our installation guides up to date to help you integrate Froala quickly and avoid common pitfalls.
  3. Test in a Safe Environment: Before rolling out changes to production, run a pilot or test environment. That way, you can catch any issues early.
  4. Explore New Features: Don’t just upgrade and call it a day. Take advantage of new APIs and performance tweaks—it’s worth the effort!

Closing Thoughts

Behind every new release, there’s a lot of collaboration and passion from our Froala team. We push ourselves to deliver features that not only keep pace with the latest frameworks but also solve real developer challenges. These React and Angular updates in Froala 4.4 are a testament to our commitment to giving you powerful, modern, and secure tools for content creation.

If you’ve been waiting for a sign to update your editor, this is it. We believe the improvements you’ll see in performance, security, and user experience make upgrading well worth your time. So go ahead—dive into React 18 or Angular 19 with Froala 4.4, and let us know how it transforms your workflow. We’re here to support you every step of the way!

Froala 4.4: Empowering Developers with New Advancements

Froala Release

We’re thrilled to announce the release of Froala WYSIWYG Editor version 4.4, a milestone that demonstrates our commitment to delivering cutting-edge solutions for developers and Froala customers alike.

This release is packed with a host of exciting updates, enhancements, and bug fixes that are sure to elevate your content creation and management experience.

Froala SDKs now support the latest versions of popular frameworks:

  • React SDK supports React 18.
  • Angular SDK supports Angular 19.
  • Django plugin works with Django 5.
  • WordPress plugin integrates with WordPress 6.

In addition to these framework updates, this release includes several bug fixes, with a particular focus on improving the content pasting experience. Furthermore, we’ve enhanced the integration with the Dompurify library, which helps sanitize HTML and strengthen security.

Let’s dive in and explore the key highlights.

Froala 4.4 release

SDK Updates: Embracing the Future

Froala SDKs help developers seamlessly integrate the Froala WYSIWYG Editor into their applications. With this release, we’ve ensured our SDKs work with the latest versions of popular frameworks. This empowers developers to leverage cutting-edge technologies and deliver exceptional user experiences.

React SDK

The React SDK now supports React 18, ensuring seamless integration with the recent advancements in the React ecosystem. This allows developers to benefit from new React 18 features such as:

  • Concurrent Rendering: React 18’s concurrent rendering allows for smoother and more responsive user interfaces by enabling non-blocking rendering.
  • Automatic Batching: This feature reduces the number of re-renders, improving performance and efficiency.
  • Suspense for Data Fetching: Enhanced support for Suspense allows for better handling of asynchronous data fetching, making your application more robust.
  • startTransition API: This API helps in marking updates as non-urgent, ensuring smoother transitions and better user experience.

As a developer, updating to the latest Froala React SDK is beneficial if you want to leverage the new features and improvements in React 18. This can enhance the performance and user experience of your application, making it more efficient and responsive.

To update your Froala React SDK, run the following command:

npm update froala-editor    

If new to Froala, follow the React SDK documentation to get started.

Angular SDK

The Angular SDK has been updated to work with Angular 19, providing developers with the tools to leverage the latest features and improvements in the Angular framework.

As a developer, updating to the latest SDK is generally recommended to take advantage of:

  • Improved Performance: Angular 19 includes performance enhancements that can make your applications run faster and more efficiently.
  • New Features: You’ll have access to the latest features and APIs introduced in Angular 19, which can help streamline development and improve functionality.
  • Better Compatibility: Ensures compatibility with other libraries and tools that are also updated to work with Angular 19.
  • Security Updates: Newer versions often include security patches that protect your application from vulnerabilities.

To update your Froala Angular SDK, run the following command:

npm update froala-editor --save

If new to Froala, follow the Angular SDK documentation to get started.

Django Framework Plugin

The Froala Django framework plugin has been updated to work seamlessly with the latest version of the popular Python web framework, Django 5.0. This update empowers developers building web applications with Django to integrate the Froala WYSIWYG Editor into their projects easily.

Django 5.0 introduces several new features and improvements, including:

  • Enhanced URL handling.
  • Improved database support.
  • Enhanced security features.

By updating the Froala Django plugin to work with Django 5.0, we’re enabling our developers to take advantage of these new features and improvements. This allows you to build more robust, secure, and feature-rich web applications with the Froala WYSIWYG Editor seamlessly integrated into your Django-powered projects.

To update your Froala Django plugin to the latest version, follow these steps:

  1. Open your project’s requirements.txt file (or equivalent dependency management file).
  2. Locate the line that specifies the Froala Django plugin version and update it to the latest version:
    froala-editor-django==4.4
    
  3. Save the requirements.txt file and run the following command in your terminal to update the dependencies:
    pip install -r requirements.txt
    

After completing these steps, your Froala Django plugin will be updated to the latest version, allowing you to leverage the new features and improvements introduced in Django 5.0. This will help you build even more powerful and efficient web applications with the Froala WYSIWYG Editor seamlessly integrated into your Django-based projects.

If you’re new to using the Froala Django plugin, be sure to check out the Froala Django documentation to get started.

WordPress Plugin

The Froala WordPress plugin has been updated to work seamlessly with the latest version of WordPress, WordPress 6, ensuring a smooth and reliable integration for our WordPress-based customers.

This update is especially important for Froala users who leverage the WordPress platform to power their websites and blogs. The Froala WordPress plugin empowers WordPress administrators to seamlessly integrate the Froala WYSIWYG Editor into their content creation workflows. With this plugin, admins can create posts and pages using the robust editing capabilities of the Froala Editor.

Beyond the admin experience, the Froala WordPress plugin also enables front-end integration. This allows your website’s users to leverage the Froala Editor when adding comments or submitting other user-generated content.

The plugin comes with a dedicated configuration page in the WordPress admin dashboard, making it easy for administrators to customize the editor’s settings to match their specific needs.

To update the Froala WordPress plugin to the latest version:

  1. Backup Your WordPress Site: Before making any changes, it’s always a good idea to create a full backup of your WordPress site. This will allow you to restore your site in case any issues arise during the update process.
  2. Download the Latest Plugin Version: Visit the Froala WordPress plugin GitHub repository and download the latest version of the plugin. You can either clone the repository or download the ZIP file containing the plugin files.
  3. Replace the Plugin Files: Log in to your WordPress admin dashboard and navigate to the “Plugins” section. Locate the existing Froala WYSIWYG Editor plugin and deactivate it. Then, delete the plugin folder from the wp-content/plugins/ directory of your WordPress installation.
  4. Install the Updated Plugin: Upload the new plugin files you downloaded in Step 2 to the wp-content/plugins/ directory, either by extracting the ZIP file or cloning the repository directly into the plugins folder.
  5. Activate the Updated Plugin: Once the new plugin files are in place, go back to the “Plugins” section in your WordPress admin dashboard and activate the Froala WYSIWYG Editor plugin.

If you encounter any issues during the update process or have questions about the new Froala WordPress plugin features, please don’t hesitate to reach out to our support team. We’re here to ensure seamless integration and help you make the most of the Froala WYSIWYG Editor within your WordPress-powered projects.

Improved Content Pasting: Enhancing the User Experience

Froala is renowned for its powerful pasting capabilities. However, in this release, we’ve made significant improvements to the content pasting functionality. We’ve addressed various issues and edge cases to ensure a smoother and more reliable pasting process.

One key improvement is the retention of the id property for table of contents (TOC) items when pasting content from Microsoft Word. This allows users to seamlessly scroll down to a specific section identified by the TOC item, preserving the intended navigation structure.

Additionally, Froala now supports the mso-list attribute from Office HTML. This helps maintain the proper hierarchy of complex multi-level lists after pasting them, ensuring the lists remain in order.

These improvements enhance the overall user experience, making it easier for users to paste content into the Froala Editor without losing formatting or structure.

Bug Fixes and Improvements

In this release, we’ve addressed various issues reported by our users to enhance the overall performance and stability of the Froala Editor. These improvements include:

  • Enhanced table header handling: We’ve ensured proper table structure and resolved issues where rows might not correctly align within the <thead> section. This improves the merging of table header cells.
  • Consistent underline color: We’ve made the underline color match the text color.
  • Restored full-page content: We’ve fixed the issue where the editor did not return the full-page content when the fontFamilyDefaultSelection option was used.
  • Cleaned text formatting: We’ve resolved the issue where the text format was not properly cleaned when setting the enter option to FroalaEditor.ENTER_BR.
  • Preserved cursor position: We’ve fixed the issue where the cursor position was lost when content was wrapped with html.wrap inside tables.
  • Improved link handling: We’ve resolved an issue where all formatting was removed when inserting a link containing special characters. The fix is to URL-encode the link, ensuring special characters are stored correctly.

Additionally, we’ve enhanced the integration with the DOMPurify library, a powerful HTML sanitization tool, to further strengthen the security and reliability of the Froala Editor. DOMPurify now respects the configurable options htmlAllowedAttrs, htmlAllowedTags, htmlAllowedEmptyTags, and not just the contenteditable property.

You can find the release notes on our website.

Embracing the Future of Content Creation

The Froala WYSIWYG Editor 4.4 release represents a significant step forward in our mission to empower developers and content creators with the tools they need to thrive in the ever-evolving digital landscape. By aligning our SDK updates with the latest versions of popular frameworks like React, Angular, and Django, we’re ensuring that our users can leverage the most cutting-edge technologies and seamlessly integrate Froala into their workflows.

Moreover, the bug fixes and security enhancements included in this release underscore our dedication to providing a reliable and secure content editing experience. By addressing the XSS vulnerability and improving the DOMPurify integration, we’re safeguarding our users’ content and protecting their digital assets from potential threats.

Unlocking New Possibilities

As we move forward, we remain committed to pushing the boundaries of what’s possible in the world of content creation and management.

Whether you’re a seasoned Froala user or new to our platform, we encourage you to explore the latest features and enhancements. Upgrade your Froala WYSIWYG Editor to version 4.4 and unlock a world of new possibilities for your content creation and management needs.

If you have any questions or feedback, our dedicated support team is always here to assist you. We value your input and look forward to continuing our collaboration as we shape the future of content creation together.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Change Log

Please visit the release notes for a complete list of changes.

Get Started

Following our get started guide, you can download and start using Froala in less than five minutes.

Change Log

Please visit the release notes for a complete list of changes.

Technical Questions

If you have a technical question, you can check whether we have already answered it in our help center. If not, contact our Support team.

HTML Code Writer with Iframe Isolation and How to Inject Styles

HTML Iframe

Looking to seamlessly integrate a rich text editor into your web application without disrupting your existing design or compromising security? Leveraging the power of iframes, the Froala WYSIWYG editor offers a robust solution for achieving just that. This approach provides a clean, isolated environment for the editor, preventing style conflicts and potential security vulnerabilities.

This article delves into the advantages of loading your Froala editor within an iframe, exploring the benefits of content isolation and enhanced customization options. We’ll provide a clear, step-by-step guide on how to effectively embed the Froala editor in an iframe, and discuss techniques for injecting custom styles to maintain brand consistency and a polished user experience.

Key Takeaways:

  1. Using an iframe to embed the Froala WYSIWYG editor provides content isolation, preventing style conflicts between the editor and the main website. This ensures a consistent editing experience regardless of the surrounding website’s CSS.
  2. Froala’s iframe mode allows developers to inject custom styles directly into the iframe, enabling precise control over the editor’s visual presentation to maintain brand consistency.
  3. Embedding the Froala editor in an iframe is a straightforward process.

HTML Code Writer

The Benefits of Using HTML Iframe with Froala Editor

Understanding the Advantages of Iframe Content Isolation

Iframes offer a powerful way to embed external content seamlessly within your web pages while maintaining a clean separation from your core site’s structure and styling. Think of them as miniature windows displaying content from other sources.

With the Froala WYSIWYG editor, utilizing iframe mode provides significant advantages, primarily centered around content isolation. This iframe editor customization ensures that the styling of your Froala editor, embedded within the iframe, won’t clash with the CSS of your main webpage. This is particularly crucial when dealing with complex website designs or when integrating third-party content. This isolation prevents conflicts and ensures a consistent editing experience within the Froala editor, regardless of the surrounding website’s styles.

Furthermore, iframe content isolation enhances security by limiting the impact of potentially malicious scripts within the embedded content, protecting your website’s integrity. Using iframes with the Froala editor allows for a more controlled and predictable integration, contributing to a smoother user experience and simplified development process.

The Froala editor embedding process is straightforward and designed to enhance both UX and DX, aligning perfectly with Froala’s mission to create exceptional editing experiences.

Enhancing Your WYSIWYG Editor with Iframe Customization

The ability to set default styles for framed WYSIWYG editors’ content is particularly beneficial for maintaining brand consistency and ensuring seamless visual integration.

How do you achieve this level of iframe editor customization? It’s simpler than you might think. Injecting styles into the framed Froala editor allows you to precisely tailor the look and feel to match your brand’s guidelines. This precise control extends to fonts, colors, button styles, and virtually every aspect of the editor’s visual presentation.

With Froala’s focus on intuitive design and developer experience, customizing your framed editor becomes a powerful tool for creating a visually appealing and user-friendly editing experience within your web application.

How to Embed Froala Editor in an Iframe Effectively

The Froala WYSIWYG editor, known for its clean design and developer-friendly integration, provides a dedicated iframe mode, further enhancing its versatility and customization capabilities.

First, include the Froala library in your project. Then, when initializing the editor, set the iframe option to true. This creates a contained environment for the editor, preventing style conflicts with the surrounding webpage.

new FroalaEditor('div#froala-editor', {
  iframe: true
})

This isolation is especially beneficial when dealing with complex website designs, ensuring the Froala editor renders perfectly regardless of existing CSS. This method offers several advantages, including iframe content isolation and enhanced iframe editor customization.

How To Inject Styles Inside Froala WYSIWYG Editor

Enabling Froala’s iframe mode brings us to the matter of styling the framed editor. Because of the inherent content isolation, simply adding CSS to your main stylesheet won’t affect the editor within the iframe. This is where the Froala core.injectStyle(style) method comes into play.

This method is used to inject styles directly into the iframe’s document. This approach allows precise control over the editor’s visual presentation within its contained environment, overcoming the limitations posed by iframe SEO impact and ensuring consistent styling regardless of the parent page’s CSS.

For example, by default, the standard browser’s font-size for the H1 tag is 32px. This is the font size that will be automatically applied to H1 elements inside the Froala editor when used in iframe mode. However, you may want to change this default to match your brand’s style guide – for instance, setting the H1 font-size to 40px. In this case, you can use core.injectStyle(style) method like this:

let editor = new FroalaEditor(
  "div#froala-editor",
  {
    iframe: true,
  },
  function () {
    // Call the method inside the initialized event.
    editor.core.injectStyle("h1{font-size: 40px}")
  },
)

The code above sets the font-size for any H1 tags inserted within the Froala editor to 40px, ensuring the editor’s appearance matches your brand’s design guidelines.

With this technique, developers can achieve seamless iframe editor customization while leveraging the benefits of iframe content isolation and enhanced security. This allows for a streamlined user experience that makes Froala a favorite among developers worldwide.

FAQ

1. What are the benefits of using HTML iframe for embedding the Froala Editor?

Using an iframe for the Froala Editor offers several key benefits: content isolation (preventing style conflicts with your main website and enhancing security), enhanced customization (allowing precise control over the editor’s appearance through style injection), and a cleaner separation of content which can potentially improve page load times and thus, SEO. It creates a contained environment, simplifying development and ensuring a consistent editing experience.

2. How can I customize the Froala Editor when loaded in an iframe?

Customize the framed Froala editor by injecting styles directly into the iframe’s document using the core.injectStyle(style) method. This allows precise control over fonts, colors, button styles, and more, ensuring brand consistency.

Conclusion

Embedding the Froala editor within an iframe offers a compelling blend of design flexibility, enhanced security, and improved site stability. While iframe implementation requires careful consideration of SEO implications, the benefits of content isolation and styling customization often outweigh the challenges. By understanding the nuances of iframe integration and leveraging Froala’s intuitive design, developers can create a seamless and visually appealing editing experience that enhances user satisfaction and development workflow. So, take the leap and explore the power of iframe embedding with Froala – you might be surprised at how easily it elevates your web application’s editing capabilities.

Froala’s Best Innovative Approach to Styling JavaScript WYSIWYG Editor Tables

Styling JavaScript WYSIWYG Editor Tables

Tables are best used in JavaScript WYSIWYG Editors. They help us organize data, highlight important information, and present content in a clear, structured way. However, styling these tables has long been a frustrating challenge for non-technical users.

Froala came up with an innovative approach to table styling, giving developers the ability to create ready visually stunning styles that content creators can select to style their tables.

In this post, we’ll explore Froala’s table styling capabilities. We’ll uncover why Froala’s table solution seamlessly fits into any content.

Styling JavaScript WYSIWYG Editor Tables

Key Takeaways:

  • Froala provides a comprehensive set of table formatting options in its rich-text editor, including the ability to resize columns, add/remove table headers/footers, and control cell alignment.
  • Froala’s innovative table styling capabilities allow developers to create pre-designed table styles that content creators can easily apply to their tables, without needing to write custom CSS.
  • Froala’s table styling features improve the readability and aesthetics of content by enabling the creation of professional-looking tables that enhance the overall visual appeal.
  • Froala’s seamless table editing tools streamline the content creation process, boosting productivity by reducing the time spent on table formatting.
  • By integrating Froala’s powerful yet user-friendly table management capabilities, you can elevate the quality and impact of your content, delivering a better experience for your audience.

Table Editing in Froala

When it comes to styling tables in a rich-text editor, Froala provides a comprehensive set of formatting options to help you create professional-looking tables.

Table Structure

Froala’s rich text editor provides a powerful “Table” dropdown menu that gives you complete control over the structure of your tables. This menu allows you to easily manipulate your table, ensuring you can create the perfect layout for your content.

With the “Table” dropdown, you can:

Add/Remove Table Header: Toggle a header row at the top of your table. This is great for labeling the different columns and providing context for your data.

Add/Remove Table Footer: Add a footer row at the bottom of your table. This can be useful for including summary information, totals, or other important details.

Add/Remove Table Rows: Quickly insert new rows or delete existing ones as needed. This flexibility allows you to expand your table to accommodate more data or trim it down to only the most essential information.

Add/Remove Table Columns: Just like with rows, you can add or remove columns at any time. This makes it easy to reorganize your content and adjust the table structure to suit your needs.

Beyond just adding and removing elements, the “Table” dropdown also lets you control the alignment of content within each cell. You can choose to align text horizontally (left, center, right, justify) as well as vertically (top, middle, bottom). This allows you to present your data in a visually appealing and organized manner.

Moreover, Froala provides the ability to merge and split cells, giving you complete control over the table structure. This flexibility ensures that you can create complex table layouts to best suit your content.

Styling Tables with Froala

One of the biggest challenges with rich-text editors is styling tables. Most WYSIWYG editors don’t provide an easy solution for non-technical users to style their tables.

But Froala has an intuitive approach to table styling. Let’s say you want to create a striped table style. You can add the following CSS rule to your stylesheet:

.class1 tbody tr:nth-child(2n) {

  background: #f9f9f9;

}

This rule will apply a light gray background color to every other row in the table, creating a striped effect.

Next, you can define this new table style in the tableStyles option of the Froala Editor:

new FroalaEditor('div#froala-editor', { 
      // Define new table cell styles 
       tableStyles: {
         class1: 'Stripped',
       }
});

In this example, the key class1 represents the CSS class that will be applied to the table, and the value 'Striped' is the label that will be displayed in the “Table Style” dropdown menu for users to select.

When a user selects the “Striped” option from the dropdown, the class1 CSS class will be applied to the table, resulting in the striped appearance you defined earlier.

This approach allows you, as the developer, to create a range of pre-designed table styles that users can easily apply to their content. By providing these visually appealing options, you empower your users to create professional-looking tables without having to write any custom CSS themselves.

Additionally, you can control whether users can select multiple table styles at once or if they should be limited to a single style. This is done using the tableMultipleStyles option in the Froala Editor configuration.

With Froala’s robust table styling capabilities, content creators can focus on creating high-quality, visually appealing content, without getting bogged down by the complexities of table formatting.

Styling Table Cells with Froala

In addition to styling entire tables, Froala also allows you to apply custom styles to individual table cells. This granular control enables you to highlight specific data, draw attention to important information, or create visually distinct sections within your tables.

To style table cells, Froala provides a “Cell Style” dropdown menu that lets users select from a range of predefined styles. Similarly to “Table Style”, as the developer, you can define these styles using CSS and then expose them in the editor’s interface. This empowers your users to easily apply professional-looking formatting to their content without any coding knowledge.

Let’s say you want to allow users to style some cell text in red so they are highlighted. You can add the following CSS rule to your stylesheet:

.redcell {
   text-align: center;
   color: red;
}

Next, set the tableCellStyles option of the Froala Editor:

new FroalaEditor('div#froala-editor', {
   // Define new table cell styles.
   tableCellStyles: {
     redcell: 'highlight',
   }
})

When a user selects the “highlight” option from the dropdown, the redcell CSS class will be applied to the table cell, resulting in the selected cell text appearing in red.

table cell style

This flexibility allows users to emphasize important data, create visual hierarchies, and ensure their tables are informative and aesthetically pleasing.

With these powerful table styling capabilities, content creators can craft professional-looking tables that effectively communicate their message and enhance the overall visual appeal of their content.

Benefits of Froala’s Table Styling

Improved Readability and Aesthetics

Froala’s table styling capabilities help create clean, professional-looking tables that enhance the overall appearance and readability of your content. With a range of formatting options, you can ensure a consistent look and feel across your entire document.

This attention to detail results in an enhanced user experience, making it easier for your audience to navigate and digest the information presented in your tables. Well-styled tables can significantly improve the clarity and impact of data-heavy content, whether it’s in a corporate blog, online documentation, or e-commerce product descriptions.

Increased Productivity

Froala’s intuitive table editing tools streamline the content creation process, allowing you to spend less time fussing with table formatting and more time focusing on the substance of your work. The seamless integration of tables with other rich-text elements, such as text, images, and multimedia, further enhances your productivity by enabling a smooth, efficient workflow.

By reducing the development time required for custom table implementations, Froala’s table styling capabilities free up your team to concentrate on higher-value tasks and deliver content to your audience more quickly.

Conclusion

Froala’s innovative approach to table styling in javaScript WYSIWYG editors has solved a long-standing challenge for content creators. By providing an intuitive set of table formatting options and the ability to define custom table styles, Froala empowers users to create professional-looking tables without requiring any specialized technical knowledge.

To experience the benefits of Froala’s table styling firsthand, we encourage you to explore the Froala Editor and integrate it into your next project. With its powerful yet user-friendly table management capabilities, you can elevate the quality and impact of your content, delivering a better experience for your audience.

Visual HTML WYSIWYG Editor Tips: Make Images Pop with Auto Enhancements

icon

It’s no secret that most users want their uploaded photos to look good, presentable, and aesthetically pleasing. That’s why in most modern applications, especially social media platforms, users can enhance their images before uploading them. They usually do so with the help of an image editor or a WYSIWYG HTML editor with image enhancement features. And that’s nice, but what if the application can do the enhancements for them so that they won’t have to do anything but upload? In this tutorial, we’ll show you how to automatically apply image enhancements using a Visual HTML WYSIWYG editor.

Key Takeaways

  • Image enhancement is an important feature for most modern applications
  • Implement automatic image enhancement quickly using Froala and Filestack
  • Greatly improve image quality with Filestack’s 10 different types of enhancement
  • Choose between multiple presets depending on your requirements
  • Use just one type of image enhancement (e.g., always upscale images) or let the user choose a preset using buttons

What is Image Enhancement?

Image enhancement refers to a process that improves the visual quality of an image. It typically involves increasing an image’s resolution, adjusting colors and shadows, and correcting parts of an image that don’t look too good. Users can usually choose which type of image enhancement they want by either adjusting the images themselves or using buttons that automatically enhance an image when clicked. Alternatively, developers can allow just one type or preset of image enhancement.

For example, let’s say we have a social media site where users share stories and photos of their travels or the outdoors. We can then configure our application to always use the “outdoor” preset instead of presenting users with different options every time. Similarly, if we’re building a platform where users can upload various types of images, we can simply let the users decide and then bind some buttons to different image enhancement presets. But how exactly do we implement this feature? In this tutorial, we’ll use Filestack, a file upload and transformation tool that supports image enhancements through simple API calls. The best part about this is that Froala (as of v4.3.0) natively comes with Filestack, meaning you can enhance images straight from your WYSIWYG editor. Before we start coding, let’s first check out the different enhancement presets available to Filestack.

Types of Image Enhancement in Froala WYSIWYG Editor

Through Filestack, Froala now supports the following types or presets of image enhancement:

  • Upscale: Increase image resolution
  • Auto: Automatically choose the optimal set of improvements for an image
  • Vivid: Increase color depth and brightness
  • Beautify: Automatically correct blemishes and color of faces in portraits of people
  • Beautify Plus: Applies stronger corrections but works similarly to beautify
  • Fix Dark: Corrects extremely underexposed photos
  • Fix Noise: Automatically detect and remove grains from photos while preserving details
  • Fix Tint: Remove abnormal tints due to cameras picking up excess green, red, blue, or yellow
  • Outdoor: Optimize landscape images by adding color vibrancy and bringing out details from shadowy areas
  • Fireworks: Set off excess color from fireworks while correcting grain from the night sky

Before we get started, note that Filestack’s image enhancement is a premium feature that supports images that are not larger than 10 MB.

How to Enhance Images in Froala WYSIWYG Editor

Implementing image enhancement is simple with Froala and Filestack. We’ll need an HTML in which we’ll place the editor element and a JS for initializing the editor and setting its options. First, let’s create our WYSIWYG editor.

Building the WYSIWYG Editor

Insert the following code in your HTML file:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Image Enhancements Using Froala and Filestack</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />
</head>

<body>
    <div class="container-fluid vh-100">
	<div class="row h-100">
            <div class="col-md-6 mx-auto my-auto">
                <div id="froala-editor"></div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
    <script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>
    <script src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>
    <script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
    <script src="js/index.js"></script>
</body>
</html>

Here, we essentially just load the required stylesheets and scripts for Froala and Filestack and then initialize the div element, where we’ll initialize Froala Editor. Afterwards, go to your JS file and add the following code:

new FroalaEditor('#froala-editor',{
    filestackOptions: {
        filestackAPI: 'YourFilestackAPIKey',
        uploadToFilestackOnly: true,
        pickerOptions: {
            accept: ['image/*'],
            fromSources: ['local_file_system']
        }
    },
    toolbarButtons: {
        'moreRich': {
            'buttons': ['openFilePickerImageOnly', 'insertLink', 'insertTable', 'emoticons', 'specialCharacters', 'insertHR'],
            'buttonsVisible': 3
        },

        'moreText': {
            'buttons': ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'clearFormatting']
        },

        'moreParagraph': {
            'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
        },
        'moreMisc': {
            'buttons': ['undo', 'redo', 'fullscreen', 'selectAll', 'html', 'help'],
            'align': 'right',
            'buttonsVisible': 2
        }
    },
    events: {
        'filestack.uploadedToFilestack': function (response) {
            const originalFileHandle = response.filesUploaded[0].handle;
            const enhancedFileURL = `https://cdn.filestackcontent.com/enhance=preset:vivid/${originalFileHandle}`;
            const editor = FroalaEditor.INSTANCES[0];
            editor.image.insert(enhancedFileURL, true, { link: enhancedFileURL, alt: 'Enhanced Image' });
        },
        'filestack.uploadFailedToFilestack': function (response) {
            console.log(response);
        },
    },
    heightMin: 500,
    heightMax: 1000
});

In our JS, we create a new FroalaEditor object in our div element. For our filestackOptions, we declare our API key (get your free Filestack API Key here), allow uploads only to Filestack, and accept all types of images from the local file system. What’s more important here is the ‘filestack.uploadedToFilestack‘ event, which is where we perform the automatic image enhancements. After getting the Filestack handle of the uploaded file, we call the Filestack API that corresponds to the enhancement preset that we want. In this code, we’re using the “vivid” one, but we’ll replace this later on to test out some of the other presets, so take note of this line of code. Afterwards, we insert the enhanced image back into the editor. With this, we’re done with our implementation. Let’s now run the application and check some of the presets that Filestack offers.

Trying out Different Image Enhancement Presets within the Editor

  • Auto: Let’s start by using the “auto” preset. For this, we’ll use the “enhance=preset:auto” CDN from Filestack. When you run the application and upload an image, you should see the resulting screen (shown below). The image above is the original photo, while the image below is the enhanced version. Upon inspection, the enhanced image now looks even better than before with its more vibrant blue hues, better contrast, and overall livelier feeling.

A screenshot of Froala WYSIWYG Editor after it performs automatic image enhancement using Filestack

  • Fix Dark: enhance=preset:fix_dark
    • Original image

A photo of a bonfire

    • Enhanced version

The bonfire photo now has less shadows, revealing some more detail

  • Fix Noise: enhance=preset:fix_noise
    • Original image

A photo with a slight grain effect

    • Enhanced version

This version of the grainy photo has been fixed by Filestack's image enhancement feature

  • Outdoor: enhance=preset:outdoor
    • Original image

A photo of a mountain

    • Enhanced version

The enhanced version of the outdoor image. It now looks even better, emphasizing clarity and color

  • Fireworks: enhance=preset:fireworks
    • Original image

Some fireworks on a grainy night sky

    • Enhanced version

The enhanced version of the fireworks image, showing less grain and blurred lights

It’s clear from these examples that the images, although already good, now look even better after undergoing Filestack’s enhancements. And it didn’t even require a lot of time or coding. With Froala and Filestack, you can do the same to your users’ image uploads, boosting user experience and content quality.

Conclusion

Image enhancement doesn’t have to be a manual or time-consuming process. By using a solid WYSIWYG editor that natively supports powerful image enhancement features, you can improve image quality seamlessly. Whether it’s upscaling resolution, fixing underexposed shots, or adding life to outdoor photos, image enhancement ensures that your users’ content always looks its best. Using Froala and Filestack, we demonstrated how you can quickly implement image enhancement in your application. How you implement it (e.g., whether you’ll automatically enhance photos right away or let users decide) is up to you. Either way, you should definitely experiment with Filestack’s enhancement presets and determine what you need. Your users deserve stunning visuals—why not make it happen with a few lines of code?

Get your Filestack API here for free.

The Best WYSIWYG Editors: A Comprehensive Guide

best WYSIWYG editor

What is a WYSIWYG Editor, and why do we need one

I get it—coding can be exhausting sometimes, even for the most dedicated developers. It takes a lot of energy and focus to constantly double-check our syntax and ensure everything is in order. And if you’re like me, there are days when you’d rather skip that part altogether. Now, what if you’re not a developer at all but a designer? Your passion lies in colors, aesthetics, and bringing creative ideas to life, not writing lines of code. We need an option to create a stunning web page without diving into complex coding. Honestly, even developers want it sometimes!

That’s why we need WYSIWYG HTML editors, and trust me, they’re a game-changer. These tools let us focus on creating rather than coding. There are plenty of WYSIWYG editors out there, but I’ll help you find the best WYSIWYG editor to suit your needs. 

WYSIWYG stands forWhat You See Is What You Get.It’s a tool that allows us to create visual content without the need for manual coding. We can design effortlessly with a user interface that mirrors the final output—whether it’s a web page or document. Features like text formatting, font selection, and image insertion make the process intuitive and enjoyable. Whether for website design, email marketing, or managing content, WYSIWYG editors simplify the journey and save us time, leaving more room for creativity.

programmer-looking-at-laptop
Image Generated with DALL-E 2

10 Best JavaScript WYSIWYG editors

Finding the best HTML editor on the market can be challenging, so we’ve provided you with the top 10 best JavaScript HTML editors. Each editor has its pros and cons so at the end of the day, it really depends on your needs.

Froala Editor

First on the list is, of course, our own editor Froala. Froala is a responsive and customizable JavaScript WYSIWYG HTML text editor that offers a range of formatting options with its simple interface. Its clean and modern interface makes it easy for both beginners and advanced users to familiarize themselves with it. It complements existing editors, like WordPress and other applications easily because it is very lightweight. The spell-checker plugin makes it easy for writers to write content and its mobile-first approach makes it easy for developers to make responsive pages.

Froala WYSIWYG editor home page

Pricing

Froala offers a free trial with limited capabilities. Paid subscription plans start from US$ 719/year.

Limitations

Froala is a premium tool, and its pricing can be high for small businesses or individuals. While it offers robust features, the cost may not justify the needs of those with simpler requirements.

CKEditor

CKEditor is a multifaceted editor since it helps users make various documents, emails, reports, and even chat messages. Its features like auto-formatting, spell detection, mentions, and copy-pasting from various applications like Microsoft Word make it a great editor. This editor is perfect when making content that is text heavy. Content such as news sites and blogs will benefit from CKEditor. Its revision history is great for editing your work.

CKEditor home page

Pricing

In CKEditor, you will get a 14-day free trial that includes all features and add-ons for all plans. Also, this tool provides a free plan with limited capabilities. The paid subscription plans start at US$ 144 per month when you pay annually.

Limitations

This tool also has feature limitations in the free version. The functionalities like export to Word and PDF, Advanced Productivity including like case change, enhanced paste from Word and Excel, merge fields, etc., and Advance Page Management features come with the paid plans.

TinyMCE

TinyMCE editor home page

This HTML WYSIWYG editor is really good at being embedded into various web apps. TinyMCE is flexible in a way that it can be used as a basic or advanced editor. It is very customizable and allows content writers to use it to their specific needs. TinyMCE has accessibility features as well. For example, it has keyboard shortcuts for users with disabilities. And its features like WAI-ARIA, defines a way to make web content more accessible to people with disabilities.

Pricing

TinyMCE editor also offers a free cloud-hosted version of the open source editor. Its paid plans start at US$ 67 per month when you pay annually.

Limitations

While basic use is straightforward, taking full advantage of TinyMCE’s capabilities requires knowledge of web development and configuration of APIs.

Mercury

Mercury is easily configurable, letting users add or remove toolbar items or create new tools. It is also maintained by the community on Github, which means it is open-source. It is built on top of HTML5, meaning it natively supports all new HTML5 features.

Mercury Editor

Pricing

Mercury is an open-source tool, meaning it is free to use. Users can download and configure it without incurring any costs. Since it is maintained by the open-source community, there are no premium plans or licensing fees involved.

Limitations

  • Lack of Official Support: Mercury does not offer official customer support, leaving users reliant on community forums and GitHub issues for help.
  • Community-Driven Maintenance: Being community-maintained means slower updates and fewer guarantees regarding bug fixes or feature enhancements.

Redactor

To put it simply, this editor can create and edit images and videos. Redactor can also embed code if you want to do the nitty-gritty. And like many other tools on the list, Redactor can be customized as well. Its hybrid interface allows the toolbar to be customized. Lastly, it is fast and minimalistic.

Redactor text editor

Pricing

Redactor pricing plans start at US$499 per year for the Basis version, which includes Redactor only. You can subscribe for the plans with Email and AI plugins at a higher prices. It does not offer a free plan.

Limitations

  • Cost: Redactor’s pricing can be on the higher side compared to some free or open-source editors, which may not be ideal for users on a tight budget.
  • Limited Free Options: There is no completely free version of Redactor, limiting accessibility for users who only need basic features.

ScribeJS

Open-source comes to life with this editor. GitHub contributors actively maintains and develops Scribe.js since it’s an open-source software. It provides a simple and modular architecture. This means that makes it easy to create custom editing experiences. It also handle complex text formatting. This includes lists, tables, and inline styles like bold and italic. Scribe.js also has undo and redo. And as for plugins, images, video, and other media, Scribe.js can do the job.

Pricing

ScribeJS offers unlimited free public packages for public package authors. They offer a Pro subscription plan at US$ 7 per month for individual creators with unlimited public and private packages. For teams and organizations, they provide the Teams plan at US$ 7 per user per month with unlimited public and private packages.

Limitations

  • Steep Learning Curve for Beginners: As an open-source tool with a modular architecture, ScribeJS may require technical expertise to configure, customize, and integrate properly.
  • Limited Support: Being open-source, ScribeJS doesn’t offer dedicated customer support. Users must rely on community forums, GitHub discussions, or documentation for troubleshooting.

QuillJS

QuillJS powerful rich text editor

QuillJS is a lightweight visual HTML editor. Looking at it, it has a really simple user interface which doesn’t make it look intimidating to new users. Like Scribe.js, it is also an open-source project. It boasts modular architecture with expressive API, which makes it completely customizable despite its simplicity. QuillJS also supports all platforms.

Pricing

Quill is completely free and open-source, and available under the MIT license. Users can download, modify, and use it for personal and commercial projects without any cost.

Limitations

  • Limited Out-of-the-Box Features: QuillJS provides a minimalistic core editor. Advanced functionalities such as tables, image resizing, or complex formatting require additional modules or third-party plugins.
  • Customization Requires Technical Knowledge: While the modular architecture makes it customizable, users with limited coding experience may struggle to configure and extend the editor for specific needs.
  • Lack of Official Support: As an open-source project, QuillJS relies on its community for support, bug fixes, and updates. Users may face delays in issue resolution if they encounter bugs or compatibility problems.

Aloha Editor

Aloha Editor makes it possible to edit websites directly, which is an awesome feature. It is lightweight, which makes it fast. Aloha Editor also allows the user to edit other content besides text, like videos, photos, graphics, and animation.

ALOHA WYSIWYG Editor

Pricing

Aloha Editor is an open-source tool and is available for free. There are no licensing fees, making it a cost-effective option for developers and businesses looking for a lightweight in-browser editing solution.

For commercial use, we can contact the Aloha Editor team for licensing options. Additionally, the license terms can be found on their GitHub repository.

Limitations

  • Steep Learning Curve for Customization: While Aloha Editor is lightweight and modular, developers need technical expertise to extend its capabilities or integrate it into larger applications.
  • Lack of Regular Updates: The editor has not seen frequent updates, which may result in compatibility issues with modern web standards or frameworks.

Bootstrap WYSIWYG Editor

Bootstrap WYSIWYG Editor is another lightweight plugin. It boasts its text editing features since it has a lot of customizability. It has text formatting, color, align, links, pictures, lists, and more. We can also use our own color palette if we think its preset colors are lacking. The editor also allows the user to disable or enable the tooltips if it annoys you. Perhaps one of its unique features is its custom translations.

Pricing

Bootstrap WYSIWYG Editor is free to use as it is an open-source plugin. It does not have any licensing costs, making it an affordable option for developers and businesses looking for a customizable text editor.

Limitations

  • Requires Technical Expertise: While highly customizable, it requires coding knowledge and familiarity with Bootstrap for configuration and integration. Non-developers may struggle to use it effectively.
  • Bootstrap Dependency: The editor heavily relies on the Bootstrap framework, which may not be ideal for projects that do not use Bootstrap.

CLEditor

CLEditor is a jQuery plugin that we can add to our web pages. It has cross-browser compatibility, text color, highlight color, font name, size, and style. We can also insert images and links. It’s pretty simple, but it gets the job done.

what is the best wysiwyg editor for you

Pricing

CLEditor is an open-source tool and is available for free. There are no licensing fees, making it a cost-effective option for developers and small businesses who need a simple and lightweight WYSIWYG editor for their web pages.

Limitations

  • No Official Support: Being an open-source tool, CLEditor does not provide official support or regular updates, which may result in compatibility issues with modern browsers or frameworks.
  • Customization Challenges: Extending or customizing CLEditor may require additional coding knowledge, as it does not have a modular architecture like modern editors.

Comparison of the best JavaScript WYSIWYG editors

Top 10 JavaScript WYSIWYG Editors
Tool Pricing Key Features Limitations
Froala Editor Free trial, Paid plans start at $719/year Mobile-first design, highly customizable, lightweight, and responsive. Premium pricing may be too high for small businesses or individuals.
CKEditor Free plan, Paid plans start at $144/month Auto-formatting, spell check, revision history, Word and Excel support. Free version lacks advanced features like PDF/Word export and advanced productivity tools.
TinyMCE Free version, Paid plans start at $67/month Accessibility features, flexible API, keyboard shortcuts, highly customizable. Full utilization requires web development knowledge and API configuration.
Mercury Free (Open-source) Built on HTML5, configurable toolbars, open-source, community-maintained. Lacks official support, slower updates, and limited guarantees on bug fixes or feature enhancements.
Redactor Paid plans start at $499/year Supports image/video editing, code embedding, fast and minimalistic interface. No free plan; pricing can be high compared to other editors.
ScribeJS Free plan, Pro at $7/month per user Modular architecture, handles complex text formatting, supports plugins for media content. Requires technical expertise; no official support for troubleshooting.
QuillJS Free (MIT License) Lightweight, customizable via APIs, modular, simple user interface, platform agnostic. Limited out-of-the-box features; technical knowledge required for customization.
Aloha Editor Free (Open-source) Direct website editing, lightweight, supports multimedia content (videos, graphics, animation). Steep learning curve for customization; infrequent updates may lead to compatibility issues.
Bootstrap WYSIWYG Free (Open-source) Highly customizable, supports text formatting, colors, images, tooltips, and translations. Requires Bootstrap framework and coding knowledge for integration; non-developers may face challenges.
CLEditor Free (Open-source) Simple jQuery plugin, supports text formatting, image and link insertion, cross-browser compatible. No official support, lacks modularity, and may face compatibility issues with modern web standards.

How to choose the best WYSIWYG editor for your needs

When choosing, consider the features you need. May it be ease of use, formatting options, and compatibility with platforms you serve. Try to look for something that offers a user-friendly interface if you’re not a developer or a beginner. Support for file formats can be a necessity depending on the service you provide. Customization options are a plus too since it optimizes your workflow. Things like the ability to add custom fonts, themes and other extra features help with content creation. If you work with a team, consider collaborative features. If you want to integrate it with other apps, consider its integration process. Is it easy to troubleshoot or no? Ultimately, the right tool will depend on your specific needs and preferences. 

Tips on using WYSIWYG Editor

Despite its ease of use, like any other tool, using a WYSIWYG editor can still be confusing so here are a few tips for making the most out of your WYSIWYG editor.

  1. Keep it simple: A clear and concise writing style and avoiding complex formatting helps readability.
  2. Use headings: Heading tags structure your content and make it easy for readers to skim.
  3. Avoid too much color: No need for many colors, the point is to read your content. Simple colors make it easy on the eyes and not distracting.
  4. Be consistent: Use a consistent font and formatting style throughout your document to maintain readability.
  5. Save frequently: Make sure to save your work often to prevent data loss.
  6. Use tables: Tables are great for organizing lists.
  7. Check for accessibility: Use alt tags for images. Ensure that your document is accessible to people with disabilities.
  8. Use bullets and lists: This makes content easy and fast to read.
  9. Preview your work: Preview your work to see errors and make adjustments immediately.
  10. Use the help documentation: You get surprised at the extra features your editor has when you check out the documentation.

best wysiwyg editor

Conclusion

In conclusion, we’ve talked about the importance of selecting the right features for your WYSIWYG editor, as well as tips for being productive when using it. Selecting features that are important to your specific needs and goals can help you create high-quality content effectively. Additionally, following tips such as previewing your work and being consistent in formatting can help maximize productivity.

The Froala WYSIWYG editor offers a user-friendly interface, mobile responsiveness, and a wide range of customization options. It is suitable for creating various types of content, including blog posts, emails, and web pages. The editor’s customizable toolbar makes it easy to use and efficient.

Choosing the best WYSIWYG editor is important because it can impact the quality and effectiveness of your content creation. Froala, CKEditor, TinyMCE, and many more are all popular options that offer various features and functionality to assist users in creating professional-looking content. By considering your specific needs and the features and functionality of different editors, you can make an informed decision and maximize your productivity. With the right WYSIWYG editor and effective use of its features, you can create high-quality content that meets your desired outcomes.

 

Froala Blog Call To Action

 

A Guide to Finding the Best HTML Editor on the Market

A Guide to Finding the Best HTML Editor on the Market

In a world where rapid application development is widespread, it’s important to find tools that make tasks easier. A WYSIWYG HTML editor, for example, cuts down the time it takes for users to create web content. Integrating a ready-made editor also makes developers’ lives a lot easier, reducing maintenance and developer costs and effort. But before enjoying the benefits of WYSIWYG editors, we must first find the best HTML editor on the market. This article will help you do exactly that.

To start our journey of finding the best HTML editor, it’s essential to understand both the basics of these editors. Furthermore, we need to learn both our requirements and what makes an editor “the best” for us. Are you ready? Let’s continue on below.

What is a WYSIWYG HTML editor?

The definition of a WYSIWYG (what you see is what you get) editor can vary. In a general sense, however, a WYSIWYG editor is an HTML editor that lets users create formatted and stylized content. Furthermore, users of such an editor can see how the rendered content will look as they work.

On the other hand, text editors (the other type of editor) let users write code. They help developers create web content with features like syntax highlighting, code formatting, and more. Text editors usually require users to have programming knowledge, while WYSIWYG editors don’t.

WYSIWYG HTML editors have two major areas: the editing area and the toolbar. The editing area is where people can write content, insert images, or paste content from their clipboard. The toolbar contains sets of buttons for performing formatting, styling, or other actions. For instance, a toolbar can have a button for italicizing text, uploading files, viewing the content’s HTML, and more. This user interface-based design of these editors makes content editing a lot easier for users. More importantly, these editors let even non-technical users create their web content without coding.

However, this doesn’t mean that WYSIWYG editors are better than text editors. It’s better to think of these editors as either a supplementary time-saving tool for developers or a way for non-technical people to build content. Both developers and non-developers can gain a lot by integrating a ready-made WYSIWYG editor into their application or website. It saves them time by having the necessary editing features right away. It can also reduce maintenance, development, or hiring costs. Managing these potential development costs often involves weighing feature sets against pricing, a process simplified by the full Froala vs CKEditor breakdown.

Today, we have plenty of ready-made WYSIWYG editors to choose from. This gives people plenty of options to find the one they need. The only question left is how they can find the editor that fits them perfectly.

Illustration of a person pushing a shopping cart towards a store labeled 'WYSIWYG' with glowing stars above the sign, symbolizing a user-friendly WYSIWYG tool or service.

How to find the best HTML editor for our application

To find the best HTML editor for our application or website, we can follow the steps below:

  1. Check our project requirements.

    The first thing that we have to do is go back to our project requirements. This means determining the features we need, timeline, budget, and the benefits that an editor can bring. This step may consist of smaller steps. But this depends on how detailed we want our assessment to be. What matters in this step is that we know our product, users, constraints, and how an editor can help improve our application. Revisiting timelines lets us know whether we need an editor we can use immediately or one we should study first. At the end of this step, we should have an idea of what type of editor we prefer.

  2. Take scalability into consideration.

    After the first step, it’s easy to search the internet for viable HTML editors and use one right away. However, this might come back to bite us in the future. For example, let’s say that our WYSIWYG editor-powered application gets popular really quickly. And that after a few months of success, a competitor releases a similar application but with newer or better WYSIWYG features. To make things worse, let’s say that we initially chose a free, poorly maintained editor that’s light on features. In this scenario, we won’t catch up to our competitors in time, potentially causing us to lose some users.
    Another thing we should consider is whether we can customize the editor to our liking. And I’m not talking purely about physical customization (themes, icons, etc.). This also includes customizing the editor’s toolbar and features. A highly customizable editor has a plugin-based architecture for adding and removing features. It should also let us create our own buttons and plugins. Lastly, it should let us organize its toolbar and change its look and feel to align with our application or website.
    So, how do we prepare for these scenarios? The answer is to find a feature-rich, well-maintained, customizable, and scalable WYSIWYG editor. Once we have considered these factors, we’re now ready to look for potential editors on the internet.

  3. Search the market.

    There are plenty of ways to search for great editors on the internet. We could go on their individual websites, read articles, or even watch YouTube reviews and demos (or all of these). What’s essential is that we assess these editors based on their features, pricing, usability, maintainability, developer friendliness, and customizability. We can also use other bases for reviewing them. These include innovation (e.g., using a React Markdown editor) and compliance with various regulations (e.g., HTML table accessibility).
    Ideally, we should look for an editor that checks all the boxes for the aforementioned factors. Of course, the reality is that it’s difficult to find such a perfect editor. So, what we can search for is an editor that suits our requirements and allows our application to scale accordingly.

What is the best HTML editor on the market?

best HTML editor

In the general sense, there is no best HTML editor that can solve every problem for every application. However, there are WYSIWYG editors that come very close to this. Froala is one of these near-perfect editors. It’s a feature-rich, elegant, customizable, and fast WYSIWYG editor that provides plenty of benefits for both users and developers. For users, Froala has over 100 features, a well-designed toolbar and interface, and high performance. For developers, it offers a quick three-step integration, easy and deep customization, and rich documentation with tons of examples.

What are the benefits of using Froala Editor?

Here are some of the things that developers and users enjoy about Froala:

  • It has an initialization time of 40 milliseconds or less.
  • Froala has the best-looking (and feeling) editing interface. Its team designed it (and continues to upgrade it) to ensure a comfortable, efficient, and aesthetically pleasing experience for users.
  • It has plenty of features. These range from basic formatting (bold text, paragraph alignment, etc.) to innovations like autosaving, document-ready mode, real-time editing, and more.
  • It’s plugin-based, meaning we can add or remove features by including or excluding plugins. That way, we can ensure that we’ll have the exact features we desire to include in our application. And should our requirements change, we can easily adapt by changing the editor’s included plugins.
  • We can organize its toolbar and create our own buttons, plugins, dropdowns, pop-ups, themes, and more. Froala is our canvas, and we are the artist.
  • It’s easy to integrate it into any application (click here to see the process). It also makes integration with popular libraries and frameworks like React, Angular, and Vue.js smooth.
  • It’s very accessible because of its compliance with regulations like Section 508 or WCAG 2.0.
  • Froala supports over 34 languages, includes RTL (right-to-left) writing support, and spell and grammar checking.
  • There are plenty of detailed documentation pages to help you achieve your goals with the editor. Froala even has dozens of examples that show how and for what purposes you can use it.
  • We’ll have better protection against XSS (cross-site scripting).
  • It helps users create SEO-friendly content.
  • Despite its status as a premium editor, Froala is affordable. It has the lowest price among the top editors. It also doesn’t keep its features locked behind a paywall unlike others. With Froala, we’ll have every editing advantage no matter which plan we choose.

What’s next?

We’re now more familiar with WYSIWYG editors, the steps to finding the best HTML editor for us, and a strong candidate for the title of best editor. That means that we’re now ready to start our search. What we should do next is explore what the best editors have to offer. We can do this by trying them out for ourself and checking whether they have everything we need or not. Always remember that there’s no best editor for every use case. But there is a best editor specifically for us and our use case. I hope that this guide has helped you, and I wish you good luck in finding your ideal editor.

Froala Blog Call To Action

 

The 10 Best HTML Editors for Website Designers and Developers 2024

html-editor

In today’s online world, having a website for our business or organization is mandatory if we want to compete with others for people’s attention. The simple fact is there are more than 1 billion websites online — whether we have a fascinating product or service to market, the information our website presents is our main edge when it comes to getting noticed by prospective customers. The way we organize and express that information is how our customers learn about who we are and understand the services we offer. Most importantly, the only way to ensure that they get the right message is to send it by designing a creative and attractive website. 

Are there Similar Tools to an HTML Editor?

Using an HTML editor is essential if we want to create a good-looking, functional website, no matter what we’re trying to do. It doesn’t matter if we are trying to promote our product, offer information about our business or service, or achieve something else entirely.

If we’re developing a product, service, or startup that relies on a website to generate leads, signups, or sales, we’ll need a Powerful HTML Editor to build our site because Froala’s Editor allows a designer to compose or copy the text in the left editor and see clean and directly usable HTML code in the right window. It also allows developers who enjoy writing code to simply paste the HTML into the right editor and see the text output in the left editor.

If you’re looking for easy-to-use HTML Editor options, you’ve come to the right place! HTML editors can help us improve our efficiency and workflow. They will also help us produce applications or a beautiful, mobile-friendly website!

Overview 

You might have heard of HTML or WYSIWYG editors like Froala, Dreamweaver, or any page builder in one form or another. All of these tools allow us to visually organize the content on our website and build it the way we want it to look.  No need to code at all—just connect the dots by dragging and dropping these elements into your website.

Whatever your use case may be, We have compiled a list of the best HTML editors for creating both responsive Desktop and mobile-friendly websites. 

So let’s check them out!

1. Froala

Froala-Editor

The Froala Editor is a lightweight, CSS-based WYSIWYG HTML editor that comes packed with a variety of features. Unlike the rest of the editors on the market, it offers users a few interesting features that make it stand out.  These features include track changes, browser compatibility, customization options, a robust API, high performance, and markdown support.  In addition, Froala has paste from Excel or Word, autosave, real-time collaboration, and a page builder, as well as design blocks on the fly. These are things many other editors simply don’t offer.

Froala also has an easy-to-use page-templates feature that visualizes all of your content in order to provide you with better overviews (and faster workdays)!

Froala-Editor

Froala is a WYSIWYG rich-text editor for modern browsers, websites, web apps, and mobile apps. It is a top pick among development teams because of its unique, real-time collaborative editing features. Thanks to detailed documentation, powerful framework plugins, and many examples, Froala seamlessly integrates with most existing technological infrastructures. Finally, the rich-text editor—which initializes in 40 milliseconds—provides a great editing experience on any application. Such high-speed performance and seamless integration provide the necessary context for how Froala compares to other WYSIWYG editors when prioritizing rapid load times and developer-friendly workflows.

The Froala Editor is a revolutionary WYSIWYG editor that allows you to build powerful and responsive websites with visual ease. It supports third-party tools like CodeMirror, Embed.ly Integration, TUI Advanced Image Editor, and Codox Real-Time Editing. Froala has also been tried and tested for countless projects. These factors all make it one of the best WYSIWYG editors for designers and developers alike.

Pricing: Froala offers a free trial with limited features. Its paid plans start at US$ 719/year.

If you are looking for the best WYSIWYG HTML editor,  Froala is the ideal option, whatever your skill level .

Download a free trial and try it for yourself!

2. Adobe Dreamweaver CC

Adobe Creative Cloud (CC) interface, highlighting creative and design software.

The Adobe Dreamweaver CC code editor handles CSS, PHP, XHTML, JSP, JavaScript, and XML. Dreamweaver CC offers a fluid grid layout that allows you to preview and fix various screen compatibility issues. The software is compatible with both PC and Mac platforms.  With the powerful Live View feature, you can easily edit HTML, CSS, and JavaScript code sources.

The software also comes with other remarkable features. These include coding assistance via code hints and error checking, a live-view monitor so that you can see your changes as they happen, and a high-performance native code editor with support for CSS and JavaScript. Finally, you get direct access to the Adobe Exchange panel so that you can discover, try, buy, and share new Adobe software extensions.

Pricing: Adobe’s Dreamweaver CC is one of the apps in Adobe Creative Cloud, a suite of design and video editing software available to monthly or annual subscribers. We can get Dreamweaver as part of Adobe Creative Cloud for just US$22.99/mo. It includes a 7-day free trial, allowing users to explore its features before making a purchase.

3. Summernote

The Summernote editor interface, focusing on its user-friendly and feature-rich design.

Next up, Summernote is a simple WYSIWYG editor that loads with Bootstrap or jQuery. Once you configure it properly, your Summernote rich-text editor includes buttons for adding images, links, videos, and tables. You can also change font types, sizes, colors, and formatting.  In addition to all that, you can customize and extend this editor with plugins to provide extra functionality. This includes spell checkers, BBCode syntax highlighting, Google Analytics plugins, polls/voting forms, and more.

Summernote is an online rich-text editor that gives you precise control over how your text looks and behaves. Simply double click on a word or highlight it and click on any of the buttons that appear to modify your markups with tag-style attributes.

Pricing: Summernote is an open-source WYSIWYG editor licensed under the MIT License, making it free to use for both personal and commercial projects.

4. CoffeeCup HTML Editor

The Coffeecup HTML editor, emphasizing its web design and development capabilities.

CoffeeCup HTML Editor is a feature-rich editor for creating websites quickly. With this editor, you get intuitive tools that help you format your code. You also get specialized elements like code completion, which automatically suggests tags as you type. This ensures that your code is always clean and consistent.

The site-management tools in this HTML editor give you new ways to control the sites you build. For instance, you get components that allow you to save an element such as a header or footer and reuse it instantly across all pages on your site. This way, you only have to edit those elements once to update instantly across all pages.

Next, CoffeeCup HTML Editor features live editing options so you can see how your page changes as you work. Use the split-screen option to display the HTML code on one side and the live preview of your page on the other. You cab also use the external browser option to display your page in another window or on a second monitor for the ultimate viewing convenience. 

Pricing: The CoffeeCup HTML Editor is available for a one-time purchase of $29. Volume discounts are offered for multiple copies, with prices per copy decreasing as the quantity increases. Additionally, a free trial is available for users to explore the software’s features before making a purchase.

5. CKEditor 

The CKEditor interface, highlighting its text editing and content creation features.
CKEditor is a modern WYSIWYG rich-text editor with all the necessary features for a powerful publishing platform. It streamlines HTML editing and brings it on par with what users of desktop publishing applications have experienced for years.

CKEditor is a full-featured HTML text editor written in JavaScript. It focuses on web standards, performance, and usability. It’s an excellent starting point for almost anything you need. When it comes to your configuration options, the sky is the limit. This is due to a plugin-based architecture that brings powerful content-processing features to the web. The sheer breadth of these plugin-based customization options creates a significant technical divergence that we address in our Froala vs CKEditor comparison of feature depth and support.

Developers looking for an HTML editor shouldn’t overlook what CKEditor has to offer. The program is easy to learn, with a clean and simple interface, and it comes with an API for those who want expanded features.

Pricing: CKEditor offers a free plan with limited capabilities and paid plans start at US$ 144 per month when you pay annually. All plans include a 14-day free plan which provides access to all features and add-ons.

6. Editor.js

Editor.js, focusing on its block-style content editing interface.
Editor.js is an open-source editor that gives you the freedom to edit your content without being limited by the “canned” blocks of a typical WYSIWYG editor. It allows you to create blocks and then add them to other parts of your text or even other pages you’re designing. When you select a block in the editor, it shows you options for text formatting and inline styles.

Editor.js is a lightweight, user-configurable text editor. It is extensible and pluggable, thanks to its application programming interface (API). It also returns clean data in the JSON output format.

Pricing: Editor.js is a free, open-source block-style editor licensed under the MIT License, allowing unrestricted use in both personal and commercial projects.

7. TinyMCE

The TinyMCE editor interface, showcasing its rich text editing functionalities.
TinyMCE is tiny. But don’t let its size fool you. It’s powerful too. TinyMCE is the rich-text editor behind many products, including Evernote, Atlassian, and Medium. According to its developers, the goal of TinyMCE is to help other developers build beautiful web content solutions.

Easy to integrate, deploy, and customize, TinyMCE is the most popular open-source rich-text editor on the web. It has a thriving community of developers behind it. Millions of people use TinyMCE every day on websites and never even know it. The setup makes it possible to incorporate frameworks such as Angular, React, and Vue. This version of TinyMCE uses jQuery (1.9) underneath for modern browsers and IE8 support.

TinyMCE provides a friendly interface for users to easily create and edit content. With TinyMCE, you can simply drop it into your app for immediate use in your application. You can also customize the instance with plugins, scripts, and more. There are no complex configuration files—just load it up and start using the rich-text editor today.

Pricing: TinyMCE starts its paid plans at US$ 67 per month when we pay annually. It also provides a free plan with limited features.

8. Bubble

Displaying Bubble.io, a visual programming and web development platform.

With a robust point-and-click editor and visual design canvas, you can build and customize your web applications and workflows on Bubble—whether they’re simple prototypes, sophisticated SaaS products, or entire marketplaces.

Bubble is ideal for creating quickly without requiring a developer. It is also perfect for launching fully functional web applications in a fraction of the time it would take to build them from scratch.

Bubble’s simple user interface makes it possible for non-developers to build and customize an application, whether for a small business or a workgroup. The timeline view helps business owners keep track of important events. Finally, its drag-and-drop functionality allows you to easily customize processes so they meet your needs.

For those who want an easy-to-use, user-friendly application for creating and executing basic logic, Bubble is a good choice. With built-in integration to common services like Facebook, Google Analytics, and Stripe, it’s a great way to get started with workflow and logic.

Pricing: Bubble offers a free plan to learn how to use the tool. Its paid subscription plans start at US$ 29 per month when we pay annually.

9. Quill

The Quill.js editor interface, emphasizing its modern and sleek design.
 Quill is a free, open-source WYSIWYG editor that focuses on extensions and customization. Thanks to its modular architecture and expressive API, you can start with the Quill core. After that, you can customize its modules or add your own extensions as needed. Quill supports any custom content or format.  This means you can easily add embedded slide decks, interactive checklists, 3-D models, and more to your Quill-hosted pages.

Quill is a simple-to-use, browser-based WYSIWYG editor for creating rich content for documents, presentations, and other HTML output. Quill’s architecture supports extensibility like third-party JQuery-powered plugins, which can be declaratively added to the editor and configured through our API. With dozens of plugins available, you can also create custom content and formats for your project’s needs.

The Quill editor supports rich and interactive content, making it a great choice for individual projects or larger, enterprise deployments. Its friendly user interface provides the full power of the Drupal CMS platform while still being very easy to use.

Pricing: Quill is a free, open-source rich text editor licensed under the BSD 3-Clause License, allowing unrestricted use in both personal and commercial projects.

10. Setka Editor

The Setka Editor interface, highlighting its layout design and content management features.

Build beautiful, feature-rich layouts with this powerful WYSIWYG tool. Setka Editor makes adding text, images, embedded video, and more to your layout fast and easy.  Setka is channel-agnostic, so you can use the same design to power any platform, including mobile and tablet apps. Collaborate with remote teams using high-fidelity real-time editing and deep integration with Slack or other team chat tools.

The Setka Editor is a no-code WYSIWYG editor for content design, built for efficient implementation and change management. Modern websites are often designed and managed by remote teams with little formal design training. Managing these diverse skill levels requires a careful look at how different interfaces handle design complexity, as seen in our list of the top WYSIWYG editors to consider in 2026.

Pricing: Setka paid plans start at US$ 150 per month. Setka Editor does not offer a free plan. However, it provides a 14-day free trial to explore its features before committing to a paid subscription.

Wrap Up

We hope that our article sheds light on which are the best HTML editors for both beginner and advanced users looking to create exciting websites. While there isn’t a one-size-fits-all solution, some editors may be more suitable than others.

Depending on our specific needs, one HTML editor might be better than another. For example, if we are building a simple landing page, we may want something like Dreamweaver that is easy to use and enables quick changes

On the other hand, if we’re looking to build more complex pages with many widgets and elements, we may want something with more advanced functionality, like Froala.

When looking for an editor, make sure all of your features are accounted for, including usability and flexibility. And as always, test it out yourself — no one will be a better judge of its capabilities than you, the creator. If one satisfies all of your needs, then go ahead and download it today and get started!

So Many HTML Editors Out There!

HTML editing can be tricky without the right mix of features. With Froala, you can create amazing templates as you design your site and then edit each element as needed. It is also good to know that you can configure each element independently — a plus for quick work.

To find out which WYSIWYG editor is right for you, consider your target audience and the features that are most important for your project. After all, these WYSIWYG HTML editor options will ultimately streamline your entire workflow and improve efficiency in the content-creation process. Handing over text to clients or team members to edit will no longer be a painful chore!

This summary table will help you compare the HTML editors discussed in this article.

Tool Name Purpose Key Features Pricing
Froala WYSIWYG HTML Editor Track changes, browser compatibility, real-time collaboration, templates Free trial, Paid plans start at $719/year
Adobe Dreamweaver CC Code Editor for Web Design Live view, grid layouts, coding assistance, error checking 7-day free trial, $22.99/month (part of Adobe Creative Cloud)
Summernote Simple WYSIWYG Editor Image/video embeds, font customization, plugin support Free (MIT License)
CoffeeCup HTML Editor Feature-rich HTML Editor Code completion, live editing, reusable components Free trial, $29 (one-time purchase)
CKEditor Rich Text HTML Editor Plugin-based, API support, advanced content processing Free plan, Paid plans start at $144/month
Editor.js Block-style Editor Customizable blocks, JSON output, lightweight API Free (MIT License)
TinyMCE Rich Text Editor Customizable, plugin support, easy integration Free plan, Paid plans start at $67/month
Bubble Visual Web Development Tool Drag-and-drop, workflow management, SaaS building Free plan, Paid plans start at $29/month
Quill Modular WYSIWYG Editor Custom content, API extensions, modular architecture Free (BSD 3-Clause License)
Setka Editor Content Design WYSIWYG Editor Collaborative editing, real-time design, Slack integration 14-day free trial, Paid plans start at $150/month

 

Takeaway

Before you start creating a website for your SaaS product, make sure to choose the right HTML editor. WYSIWYG stands for “what you see is what you get,” which means that when your team member clicks “publish,” the changes they make display exactly as they intended.

WYSIWYG editors on the market today range from collaboration features to mini-CMS systems that clients and team members can edit. Regardless of the specific features you choose, what matters most is whether or not the WYSIWYG HTML editor makes your content development process easier and more collaborative. By handing over control to clients or other team members, you will free up time and energy to work on other priorities.

Froala Editor offers a great platform to create your own websites and publish them on the web. Whether you want an e-commerce website or blog, the ability to customize your designs right in the user interface is pretty awesome. It doesn’t matter if this is your first customization project or you’re an expert in HTML and CSS—Froala editor caters to both levels of users. The affordability of this platform makes it one of the most accessible design platforms online.

Enhancing a Lightweight WYSIWYG Editor with a File Uploader: A Developer’s Guide

icon

Creating user-friendly and efficient tools is essential. WYSIWYG (What You See Is What You Get) editors help users create and format content without needing to know HTML or CSS. Lightweight WYSIWYG editors are especially popular because they load quickly and are easy to integrate into projects. However, to make these editors even more powerful, adding a file uploader is a great idea. This guide will show you how to add a file uploader to a lightweight WYSIWYG editor using Froala and Filestack as examples.

What is a Lightweight WYSIWYG Editor?

A WYSIWYG editor allows users to see how their content will look while they are creating it. A lightweight editor means it has a small file size, loads quickly, and doesn’t use a lot of computer resources. These editors are perfect for projects where speed and efficiency are important.

Why Choose Lightweight Editors?

  • Faster Performance: They load quickly, making your website or application run smoother.
  • Easy to Integrate: Simple to add to your project without complicated setup.
  • Customizable: Easy to adjust to fit your specific needs.
  • Better User Experience: Provides a smooth and responsive interface for creating content.

Why Add a File Uploader?

Adding a file uploader to your WYSIWYG editor makes it easier for users to include images, videos, documents, and other media in their content. This not only makes the content more engaging but also improves the overall user experience.

Benefits of File Uploaders:

  • Richer Content: Users can add various types of media to their content.
  • User-Friendly: Features like drag-and-drop and multiple file uploads make it easy to use.
  • Developer Efficiency: Offloads the task of handling files to specialized services, saving time and effort.

Tools You’ll Need

Froala Editor

Froala is a modern, lightweight WYSIWYG editor known for its speed and flexibility. It offers many features while keeping its file size small, making it a great choice for developers.

Filestack

Filestack is a powerful service that helps you upload, transform, and deliver files easily. It supports many file types and offers features like resizing, cropping, and optimizing files. Filestack also ensures your files are delivered quickly and reliably through its global network.

Step-by-Step Tutorial: Integrating Filestack with Froala

Follow these simple steps to add a file uploader to your Froala editor using Filestack.

1. Set Up Your Development Environment

First, you need to include the necessary CSS and JavaScript files for both Froala and Filestack in your HTML file.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Froala & Filestack Integration</title>
  <!-- Load Froala Editor CSS files -->
  <link href='https://cdn.jsdelivr.net/npm/froala-editor@4.3/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
  
  <!-- Load Filestack Transformation UI CSS files -->
  <link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />
</head>
<body>
  <div id="editor">Type something...</div>

  <!-- Load Filestack JS -->
  <script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>       
  <script src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>
  
  <!-- Load Filestack Transformation UI JS -->
  <script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>
  
  <!-- Load Froala Editor JS files -->
  <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@4.3/js/froala_editor.pkgd.min.js'></script>
  
  <!-- Initialize Froala Editor with Filestack Integration -->
  <script>
    const filestackClient = filestack.init('YOUR_FILESTACK_API_KEY'); // Replace with your Filestack API key

    // Initialize the Froala Editor
    new FroalaEditor('#editor', {
      imageEditButtons: ['imageReplace', 'imageAlign', 'imageCaption', 'filestackIcon', 'imageTUI'],

      filestackOptions: {
        uploadToFilestackOnly: false,
        filestackAPI: 'YOUR_FILESTACK_API_KEY', // Replace with your Filestack API key
        pickerOptions: {
          fromSources: [
            'local_file_system',
            'imagesearch',
            'url',
            'googledrive',
            'facebook',
          ],
          accept: [
            ".pdf",
            "image/jpeg",
            "image/png",
            "image/webp",
            "video/*",
            "audio/*"
          ],
          transformations: {
            "crop": true,
            "rotate": true
          }
        },
      },
    });
  </script>
</body>
</html>

2. Initialize the Froala Editor

The HTML above sets up the Froala editor inside a div with the ID editor. The Froala Editor is initialized with options that allow it to work with Filestack for file uploads.

3. Configure Filestack Integration

In the JavaScript section, you need to initialize Filestack with your API key and configure Froala to use Filestack for handling file uploads.

const filestackClient = filestack.init('YOUR_FILESTACK_API_KEY'); // Replace with your Filestack API key

// Initialize the Froala Editor
new FroalaEditor('#editor', {
  imageEditButtons: ['imageReplace', 'imageAlign', 'imageCaption', 'filestackIcon', 'imageTUI'],

  filestackOptions: {
    uploadToFilestackOnly: false,
    filestackAPI: 'YOUR_FILESTACK_API_KEY', // Replace with your Filestack API key
    pickerOptions: {
      fromSources: [
        'local_file_system',
        'imagesearch',
        'url',
        'googledrive',
        'facebook',
      ],
      accept: [
        ".pdf",
        "image/jpeg",
        "image/png",
        "image/webp",
        "video/*",
        "audio/*"
      ],
      transformations: {
        "crop": true,
        "rotate": true
      }
    },
  },
});

Key Options Explained:

  • imageEditButtons: Adds Filestack-specific buttons to the image editing toolbar in Froala.
  • filestackOptions:
    • uploadToFilestackOnly: If set to true, only Filestack handles uploads. If false, other sources can also upload files.
    • filestackAPI: Your Filestack API key for authenticating upload requests.
    • pickerOptions:
      • fromSources: Lists the sources users can upload files from, like their local system or Google Drive.
      • accept: Specifies the types of files users can upload, such as PDFs and images.
      • transformations: Enables options like cropping and rotating images directly in the uploader.

4. Exploring Advanced Integration Modes

Froala offers different ways to integrate with Filestack, allowing you to choose how much control you want over the upload process.

Demo #1: Basic Mode

In Basic Mode, Filestack’s file picker and transformation tools are added to Froala’s existing upload options. This mode enhances Froala without changing its default upload behavior.

new FroalaEditor('#editor', {
  imageEditButtons: ['imageReplace', 'imageAlign', 'imageCaption', 'filestackIcon', 'imageTUI'],

  filestackOptions: {
    uploadToFilestackOnly: false,
    filestackAPI: 'YOUR_FILESTACK_API_KEY',
    pickerOptions: {
      fromSources: [
        'local_file_system',
        'imagesearch',
        'url',
        'googledrive',
        'facebook',
      ],
      accept: [
        ".pdf",
        "image/jpeg",
        "image/png",
        "image/webp",
        "video/*",
        "audio/*"
      ],
      transformations: {
        "crop": true,
        "rotate": true
      }
    },
  },
});

Demo #2: Advanced (Filestack-only) Mode

Advanced Mode uses Filestack exclusively for all file uploads in Froala. This gives you complete control over the upload process through Filestack.

new FroalaEditor('#editor', {

  filestackOptions: {
    uploadToFilestackOnly: true,
    filestackAPI: "YOUR_FILESTACK_API_KEY"
  },

  events: {
    'filestack.uploadedToFilestack': function (response) {
      console.log("File uploaded to Filestack:", response);
    },

    'filestack.filestackPickerOpened': function () {
      console.log("Filestack picker opened");
    },

    'filestack.filestackPickerClosed': function () {
      console.log("Filestack picker closed");
    },

    'filestack.uploadFailedToFilestack': function (error) {
      console.log("File upload failed:", error);
    },
  },

});

Key Points in Advanced Mode:

  • uploadToFilestackOnly: Set to true to ensure all uploads go through Filestack.
  • events: Customize how your application responds to different stages of the upload process, like when a file is uploaded or if an upload fails.

Demo #3: Enable Transformation UI after Image Uploads

Filestack’s Transformation UI allows users to edit images right after uploading. They can adjust brightness, contrast, size, and apply filters. To enable this feature, adjust the transformationsUI option.

 

new FroalaEditor('#editor', {
  filestackOptions: {
    uploadToFilestackOnly: true,
    filestackAPI: "YOUR_FILESTACK_API_KEY",
    pickerOptions: {
      transformationsUI: true,
    } 
  },
});

 

Benefits of Transformation UI:

  • Real-Time Editing: Users can edit images immediately after uploading.
  • Professional Enhancements: Apply filters and effects easily.
  • User-Friendly Interface: Simple controls make it easy for users to customize images.

5. Best Practices for Integration

To make sure your integration works smoothly and securely, follow these best practices:

Security Considerations:

  • File Validation: Check files on both the client side and server side to ensure only allowed types and sizes are uploaded.
  • Secure Connections: Use HTTPS to protect data during upload.
  • Access Control: Make sure only authorized users can upload and access files.

Performance Optimization:

  • Optimize Images: Compress and resize images before uploading to save bandwidth and improve load times.
  • Lazy Loading: Load images only when needed to speed up page loads.
  • Efficient Caching: Use Filestack’s CDN to deliver files quickly to users around the world.

User Experience Enhancements:

  • Progress Indicators: Show upload progress bars to keep users informed.
  • Error Handling: Provide clear messages if something goes wrong during upload.
  • Intuitive Interface: Make the upload process simple with features like drag-and-drop.

6. Testing and Debugging

Thorough testing ensures your integration works well for all users. Here’s how to test and fix common issues:

Testing Upload Functionality:

  • Different File Types: Try uploading various files like images, videos, and documents to ensure compatibility.
  • Multiple Files: Check that the editor can handle multiple uploads at once.
  • Edge Cases: Test with large files, slow internet connections, and unsupported file types to see how your system handles them.

Debugging Common Issues:

  • Network Errors: Make sure your application can handle network problems gracefully and allow users to retry uploads.
  • API Key Errors: Verify that your Filestack API key is correct and has the right permissions.
  • Compatibility Issues: Ensure the integration works on different browsers and devices, and fix any issues that arise.

Conclusion

Adding a file uploader to a lightweight WYSIWYG editor like Froala can greatly enhance its functionality. By integrating Filestack, you enable users to easily upload and manage files, making content creation more efficient and engaging. This guide provided a simple, step-by-step approach to setting up this integration, ensuring that your editor remains fast and user-friendly.

Next Steps:

  • Explore More Features: Look into additional options and settings in Froala and Filestack to further customize your editor.
  • Optimize for Your Needs: Adjust the integration to fit the specific requirements of your project, whether it’s a blog, a content management system, or a single-page application.
  • Stay Updated: Keep up with updates from Froala and Filestack to take advantage of new features and improvements.

By following these steps and best practices, you can create a robust and user-friendly content editing tool that meets the needs of modern web applications.

Elevate Your Froala File Uploads: Harnessing Filestack’s Robust Event System

enhance file uploading experience

Filestack doesn’t just offer a reliable file uploading solution – it empowers you to craft a truly exceptional user experience. By harnessing Filestack’s robust event system, you can take control of every step of the file upload process and delight your users like never before.

The Filestack events allow developers to handle different scenarios, such as when a file is selected, when the upload is in progress, or when the upload is completed.

By leveraging these events, developers can create a more seamless and user-friendly file uploading experience for your users. This can include providing feedback on the upload status, handling errors, and integrating the uploaded files into the application’s workflow. This is the power of Filestack’s events that you can leverage to enhance the file uploading experience within the Froala editor.

In a previous article, we explored the foundational events like onOpen, onFileSelected, and onCancel. Now, let’s dive deeper and uncover how the onFileUploadCancel, onFileUploadFailed, onFileUploadFinished, and other Filestack events can help you elevate your file uploading experience to new heights.

Events for enhancing file uploading experience

Key Takeaways

  • Filestack’s robust event system allows developers to handle different scenarios in the file upload process, such as file selection, upload progress, upload completion, and errors.
  • By leveraging events like onFileUploadCancel, onFileUploadFailed, onFileUploadFinished, and others, developers can create a more seamless, transparent, and user-friendly file management workflow within their Froala-powered applications.
  • Implementing these Filestack events allows developers to provide visual feedback, handle errors gracefully, and integrate the uploaded files into their application’s functionality, resulting in a more polished and delightful experience for users.
  • Integrating Filestack into Froala-based applications unlocks the full potential of file management, allowing developers to enhance their users’ trust and confidence in their application’s file handling capabilities.

Improving the File Upload Cancellation Experience

The onFileUploadCancel event lets you handle when a user cancels a file upload. By listening to this event, you can:

  • Provide visual feedback to the user
  • Update the application’s state
  • Ensure a smooth experience even when a file upload is interrupted

This event gives you control to gracefully handle cancellations and maintain the coherence of your application’s file management workflow.

The onFileUploadCancel event receives an object containing the cancelled file’s metadata. You can use this information to update your UI and application state accordingly.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileUploadCancel: (file) => {
                console.log(file.size);
            }
        }
    }
});

By handling the onFileUploadCancel event, you can create a more responsive and transparent file uploading experience for your users.

Improving the File Upload Start Experience

The onUploadStarted and onFileUploadStarted events let you know when a file upload has begun. By handling these events, you can keep users informed about the status of their uploads, which builds trust and confidence in your application’s file management capabilities.

The onUploadStarted event fires when the user clicks the upload button. It provides an array of file metadata objects. The onFileUploadStarted event fires when a file begins uploading. It provides the metadata for the file being uploaded.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
           onUploadStarted: (files) => {
              console.log(files[0].size);
            },
           onFileUploadStarted: (file) => {
            console.log(file.size);
          },
        }
    }
});

Improving the File Upload Progress Experience

The onFileUploadProgress event allows you to track the multi-part upload progress of local files. This enables you to provide users with a visual representation of the upload status, such as progress bars or spinners. By leveraging this event, you can create a more responsive and transparent file uploading experience, building trust and confidence in your application.

The onFileUploadProgress event fires repeatedly during the file upload process. It provides the file metadata and an FSProgressEvent object containing information about the upload progress.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileUploadProgress: (file, ProgressEvent) => {
                console.log(file.size);
                console.log(ProgressEvent);
            }
        }
    }
});

By handling the onFileUploadProgress event, you can create a more engaging and informative file uploading experience for your users.

Improving the File Upload Failed Experience

The onFileUploadFailed event lets you handle failed file uploads. This allows you to provide users with meaningful feedback and guidance. When this event fires, you can:

  • Display error messages to inform users about the issue
  • Suggest troubleshooting steps to help users resolve the problem
  • Automatically retry the upload to recover from the failure

By handling the onFileUploadFailed event, you can significantly improve the overall user experience. This makes your application more resilient and user-friendly. It ensures users are never left in the dark when encountering upload issues, fostering trust and confidence in your application’s file management capabilities.

The onFileUploadFailed event provides the file metadata and an error object. You can use this information to give users the necessary feedback and guidance.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileUploadFailed: (file, error) => {
                console.log(file.size);
                console.log(error);
            }
        }
    }
});

By handling the onFileUploadFailed event, you can create a more robust and user-friendly file uploading experience.

Improving the Successful Uploads Experience

The onFileUploadFinished event lets you handle successful file uploads. When this event fires, you can:

  • Update your application’s state to reflect the new file
  • Integrate the uploaded file into your workflow
  • Provide visual feedback to the user, such as a success message

This event allows you to seamlessly incorporate the uploaded files into your application. This creates a cohesive and efficient file management experience for your users. By handling onFileUploadFinished, you can ensure your application responds effectively to successful file uploads, enhancing the overall user experience.

The onFileUploadFinished event provides the uploaded file’s metadata, which you can use to update your application accordingly.

Explain
new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileUploadFinished: (file) => {
                console.log(file.size);
            }
        }
    }
});

You can create a more polished and user-friendly file uploading experience by leveraging the event.

Improving the Upload End Experience

The onUploadDone event allows you to handle the completion of a file upload, whether successful or not. This event gives you the opportunity to perform cleanup, update your application’s state, or trigger additional actions based on the upload outcome. By using this event, you can ensure a seamless and comprehensive file management experience, allowing users to confidently interact with your application’s file handling.

The onUploadDone event receives an object containing two arrays: filesFailed and filesUploaded. The filesFailed array contains metadata for failed uploads, while the filesUploaded array contains metadata for successful uploads. You can use this information to take appropriate actions, such as displaying error messages for failed uploads or integrating the successful uploads into your application.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
          onUploadDone: (files) => {
             console.log(files.filesUploaded[0].size);
          },
        }
    }
});

How Filestack Integration in Froala Editor Works?

The Filestack integration in Froala Editor provides a straightforward way to enable powerful file management and upload capabilities. This integration was introduced in Froala V4.3, making it easy for developers to leverage Filestack’s features.

To get started, you’ll need a free Filestack API key. Once you have that, you can follow the steps outlined in the Filestack integration guide for Froala. This guide will walk you through the necessary setup and configuration to integrate Filestack within your Froala-powered application.

With the Filestack plugin, Froala developers can unlock a wide range of file management features, including:

  • Seamless file uploads
  • Robust file processing capabilities
  • Advanced file transformation options
  • Secure file storage and delivery

By integrating Filestack, Froala developers can enhance the file handling experience for their users, creating a more polished and feature-rich application.

Conclusion

In this article, we demonstrate how Filestack’s robust event system can help Froala developers elevate the file uploading experience for their users. By leveraging events like onFileUploadCancel, onFileUploadFailed, onFileUploadFinished, and others, you can create a more seamless, transparent, and user-friendly file management workflow within your Froala-powered applications.

Implementing these Filestack events allows you to provide visual feedback, handle errors gracefully, and integrate the uploaded files into your application’s functionality. This results in a more polished and delightful experience for your users, building their trust and confidence in your application’s file handling capabilities.

If you’re a Froala developer looking to enhance your file uploading experience, we encourage you to explore the power of Filestack’s events. Integrate Filestack into your Froala-based applications and unlock the full potential of file management for your users. Get started with Filestack today and take your Froala-powered experiences to new heights!

Customizing Filestack File Picker: the New Froala File Uploading Option – Part 2

file uploading

Imagine a JavaScript tool – where it can effortlessly handle upload, store, and process your files with a few lines of code. That’s the power of Filestack, a file management tool that has processed over 1 billion files and counting.

Filestack now has official integration with Froala, offering many customization options that allow developers to create a truly seamless and intuitive file uploading process within the Froala editor tailored for your users.

We explored some of the Filestack File Picker customization options available to developers before. In this second part of the series, we will explore additional customization options related to events, uncovering how you can customize the file uploading experience from start to finish – from the moment the user opens the picker to handle the successful (or failed) upload.

Let’s delve into these customization features that help you create a smooth and intuitive file management workflow within your Froala-powered applications, significantly improving user experience.

Key Takeaways:

  1. Filestack provides a range of customization options and events that allow developers to create a highly responsive and tailored file picker experience within Froala-powered applications.
  2. The onOpen event can be used to enhance the user experience when the File Picker UI mounts, such as displaying a custom loading indicator or updating the UI.
  3. The onFileSelected event enables developers to validate selected files, reject files that don’t meet certain criteria, and even modify the file name if needed.
  4. The onFileCropped event provides metadata about the cropped image, allowing developers to perform additional processing before inserting it into the Froala editor.
  5. The onCancel event can be used to customize the user experience when file uploads are cancelled, ensuring the application remains responsive and user-friendly.
  6. The onClose event triggers when the File Picker UI is exited, providing an opportunity to perform any necessary cleanup or additional actions.

Enhance File Uploading experience

Customize the File Picker Opening Experience

Filestack’s onOpen event triggers when the File Picker UI mounts. You can use this event to enhance the user experience. For example, you can display a custom loading indicator or update the UI to provide feedback.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onOpen: filepicker => {
                console.log(filepicker);
            }
        }
    }
});

The onOpen callback receives the PickerInstance interface, which provides the following methods:

  • cancel() Cancels any ongoing uploads. This operation is idempotent and returns a Promise.
    new FroalaEditor("div#froala-editor", {
        filestackOptions: {
            filestackAPI: 'yourAPIKey',
            pickerOptions: {
                onOpen: PickerInstance => {
                    //Cancel picker uploads. 
                    PickerInstance.cancel();
                }
            }
        }
    });
    
  • close() Closes the File Picker. This operation is idempotent and returns a Promise.
    new FroalaEditor("div#froala-editor", {
        filestackOptions: {
            filestackAPI: 'yourAPIKey',
            pickerOptions: {
                onOpen: PickerInstance => {
                    //Close the File Picker.
                    PickerInstance.close();
                }
            }
        }
    });
    
  • open() Opens the File Picker. This operation is idempotent.
  • crop(urls) Specifies a list of file URLs to open in the Picker for cropping.
    new FroalaEditor("div#froala-editor", {
    filestackOptions: {
            filestackAPI: 'yourAPIKey',
            pickerOptions: {
                onOpen: PickerInstance => {
                    const urls = [
                        'https://d1wtqaffaaj63z.cloudfront.net/images/fox_in_forest1.jpg',
                        'https://d1wtqaffaaj63z.cloudfront.net/images/sail.jpg',
                    ];
                    PickerInstance.crop(urls);
                }
            }
        }
    });
    

Leverage the onOpen event and the PickerInstance methods to create a more engaging user experience.

Handling User Selected Files

The onFileSelected event in Filestack triggers whenever a user selects a file. You can use this event to validate the selected file and, if necessary, reject the selection by throwing an error. The error message will be displayed to the user as an alert.

For example, you can reject files that exceed a certain size limit:

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileSelected: file => {
                if (file.size > 1000 * 1000) {
                    throw new Error('File too big, select something smaller than 1MB');
                }
            }
        }
    }
});

Developers can use this event to change the selected file name if it’s uploaded from the local source.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileSelected: file => {
                // It's important to return a new file by the end of this function.
                return { ...file, name: 'foo' };
            }
        }
    }
});

The onFileSelected event also supports asynchronous validation logic. You can return a Promise from the callback function and then resolve or reject the Promise as needed:

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileSelected: file => {
                return new Promise((resolve, reject) => {
                    // Do something async
                    resolve();
                    // Or reject the selection with reject()
                  });
            }
        }
    }
});

By leveraging the onFileSelected event, you can create a more robust and user-friendly file selection experience within your Froala-powered applications.

Handling Cropped Files

When a user uploads an image using the File Picker, Filestack displays a simple image editor. This editor allows the user to crop, circle crop, and rotate the image.

Filestack triggers the onFileCropped event when the user crops the image. This event provides an object with the file metadata, such as the file size. You can use this metadata to perform additional processing on the cropped image before inserting it into the Froala editor.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onFileCropped : (file) => {
                console.log(file.size);
            }
        }
    }
});

The onFileCropped event provides the necessary information to handle the cropped image, allowing you to integrate the cropping functionality seamlessly into your application’s workflow.

Customize User Experience When Files Get Cancelled

Filestack triggers the onCancel event when all uploads in the File Picker are cancelled. This event receives an object containing the file’s metadata.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onCancel: PickerUploadDoneCallback => {
                console.log(PickerUploadDoneCallback);
            }
        }
    }
});

Handling the onCancel event gives you the flexibility to customize the user experience when the file upload is interrupted, ensuring your application remains responsive and user-friendly. By providing feedback and handling the cancellation scenario, you can create a more engaging and intuitive file management workflow within your Froala-powered applications. This helps to enhance the overall user experience and ensure your users feel in control of the file upload process, even when they choose to cancel it.

Customize the File Picker Closing Experience

Filestack triggers the onClose event when the File Picker UI is exited.

new FroalaEditor("div#froala-editor", {
    filestackOptions: {
        filestackAPI: 'yourAPIKey',
        pickerOptions: {
            onClose: () => {
                console.log('File Picker closed');
            }
        }
    }
});

Looking For Other Events?

Beyond the events mentioned, Filestack provides a range of other events such as onFileUploadCancel, onFileUploadFailed, onFileUploadFinished, onFileUploadProgress, onFileUploadStarted, onUploadDone, and onUploadStarted that you can leverage to customize the file uploading experience. Refer to the Filestack documentation for a comprehensive list of available options and their usage.

Conclusion

Filestack File Picker is a powerful tool for handling file uploads. Users appreciate its ease of use, support for various upload sources, dependability, and straightforward cloud storage integration. Filestack offers many customization options and events that allow developers to create a highly responsive and tailored file picker experience.

From validating file selections to handling cropped images and managing the overall file upload workflow, these events empower you to customize the user experience to your specific needs. Explore the full range of Filestack events and integrate them seamlessly into your application’s logic. This ensures a smooth and intuitive file management process for your users.

If you’re looking to enhance the file-uploading experience in your Froala-powered applications, try the Filestack integration today. Its robust set of customization features will help you create a seamless and user-friendly file management workflow.

 

Get your Filestack API here for free.

Froala 4.3.1: Improved Pasting and Enhanced Content Creation

Froala Release

We’re thrilled to announce Froala Editor 4.3.1 with impressive improvements to the content pasting process, enhancements to the lists plugin, and fixes for reported customer issues.

At Froala, we’re committed to delivering the best possible user experience. That’s why we maintain an ongoing feedback loop with our users, ensuring that we’re addressing your top-requested features and pain points. With this release, we’ve laser-focused on bringing those highly anticipated improvements to life.

So, what can you expect from Froala Editor 4.3.1? Read on to discover the fantastic improvements that will elevate your content creation workflow!

content pasting

Improved Content Pasting Process

Maintaining the format of pasted text has always been a challenge for users, often leading to frustration and extra work. Many editors struggle to perform this function correctly, resulting in inconsistent and messy formatting.

Imagine pasting a complex table or a styled document into your editor, only to find the layout entirely off. You have to spend valuable time fixing it, which can be incredibly annoying and disrupt your workflow.

In the latest improvements in Froala Editor, we enhanced pasting capabilities, particularly from Microsoft Word, to ensure that the original formatting of your content is preserved seamlessly, saving you time and effort.

Froala Editor has been improved to enhance pasting capabilities, ensuring that the original formatting of your content is preserved seamlessly, saving you time and effort. Pasting from Microsoft Word, a popular text editor known for pasting issues, has been particularly problematic in the past, often resulting in lost or altered formatting and requiring manual adjustments. With the latest updates, pasting from Word is now smoother and more accurate.

Your end-users can look forward to a more seamless experience that eliminates the hassle of reformatting. With these updates, they’ll be empowered to concentrate on what truly matters: creating outstanding content that resonates

Key improvements in this release for content pasting include:

  • Preserve the font size for text pasted from Microsoft Word by prioritizing CSS font-family styles over embedded Rich Text Format (RTF) styles.
  • Maintaining list numbering order and style, even with extra white spaces.
  • Preventing the insertion of inappropriate list items when copying and pasting part of a list item.
  • Ensuring the Word Paste feature functions correctly across Android Chrome versions.
  • Preserving table formatting when pasting from Word365.
  • Maintaining nested table column widths without parent table overflow.
  • Avoiding content duplication when multiple editor instances exist on the same page.

Enhancements to The Lists Plugin

Froala Editor allows users to create and manage various types of lists within their content using the Lists plugin. This plugin supports not only basic lists like numbered (ordered) and bulleted (unordered) lists but also advanced list types such as lower Greek and upper Roman numerals.

In this release, Froala enhanced list indenting and outdenting capabilities. We have updated the code in order to account for selections spanning multiple list levels. Additionally, the editor now considers the text-indent CSS property, disabling the outdent button if the next outdent would push the text outside the editor’s boundaries.

But that’s not all! Froala has also ensured that the editor preserves the first item’s list type when indenting the list further. This means the intended list structure is always maintained, keeping your content organized and consistent.

Much More…

We have addressed various issues reported by our users to enhance the overall performance and stability of Froala Editor. These include:

  • Resolved the incorrect word replacement issue caused by the Microsoft Edge autocorrect feature.
  • Resolved the issue where inserting a table on an Android device would result in one of the table cells being automatically focused.
  • Resolved the issue where the href attribute values were being truncated when the editor was loaded with pre-existing HTML content.

These enhancements demonstrate Froala’s commitment to continuously improving the editor’s functionality and addressing user feedback to provide a superior content creation experience.

Please find the complete changelog list here.

How Can I Update?

Don’t miss out on the benefits of the latest Froala 4.3 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.3.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.3.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check Get Started page for other options for using Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement and meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

Get your Filestack API here for free.

Customizing Filestack File Picker: the New Froala File Uploading Option – Part 1

customization

Froala, a popular rich text editor, just got even better with its latest update. Froala V4.3+ now supports the Filestack File Picker as a new option for uploading images, videos, and files.

The Filestack File Picker offers a user-friendly interface that improves the uploading file experience. By integrating Filestack, Froala users can now leverage its robust file management capabilities to simplify the entire upload process, delivering a much smoother experience for their users.

One of the advantages of Filestack File Picker is its many customization options, such as restricting file types and setting upload size limits. In this article, we’ll dive into some of the customization options available to Froala users when integrating the Filestack File Picker.

By leveraging these powerful features, you can create a truly seamless and intuitive file management workflow within your Froala-powered applications, taking the user experience to new heights.

How Can I Customize The File Picker Within the Froala Editor?

To start using Filestack File Picker for file uploading within the Froala editor, you have to include its scripts and stylesheet files within your project and configure the filestackOptions.filestackAPI option with a valid API key which you can get from Filestack DevPortal for free.

Here’s an example of what your HTML code might look like:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" 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" />
              <link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />

    </head>
    <body>
        <div id="froala-editor"> </div>
        <script type="text/javascript"
            src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
         <script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>
  <script src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>
  <script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>
        
        <script>
                new FroalaEditor("div#froala-editor",{
                  filestackOptions{
                    filestackAPI: 'yourAPIKey',
                  }
                });
        </script>
        </body>
</html>

To customize the File Picker, you can add your custom configuration to the filestackOptions.pickerOptions option. In this case, the Froala initialization code would be similar to:

  new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        transformationsUI: true
      }
    }
  });

Customization Options

Restrict File Types

You can restrict the file types that users can upload by setting the accept option within the  filestackOptions.pickerOptions configuration. For example, to only allow image files, you can use accept: 'image/*'. You can also specify multiple file types by providing an array, such as accept: ['image/*', 'video/*', 'application/pdf']. This ensures that users can only upload the file types that are relevant to your application, enhancing the overall user experience. The formats that you can assign through this option are:

  • .pdf <- accept PDF files.
  • image/jpeg <- any MIME type commonly known by browsers
  • image/* <- accept all types of images
  • video/* <- accept all types of video files
  • audio/* <- accept all types of audio files
  • application/* <- accept all types of application files
  • text/* <- accept all types of text files
  new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        accept: ['image/*', 'video/*']
      }
    }
  });

If you need to restrict other file types, you can use the acceptFn option which allows you to provide a custom function to determine which files are accepted. This gives you full control over the file type validation process.

The acceptFn has two parameters:

  • PickerFileMetadata
  • PickerAcceptFnOptions

And you have to return the Promise<string> .

  new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        acceptFn: (file, options) => {
           return options.mimeFromMagicBytes(file.originalFile).then((res) => { // we can check mimetype from magic bytes
             //console.log(options.mimeFromExtension(file.originalFile.name)); // or check extension from filestack extensions database
             // throw new Error('Cannot accept that file') // we can throw exception to block file upload
             // return Promise.reject('Cannot accept that file'') // or reject a promise
             return Promise.resolve();
           });
        }
      }
    }
  });

By leveraging the acceptFn, Froala users can ensure that only the appropriate files are uploaded, maintaining the integrity and consistency of the content within their Froala-powered applications. This level of customization empowers them to tailor the file upload experience to their specific needs, enhancing the overall user experience.

Restrict File Size

You can also set upload size limits using the maxSize option within the filestackOptions.pickerOptions configuration. This allows you to restrict the maximum file size that users can upload, helping to manage storage and bandwidth constraints. For example, to set a 10MB limit, you can use maxSize: 10 * 1024 * 1024. This ensures that users cannot upload files that exceed your specified size limit, improving the overall file management process.

  new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        maxSize: 10 * 1024 * 1024
      }
    }
  });

By setting appropriate size limits, you can ensure that the file upload process aligns with your application’s requirements and provides a seamless user experience.

Restrict Allowed Image Dimensions

You can also set accepted image dimensions using the imageDim option within the filestackOptions.pickerOptions configuration. This allows you to specify the exact width and height for uploaded JPEG, PNG, and BMP images, ensuring that they meet your application’s requirements.

Local and cropped images will be resized (upscaled or downscaled) to the specified dimensions before uploading. The original height to width ratio is maintained. To resize all images based on the width, set [width, null], e.g. [800, null]. For the height set [null, height], e.g. [null, 600].

  new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        imageDim: [800, 600]
      }
    }
  });

This helps maintain visual consistency and quality within your Froala-powered content.

Instead, if you prefer to give your users some freedom, you can use imageMax and imageMin options where imageMax allows you to set the maximum allowed dimensions. Images bigger than the specified dimensions will be resized to the maximum size while maintaining the original aspect ratio.

imageMin allows you to set the minimum allowed image dimensions. Images smaller than the specified size will be upscaled to the minimum size while maintaining the original aspect ratio.

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        imageMax: [1800, 1600],
        imageMin: [800, 600],

      }
    }
  });

This gives users more flexibility while still ensuring the images meet your application’s requirements. By leveraging these options, you can strike a balance between maintaining visual consistency and providing users with a more open file upload experience.

Restrict Upload Number

You can also restrict the number of files that users can upload at once by setting the maxFiles option within the filestackOptions.pickerOptions configuration. This helps you manage the upload process and ensure that users don’t overwhelm your application with too many files at once. For example, to limit the number of files to 5, you can use maxFiles: 5.

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         maxFiles: 5,
         
      }
    }
  });

Additionally, you can set the minimum number of files that users must upload at once by setting the minFiles option within the filestackOptions.pickerOptions configuration. This can be useful if your application requires a certain number of files to be uploaded together, such as multiple images for a product listing. For example, to require at least 3 files to be uploaded, you can use minFiles: 3.

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         maxFiles: 5,
         minFiles: 3
      }
    }
  });

By setting both maxFiles and minFiles, you can strike a balance between providing flexibility and maintaining control over the file upload process, ensuring that your Froala-powered application meets your specific requirements.

By default, the upload process didn’t start until the user hit the “Upload“ button. If you want to start uploading automatically when maxFiles is hit, set the startUploadingWhenMaxFilesReached option to true.

Restrict Concurrency Upload Number

You can also restrict the number of concurrent file uploads by customizing the concurrency option within the filestackOptions.pickerOptions configuration, which is by default set to 4. This allows you to control the maximum number of files that can be uploaded simultaneously, preventing your application from being overwhelmed and ensuring a smooth upload experience. By setting an appropriate value for concurrency, you can balance the need for efficient file uploads with the available resources and bandwidth of your application.

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         concurrency: 2,
      }
    }
  });

 

Restrict Video Resolution

You can also restrict the video resolution of uploaded files using the videoResolution option within the filestackOptions.pickerOptions configuration. This allows you to specify the maximum width and height for video files to one of these values “320×240”, “640×480” or “1280×720”, ensuring that they meet your application’s requirements. By default, it is "640x480". By setting appropriate limits, you can optimize storage, bandwidth, and playback performance, while maintaining the desired visual quality for your Froala-powered content.

 

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         videoResolution: "1280x720",
      }
    }
  });

 

Customize Upload Sources

You can also specify the upload sources that users can choose from by setting the fromSources option within the filestackOptions.pickerOptions configuration. This allows you to restrict the file selection to specific sources, such as local device storage, cloud storage providers, or social media platforms. For example, to only allow users to upload files from their local device and Google Drive, you can use fromSources: ['local_file_system', 'google_drive']. This helps streamline the file upload process and ensures that users can only access the file sources that are relevant to your application. Valid ones are:

  • local_file_system – Default
  • url – Default
  • imagesearch – Default
  • facebook – Default
  • instagram – Default
  • googledrive – Default
  • dropbox – Default
  • webcam – Uses device menu on mobile. Not currently supported in Safari and IE.
  • video – Uses device menu on mobile. Not currently supported in Safari and IE.
  • audio – Uses device menu on mobile. Not currently supported in Safari and IE.
  • box
  • github
  • gmail
  • googlephotos
  • onedrive
  • onedriveforbusiness
  • customsource – Configure this in your Filestack Dev Portal.
  • unsplash

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         fromSources: ['local_file_system', 'google_drive'],
      }
    }
  });

Cleaning JPEG Image EXIF

You can also configure Filestack to automatically remove EXIF data from JPEG images during the upload process. This can be useful for reducing the file size and ensuring that sensitive metadata, such as location information, is not inadvertently included in the uploaded images. To enable this feature, you can set the cleanupImageExif option within the filestackOptions.pickerOptions configuration to true.

 

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         cleanupImageExif: true,
      }
    }
  });

 

This option also offers the ability to keep image orientation by assigning it to an object and setting a keepOrientation property to true. Moreover, you can keep image color profiles by setting keepICCandAPP property to true.

 new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
         cleanupImageExif: {
           keepOrientation: true,
           keepICCandAPP: false
         },
      }
    }
  });

By doing so, you can streamline the file upload process and maintain better control over the data being stored in your Froala-powered application.

Enable Transformation UI

You can also enable the Transformation UI to allow users to perform advanced image editing, including filters and overlay text, alongside basic operations like cropping and rotating, directly in the file picker. To enable this feature, you can set the transformationsUI option within the filestackOptions.pickerOptions configuration to true.

This provides users with a more robust file editing experience, allowing them to customize their uploads before they are sent to your application.

  new FroalaEditor("div#froala-editor",{
    filestackOptions{
      filestackAPI: 'yourAPIKey',
      pickerOptions: {
        transformationsUI: true
      }
    }
  });

Conclusion

In this article, we’ve explored the powerful customization options available when integrating the Filestack File Picker into your Froala-powered applications. By leveraging features like file type restrictions, upload size limits, image dimension controls, and more, you can create a truly seamless and intuitive file management workflow for your users.

These customization capabilities empower Froala users to tailor the file upload experience to their specific needs, ensuring the integrity and consistency of the content within their applications. As we continue to explore the Filestack integration in future articles, we’ll cover File Picker events and the user interface customization options.

To get started, sign up for a free Filestack account today and start enhancing your Froala-powered applications with a truly customized file upload experience. With Filestack’s robust file management capabilities and Froala’s industry-leading rich text editing features, you can take your content creation and management to new heights.

Get your Filestack API here for free.

Explore The Transformation Options within The Froala New File Uploading Tool

Image transformation UI

Tired of the same old image editing options in your content editor? Get ready to unlock a new world of creative possibilities with Froala’s latest file-uploading feature!

Froala integrated Filestack to bring you a powerful, user-friendly file uploader that goes way beyond basic image cropping and resizing. With the Filestack integration, you can now transform your uploaded images in ways you never thought possible – right from within the Froala editor.

Imagine being able to apply eye-catching filters, adjust the brightness and contrast, or even swap out the background of your images, all with just a few clicks. Sounds intriguing? In this post, we’ll dive into the various image transformation options available through the Filestack TUI and show you how to unleash your creative side while building content for your Froala-powered website or app.

By the end, you’ll be equipped with the knowledge to take your visual content to the next level and leave your readers thoroughly impressed. So, what are you waiting for? Let’s get started!

Getting Started with the Transformation UI

To use the Transformation UI within the Froala editor, you’ll need to follow a few simple steps:

  1. Get a Filestack API Key: Filestack is the service that powers the Transformation UI. Get a free Filestack API key now.
  2. Include the Required Scripts and Stylesheets: In your HTML file, you’ll need to include the Filestack JavaScript library, the Transformation UI scripts, and the Transformation UI stylesheet. This will give you access to all the powerful image editing tools.
  3. Configure the Froala Editor: When you initialize the Froala editor, you’ll need to provide your Filestack API key in the filestackOptions.filestackAPI setting.

Here’s an example of what your HTML code might look like:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" 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" />
              <link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />

    </head>
    <body>
        <div id="froala-editor"> </div>
        <script type="text/javascript"
            src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
         <script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>
  <script src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>
  <script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>
        
        <script>
                new FroalaEditor("div#froala-editor",{
                  filestackOptions{
                    filestackAPI: 'yourAPIKey',
                  }
                });
        </script>
        </body>
</html>

With this setup, an “Image Transformation” button will appear when you click on an image uploaded using Filestack. Clicking this button will open the Transformation UI, allowing you to edit the image in various ways before inserting it into the Froala editor.

Transformation button

If you want the Transformation UI to be available immediately after uploading an image using the “Filestack Upload” button, you can enable the transformationsUI option within the filestackOptions.pickerOptions setting.

        <script>
                new FroalaEditor("div#froala-editor",{
                  filestackOptions{
                    filestackAPI: 'yourAPIKey',
                    pickerOptions: {
                      transformationsUI: true,
                    }
                  }
                });
        </script>

Now when you click “Upload with Filestack”, you can select an image to upload. Once the image is uploaded, a thumbnail will appear, and an “Edit” button will appear on the right. Clicking the “Edit” button will open the transformation UI, allowing you to edit the image before inserting it into the editor.

Filestack upload

If you are using a front-end framework, check the following guide:

Explore Transformation UI: A Powerful Image Editing Tool

The Transformation UI is an intuitive image editing tool that appears when you click on an image uploaded using Filestack. This tool allows you to make various changes and enhancements to your images right within the Froala editor.

When you open the Transformation UI, you’ll see the image displayed in the center of the editor. At the top, you’ll find a few helpful controls:

  • Undo Button: On the left, you’ll see an “Undo” button that allows you to revert any changes you’ve made to the image.
  • Zoom Options: In the center, you’ll find zoom controls that let you adjust the size of the image within the editor.
  • Cancel and Save Buttons: On the left, you’ll see a “Cancel” button to close the editor without saving any changes, and a “Save” button to apply your edits and insert the updated image into the Froala editor.

At the bottom of the Transformation UI, you’ll find a variety of transformation options, including filters, adjustments, and overlays. Simply click on the option you want to apply it to the image. The changes will be shown in real time, so you can preview the results before finalizing your edits.

Transformation User Interface

This powerful image editing tool empowers your users to create visually stunning content with ease. By allowing them to enhance and transform their images right within the Froala editor, you’re giving them the ability to elevate the visual appeal of their content and captivate their audience.

Available Transformation Options

The Transformation UI within the Froala editor provides a range of powerful tools to enhance your images. Let’s dive into the key features:

Crop

The Crop tool allows you to select a specific area of the image and remove the unwanted parts. This is useful for focusing the viewer’s attention on the most important part of the image. You can adjust the crop box by dragging the corners or edges, and the image will update in real-time. Once you’re satisfied with the crop, simply click the “Save” button to apply the changes.

Image Crop

Froala offers several pre-defined crop options:

  • Portrait (16:9): This is ideal for social media posts, as it ensures images fit seamlessly on platforms like Instagram or Facebook.
  • Square: A square-shaped crop that you can resize and position as needed.
  • Circle: A circular crop that always maintains a perfect circle shape as you resize and position it.
  • Custom: A rectangular crop that you can freely resize and position to suit your needs.

Image crop

Resize

Resizing images is important for optimizing file size, fitting specific layouts, and ensuring consistent quality across devices. The Resize tool in the Transformation UI allows you to easily adjust the width and height of the image, while maintaining the original aspect ratio or changing it as needed. This gives you precise control over the final image size, helping you create a cohesive and visually appealing layout within the Froala editor.

Image resize

Flip and Rotate

Users often need to flip or rotate images to correct the orientation or achieve a specific visual effect. The Transformation UI provides four options for this:

  • Flip horizontally
  • Flip vertically
  • Rotate 90 degrees clockwise
  • Rotate 90 degrees counter-clockwise

Image flip and rotate

These tools empower users to optimize their images and ensure they are displayed correctly within the Froala editor.

Filters

The Transformation UI offers a variety of filters that can be applied to your images to alter their visual appeal. These filters range from subtle adjustments to dramatic effects, giving you the flexibility to find the perfect look for your content. You can experiment with different filters, adjust their intensity, and preview the changes in real time before saving the final image.

 

Enhance Presets

This feature smartly analyzes a photo and performs color correction and other enhancements to improve the overall quality of the image. You can choose from multiple presets to achieve the best results. Currently, it is available only when you open the Transformation UI from the File Picker. Here are the presets available with their purpose:

Preset Description
auto Automatically selects the best enhancement settings for a photo.
vivid Enhances depth and brightness in a photo.
beautify Ideal for portraits, this preset scans each face in the photo and adjusts corrections individually for optimal results.
beautify_plus Similar to Beautify, it applies stronger corrections with a broader range of modifications.
fix_dark It is perfect for underexposed photos or dark subjects against bright backgrounds. Turning off contrast maximizes detail in shadow areas without blowing out highlights.
fix_noise Detects and removes noise from photos while preserving details. Adjusts based on the ISO level and camera model.
fix_tint Removes abnormal tints (yellow, blue, green, etc.) caused by various lighting conditions, such as fluorescent, infrared, ultraviolet, and tungsten lights.
outdoor Enhances landscape photos by increasing color vibrancy and adjusting the contrast to reveal more detail in shadow areas.
fireworks Corrects for night skies and highlights excess colors from fireworks.

Image Adjustments

This feature allows users to adjust different image parameters to modify and enhance the visual appearance of an image. Here’s a list of different parameters you can adjust directly within the editor:

  • Blur: Softens the image, reducing detail and sharpness.
  • Brightness: Adjusts the overall lightness or darkness of the image.
  • Contrast: Alters the difference between the light and dark areas of the image.
  • Gamma: Adjusts the midtones of the image without affecting the shadows and highlights.
  • Hue: Changes the overall color tone of the image.
  • Noise: Adds or reduces random variations of brightness or color information in the image.
  • Pixelate: This creates a mosaic effect by enlarging the pixels, making the image appear blocky.
  • Saturation: Adjusts the intensity of the colors in the image.

These adjustments can be used individually or in combination to achieve the desired visual effect.

Overlay Text

The Transformation UI also allows users to overlay text on their images. This feature is useful for adding captions, titles, or other textual elements to enhance the visual communication of the content.

Users can choose from a variety of font styles, sizes, and colors, and position the text anywhere on the image. This empowers content creators to elevate their visuals and convey their message more effectively.

The text overlay tool provides a seamless way to integrate text and imagery, creating a cohesive and visually appealing final product.

Overlay Text

Overlay Image

The Transformation UI also allows users to overlay additional images on top of the main image. This can be useful for adding logos, watermarks, or other visual elements to the image. Users can resize, position, rotate, and adjust the opacity of the overlaid image to achieve the desired effect.

This feature provides a flexible way to enhance the visual impact and branding of the content within the Froala editor. The real-time preview ensures users can experiment with different overlay options and find the perfect combination.

Image Border

The Transformation UI also offers the ability to add a border around the image. Users can customize the border width, color, and style to create a polished, professional visual look.

This feature is particularly useful for framing images, separating them from the surrounding content, or adding a decorative touch. The real-time preview allows users to experiment with different border options and find the perfect balance between the image and its presentation within the Froala editor.

Elevate Your Visual Content with Froala’s Transformation UI

The Filestack integration within the Froala editor has unlocked a whole new world of creative possibilities for content creators. With the powerful Transformation UI, you now have the ability to enhance your images in ways you never thought possible – right from within your content editor.

From applying eye-catching filters and adjusting brightness and contrast, to swapping backgrounds and overlaying text and graphics, the Transformation UI puts a suite of advanced image editing tools at your fingertips. This empowers you to elevate the visual appeal of your content and leave your readers thoroughly impressed.

So what are you waiting for? Take your visual content to new heights by exploring the Transformation UI within the Froala editor. Unlock your creative potential, captivate your audience, and watch your engagement soar. Get started with the Filestack integration today and see the difference it can make for your Froala-powered website or app.

Get your Filestack API here for free.

Uploading Files to Dropbox in Angular Rich Text Editor with Froala

Froala filestack integration in Angular

Dropbox is a popular cloud storage service allowing users to securely store and share files. Integrating Dropbox with an Angular rich text editor, such as Froala, can enhance the user experience by enabling seamless file uploads directly from the editor. This integration can be achieved by leveraging a service like Filestack, which provides a user-friendly interface for handling file uploads and storage. By incorporating Filestack’s features, developers can streamline the file upload process and ensure that users can easily access and manage their Dropbox files within the rich text editor.

Froala’s latest version, V4.3, includes a new plugin for integrating with Filestack. This makes it easy to upload files to your Dropbox storage directly from the Froala editor. With just a few simple configuration steps, you can start uploading files without leaving the editor.

This integration saves development time and cost. Developers can focus on building the core functionality of their application, rather than spending time implementing complex file upload and storage solutions.

It also saves users time and effort by eliminating the need to switch between different applications or interfaces to manage files. Additionally, it ensures that uploaded files are securely stored in the user’s Dropbox account, providing an extra layer of data protection.

Overall, the Froala-Filestack-Dropbox integration offers a powerful and efficient way to incorporate file management into your Angular-based applications.

Let’s explore how this integration can be set up and leveraged to enhance your Angular application’s functionality. We’ll cover the necessary steps to configure Filestack, connect it to Dropbox, and seamlessly integrate it with the Froala rich text editor. By the end, you’ll have a robust file management solution that provides a seamless user experience within your Angular app.

Angular rich text editor

Step 1: Create a Filestack Account

You will need a Filestack account and obtain an API key for successful uploads. You can create a free Filestack account, which provides a limited amount of bandwidth, uploads, and transformations, as well as access to Filestack’s internal S3 storage. To upload files to Dropbox, you’ll need a paid plan. Start a free trial of a Filestack plan that fits your needs.

Step 2: Dropbox Configuration

Just four simple steps to ensure that files uploaded through the file picker will be stored in your Dropbox account.

  1. You need an existing Dropbox application or you can create a new one.
  2. Make sure to enable additional development users.

Enable additional users

  1. Generate an OAuth2 access token that will be added to the Dropbox storage section in the developer portal.

generate access

  1. Add the necessary policies and test the Storage Keys in the Developer Portal to ensure the connection between our API and your Cloud Storage is set.

Step 3: Create a new Angular project

Skip this step if you are installing the editor in an existing Angular project.

To create a new Angular project, you can use the Angular CLI. Open a terminal or command prompt, navigate to the desired directory, and run the following command:

ng new filestack-integration

This will create a new Angular project named “my-app” and guide you through the setup process, including options for routing and stylesheet format.

When prompted “Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? (y/N)“, answer with “N”.

Once the project is created, you can navigate to the project directory:

cd filestack-integration

 

Step 4: Install Froala Angular SDK

To integrate the Froala rich text editor into your Angular application, you’ll need to install the Froala Angular SDK. You can do this by running the following command in your project’s root directory:

npm install angular-froala-wysiwyg --save

This will install the necessary packages and dependencies.

Step 5: Include the Froala Stylesheets

To include the necessary Froala stylesheets, add the following lines to your `angular.json` file, within the `styles` array:

"node_modules/froala-editor/css/froala_editor.pkgd.min.css",

"node_modules/froala-editor/css/froala_style.min.css"

This will ensure that the Froala editor is properly styled within your Angular application.

Step 6: Create Editor Component

In this step, we will create a custom component to handle the Froala editor and Filestack integration. This component will provide a user-friendly interface for uploading files to Dropbox directly from the rich text editor. By encapsulating the integration logic within a dedicated component, you can easily reuse and maintain the editor functionality across your Angular application.

Create a new component using the Angular CLI:

ng generate component editor

This will create a new component called EditorComponent in your project.

Step 7: Import the Froala Editor Modules

Open the editor.component.ts file and import the necessary Froala modules.

import { Component } from '@angular/core';
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
import 'froala-editor/js/plugins.pkgd.min.js';

@Component({
  selector: 'app-editor',
  standalone: true,
  imports: [FroalaEditorModule, FroalaViewModule],
  templateUrl: './editor.component.html',
  styleUrl: './editor.component.css'
})
export class EditorComponent {

}

Step 8: Include Filestack Files

Open index.html and include the required Filestack files to open the file picker and Transformation UI.

<link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />

<script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>

<script src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>

<script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>

Step 9: Configure the Froala Component

Open the editor.component.ts file and add the required editor configuration within the EditorComponent class. To complete the Filestack integration, consider setting the following options and events:

  • filestackOptions.filestackAPI This is where you should add your Filestack API key.
  • filestackOptions.uploadToFilestackOnly (Optional) Set this option to true if you want to handle all file uploads by Filestack.
  • filestackOptions.pickerOptions (Optional) Use this option to customize the Filestack Picker.
  • filestack.filestackPickerOpened (Optional) This event is triggered when the Filestack File Picker is opened.
  • filestack.filestackPickerClosed (Optional) This event is triggered when the Filestack File Picker is closed.
  • filestack.uploadedToFilestack (Optional) This event is triggered when files are successfully uploaded to your storage.
  • filestack.uploadFailedToFilestack (Optional) This event is triggered when a file upload fails. You can use this event to run a custom function to handle the failed upload.
import { Component } from '@angular/core';
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
import 'froala-editor/js/plugins.pkgd.min.js';

@Component({
  selector: 'app-editor',
  standalone: true,
  imports: [FroalaEditorModule, FroalaViewModule],
  templateUrl: './editor.component.html',
  styleUrl: './editor.component.css'
})
export class EditorComponent {
  public editorContent = "Filestack is a simple file uploader & powerful APIs to upload, transform & deliver any file into your app.";
  public options: Object = {

    heightMin: 300,
    filestackOptions: {
      uploadToFilestackOnly: true,
      filestackAPI: "AvaZ2E0mxRdGPjgMAbus8z",
    },

    events: {
      'filestack.uploadedToFilestack': function () {
        console.log("Callback is triggered for uploaded to filestack ",)
      },

      'filestack.filestackPickerOpened': function () {
        console.log("Callback is triggered for picker opened ",)
      },

      'filestack.filestackPickerClosed': function () {
        console.log("Callback is triggered for picker closed ",)
      },

      'filestack.uploadFailedToFilestack': function () {
        console.log("Callback is triggered for filestack failed ",)
      },

    },
  };
}

Then add <div [froalaEditor]="options" [(froalaModel)]="editorContent"></div> in your editor.component.html file.

With the editor component set up, you can now use it in your Angular application. Simply add the <app-editor> element wherever you want the rich text editor to appear. The EditorComponent will handle the integration with Froala and Filestack, providing a seamless user experience for file uploads directly within the editor. The uploaded files will then be stored in Dropbox using the Filestack integration. This allows your users to easily incorporate multimedia content into their rich text content without leaving the editor interface.

Step 10: Displaying Froala on the main page

To display the Froala editor on the main page of your Angular application, open app.component.ts and import the EditorComponent.

import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterOutlet } from '@angular/router';
import { EditorComponent } from './editor/editor.component';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [CommonModule, RouterOutlet, EditorComponent],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css'
})
export class AppComponent {
  title = 'filestack-integration';
}

Then simply add the <app-editor> element to the app.component.html template.

<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced.  * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
<!-- * * * * * * * to get started with your project! * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->

<style>
  :host {
    --bright-blue: oklch(51.01% 0.274 263.83);
    --electric-violet: oklch(53.18% 0.28 296.97);
    --french-violet: oklch(47.66% 0.246 305.88);
    --vivid-pink: oklch(69.02% 0.277 332.77);
    --hot-red: oklch(61.42% 0.238 15.34);
    --orange-red: oklch(63.32% 0.24 31.68);

    --gray-900: oklch(19.37% 0.006 300.98);
    --gray-700: oklch(36.98% 0.014 302.71);
    --gray-400: oklch(70.9% 0.015 304.04);

    --red-to-pink-to-purple-vertical-gradient: linear-gradient(180deg,
        var(--orange-red) 0%,
        var(--vivid-pink) 50%,
        var(--electric-violet) 100%);

    --red-to-pink-to-purple-horizontal-gradient: linear-gradient(90deg,
        var(--orange-red) 0%,
        var(--vivid-pink) 50%,
        var(--electric-violet) 100%);

    --pill-accent: var(--bright-blue);

    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
      "Segoe UI Symbol";
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1 {
    font-size: 3.125rem;
    color: var(--gray-900);
    font-weight: 500;
    line-height: 100%;
    letter-spacing: -0.125rem;
    margin: 0;
    font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
      "Segoe UI Symbol";
  }

  p {
    margin: 0;
    color: var(--gray-700);
  }

  main {
    width: 100%;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: inherit;
    position: relative;
  }


  .content {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 700px;
    margin-bottom: 3rem;
  }

  .content p {
    margin-top: 1.5rem;
  }


  @media screen and (max-width: 650px) {
    .content {
      flex-direction: column;
      width: max-content;
    }

  }
</style>

<main class="main">
  <div class="content">
    <div class="">

      <p>Congratulations! Your app is running. 🎉</p>
      <app-editor></app-editor>
    </div>

  </div>
</main>

<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * The content above * * * * * * * * * * * * -->
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced.  * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * End of Placeholder  * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->


<router-outlet></router-outlet>

This will render the EditorComponent you created earlier, which encapsulates the Froala editor and Filestack integration. By using the custom EditorComponent, you can easily reuse the rich text editing functionality across your application without having to manage the integration details in multiple places. This promotes code reusability and maintainability as your application grows.

Step 11: Test your App

Run ng serve. This will start the development server and make your Angular application available at http://localhost:4200

Forala Filestack Integration in Angular

You can now test the Froala editor and Filestack integration within your Angular application. Verify that the editor is displayed correctly on the main page and that users can upload files directly within the editor interface. Ensure that the uploaded files are successfully stored in Dropbox using the Filestack integration.

forala angular rich text editor with Filestack integration Froala Angular WYSIWYG editor integration with Filestack Froala integration with Dropbox

Test various editing features provided by Froala, such as formatting, inserting images, and embedding multimedia content. Validate that the rich text content is properly rendered and that the user experience is seamless. Make any necessary adjustments to the integration or styling to optimize the overall functionality and appearance of the editor within your Angular application.

Elevate Your Angular App with Seamless Dropbox Integration

By integrating Froala’s Angular rich text editor with Filestack and Dropbox, you can elevate your Angular application’s functionality and provide users with a seamless content creation experience. This integration empowers your users to effortlessly upload and manage files directly within the editor, eliminating the need to switch between different applications.

The benefits of this integration are clear:

  • It saves development time and costs, while also enhancing the user experience.
  • Developers can focus on building core application features, rather than implementing complex file upload and storage solutions.
  • Users enjoy the convenience of accessing and managing their Dropbox files without leaving the familiar Froala editor interface.

Don’t settle for a disjointed content creation workflow in your Angular app. Embrace the power of the Froala-Filestack-Dropbox integration and take your application to new heights.

Get your Filestack API here for free.

How to transform your LMS with a React WYSIWYG HTML editor, part 1

icon

We’ve all been there. Huge project, impending deadlines, hopeful clients or investors, and plenty of tasking tasks left. Uploading content like rich text with images, videos, and specific formatting, for example, is not as simple as it sounds. This is especially true for LMS (learning management systems), which require course creators to upload different content in one go. To accommodate this need, we must prepare to allow as many file types as possible while also considering rich text processing and storage. Thankfully, we have WYSIWYG editors for that. In this tutorial, we’ll tackle these LMS content issues using a React WYSIWYG HTML editor.

Key takeaways

  • A WYSIWYG HTML editor significantly simplifies content processing and uploading tasks
  • Video and image uploads, processing, and transformations make LMS more engaging and powerful.
  • Froala Editor now comes with built-in Filestack integration, making image transformations and more possible within the editor.
  • You can use React, PHP (or the back-end tool of your choice), and Froala to easily get started with a modern LMS project.
  • As your mastery with WYSIWYG editors and file upload tools grows, so do the capabilities of your LMS.

Defining the scope and features of our LMS project

First, let me clarify that this isn’t a full tutorial for creating a full-fledged LMS. Instead, this is a guide for those who want to have robust content editing and uploading features within their projects. We will be building the front end of the application using React and Froala. For file uploading, we’ll leverage the newly integrated Filestack within the editor. Finally, we will use PHP for the back-end parts and SQL Server for storing and retrieving the data.

Our mini LMS will have the following features:

  • View and add courses – each course will have a title, description, date published, and a unique ID.
  • View and add chapters – each course will consist of chapters, which contain a title, description, content, date published, and a unique ID.

We’ll first set up the React application and Froala Editor. And then, we will create the front end of the application, followed by the back end and database tables. In the end, we’ll run a demo of the application.

Setting up the React project and the WYSIWYG HTML editor

Let’s start our project by creating our React app and installing the packages that we need:  

npx create-react-app demo-lms
cd demo-lms
npm install react-froala-wysiwyg --save

npm install react-router-dom

 

Now, you should have a React application with the Froala WYSIWYG HTML editor and page routing dependencies. The next thing we need to do is create a new folder under “src” called “components.” Afterwards, create a new file named “FroalaComponent.jsx” and insert the following:

import React, { useEffect } from 'react';
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import FroalaEditorComponent from 'react-froala-wysiwyg';
import 'froala-editor/js/plugins.pkgd.min.js';

function FroalaComponent({ setChapterContent, setChapterImage }) {
  const config = {
    filestackOptions: {
      uploadToFilestackOnly: true,
      filestackAPI: 'InsertYourFilestackAPIHere',
    },
    events: {
      'contentChanged': function () {
        setChapterContent(this.html.get());
      },
      'filestack.uploadedToFilestack': function (response) {
        if(response && response.filesUploaded[0].url){
          setChapterImage(response.filesUploaded[0].url);
        }

        else{
          console.error("Image upload failed, no URL found in response", response);
        }
      }
},
  };

  useEffect(() => {
    const filestackScript1 = document.createElement('script');
        filestackScript1.src = 'https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js';
        filestackScript1.async = true;
        document.body.appendChild(filestackScript1);

        const filestackScript2 = document.createElement('script');
        filestackScript2.src = 'https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js';
        filestackScript2.async = true;
        document.body.appendChild(filestackScript2);

        const filestackScript3 = document.createElement('script');
        filestackScript3.src = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js';
        filestackScript3.async = true;
        document.body.appendChild(filestackScript3);

        const filestackStylesheet = document.createElement('link');
        filestackStylesheet.rel = 'stylesheet';
        filestackStylesheet.href = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css';
        document.head.appendChild(filestackStylesheet);

    return () => {
      document.body.removeChild(filestackScript1);
      document.body.removeChild(filestackScript2);
      document.body.removeChild(filestackScript3);
      document.head.removeChild(filestackStylesheet);
    };
  }, []);

  return (
    <div className="editor">
      <FroalaEditorComponent tag='textarea' config={config} />
    </div>
  );
}

export default FroalaComponent;

The first thing we need to do is declare our component and its properties. Note that for the Froala config, we have to declare the Filestack options, including our Filestack API. You can get one by creating a free Filestack account or starting a free trial of a paid plan. Also note that we’re handling Froala’s content-change events and Filestack’s image upload event. This is for storing a course chapter’s content and image URL later.

Additionally, we’re loading Filestack-related scripts and styles dynamically using useEffect. That way, we can easily use Filestack’s drag-and-drop functionality, image uploads, and other features. Lastly, we load our FroalaEditorComponent and its configuration. If you need additional guidance on setting up Froala for React, follow this helpful article.

Creating the LMS

Now that we have the application and our Froala WYSIWYG HTML editor component ready, let’s build our LMS! Start by creating 4 files under the components folder:

  • Courses.jsx: For viewing courses and navigating to a course’s chapters
import React, { useState, useEffect } from 'react';
import CourseModal from './CourseModal';
import { Link } from 'react-router-dom';

function Courses() {
  const [courses, setCourses] = useState([]);
  const [isModalOpen, setIsModalOpen] = useState(false);

  const fetchCourses = async () => {
    // Fetch courses from the back end
    const response = await fetch('path-to-backend/demo-lms-backend/fetchCourses.php');
    const data = await response.json();
    setCourses(data);
  };

  useEffect(() => {
    fetchCourses();
  }, []);

  const handleSaveCourse = () => {
    fetchCourses(); // Fetch courses again after saving a new one
    setIsModalOpen(false);
  };

  return (
    <div className="course-list">
      <h1>My Simple yet Powerful LMS</h1>
      <h2>Courses</h2>

      <button onClick={() => setIsModalOpen(!isModalOpen)}>
        {isModalOpen ? 'Close' : 'Add a Course'}
      </button>

      {isModalOpen && <CourseModal onSaveCourse={handleSaveCourse} onClose={() => setIsModalOpen(false)} />}
      {courses.map((course) => (
        <div key={course.course_id} className="course-card">
          <h3>{course.course_title}</h3>
          <p>{course.course_description}</p>
          <p>Date Published: {course.date_published ? new Date(course.date_published.date).toLocaleDateString() : 'N/A'}</p>
          <Link to={`/chapters/${course.course_id}`}>
            <button>View Course</button>
          </Link>
        </div>
      ))}
    </div>
  );
}

export default Courses;
  • CourseModal.jsx: For saving courses
import React, { useState } from 'react';

function CourseModal({ onSaveCourse, onClose }) {
  const [courseTitle, setCourseTitle] = useState('');
  const [courseDescription, setCourseDescription] = useState('');

  const handleSubmitCourse = async (e) => {
    e.preventDefault();

    const newCourse = {
      title: courseTitle,
      description: courseDescription,
      date_published: new Date().toISOString().split('T')[0],
    };

    const response = await fetch('path-to-backend/demo-lms-backend/saveCourse.php', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(newCourse),
    });

    const result = await response.json();
    if (response.ok) {

      // This will call fetchCourses from Courses.jsx
      onSaveCourse();
    } else {
      console.error('Failed to save course:', result);
    }
  };

  return (
    <div className="modal">
      <form onSubmit={handleSubmitCourse}>
        <h3>New Course</h3>
        <label>Title</label>
        <input type="text" value={courseTitle} onChange={(e) => setCourseTitle(e.target.value)} required />
     
        <label>Description</label>
        <textarea value={courseDescription} onChange={(e) => setCourseDescription(e.target.value)} required />

        <button type="submit">Save</button>
        <button type="button" onClick={onClose}>Cancel</button>
      </form>
    </div>
  );
}

export default CourseModal;
  • Chapters.jsx: For viewing the chapters of a course and navigating back to the courses
import React, { useState, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import ChapterModal from './ChapterModal';
import { Link } from 'react-router-dom';

function Chapters() {
  const { courseId } = useParams();
  const [chapters, setChapters] = useState([]);
  const [course, setCourse] = useState(null); // To store course details
  const [isModalOpen, setIsModalOpen] = useState(false);

  // Fetch chapters for the course
  const fetchChapters = async () => {
    const response = await fetch(`path-to-backend/demo-lms-backend/fetchChapters.php?course_id=${courseId}`);
    const data = await response.json();
    setChapters(data);
  };

  // Fetch course details
  const fetchCourseDetails = async () => {
    const response = await fetch(`path-to-backend/demo-lms-backend/getCourseById.php?courseId=${courseId}`);
    const data = await response.json();
    setCourse(data);
  };

  useEffect(() => {
    fetchChapters();
    fetchCourseDetails(); // Fetch course details on load
  }, [courseId]);

  const handleSaveChapter = (newChapter) => {
    setChapters([...chapters, newChapter]);
    setIsModalOpen(false);
  };

  if (!course) {
    return <p>Loading course details...</p>;
  }

  return (
    <div className="course-details">
      <h1>{course.course_title}</h1>
      <p>Description: {course.course_description}</p>
      <p>Date Published: {course.date_published ? new Date(course.date_published.date).toLocaleDateString() : 'N/A'}</p>
      <Link to={`/`}>
        <button>Back to Courses</button>
      </Link>

      <button onClick={() => setIsModalOpen(!isModalOpen)}>
        {isModalOpen ? 'Close' : 'Add a Chapter'}
      </button>
   
      <div className="chapter-list">
        {chapters.map((chapter) => (
          <div key={chapter.chapter_id} className="chapter-card">
            <h3>{chapter.chapter_title}</h3>
            <p>{chapter.chapter_description}</p>
            <p>Date Published: {chapter.date_published}</p>
          </div>
        ))}
      </div>

      {isModalOpen && <ChapterModal courseId={courseId} onSaveChapter={handleSaveChapter} onClose={() => setIsModalOpen(false)} />}
    </div>
  );
}

export default Chapters;
  • ChapterModal.jsx: For saving chapters within a course
import React, { useState } from 'react';
import FroalaComponent from './FroalaComponent';

function ChapterModal({ courseId, onSaveChapter, onClose }) {
  const [chapterTitle, setChapterTitle] = useState('');
  const [chapterDescription, setChapterDescription] = useState('');
  const [chapterContent, setChapterContent] = useState('');
  const [chapterImage, setChapterImage] = useState('');

  const handleSubmitChapter = async (e) => {
    e.preventDefault();

    console.log('Chapter Image URL:', chapterImage);

    const newChapter = {
      course_id: courseId,
      title: chapterTitle,
      description: chapterDescription,
      content: chapterContent,
      chapter_img: chapterImage, // for Filestack URL
      date_published: new Date().toISOString().split('T')[0],
    };

    const response = await fetch('path-to-backend/demo-lms-backend/saveChapter.php', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(newChapter),
    });

    const result = await response.json();
    if (response.ok) {
      onSaveChapter(result);
    } else {
      console.error('Failed to save chapter:', result);
    }
  };

  return (
    <div className="modal">
      <form onSubmit={handleSubmitChapter}>
        <h3>Add New Chapter</h3>
        <label>Title</label>
        <input type="text" value={chapterTitle} onChange={(e) => setChapterTitle(e.target.value)} required />
     
        <label>Description</label>
        <textarea value={chapterDescription} onChange={(e) => setChapterDescription(e.target.value)} required />
     
        <label>Content</label>
        <FroalaComponent setChapterContent={setChapterContent} setChapterImage={setChapterImage} />

        <div><button type="submit">Save</button> <button type="button" onClick={onClose}>Cancel</button></div>
      </form>
    </div>
  );
}

export default ChapterModal;

Lastly, replace the default code in your App.js with:

import React, { useState } from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import './App.css';
import Courses from './components/Courses';
import Chapters from './components/Chapters';

function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Courses />} />
        <Route path="/chapters/:courseId" element={<Chapters />} />
      </Routes>
    </Router>
  );
}

export default App;

Here’s a quick summary of how our components work:

  • App.js displays the Courses page first. Using the fetchCourses function, the application will send a fetch request to fetchCourses.php on the server. This loads all courses from the database table.
  • When the user clicks the “Add a Course” button, we’ll show the CourseModal component. The user can then save a course through a fetch request to saveCourse.php. After saving the course, the application refreshes the courses.
  • The Chapters and ChapterModal components work similarly, except that loading and saving chapter data requires a course ID. Furthermore, we add the Froala component in our ChapterModal.

After creating the front end of our LMS, we’ll handle the back end of the application next.

Setting up the DB tables and back-end codes

For our database tables, we’ll create two simple tables in SQL Server:

  • course
    • course_id char(10)
    • course_title varchar(100)
    • course_description varchar(255)
    • date_published date
  • chapter
    • course_id char(10)
    • chapter_id char(10)
    • chapter_title varchar(100)
    • chapter_description varchar(255)
    • chapter_content varchar(max)
    • chapter_img_url varchar(255)
    • date_published date

These are just some basic tables, so you will want to improve this or plan ahead when implementing your LMS. Note that we plan to store the contents of the editor in chapter_content. On the other hand, we’ll store the Filestack URL in the chapter_img_url column. For now, we choose 255 as the max length, but you might want to adjust this in your implementation.

Alright, we’re almost done! The last thing we need to do is create our PHP files for fetching and saving data. We also assume that we have a “connection.php” that connects to a database instance. Here are our PHP files and their respective purposes:

  • fetchCourses.php: Retrieve all course data from the course table
<?php
    include "connection.php";

    $query = "SELECT course_id, course_title, course_description, date_published FROM course";
    $result = sqlsrv_query($conn, $query);

    $courses = array();
    while ($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)) {
        $courses[] = $row;
    }

    sqlsrv_close($conn);
    echo json_encode($courses);
?>
  • saveCourse.php: Generate a unique course ID and save the course data
<?php
    include "connection.php";

    $input = json_decode(file_get_contents("php://input"), true);

    $course_title = $input["title"];
    $course_description = $input["description"];

    $query = "
        DECLARE @course_id CHAR(10)

        WHILE 1 = 1
        BEGIN
            SET @course_id = LEFT(CONVERT(NVARCHAR(36), NEWID()), 10)

            IF NOT EXISTS (SELECT 1 FROM course WHERE course_id = @course_id)
            BEGIN
                BREAK
            END
        END

        INSERT INTO course
        (course_id, course_title, course_description, date_published)
        VALUES
        (@course_id, ?, ?, GETDATE())
    ";
    $params = array($course_title, $course_description);
    $result = sqlsrv_query($conn, $query, $params);

    if($result===false) {
        echo json_encode(["error" => "Failed to save course"]);
    }
    else{
        echo 1;
    }
    sqlsrv_close($conn);
?>
  • getCourseById.php: Select all information of a specific course (for generating course data in our Chapters component)
<?php
    include "connection.php";

    if (isset($_GET["courseId"])) {
        $courseId = $_GET["courseId"];

        $query = "SELECT course_id, course_title, course_description, date_published FROM course WHERE course_id = ?";
        $params = array($courseId);
        $stmt = sqlsrv_query($conn, $query, $params);

        if($stmt === false){
            http_response_code(500);
            echo json_encode(["error" => "Failed to query the database."]);
            exit;
        }

        $course = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC);

        if($course){
            echo json_encode($course);
        }
        else{
            http_response_code(404);
            echo json_encode(["message" => "Course not found"]);
        }

        sqlsrv_free_stmt($stmt);
        sqlsrv_close($conn);
    }
    else{
        echo json_encode(["message" => "Course ID not provided"]);
    }
?>
  • fetchChapters.php: Get all chapters in a course
<?php
    include "connection.php";

    $course_id = $_GET["course_id"];

    $query = "SELECT chapter_title, chapter_description, date_published FROM chapter WHERE course_id = ?";
    $params = array($course_id);
    $result = sqlsrv_query($conn, $query, $params);

    if ($result === false) {
        die("Error in query preparation/execution: " . print_r(sqlsrv_errors(), true));
    }
    $chapters = array();
    while($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)){
        $chapters[] = $row;
    }

    sqlsrv_close($conn);
    echo json_encode($chapters);
?>
  • saveChapter.php: Add a chapter to a course
<?php
    include "connection.php";

    $input = json_decode(file_get_contents("php://input"), true);

    $course_id = $input["course_id"];
    $chapter_title = $input["title"];
    $chapter_description = $input["description"];
    $chapter_content = $input["content"];
    $chapter_img_url = $input["chapter_img"];

    $query = "
        DECLARE @chapter_id CHAR(10)

        WHILE 1 = 1
        BEGIN
            SET @chapter_id = LEFT(CONVERT(NVARCHAR(36), NEWID()), 10)

            IF NOT EXISTS (SELECT 1 FROM chapter WHERE chapter_id = @chapter_id)
            BEGIN
                BREAK
            END
        END

        INSERT INTO chapter
        (course_id, chapter_id, chapter_title, chapter_description, chapter_content, chapter_img_url, date_published)
        VALUES
        (?, @chapter_id, ?, ?, ?, ?, GETDATE())
    ";

    $params = array($course_id, $chapter_title, $chapter_description, $chapter_content, $chapter_img_url);
    $result = sqlsrv_query($conn, $query, $params);

    if($result===false){
        echo json_encode(["error" => "Failed to save chapter"]);
    }
    else{
        echo 1;
    }
    sqlsrv_close($conn);
?>

And that’s it! Now, we have all we need for our React LMS with image transformations and rich-text editing. 

Seeing the React WYSIWYG HTML editor LMS in action

Let’s end this tutorial by checking how our React LMS works. After running npm start, we’ll see the homepage, which is empty at first. So, let’s add a course:

A GIF showing the sample LMS' feature that allows users to create courses.

We now have a course. Note that for demo purposes, we didn’t apply that much CSS for now, which is why the input fields and other elements look out of place. Next, let’s view the course and try to add a chapter. After clicking “Add a Chapter,” we will see the WYSIWYG HTML editor along with two input fields.

A GIF showing how you can create an LMS chapter for a course using Froala, Filestack, and React.

Once we’ve selected, cropped, and uploaded the image through the integrated Filestack file picker, we’ll now apply some transformations to the image.

A GIF showing how you can transform images using Froala's built-in Filestack file picker.

Lack of CSS aside, this LMS already looks and feels like a top-notch editing and content processing tool because of the WYSIWYG editor. Lastly, we save the enhanced image, insert a document (a sample chapter outline), add the chapter title and description, and save the chapter.

A GIF that shows how you can upload documents using Froala and Filestack.

Now, let’s check the database to see if we saved the information correctly. Note that I added the chapter to the course about 4 days after creating the course.

Database results that show correctness in terms of data uploaded

Let’s also check our Filestack dashboard:

We can see that we have both the edited image and our demo PDF in our Filestack dashboard. If we now download the image file, we’ll see the image that we transformed earlier in our LMS!

An image that was uploaded using Froala Editor and cropped and edited using Filestack

And there you have it: a React WYSIWYG HTML editor-powered LMS. Undoubtedly, this is far from a finished or even decent LMS product. However, it’s a good start, especially if you plan on implementing comprehensive image handling and content editing on your application. Moreover, we can still do a lot more that I haven’t shown you yet. Next time, we’ll continue this mini project and load the image from Filestack back to our application. Happy coding!

Get your Filestack API here for free.

Integrating Google Cloud Storage in Vue.js Rich Text Editor with Froala

Froala Vue.js rich text editor

As businesses continue to embrace the power of cloud computing, the need to effortlessly manage and store files has become paramount. If you’re a Vue.js developer working with the Froala rich-text editor, you may have encountered the challenge of implementing a file-uploading process that seamlessly integrates with Google Cloud Storage.

Fortunately, the latest version of Froala, V4.3, has introduced a game-changing solution: the Filestack plugin. This innovative feature makes integrating your Vue.js WYSIWYG editor with Google Cloud Storage a breeze, requiring only a few lines of code to set up.

In this article, we’ll dive deep into how Froala V4.3 has simplified this process, empowering you to effortlessly store your files in the Google Cloud while providing your users with a seamless rich-text editing experience. We will discover practical insights and step-by-step guidance to help you master this powerful integration.

So, let’s explore how you can elevate your Vue.js projects by seamlessly connecting your Froala rich-text editor with the reliability and scalability of Google Cloud Storage.

Wysiwyg editor with Google cloud integration

How does Froala V4.3 simplify the integration with Google Cloud?

Froala V4.3 introduces a game-changing feature that streamlines the process of integrating your Vue.js rich-text editor with Google Cloud Storage. This new capability comes in the form of the Filestack plugin, which seamlessly integrates the Filestack Picker directly into the Froala editor.

With the Filestack plugin, users can now upload images, videos, and files directly from the rich-text editor, and these assets will be automatically stored in your Google Cloud Storage. This is made possible by the Filestack platform, which supports a wide range of popular cloud storage services, including Google Cloud.

The integration process is incredibly straightforward. All you need to do is connect your Google Cloud account to your Filestack dashboard, and you’re good to go. From that point on, any files uploaded through the Filestack Picker within the Froala editor will be directly saved to your Google Cloud Storage, without the need for any additional configuration or complex integrations.

This streamlined approach not only saves you time and effort but also ensures a seamless user experience for your content creators. They can focus on crafting their content, while the Froala-Filestack-Google Cloud integration handles the behind-the-scenes file management, allowing you to leverage the power and reliability of Google Cloud Storage with minimal hassle.

Let’s explore how this integration works.

Step 1: Create a simple Vue project

Skip this step if you will install the editor in an existing Vue app.

Run the following commands to create a new Vue 3 project.

npm install -g @vue/cli

vue create my-froala-vue-app

cd my-froala-vue-app

The above code creates a new Vue 3 project named “my-froala-vue-app” and navigates to the project directory. This provides a clean starting point for integrating the Froala rich-text editor and enabling the Google Cloud Storage integration using the Filestack plugin.

Step 2: Install the Froala Editor Vue SDK

Next, you’ll need to install the Froala Editor for Vue.js. Run the following commands in your project directory:

npm install vue-froala-wysiwyg --save

This will add the required dependencies to your project, allowing you to use the Froala editor within your Vue application.

Step 3: Include Froala in Your Application

3.1 Import Froala Editor in main.js

In your “main.js” file, import the Froala associated CSS and JS files:

import { createApp } from 'vue'
import App from './App.vue'

//Import Froala Editor plugins
import 'froala-editor/js/plugins.pkgd.min.js';


// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';


// Import Froala Editor component
import VueFroala from 'vue-froala-wysiwyg';

const app = createApp(App);          

app.use(VueFroala);
app.mount('#app');

This step ensures that the Froala Editor is available throughout your Vue.js application, allowing you to use it in your components.

3.2 Use Froala in a Vue Component

In your “App.vue” file, add the Froala component within the template and add some initial configuration.

<template>

  <froala id="edit" :tag="'textarea'" :config="config" v-model:value="model"></froala>

</template>


<script>

export default {

  name: 'App',

  data () {

    return {

      config: {

        heightMin: 300,

      },

      model: '<i>Edit Your Content Here!</i>'

    }

  }

}

</script>


<style>

#app {

  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;

}

</style>

The Froala component has three attributes:

  • :tag attribute is used to tell on which tag the editor is initialized.
  • :config attribute is used to configure the editor options.
  • v-model:value Used to load editor content. This value is affected by editor HTML changes.

Step 4: Include Filestack for Uploading and Storing Files

Since we already included the “plugins.pkgd.min.js” file in our application, then the Froala Filestack is already included and active by default. However, to correctly display the Filestack File Picker and UI Transformation tools in the editor, include the following Filestack stylesheet and scripts:

Open the “public/index.html” file and include the mentioned scripts.

<!DOCTYPE html>
<html lang="">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  <title>
    <%= htmlWebpackPlugin.options.title %>
  </title>
  <link rel="stylesheet" href="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css" />

</head>

<body>
  <noscript>
    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
        Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->
  <script src="https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js"></script>
  <script
    src="https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js"></script>
  <script src="https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js"></script>
</body>

</html>

Step 5: Create a Filestack Account

To integrate the Filestack File Picker with your Froala Editor, you’ll need to create a Filestack account and obtain an API key.

  1. Sign up for a Filestack Account:
    You can create a free Filestack account with low bandwidth, uploads, transformations, and storage limits. However, to upload files to Google Cloud you need a paid plan. Start a free trial of a paid plan based on your needs.
  2. Obtain the Filestack API Key:
    • After creating your account, you’ll be taken to the Filestack dashboard.
    • In the dashboard, locate the “API Keys” section and copy your “API Key”.
    • You’ll need this API key to configure the Filestack integration with your Froala Editor.

Get Filestack API key

With your Filestack account and API key, you’re now ready to integrate the Filestack File Picker into your Froala Editor, allowing your users to upload, store, and transform files directly within the rich-text editing experience.

Step 6: Filestack Configuration

To complete the Filestack integration, we need to configure the following options and events:

  • Set the filestackOptions.filestackAPI to your Filestack API key.
  • (Optional) Set the filestackOptions.uploadToFilestackOnly to true. This will handle all file uploads by Filestack.
  • (Optional) Pass the File Picker configurations in the filestackOptions.pickerOptions option to customize the Filestack Picker.
  • (Optional) Configure the filestack.filestackPickerOpened event. This allows you to execute a custom action after a user opens the Filestack File Picker.
  • (Optional) Configure the filestack.filestackPickerClosed event. This allows you to execute a custom action after a user closes the Filestack File Picker.
  • (Optional) Configure the filestack.uploadedToFilestack event. This allows you to execute a custom action when files are successfully uploaded to your cloud storage.
  • (Optional) Configure the filestack.uploadFailedToFilestack event. This allows you to execute a custom action if the file upload fails.

Open your “App.vue” file and modify the data() function:

      data () {
      
        return {
        
          config: {
            
            heightMin: 300,
            filestackOptions: {
              uploadToFilestackOnly: true,
              filestackAPI: "***",
            },

            events: {
              'filestack.uploadedToFilestack': function () {
                  console.log("Callback is triggered for uploaded to filestack ",)
              },

              'filestack.filestackPickerOpened': function () {
                  console.log("Callback is triggered for picker opened ",)
              },

              'filestack.filestackPickerClosed': function () {
                  console.log("Callback is triggered for picker closed ",)
              },

              'filestack.uploadFailedToFilestack': function () {
                  console.log("Callback is triggered for file stack failed ",)
              },

            },
          },
        
          model: '<i>Edit Your Content Here!</i>'
        
        }
      
      }

Step 7: Google Cloud Configuration

Log in to your Filestack Dev Portal to configure your storage options so that uploaded files are saved in your Google Cloud account instead of Filestack’s default S3 bucket.

Simply add your service account key and ensure it has the Storage Object Admin role.

Note that depending on your internal GCS settings, additional permissions may be required, such as Storage Admin, Storage Object Creator, and Storage Object Viewer.

Obtain the JSON key for this account and paste it into the Access Key field in the GCS section of the developer portal.

Step 8: Start Your Application

With the Filestack integration and Google Cloud Storage configuration complete, you can now start your application. Run the following command in your terminal:

npm run serve

This command will start the development server and run your application at “http://localhost:8080”.

Froala Filestack integration

When a user clicks the Filestack File Picker button, the picker will open, allowing them to select files from various sources. The selected files will be automatically uploaded to your Google Cloud Storage account, and you can handle the successful or failed upload events using the configured callbacks. This integration provides a seamless file management experience within your Froala Editor-powered application.

What other cloud storage services are supported?

In addition to Google Cloud Storage, Filestack supports integration with other popular cloud storage services such as Amazon S3, Rackspace, Microsoft Azure Blob Storage, and Dropbox. You can configure the desired cloud storage provider in the Filestack Developer Portal and use the same integration approach as outlined for Google Cloud Storage. This flexibility allows you to choose the cloud storage solution that best fits your application’s requirements and infrastructure. The Filestack File Picker seamlessly handles file uploads and transformations, regardless of the underlying cloud storage provider.

Unlock the Power of Seamless Cloud Integration with Froala, Filestack, and Google Cloud Storage

By leveraging the Filestack plugin in Froala V4.3, you can now effortlessly integrate your Vue.js rich-text editor with the reliability and scalability of Google Cloud Storage. This game-changing integration empowers your content creators to focus on crafting exceptional content, while the behind-the-scenes file management is handled seamlessly.

With just a few lines of code, you can set up this powerful integration and unlock a new level of productivity and efficiency in your Vue.js projects. Say goodbye to the hassle of complex file upload processes and hello to a streamlined, user-friendly experience that delights your users.

Get your Filestack API here for free.

React Rich-Text Editor with Advanced Images and Cloud Storage

React rich-text editor

Rich-text editor is a crucial component that allows your users to seamlessly add and edit content. But have you ever found the process of integrating image uploads and storage to be a complex and time-consuming task?

Rich-text editors are undoubtedly popular, but the ability to easily insert and display images is often a pain point. Traditionally, developers have had to write additional code to handle the uploading and storage of images, a process that can be both tedious and error-prone.

However, thanks to the integration between Froala and Filestack, introduced in Froala version 4.3, the uploading and storing of any type of files has become a straightforward process. In this article, we’ll guide you through the setup of this powerful integration within your React applications, empowering you to create a React rich-text editor with advanced image editing capabilities and a seamless cloud storage solution.

Get ready to streamline your content management workflow and provide your users with a truly exceptional experience. Let’s dive in and explore how you can leverage this powerful combination to take your web applications to new heights.

A React Rich-Text Editor with Advanced Image Capabilities and Seamless Cloud Storage Solution

Step 1: Creating A React App.

Skip this step if you will install the editor in an existing React app.

Run the following commands to create a new React application

npm install -g create-react-app

npx create-react-app froala-app

cd froala-app

The above code creates a new React application named “froala-app” and navigates to the project directory. This sets up the necessary files and folders for a basic React application, which you can then customize to integrate the Froala Rich Text Editor and Filestack for file management.

Step 2: Install Froala React Component

Next, you’ll need to install the Froala Rich Text Editor SDK for React. Run the following commands in your project directory:

npm install react-froala-wysiwyg --save

This will add the required dependencies to your project, allowing you to use the Froala editor within your React application.

Step 3: Include Froala in Your Application

To create a Froala editor component with your custom configuration, create a new file “src/components/FroalaComponent.jsx” and add the following code

import React from 'react';

// Require Editor CSS files.

import 'froala-editor/css/froala_style.min.css';

import 'froala-editor/css/froala_editor.pkgd.min.css';

import FroalaEditorComponent from 'react-froala-wysiwyg';

import 'froala-editor/js/plugins.pkgd.min.js';

// Render Froala Editor component.
function FroalaComponent (){

  return (
  
    <div class="editor">
    
    <h3> Froala's React WYSIWYG Editor</h3>
    
    <FroalaEditorComponent tag='textarea'/>
    
    </div>
  
  );

}

export default FroalaComponent;

In the above code, we did the following

  • Import the necessary Froala CSS files and the FroalaEditorComponent from the “react-froala-wysiwyg” library.
  • Import the /plugins.pkgd.min.js to load the full-featured editor with all default plugins loaded.
  • Create a functional component called FroalaComponent that renders the Froala editor within a div.
  • Set the tag attribute of FroalaEditorComponent to textarea, this means the editor will be initialized at textarea HTML element.
  • (Optional) Set the config attribute of FroalaEditorComponent and pass your custom Froala options values through it. We will use it later to set up Filestack plugin options and events.

Step 4: Include Filestack For Uploading and Storing Files

To correctly display the Filestack File Picker and UI Transformation tools in the editor, include the following Filestack files:

We can directly add the script and link tags to your React project’s “public/index.html” file. This method ensures that the scripts are loaded with the initial HTML file.

However, for better performance, we will use the useEffect hook to dynamically add the scripts and stylesheet to the document when the component mounts and remove them when the component unmounts. This ensures the external resources are properly loaded and unloaded with the component lifecycle.

Here’s the “FroalaComponent.jsx” after including the Filestack scripts and stylesheet:

import React, { useEffect } from 'react';
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import FroalaEditorComponent from 'react-froala-wysiwyg';
import 'froala-editor/js/plugins.pkgd.min.js';

function FroalaComponent() {

    useEffect(() => {
        const filestackScript1 = document.createElement('script');
        filestackScript1.src = 'https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js';
        filestackScript1.async = true;
        document.body.appendChild(filestackScript1);

        const filestackScript2 = document.createElement('script');
        filestackScript2.src = 'https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js';
        filestackScript2.async = true;
        document.body.appendChild(filestackScript2);

        const filestackScript3 = document.createElement('script');
        filestackScript3.src = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js';
        filestackScript3.async = true;
        document.body.appendChild(filestackScript3);

        const filestackStylesheet = document.createElement('link');
        filestackStylesheet.rel = 'stylesheet';
        filestackStylesheet.href = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css';
        document.head.appendChild(filestackStylesheet);

        return () => {
            document.body.removeChild(filestackScript1);
            document.body.removeChild(filestackScript2);
            document.body.removeChild(filestackScript3);
            document.head.removeChild(filestackStylesheet);
        };
    }, []);

    return (
        <div className="editor">
            <h3>Froala's React WYSIWYG Editor</h3>
            <FroalaEditorComponent tag='textarea' />
        </div>
    );
}

export default FroalaComponent;

Step 5: Filestack Configuration

5.1: Create Filestack Account

In this step, we need to create a Filestack account and obtain a Filestack API key to add to the Froala configuration so we can upload files to your cloud storage through the Filestack File Picker. This powerful tool allows users to upload, store, and transform files directly. When integrated with Froala, it enables users to upload files from their local devices or cloud storage and apply various transformations within the Froala Editor interface.

You can create a free Filestack account with limited bandwidth, uploads, transformations, and storage, or start a free trial of a paid plan based on your needs.

create Filestack account

5.2: Set the Filestack Plugin Options

Login to your account and copy your Filestack API key.

Get Filestack API key

In the “FroalaComponent.jsx”, add a config parameter to FroalaEditorComponent where you can pass all the Froala configuration:

  • Set the filestackOptions.filestackAPI to your Filestack API key.
  • Set the filestackOptions.uploadToFilestackOnly to true. This will handle all file uploads by Filestack.
  • (Optional) If you want to customize the Filestack Picker, pass the File Picker configurations in the filestackOptions.pickerOptions option.
  • (Optional) Assign a callback function to the filestack.filestackPickerOpened event to perform a custom action after a user opens the Filestack File Picker.
  • (Optional) Assign a callback function to the filestack.filestackPickerClosed event to perform a custom action after a user closes the Filestack File Picker.
  • (Optional) Assign a callback function to the filestack.uploadedToFilestack event to perform a custom action when files are successfully uploaded to your cloud storage.
  • (Optional) Assign a callback function to the filestack.uploadFailedToFilestack event to perform a custom action if file upload fails.
import React, { useEffect } from 'react';
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import FroalaEditorComponent from 'react-froala-wysiwyg';
import 'froala-editor/js/plugins.pkgd.min.js';

function FroalaComponent() {
    let config = {
        filestackOptions: {
            uploadToFilestackOnly: true,
            filestackAPI: "***",
        },

        events: {
            'filestack.uploadedToFilestack': function (response) {
                console.log("Callback is triggered for uploaded to filestack ",)
            },

            'filestack.filestackPickerOpened': function (response) {
                console.log("Callback is triggered for picker opened ",)
            },

            'filestack.filestackPickerClosed': function (response) {
                console.log("Callback is triggered for picker closed ",)
            },

            'filestack.uploadFailedToFilestack': function (response) {
                console.log("Callback is triggered for file stack failed ",)
            },

        },
    };
    useEffect(() => {
        const filestackScript1 = document.createElement('script');
        filestackScript1.src = 'https://static.filestackapi.com/filestack-js/3.32.0/filestack.min.js';
        filestackScript1.async = true;
        document.body.appendChild(filestackScript1);

        const filestackScript2 = document.createElement('script');
        filestackScript2.src = 'https://static.filestackapi.com/filestack-drag-and-drop-js/1.1.1/filestack-drag-and-drop.min.js';
        filestackScript2.async = true;
        document.body.appendChild(filestackScript2);

        const filestackScript3 = document.createElement('script');
        filestackScript3.src = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.umd.min.js';
        filestackScript3.async = true;
        document.body.appendChild(filestackScript3);

        const filestackStylesheet = document.createElement('link');
        filestackStylesheet.rel = 'stylesheet';
        filestackStylesheet.href = 'https://static.filestackapi.com/transforms-ui/2.x.x/transforms.css';
        document.head.appendChild(filestackStylesheet);

        return () => {
            document.body.removeChild(filestackScript1);
            document.body.removeChild(filestackScript2);
            document.body.removeChild(filestackScript3);
            document.head.removeChild(filestackStylesheet);
        };
    }, []);

    return (
        <div className="editor">
            <h3>Froala's React WYSIWYG Editor</h3>
            <FroalaEditorComponent tag='textarea' config={config} />
        </div>
    );
}

export default FroalaComponent;

The “FroalaComponent.jsx” component can now be imported and used in other components of your React application.

5.3: Configure Cloud Storage

By default, all uploaded files are stored in Filestack’s internal S3 bucket. This doesn’t require any additional configuration and works for both free and paid Filestack accounts.

However, if you’re on a paid plan, you can store files in your custom cloud storage on the following platforms:

  • Amazon S3
  • Rackspace
  • Azure Blob Storage
  • Dropbox
  • Google Cloud Storage

Log in to your Filestack dev portal and follow the steps described in the Filestack’s storage docs.

Step 6: Add Froala To Your Main Component

To display the Froala editor in your product, add the FroalaComponent to the template where you want the editor to be displayed.

In our tutorial, we will add it to the App.js file. It will be like

import './App.css';
import FroalaComponent from './components/FroalaComponent';

function App() {
  return (
    <div className="App">

      <FroalaComponent />
    </div>
  );
}

export default App;

 Step 7: Start Your Application

Open the terminal again and run the following command.

npm start

This will start the development server, which will display the Froala editor with Filestack buttons for uploading images, videos, and files.

Rich text-editor integrated with Filestack

Step 8: Test Your Application

You can test if your Filestack integration is working properly by following the below steps:

  • Upload images, videos, or files through Filestack File Picker.
  • Login to your Filestack dev portal.
  • Click on the “Content Browser“ and see if your files are listed.
  • Go to your cloud storage service and check if your file is successfully stored.

Conclusion

In this article, we’ve explored how to seamlessly integrate the Froala React Rich Text Editor with Filestack’s powerful file management capabilities within a React application. Filestack provides a user-friendly interface and a range of advanced image editing capabilities that can be easily integrated with the Froala editor.

The integration of Froala and Filestack streamlines the process of uploading, storing, and transforming files directly within the rich-text editor, empowering your users to focus on creating great content without the hassle of complex file management. With just a few simple steps, you can set up this integration and unlock advanced image editing tools, a user-friendly file picker, and a robust cloud storage solution.

So what are you waiting for? Try the Froala-Filestack integration and give your users the rich-text editing experience they deserve.

Get your Filestack API here for free.

 

Explore Froala Lists Plugin Setup, Options, and Methods

Froala Lists plugin

Crafting content with clear structure and organization is essential for effective communication. Fortunately, Froala – a powerful WYSIWYG HTML editor – offers advanced list formatting capabilities that go beyond the basic list features found in most editors. In this post, we’ll explore how you can harness Froala’s robust list management tools to create and customize lists like a pro.

What are HTML Lists? and How Are They Structured?

HTML lists are a way for web developers to group related items together in an organized manner. They help present content in a clear and structured way, making it more readable and accessible. There are three main types of lists in HTML:

  1. Ordered Lists (<ol>): These lists are used when the order of items matters. Each item is numbered.
  2. Unordered Lists (<ul>): These lists are used when the order of items doesn’t matter. Each item is marked with a bullet point.
  3. Definition Lists (<dl>): These lists are used for terms and their definitions.

Each type of list serves a specific purpose and can be customized to fit the design and content requirements of your website. Let’s break down how each type of list is structured:

Ordered List (<ol>):

<ol>

<li>First item</li>
<li>Second item</li>
<li>Third item</li>

</ol>
  • <ol>: This tag defines the start of an ordered list.
  • <li>: Each list item is wrapped in this tag.

Unordered List (<ul>):

 

<ul>

<li>First item</li>

<li>Second item</li>

<li>Third item</li>

</ul>
  • <ul>: This tag defines the start of an unordered list.
  • <li>: Each list item is wrapped in this tag.

Definition List (<dl>):

<dl>

<dt>Term 1</dt>

<dd>Definition of Term 1</dd>

<dt>Term 2</dt>

<dd>Definition of Term 2</dd>

</dl>
  • <dl>: This tag defines the start of a definition list.
  • <dt>: This tag is used for each term.
  • <dd>: This tag is used for each definition.

How does Froala Help in Creating HTML Lists?

Froala helps developers and non-developers create HTML content without needing to know or remember the HTML tags. Users can use the editor’s intuitive toolbar to format the content. The editor offers the option to create ordered or unordered lists without writing a single line of code. Moreover, Froala supports advanced list styling options, allowing users to customize the appearance of their lists. For example, you can change bullet points to different shapes. The Froala’s Lists plugin is responsible for providing this functionality.

By providing these features, Froala empowers non-developers to create well-structured and visually appealing HTML lists with ease, enhancing both the user experience and the quality of the web content.

Froala Lists plugin

Froala’s Lists plugin

Froala’s Lists plugin provides a comprehensive set of options and methods to create and manage HTML lists within your rich text editor. With Froala, you can easily insert, modify, and style unordered and ordered lists to enhance the structure and presentation of your content. The plugin allows you to seamlessly integrate lists into your web application’s content.

The Froala’s Lists plugin registers three buttons that can be added to the editor toolbar:

  1. formatOLSimple: Display a button for formatting content in an ordered list where list items will be numbered with numbers.
  2. formatOL: Display a list of options for formatting content in an ordered list
    1. Default: list items will be numbered with numbers.
    2. Lower Alpha: The list items will be numbered with lowercase letters style="list-style-type: lower-alpha;"
    3. Lower Greek: The list items will be numbered with lowercase classical Greek symbols style="list-style-type: lower-greek;"
    4. Lower Roman: The list items will be numbered with lowercase Roman numerals style="list-style-type: lower-roman;"
    5. Upper Alpha: The list items will be numbered with uppercase letters style="list-style-type: upper-alpha;"
    6. Upper Roman: The list items will be numbered with uppercase Roman numerals style="list-style-type: upper-roman;"
  3. formatUL: Display a list of options for formatting content in an unordered list
    1. Default: Sets the list item marker to a disc bullet (small black circle).
    2. Circle: Sets the list item marker to a hollow circle.
    3. Disc: Sets the list item marker to a small black circle.
    4. Square: Sets the list item marker to a filled square.

By default, the formatOL and formatUL are displayed in the “Paragraph” toolbar buttons group. Learn more about Froala’s toolbar configuration.

Formatting a List

To create a list:

  1. Click on one of the formatting toolbar buttons.
  2. Start typing to create the first list item.
  3. Press “Enter” to create a new list item.
  4. To create a second-level list item, press “Tab”.
  5. To decrease the list level, press “Shift + Tab”.
  6. When you’re finished with the list, press “Enter” twice to start a normal paragraph.

HTML lists

If the content was already on the editor

  1. Select it.
  2. Click on one of the formatting toolbar buttons and it will be converted to a list.

To reformatting a list:

  1. Select the list.
  2. Click on the same formatting toolbar button that was used to create the list.

Installation and Setup of Froala Lists Plugin

If you include the Froala packaged script, the Froala Lists plugin is active by default. However, if you only include the Froala core script, you will need to add the Lists plugin script separately.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lists</title>
    <!--Include Froala Stylesheet -->
    <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.min.css' rel='stylesheet'
        type='text/css' />

</head>

<body>

    <!--Editor element -->
    <textarea id="editor"></textarea>

    <!--Include Froala Script -->
    <script type='text/javascript'
        src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.min.js'></script>
            
    <!--Include Lists Plugin Script -->
    <script type='text/javascript'
        src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/lists.min.js'></script>


    <script>

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

</html>

If you are customizing the enabled plugins, add the “Lists” plugin to the `pluginsEnabled` option.

new FroalaEditor('#editor', {

  pluginsEnabled: ['lists', 'image', 'link', 'video']

});

When customizing the toolbar buttons, add the list formatting buttons you want to use to the toolbarButtons option.

new FroalaEditor('#editor', {

  pluginsEnabled: ['lists', 'image', 'link', 'video'],

  toolbarButtons: ['formatOL', 'formatUL', 'bold']

});

Similarly, customize the toolbarButtonsMD, toolbarButtonsSM, toolbarButtonsXS options. These options indicate the buttons to be displayed on medium, small, and extra small screens, respectively. By default, these options display the same buttons defined in the toolbarButtonsoption.

Customizing the Lists Plugin

Setting the listAdvancedTypes option to false disables the advanced types selection for the bullets. This restricts the list formatting options to the default settings only.

new FroalaEditor('#editor', {

  pluginsEnabled: ['lists', 'image', 'link', 'video'],

  toolbarButtons: ['formatOL', 'formatUL', 'bold'],

  listAdvancedTypes: false

});

Moreover, you can listen to the formatOL and formatUL actions and execute a custom function before or after them using Froala commands.before and commands.after events.

        new FroalaEditor('#editor', {
            pluginsEnabled: ['lists', 'image', 'link', 'video'],
            toolbarButtons: ['formatOL', 'formatUL', 'bold'],
            listAdvancedTypes: false,
            events: {
                'commands.before': function (cmd) {
                    if (cmd == 'formatUL' || cmd == 'formatOL') {
                        this.html.insert('Do somthing <b>before</b> ' + cmd + ' ');

                    }
                },
                'commands.after': function (cmd) {
                    if (cmd == 'formatUL' || cmd == 'formatOL') {
                        this.html.insert('Do somthing <b>after</b> ' + cmd + ' ');

                    }
                }
            }
        });

Additionally, the plugin provides a lists.format(tag_name) method, which allows developers to programmatically convert selected content into a list. If the tag_name is ‘OL’, the method will create an ordered list. If the tag_name is ‘UL’, the method will create an unordered list.

Try Froala List Plugin for Free

The Froala Lists plugin provides a flexible and customizable way to create and manage lists within your Froala-powered content editor. You can easily configure the available list formatting options, control the toolbar buttons, and even listen to list-related events to execute custom functionality. By leveraging the plugin’s programmatic methods, you can also dynamically convert content into ordered or unordered lists as needed. This level of control and extensibility allows you to tailor the list management experience to best fit your specific application requirements.

Ready to unlock the power of structured content? Try the Froala Editor for free today and experience the difference it can make in your web projects. Elevate your content with the advanced list formatting capabilities of Froala.

Seamlessly Integrate a Date Picker Into Froala Rich Text Editor

Integrate a date picker into Froala

Froala WYSIWYG editor is a powerful tool that transforms content management. Integrating a date picker into it enhances your whole application user experience. This can be easily achieved by incorporating a date picker JavaScript library into Froala.

This blog post will guide you through the process of integrating a date picker into the Froala Rich Text Editor using the MCDatepicker JavaScript library. You can use any other date picker alternative, the integration process will be almost the same.

MCDatepicker is a free, open-source date picker library with a clean design and flexibility, making it the ideal choice for managing dates with ease and accuracy. Join us as we delve into the step-by-step process of this integration, showcasing how you can enrich the Froala experience and streamline your content creation process with just a few lines of intuitive JavaScript.

Date picker integration into Froala rich text editor

Understanding the Role of a Date Picker in a Rich Text Editor

When it comes to rich text editors, usability and functionality are paramount. Adding a custom date picker enhances the user experience by providing an intuitive way to input dates. Using a JavaScript date picker simplifies the process, reducing user errors and improving the efficiency of content creation. Froala’s rich text editor is a great example of how we can integrate these tools seamlessly, offering developers a solution that’s both powerful and easy to use. Our focus on UX ensures that users have a smooth experience, and integrating a date picker is just one of the many ways we enhance the editor’s capabilities.

Why Should We Use Froala Rich Text Editor?

The Froala Rich Text Editor is a popular WYSIWYG (What You See Is What You Get) editor that provides a wide range of features and customization options.

It allows users to easily format text, and insert images, tables, and videos. It offers over 100 features. Check them all here.

One of the key benefits of the Froala Rich Text Editor is its extensibility, which enables developers to integrate additional functionality and features.

Setting Up MCDatepicker for Seamless Date Management

To manage dates effectively within Froala’s editor, we turn to MCDatepicker, a robust library renowned for its attractive design and ease of use. Setting up an MCDatepicker date picker allows us to handle date formats and calculations with precision. By leveraging MCDatepicker, developers can streamline date management, ensuring application consistency and reliability. The integration process is straightforward. Froala’s custom buttons approach makes it easy for developers to implement MCDatepicker within the editor.

Integrating the Date Picker

  1. Set up the Froala Rich Text Editor:
    1. Include the necessary Froala CSS and JavaScript files in your HTML file.
    2. Initialize the Froala Rich Text Editor on your desired HTML element.
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Insert date and time</title>
    <!--Include Froala Stylesheet -->
    <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet'
        type='text/css' />
    <!--Include Font awesome for the button icon -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"
        integrity="sha512-+L4yy6FRcDGbXJ9mPG8MT/3UCDzwR9gPeyFNMCtInsol++5m3bk2bXWKdZjvybmohrAsn3Ua5x8gfLnbE1YkOg=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>

<body>

    <!--Editor element -->
    <textarea id="editor"></textarea>

    <!--Include Froala javaScript -->
    <script type='text/javascript'

    <script>

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

</html>
  1. Install and include MCDatepicker:
    Download the MCDatepicker library or include it from a CDN.
<link href="https://cdn.jsdelivr.net/npm/mc-datepicker/dist/mc-calendar.min.css" rel="stylesheet" />

<script src="https://cdn.jsdelivr.net/npm/mc-datepicker/dist/mc-calendar.min.js"></script>
  1. Define a new Froala button and include the necessary functionality:
    As per the Froala custom button guide, we should:

    1. Define an icon for the custom button.
FroalaEditor.DefineIcon('calendar', { NAME: 'calendar', template: 'font_awesome' });
    1. Register the button
FroalaEditor.RegisterCommand('calendar', {
    1. Set a title
title: 'Display Calendar Popup',
    1. Specify the icon for the button. If this option is not specified, the button name is used.
icon: 'calendar',
    1. Save the button action into the undo stack.
undo: true,
    1. Set whether to focus inside the editor before the callback or not
focus: false,
    1. Set a callback function to be called when the button is hit.
    callback: function () {
        const datepicker = MCDatepicker.create();
        datepicker.open();
        datepicker.onSelect((date, formatedDate) => {
            this.html.insert('Selected date: ' + formatedDate);
        });
}

In the callback function, we used the MCDatepicker.create() method to initialize the date picker and then automatically display the picker using the datepicker.open(); method.
When the user selects a date and clicks on the “OK“ button, the selected date is inserted in the editor. We achieved this using the MCDatepicker onSelect event. This event provides the selected date and formatted date. We then used the html.insert() Froala method to insert the formatted date into the Froala editor.
The MCDatepicker provides the formatted date based on the format specified with the dateFormat option, which is set to DD-MMM-YYYY by default. By customizing the dateFormat option, you can customize the date format to suit your specific needs. Once the date picker is integrated, users can easily select dates within the Froala Rich Text Editor, streamlining the content creation process.

rich text editor

  1. Display the date picker button on the Froala toolbar
    Add the newly created custom button to Froala’s toolbarButtons options. Master the customization of Froala toolbar buttons.
        new FroalaEditor('#editor', {
            // Add the custom buttons in the toolbarButtons list, after the separator.
            toolbarButtons: [['calendar', 'italic', 'bold']]
        });
  1. The final code
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Insert date and time</title>
    <!--Include Froala Stylesheet -->
    <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet'
        type='text/css' />
    <link href="https://cdn.jsdelivr.net/npm/mc-datepicker/dist/mc-calendar.min.css" rel="stylesheet" />
    <!--Include Font awesome for the button icon -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"
        integrity="sha512-+L4yy6FRcDGbXJ9mPG8MT/3UCDzwR9gPeyFNMCtInsol++5m3bk2bXWKdZjvybmohrAsn3Ua5x8gfLnbE1YkOg=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>

<body>

    <!--Editor element -->
    <textarea id="editor"></textarea>

    <!--Include Froala javaScript -->
    <script type='text/javascript'
        src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>
    <script src="https://cdn.jsdelivr.net/npm/mc-datepicker/dist/mc-calendar.min.js"></script>
    <script>
        // Define an icon and command for the button that opens the custom popup.
        FroalaEditor.DefineIcon('calendar', { NAME: 'calendar', template: 'font_awesome' });
        FroalaEditor.RegisterCommand('calendar', {
            title: 'Display Calendar Popup',
            icon: 'calendar',
            undo: true,
            focus: false,
            popup: false,

            callback: function () {
                const datepicker = MCDatepicker.create();
                datepicker.open();
                datepicker.onSelect((date, formatedDate) => {
                    this.html.insert('Selected date: ' + formatedDate);
                });

            }
        });
    </script>
    <script>

        new FroalaEditor('#editor', {
            // Add the custom buttons in the toolbarButtons list, after the separator.
            toolbarButtons: [['calendar', 'italic', 'bold']]
        });
    </script>
</body>

</html>

Customize The Date Picker

The MCDatepicker library offers a range of customization options, enabling developers to tailor the date picker’s appearance and behavior to match the branding and design of their application. By leveraging these features, you can create a cohesive and visually appealing date management solution within the Froala Rich Text Editor. For example, you can disable some weekdays, specify allowed years, or change the date picker theme.

Conclusion

Integrating a date picker into the Froala Rich Text Editor using MCDatepicker can be a powerful way to enhance the user experience and improve the overall quality of your web content. By following the steps outlined in this blog post, you can seamlessly incorporate this functionality into your web application or website.

This seamless integration of MCDatepicker enhances the overall functionality and user experience of the Froala editor, making it a powerful tool for developers to create rich and engaging content. The flexibility to add custom features like the date picker sets Froala apart as a versatile and extensible rich text editing solution.

If you’re looking to enhance your web application’s content creation experience, I encourage you to give Froala a try. With its robust API, extensive feature set, and easy integration, Froala makes it simple to build a WYSIWYG editor that is perfectly suited to your users’ needs.

Using JavaScript Date Object to Add Date/Time in a JavaScript WYSIWYG Editor

JavaScript WYSIWYG Editor

The JavaScript Date object is a powerful tool that allows developers to work with dates and times in their web applications. JavaScript WYSIWYG editors can utilize it to allow users to insert specific dates and times in their content. In this blog post, we’ll explore using the Date object to insert date and time into the Froala WYSIWYG editor.

Understanding the Date Object

The Date object in JavaScript represents a single moment in time. It provides a variety of methods for working with dates and times, such as getting the current date and time, formatting dates, and performing date calculations.

The Date object can be created in several ways, including using the new Date() constructor or by passing specific date and time values to the constructor.

Displaying the Current Date

Getting the Current Date

To get the current date, you can use the new Date() constructor without any arguments. This will create a new Date object representing the current date and time.

const currentDate = new Date();

Formatting the Date

Once you have the current date, you can use various methods of the Date object to format the date in the desired way. We want to display the inserted date and time in the following format Month/Day/Year Hours:Minutes:Seconds. The methods we will use in our case are:

  • getFullYear(): Returns the year as a four-digit number (e.g., 2023)
  • getMonth(): Returns the month as a zero-based number (0 for January, 1 for February, etc.)
  • getDate(): Returns the day of the month (1-31)
  • getDay(): Returns the day of the week as a zero-based number (0 for Sunday, 1 for Monday, etc.)
  • getHours(): Returns the hours (0-23)
  • getMinutes(): Returns the minutes (0-59)
  • getSeconds(): Returns the seconds (0-59)

If you want another format, you can check the Date JavaScript documentation for other methods.

Displaying the Date

After getting the current date and formatting it, you can display the date on your web page.

You can use JavaScript to update the content of an HTML element, such as a <p> or <div> tag, with the formatted date.

const currentDate = new Date();

const dateString = `Current date and time is ${currentDate.getMonth() + 1}/${currentDate.getDate()}/${currentDate.getFullYear()} ${currentDate.getHours()}:${currentDate.getMinutes()}:${currentDate.getSeconds()}`;

document.getElementById('date-display').textContent = dateString;

In this example, we create a new Date object, format the date using the methods mentioned above, and then update the text content of an HTML element with the ID `date-display`.

Now let’s use it with Froala WYSIWYG editor but first let’s explain what WYSIWYG editor means, why we want to insert the current date in it, and how to do it.

What are WYSIWYG Editors?

WYSIWYG (What You See Is What You Get) editors are text editors that allow users to format and style content as they type, without having to write raw HTML or markup. These editors provide a user-friendly interface, making it easier for non-technical users to create and edit web content.

datetime with Froala

Why Do I Need To Insert The Current Date While Using WYSIWYG Editor?

WYSIWYG Editors are used in many use cases where adding current date and time are important to users. For example:

  • In Content Management Systems (CMSs): users can insert the current date when creating a new blog post or article. This helps provide context and timestamp the content.
  • In Email Clients: users may want to insert the current date when composing a new email message.
  • In Online Forms: users may need to insert the current date when filling out forms, such as job applications or registration forms.
  • In Note-taking Apps: users may want to timestamp their notes with the current date.

By utilizing the JavaScript Date object, developers can enable users to insert the current date and time directly into the content they are creating or editing, enhancing the functionality and convenience of the WYSIWYG editor.

Why It’s Recommended to Use Froala Editor?

Froala Editor is an advanced WYSIWYG editor with a user-friendly interface. It offers a wide range of features and tools, including advanced formatting options, image and media integration, and export to PDF, allowing users to create high-quality content efficiently.

One of the most important features is its powerful API that allows developers to easily and quickly customize the editor to fit the specific needs and branding of your organization, allowing you to create a unique and tailored content creation experience.

How To Insert Date and Time Into Froala JavaScript WYSIWYG Editor?

First, we need to add a new toolbar button. When this button is clicked, it inserts the current date and time into the editor. Froala made defining new toolbar buttons easy. You just need to follow this “create a custom Froala button“ guide.

The main steps to define a custom button and display it in the editor toolbar are:

  • Define the button icon to be displayed on the editor toolbar
  • Define the button’s action, which in our case will be to insert the current date and time into the editor.
  • Register the custom button with Froala’s API

Define button icon

We will use the calendar icon from the Font Awesome library.

FroalaEditor.DefineIcon('dateIcon', {NAME: 'calendar', template: 'font_awesome'})

Define the button’s action

Here is the button definition and inside the callback function we will use the JavaScript Date object as we used earlier to format the current date and time and then we will use the html.set() Froala Method to insert the date and the time into the editor.

        FroalaEditor.RegisterCommand('date', {
            title: "Today's date and time",
            icon: 'dateIcon',
            undo: true,
            focus: true,
            showOnMobile: true,
            refreshAfterCallback: true,
            callback: function () {

                const currentDate = new Date();
                const dateString = `${currentDate.getMonth() + 1}/${currentDate.getDate()}/${currentDate.getFullYear()} ${currentDate.getHours()}:${currentDate.getMinutes()}:${currentDate.getSeconds()}`;

                this.html.set("<i>"+dateString+"</i>");
            },

        })

Register the custom button with Froala’s API

In a basic HTML project, initialize the editor and the date custom button we created above to Froala’s toolbarButtons option.

Here’s the full code example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Insert date and time</title>
    <!--Include Froala Stylesheet -->
    <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
    <!--Include Font awesome for the button icon -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha512-+L4yy6FRcDGbXJ9mPG8MT/3UCDzwR9gPeyFNMCtInsol++5m3bk2bXWKdZjvybmohrAsn3Ua5x8gfLnbE1YkOg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>

    <!--Editor element -->
    <textarea id="editor"></textarea>

    <!--Include Froala javaScript -->
    <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>
    <script>
        FroalaEditor.DefineIcon('dateIcon', {NAME: 'calendar', template: 'font_awesome'})
        FroalaEditor.RegisterCommand('date', {
            title: "Today's date and time",
            icon: 'dateIcon',
            undo: true,
            focus: true,
            showOnMobile: true,
            refreshAfterCallback: true,
            callback: function () {

                const currentDate = new Date();
                const dateString = `${currentDate.getMonth() + 1}/${currentDate.getDate()}/${currentDate.getFullYear()} ${currentDate.getHours()}:${currentDate.getMinutes()}:${currentDate.getSeconds()}`;

                this.html.set("<i>"+dateString+"</i>");
            },

        })

        new FroalaEditor('#editor', {
            // Add the custom buttons in the toolbarButtons list, after the separator.
            toolbarButtons: [['date', 'italic' , 'bold']]
        });
    </script>
</body>
</html>

By following these steps, you can easily integrate the ability to insert the current date and time into your Froala-powered web applications, providing users with a convenient way to timestamp their content.

Advanced Date Formatting

While the basic formatting methods provided by the Date object are useful, you may sometimes need more advanced date formatting options. In that case, it’s recommended to integrate third-party libraries, such as Moment.js with Froala editor to provide additional date formatting capabilities.

These libraries offer a wide range of formatting options, including the ability to display dates in different languages, time zones, and custom formats.

If you recommend writing an article about how to do that integration, leave a comment below.

Try Froala for Your Next Project

In this article, we’ve explored how to leverage the powerful JavaScript Date object to insert the current date and time into a Froala WYSIWYG editor. By creating a custom toolbar button, we were able to give users a convenient way to timestamp their content directly within the editor interface.

The ability to seamlessly integrate date and time functionality into a WYSIWYG editor can be a valuable feature for a wide range of applications, from content management systems to online forms and note-taking apps. With the flexibility and customization options provided by Froala, developers can tailor this functionality to perfectly fit the needs of their users and their application’s branding.

If you’re looking to enhance your web application’s content creation experience, I encourage you to give Froala a try. With its robust API, extensive feature set, and easy integration, Froala makes it simple to build a WYSIWYG editor that is perfectly suited to your users’ needs.

Get started with Froala today and unlock the power of dynamic date and time integration in your web applications!

Froala 4.2.2: Improved Word Pasting, YouTube Shorts Support, and More

Froala Release

We are excited to announce the release of Froala Editor 4.2.2. Froala always brings stability and quality improvements with each new release to keep delivering our customers the best WYSIWYG editing experience.

Froala V4.2.2 improves MS Word pasting, supports YouTube Shorts, improves the inline toolbar on mobile, and more.

Let’s dig deep into the most significant changes in this release.

Pasting From Microsoft Word

Enhancing Pasting From MS Word

The latest version of Froala significantly improves the experience of pasting content from Microsoft Word. Users can now upload pasted images to their server and receive the corresponding upload events. Additionally, the editor retains font formatting, even for font families that use MS Word attributes. Overall, the pasting experience from MS Word is better than ever, saving users time while maintaining clean, well-formatted documents.

Enhanced Pasting Images

Previously, when you pasted images with other content from MS Word into the editor, the pasted images were just displayed in the editor with other content. Now the pasted image is also uploaded to the server and triggers the related events such as the image.beforeUpload event.

Uploading images to the server allows you to save the images to your content management system and use them later. This enhanced pasting experience ensures a seamless workflow when incorporating content from Microsoft Word into your Froala-powered applications.

Support Microsoft Word Custom Font Family Attributes

Microsoft Word represents font families in various ways, sometimes using HTML attributes and other times employing custom attributes like mso-bidi-font-family and mso-fareast-font-family.

In this release, Froala adds support for the following custom MS Word attributes:

  • mso-bidi-font-family
  • mso-fareast-font-family
  • mso-fareast-theme-font

This preserves the text font format when pasting from MS Word, ensuring a seamless integration of content into your Froala-powered applications while maintaining original formatting.

Fix Table Pasting

Previously, pasting a table from Microsoft Word into the editor could place the table outside the selected div, resulting in extra div elements. This issue has been resolved; now, tables from DOCX files paste directly within the selected div without adding extra div elements.

Support YouTube Shorts

The Froala Video plugin enables users to insert videos directly in the editor from different sources. It automatically parses YouTube, Vimeo, Yahoo, and DailyMotion video links.

The Froala Video plugin now supports YouTube Shorts, enabling users to embed short-form videos directly into their documents. Users can manage these videos just like regular YouTube videos, including resizing, adjusting alignment, and previewing or removing them, all within the editor’s interface without leaving the page.

With the addition of YouTube Shorts support, Froala continues to evolve and adapt to the changing landscape of digital content, keeping users aligned with the latest social media trends and enriching their overall content experience.

Enhancing Mobile Experience

Froala 4.2.2 enhances the mobile editing experience by improving the responsiveness of the alignment and font size dropdowns in the inline toolbar. The update ensures that these dropdowns reliably respond to user clicks, allowing for easy selection of alignment options and font sizes directly from the toolbar, thus streamlining the mobile editing workflow. These enhancements aim to provide a seamless editing experience across all devices and platforms.

Enhancing List Management with Track Changes Enabled

If you utilize the Track Changes plugin, which is not enabled by default, this update is for you. In earlier versions, users experienced issues formatting unordered lists when Track Changes was enabled. This issue is no longer happening.

How Can I Update?

Don’t miss out on the benefits of the latest Froala 4.2.2 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.2.2/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.2.2/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide for step-by-step instructions on upgrading from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get-started guide.

Technical Questions

Customizing Froala’s Behavior with Command-Driven Events

Froala commands API

Froala is a powerful WYSIWYG editor created by developers for developers. Its robust API empowers users to create highly customized and seamless user experiences. One of the Froala API’s standout features is the ability to execute commands programmatically. Furthermore, developers can run custom functions before or after specific commands are triggered.

In this blog post, we’ll explore the steps to master programmatic command execution and learn how to listen for their related events in Froala. By the end, you’ll have a solid understanding of how to leverage Froala’s advanced API Commands methods and events to build exceptional content editing experiences.

What Are the Types of Commands I Can Execute Programmatically In Froala

There are several types of commands that developers can call in their custom code. Here is the complete list:

  1. Format The Selected Text
    1. Bold
      Developers can use the commands.bold() method to format the user-selected text as bold.
    2. Italic
      Developers can use the commands.italic() method to format the user-selected text as italic.
    3. strikeThrough
      The commands.strikeThrough() method helps developers to format the user-selected text as a strikethrough.
    4. Subscript
      The commands.subscript() method helps developers format the user-selected text as a subscript.
    5. Superscript
      The commands.superscript() method helps developers format the user-selected text as a superscript.
    6. Underline
      The commands.underline() method helps developers format the user-selected text as an underlined.
    7. Indent
      Using the commands.indent() method, developers can indent more of the selected paragraphs.
    8. Outdent
      Using the commands.outdent() method, developers can indent fewer of the selected paragraphs.
  2. Clear Formatting
    If a developer wants to clear the format applied to the selected text, he can execute the commands.clearFormatting() method.
  3. Insert a horizontal line
    The commands.insertHR() method helps developers insert a horizontal line in the editor.
  4. Redo
    Using the commands.redo() method, developers can redo the user’s most recent action.
  5. Undo
    Using the commands.undo() method, developers can undo the user’s last executed action.
  6. Select All
    Using the commands.selectAll() method, developers can select all the content inside the editor.
  7. Toolbar
    1. Display The Inline Toolbar
      The commands.show() method displays the inline toolbar at the cursor position.
    2. Open sub-toolbars
      1. The commands.moreText() method opens the more text actions toolbar.
      2. The commands.moreParagraph() method opens the more paragraph actions toolbar.
      3. The commands.moreRich() method opens the more rich text actions.
      4. The commands.moreMisc() method opens the more miscellaneous actions toolbar.
      5. The commands.moreTrackChanges() method opens the track changes actions toolbar.

All the methods do not accept any arguments, and you can call them from the editor instance. For example, to call the moreText command, you can do it like this

var editor = new FroalaEditor('.selector', {}, function () {

  // Call the method inside the initialized event.

  editor.commands.moreText ();

})

In the above code, the commands.moreText() method is called once the editor is initialized. This opens the “More Text” actions toolbar.

Customize The Editor Based on The Executed Commands

The Froala API provides developers with over 100 events that can be used to listen for specific actions performed by the user. Five of these events allow developers to customize the editor’s behavior and appearance based on the executed commands. By leveraging these events, developers can create highly interactive experiences tailored to their users’ needs. Let’s dig deeper into these events.

Execute Actions Prior to Command Execution

The commands.before event is triggered right before a command is executed. This allows developers to perform custom actions or validations before the command is carried out. For example, developers can use this event to display a confirmation dialog, update the UI, or perform any other action.

The command name is passed as the first parameter of the callback function for the commands.before event. To see the full list of commands that trigger this event, refer to the documentation. Depending on the command type, a second parameter may be defined in the callback function, providing information related to the executed command. For example, when the fontSize command is executed, the second parameter will be the selected font size.

Developers can listen to the commands.before event, check which command is being executed, and then take an appropriate action based on that command. For example:

var editor = new FroalaEditor('.selector', {
  events: {
    'commands.before': function (command, param) {
      // Perform custom actions here.
      console.log('Command about to be executed:', command);
      if(command== "fontSize"){
        if(param == "72px")
            this.inlineStyle.apply('color: red;');
      }      
    }
  }
});

In the above example, the `commands.before` event is used to listen for commands before they are executed. In this case, when the fontSize command is about to be executed, the code checks if the selected font size is 72px. If so, it applies a custom inline style to the editor, setting the text color to red. This shows how developers can customize the editor’s behavior based on the specific command being executed.

In the code, we used the inlineStyle.apply method to style the text. Click to learn more about the Froala Inline Style plugin and how it differs from the Inline Class plugin.

Execute Actions Following Command Execution

If you need to run custom code after a specific command is executed, you can use the commands.after event. This event is triggered immediately after a command is executed, allowing you to perform additional actions or update the UI as needed. The callback function for this event receives the same parameters as the commands.before event – the command name and any additional information related to the executed command.

Execute Actions According to the Clicked Button

Froala offers the commands.mousedown(btn) event which is triggered when a button in the editor’s toolbar is clicked. This allows developers to perform custom actions based on the specific button that was clicked. The callback function for this event receives the clicked button element as a parameter, which can be used to identify the button and execute the desired logic.

In the following example, the commands.mousedown event is used to listen for when a button in the editor’s toolbar is clicked. In this case, when the “Bold” button is clicked, the code checks the data-cmd attribute of the clicked button to identify the command. If the command is “bold”, it applies a custom inline style to the editor, setting the text color to red. This demonstrates how developers can customize the editor’s behavior based on the specific button that was clicked.

let editor = new FroalaEditor('#editor', {

        events: {

            'commands.mousedown': function(btn) {
                  // Do something here.
                  // this is the editor instance.
                  let cmd = btn[0].getAttribute('data-cmd');
                  if( cmd == "bold"){
            		this.inlineStyle.apply('color: red;');
                  }
  
           }
        }
    }, function () {

});

The Difference Between Before, After, and Mousedown Command Events

Here are the key differences between these events to help you choose the right one:

  • The Mousedown event is triggered before the Before and After events.
  • The Mousedown event can be triggered by any toolbar button, while the Before and After events are specific to certain commands.
  • The callback function for Before and After events may include a second parameter with additional information about the executed command.

Redo and Undo Specific Command Events

The Froala API also provides events for handling redo and undo actions. The commands.redo() event is triggered when the user performs a redo action, while the commands.undo()event is triggered when the user performs an undo action. These events allow developers to customize the editor’s behavior or update the UI in response to these actions.

For example, you could use the commands.redo event to update a counter or button state to reflect the current redo/undo state. Similarly, the commands.undo event could be used to update the UI to show that an action has been undone. By leveraging these events, developers can create a more responsive and interactive editor’s behavior.

Elevate Your Application User Experience

Froala’s powerful API and rich set of events provide developers with the tools to create highly customized and interactive content editing experiences. By leveraging the commands.before, commands.after, and commands.mousedown events, you can execute custom logic at key points in the editing workflow – before and after commands are executed, and when specific toolbar buttons are clicked.

These events, combined with the ability to inspect the executed commands and their parameters, give you granular control over Froala’s behavior. You can use this to display confirmations, update the UI, apply custom styles, and much more. The redo and undo-specific events also allow you to keep your application in sync with the user’s actions.

With this knowledge, you’re now equipped to take your Froala-powered applications to new heights. Start experimenting with command-driven events today and unlock the full potential of this robust WYSIWYG editor. Download Froala for free and try it out for yourself!

Inline Styles vs Classes: Best Practices for Froala-Powered Apps

inline styles and inline classes

Styling text is essential for modern web applications. Rich-text editors make it easy to style text and preview changes in real time. These editors provide various buttons to apply different styles to the text. Professional WYSIWYG editors, like Froala, go a step further. They allow developers to combine multiple formats for the end-user to apply with a single button, streamlining the process of applying styles. This helps create a consistent user experience for the end-user.

The Froala inline styles and inline classes plugins help in styling text but using two different approaches. Each approach has its advantages and disadvantages, and the choice between them depends on the project’s specific requirements. Inline styles are applied directly to the HTML element, while inline classes are applied to the element using a CSS class. The choice between the two depends on factors such as the complexity of the styling, the need for reusability, and the overall maintainability of the codebase.

In this article, we will explore the difference between inline styles and inline classes plugins, and provide guidance on when to use each approach. Understanding the differences between these two plugins can help developers make informed decisions and create more efficient and maintainable web applications.

Froala inline class and inline styles plugins

How Does The Froala Inline Style Plugin Work?

The Froala Inline Style plugin offers the inlineStyles option that is used to define some CSS styles that can be applied to text.

When the Froala Inline Style plugin is activated, a button appears on the editor toolbar that opens a list of the predefined styles. Choosing a style will apply its corresponding CSS rules inline to the selected text allowing end-users to effortlessly enhance the visual appeal of your text.

How Does The Froala Inline Class Plugin Work?

The Froala Inline Class plugin offers the inlineClasses option that is used to define some CSS class names that can be applied to text. The CSS classes themselves should be defined in the page stylesheet.

When the Froala Inline Class plugin is activated, a button appears on the editor toolbar that opens a list of the predefined styles. Choosing a style will apply its corresponding CSS class to the selected text allowing end-users to effortlessly enhance the visual appeal of your text.

Inline Style VS Inline Class

Both plugins offer a user-friendly way to make your text more engaging and visually appealing, helping you stand out with iconic text styles.

The choice between inline styles and inline classes often depends on the specific requirements of the project, such as the complexity of the styling, the need for reusability, and the overall maintainability of the codebase.

Inline styles are useful for simple, one-off styling requirements, as they can be quickly applied and don’t require additional CSS files. However, they can make the HTML code more cluttered and harder to maintain. Inline classes, on the other hand, allow for more modular and reusable styling, as the CSS can be defined in a separate file. This can lead to a more organized and maintainable codebase but may require more upfront effort to set up.

Developers should consider factors such as code maintainability, performance, and overall project requirements when deciding which approach to use. Ultimately, a combination of both techniques may be the most effective solution, allowing for flexibility and consistency in the application’s styling.

What is the difference between Inline Style, Inline Class, and Paragraph Style Plugin?

The Paragraph Style plugin in Froala is a separate plugin that allows users to apply predefined styles to entire paragraphs, rather than just inline text. In contrast, the Inline Style and Inline Class plugins focus on applying styles to selected text within a paragraph. The choice between these plugins depends on the specific needs of the project and the desired level of control over the text formatting.

Learn more about the Paragraph Style plugin.

The Inline Style and Inline Class Plugins in Code

Both plugins are included by default when the Froala packaged JavaScript file is included. However, if you’re using the core editor files only, you may include the plugins individually.

Installation

Use the following code to include the Inline Style plugin:

<script type='text/javascript' src='{url_based_on_your_download_option}/js/plugins/inline_style.min.js'></script>

Use the following code to include the Inline Class plugin:

<script type='text/javascript' src='{url_based_on_your_download_option}/js/plugins/inline_class.min.js'></script>

Activation

When customizing the enabled plugins, ensure that the inlineStyle and inlineClass values are included in the pluginsEnabled array to keep the Inline Style and Inline Class plugins enabled.

new FroalaEditor('#HTMLElement',{

   pluginsEnabled: ['image', 'link', 'video', 'inlineStyle', 'inlineClass']

});

When customizing the editor toolbar buttons, ensure that the inlineStyle and inlineClass values are included in the toolbarButtons array to display the buttons needed to open the dropdown corresponding to each plugin.

new FroalaEditor('#HTMLElement',{

    toolbarButtons: ['inlineStyle', 'inlineClass', 'bold', 'italic', 'underline', 'fontFamily', 'fontSize', '|', 'paragraphFormat', 'align', 'undo', 'redo', 'html'],

});

Styles Definition

For Inline Styles, define styles using inlineStyles option. It is an object where the property name is the text shown in the dropdown menu when the inlineStyle button is clicked while the property’s value is the inline CSS rules that will be applied to the text. For example, if the inlineStyles is

// Define new inline styles.

inlineStyles: {

      'Big Red': 'font-size: 20px; color: red;',

      'Small Blue': 'font-size: 14px; color: blue;'

}

This will display two options on the dropdown menu:

  • Big Red: once selected, the editor will wrap the selected text into <span style=”font-size: 20px; color: red;”> </span>.
  • Small Blue: once selected, the editor will wrap the selected text into <span style=”font-size: 14px; color: blue;”> </span>.

For Inline Classes, define styles using inlineClasses option. It is an object where the property name represents a CSS class and its corresponding value is the text shown in the dropdown menu when the inlineClasses button is clicked. For example, if the assigned object is

// Define new inline styles.

inlineClasses: {

   'fr-class-code': 'Code',

   'fr-class-highlighted': 'Highlighted',

   'fr-class-transparency': 'Transparent'

}

and define the classes in the CSS code

<style>

  .fr-view .fr-class-highlighted {

    background-color: #ffff00;

  }

  .fr-view .fr-class-code {

    border-color: #cccccc;

    border-radius: 2px;

    -moz-border-radius: 2px;

    -webkit-border-radius: 2px;

    -moz-background-clip: padding;

    -webkit-background-clip: padding-box;

    background-clip: padding-box;

    background: #f5f5f5;

    padding: 10px;

    font-family: "Courier New", Courier, monospace;

  }

  .fr-view .fr-class-transparency {

    opacity: 0.5;

  }

</style>

This will display three options on the  Inline Classes dropdown menu:

  • Code: when selected, the editor will toggle the ‘fr-class-code’ class in the selected text.
  • fr-class-code: when selected, the editor will toggle the ‘fr-class-highlighted’ class in the selected text.
  • fr-class-code: when selected, the editor will toggle the ‘fr-class-transparency’ class in the selected text.

Plugins Methods

The Inline Styles plugin provides the inlineStyle.apply(value) method, which can be used to dynamically apply inline styles to a text. The value parameter is a string that represents the inline CSS style to be applied to the selected text.

The Inline Class plugin provides the inlineClass.apply(value) method, which can be used to dynamically add a specific class to the selected text. The value parameter is the name of the defined class that should be applied to the selected text.

Full Code Example

Here is a full code example:

<!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' />

        <style>

          .fr-view .fr-class-highlighted {
            background-color: #ffff00;
          }
        
          .fr-view .fr-class-code {
            border-color: #cccccc;
            border-radius: 2px;
            -moz-border-radius: 2px;
            -webkit-border-radius: 2px;
            -moz-background-clip: padding;
            -webkit-background-clip: padding-box;
            background-clip: padding-box;
            background: #f5f5f5;
            padding: 10px;
            font-family: "Courier New", Courier, monospace;
          }
        
          .fr-view .fr-class-transparency {
            opacity: 0.5;
          }

        </style>
    </head>

    <body>

            <textarea id="editor"></textarea>


        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>

        <script> 
            new FroalaEditor('div#froala-editor', {
              toolbarButtons: ['inlineStyle', 'inlineClass', 'bold', 'italic', 'underline', 'strikeThrough', 'fontFamily', 'fontSize', '|', 'align', 'undo', 'redo', 'html'],
            
              // Define new inline styles.
              inlineStyles: {
                'Big Red': 'font-size: 20px; color: red;',
                'Small Blue': 'font-size: 14px; color: blue;'
              },
                  inlineClasses: {
                  'fr-class-code': 'Code',
                  'fr-class-highlighted': 'Highlighted',
                  'fr-class-transparency': 'Transparent'
                },
              events: {
                'commands.after': function(cmd) {
                  // Do something here.
                  // this is the editor instance.
                  if(cmd== "strikeThrough"){
                   this.inlineStyle.apply('font-size: 20px; color: red;');
\                  
                  }
                        // this is the editor instance.
                  if(cmd== "bold"){
                   this.inlineClass.apply('fr-class-code');
                  }
                }
              }
            })

        </script>
    </body>

</html>

Balancing Simplicity and Maintainability in Froala’s Rich-Text Editor

Froala, a popular rich-text editor, offers two approaches to enhancing the visual appeal of text in web applications: inline styles and inline classes. Both are powerful tools, but each has its own advantages and disadvantages.

Inline styles, as offered by Froala’s Inline Style plugin, provide a quick and easy way to apply formatting to text. With just a few clicks, you can wrap your selected text in custom CSS rules, making it stand out and grab your users’ attention. This can be particularly useful for simple, one-off styling requirements.

However, inline styles can also lead to cluttered HTML and maintainability issues over time. That’s where Froala’s Inline Class plugin comes in. This approach allows you to define CSS classes in your stylesheet and then easily apply them to text within the editor. While it may require a bit more upfront effort to set up, this modular and reusable approach can result in a cleaner, more organized codebase.

As you continue to build and enhance your web applications, I encourage you to download Froala and experiment with both the Inline Style and Inline Class plugins. Take the time to carefully consider the tradeoffs between the two approaches and choose the one that best fits your specific needs. With Froala’s powerful tools and the right techniques, you can create engaging and visually appealing content that captivates your users and helps your application stand out from the crowd.
Download Froala Editor

Classic, IFrame, Inline & Document Modes: HTML Editor Software Differences

popular rich text editor

Froala is a popular rich text editor that offers users various editing modes, each with its own user interface and use cases. As a writer or content creator, understanding the differences between these modes can help you select the most appropriate one for your project needs.

In this blog post, we’ll take a deep dive into the four main editing modes provided by Froala: Classic, IFrame, Inline, and Document. We’ll explore the key characteristics of each mode, their benefits, and the scenarios where they are best suited. By the end, you’ll have a solid understanding of Froala’s editing capabilities and be equipped to choose the right mode for your content creation workflows.

Froala editor modes

Classic Froala Editor

basic mode

The Classic mode is the default and most commonly used editing mode in Froala. In this mode, the editor is displayed as a standalone element on the page, typically within a <div> or <textarea> element.

This mode is the default mode in the Froala editor. You don’t need any special configuration when you initialize the editor.

<!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.min.css' rel='stylesheet' type='text/css' />
    </head>

    <body>

        <div id="froala-editor"></div>

        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.min.js'></script>
        <script> 

        	new FroalaEditor('div#froala-editor');

        </script>
    </body>

</html>

In this mode, the editor toolbar is always visible at the top of the editor. If you want to make the toolbar stay visible as you scroll the content, you need to enable the toolbarSticky option.

 new FroalaEditor('div#froala-editor', {
    toolbarSticky: true
  })

You can also display the toolbar at the bottom instead of the top of the editor by setting the toolbarBottom option to true.

new FroalaEditor('div#froala-editor', {

    toolbarBottom: true

  })

Explore how to customize the Froala editor toolbar.

The Froala classic mode is suitable for scenarios where you want the editor to be a distinct element on the page, such as in a content management system or a form. It provides a familiar and intuitive interface for users to input and format text.

IFrame Froala Editor

The IFrame mode embeds the Froala editor within an <iframe> element. This isolates the editor’s content and styling from the main page, providing a more secure and independent editing environment.

This mode is useful when you need to ensure the editor’s content and styles do not interfere with the surrounding page. It can be particularly helpful in scenarios where the page has complex layouts or existing styles that could potentially conflict with the editor.

The user interface of the editor is the same as it is in the classic mode.

To enable this mode, set the iframe option to true.

new FroalaEditor('div#froala-editor', {

iframe: true

})

Full Page Mode

The Full Page mode is similar to the classic mode but allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration. This mode is useful when you need to edit the entire web page, including the <head> and <body> sections. It provides a more comprehensive editing experience, allowing you to modify the page’s metadata, styles, and overall structure. The Full Page mode is particularly beneficial when working on standalone HTML pages or templates that require a complete document-level editing capability.

To enable the Full Page mode, set the fullPage option to true when initializing the Froala Editor.

new FroalaEditor('div#froala-editor', {
   fullPage: true
 })

Inline (Distraction-Free) Mode

inline mode

The minimalist interface of this mode helps you focus on your content. In Froala’s Inline mode, the editor’s toolbar remains accessible but stays hidden until needed, providing a clean and minimalist interface, ensuring a seamless and uninterrupted writing experience. This mode makes it easier for users to focus on their content.

var editor = new FroalaEditor('div#froala-editor',{

toolbarInline: true,

});

The toolbarVisibleWithoutSelection option allows you to control whether the toolbar should be displayed when the user:

  1. Select content within the editor.
  2. Focuses on the editor without selecting any content.

This gives you the flexibility to decide when the toolbar should be visible to the user.

var editor = new FroalaEditor('div#froala-editor',{

toolbarInline: true,

toolbarVisibleWithoutSelection: true,

});

By default, Froala displays Character and Word Counts at the bottom of the editing area. However, it may be feasible to hide this information in this mode.

var editor = new FroalaEditor('div#froala-editor',{

toolbarInline: true,

toolbarVisibleWithoutSelection: true,

charCounterCount: false,

wordCounterCount: false

});

This mode is suitable for scenarios where you want to provide a seamless editing experience within the page’s content, such as in a blog post or a content-heavy website.

Explore Froala’s inline editing mode.

Document Mode

document mode

The Document mode in Froala is similar to the classic mode but with a different default toolbar configuration optimized for creating online documents. The editing area is taller, providing an A4 page layout design. However, this mode does not offer page break, headers, or footers features. The Document mode is best suited for scenarios where you need a rich text editor with a document-like appearance, such as in a word processor or a report generator. The increased editing area height makes it easier to work with longer-form content.

The content is editable within the editor, and the changes are reflected in the underlying HTML structure.

To enable this mode, set the documentReady option to true.

new FroalaEditor('div#froala-editor',{

documentReady : true,

});

Edit in Popup

popup mode

The Froala editor’s “Edit in Popup” mode allows users to quickly update text content within a focused popup environment. In this mode, the toolbar functionality is not available, making formatting a text is not an option but users can easily make simple text updates without the complexity of the complete editor interface. To enable this mode, set the editInPopup option to true when initializing the Froala editor. The popup will appear when the user focuses on the text, providing a streamlined experience for updating specific content areas within your application.

new FroalaEditor('div#froala-editor',{

editInPopup : true,

});

What Are Froala Initialize Modes?

Froala is a flexible editor that can be initialized on different HTML elements, giving different UI and options for each.

The different modes we have discussed in this article can be applied when the editor is initialized on <div>, <p>, or <textarea> elements. However, the Froala editor can be initialized on other elements where these modes will not be applicable. For example:

  • Initialize on a Button: in this mode, a popup will be displayed to update the button text.
  • Initialize on an Image: The image popup will be displayed to replace or edit the image.
  • Initialize on a link: allowing you to update, remove, and set link attributes.

Conclusion

Froala rich text editor offers a variety of editing modes to cater to different use cases. The choice of editing mode will depend on the specific requirements of your project and the type of editing experience you want to provide to your users. By understanding the differences between the Classic, IFrame, Inline, and Document modes, you can choose the most appropriate mode for your project and provide a seamless and efficient editing experience for your users.

Try Froala for free and explore its different modes.

How WYSIWYG Editors Turned Us All Into Web Writers

icon

You’re already familiar with the online world: scrolling through social media, watching videos, reading articles like this one. But have you ever wondered how all those words, pictures, and videos actually get onto the web? Behind the scenes, it all boils down to code, specifically a language called HTML.

Now, before you run for the hills thinking you need to become a programmer, relax! While websites rely on HTML, most of us don’t write it directly. That’s where the magic of WYSIWYG text to HTML editors comes in. They’re like secret translators, letting you write for the web using familiar tools, while they handle the code stuff in the background.

What You See Is…Exactly What the Web Gets (Thanks to HTML)

WYSIWYG stands for “What You See Is What You Get,” and that’s the beauty of it. Instead of cryptic lines of code, you get a writing interface that looks and feels like what you’re used to: a word processor, but for online content. You type, you format, you add pictures—and poof—a webpage is born (well, almost).

Think of it like this: imagine writing a school report using your favorite app. You’ve got bold headings, bulleted lists, maybe even a picture or two. Now, imagine that while you’re busy making your report look awesome, a helpful friend is simultaneously translating every word and format into this other language that the printer understands (that’s the HTML part). You get to focus on the content, while your friend ensures it gets delivered in the right format.

That’s what a WYSIWYG editor does. You don’t need to memorize codes for bold text (it’s <b></b>, by the way) or remember how to insert an image the right way (that’s <img src=”…” alt=”…”>). The editor handles that, leaving you free to concentrate on what matters: your ideas.

 

 

Common WYSIWYG Features: Like Your Favorite Apps, But for Online Content

Here’s what makes these editors so user-friendly:

  • Text Formatting Galore: Change fonts, sizes, colors—all the usual suspects are there. Create headings, subheadings, and even those multi-level lists your teachers love, all without writing a single line of HTML.

  • Images and Media Made Easy: Forget about fiddling with file paths and code. With a WYSIWYG editor, you simply upload your pictures, videos, or even audio files, and drag them right into your content. The editor embeds them properly, ensuring they’ll show up on the webpage without a hitch.

  • And More!: Many editors include extras like tables, quotes, special characters, and even some basic layout options—all visually controlled, with the HTML neatly generated behind the scenes.

Code View: When a Little Peek Behind the Curtain Comes in Handy

While the magic of WYSIWYG is all about not dealing with code, many editors have a handy feature called “Code View.” This lets you switch from the visual editor to see the raw HTML it’s creating. Before you panic, remember, this isn’t about turning you into a programmer!

Code View has three main benefits:

  1. Troubleshooting: Ever have a picture refuse to show up or text stubbornly stuck in the wrong font? Sometimes, taking a peek at the HTML can reveal a simple error. Maybe a file name is misspelled, or a tag is in the wrong place. It’s like checking under the hood of a car—you don’t need to be a mechanic to spot a loose wire.

  2. Customization Power-Ups: For advanced users (or the curious), Code View offers a way to fine-tune things beyond what the basic menus allow. For example, you could add a bit of inline CSS code to change the color of a single word, something most visual editors don’t offer easily.

  3. Learning by Osmosis: Even if you never write a line of code yourself, seeing how the editor structures HTML can be surprisingly educational. You start to notice patterns, understand how things connect, and gain a deeper appreciation for the web’s underlying language.

Froala: An Example of WYSIWYG With a Code View Twist

Froala is one such WYSIWYG editor used in various online platforms. It’s not a website builder itself—think of it like a fancy text box plugged into a larger system. But what makes Froala neat is its powerful Code View feature.

Now, you don’t need to become a Froala expert. Here’s the key takeaway: Froala, like many editors, lets you switch between easy visual editing and looking at the code it generates.

Here’s a glimpse of how Froala lets developers access the code, but don’t worry too much about the specifics:


var editor = new FroalaEditor('#froala', {
  pluginsEnabled: ['codeView'],
  events: {
    'codeView.update': function () {
      document.getElementById("eg-previewer").textContent = this.codeView.get();
    }
  }
});


In simple terms, this code activates Froala’s Code View and allows developers to see and even change the underlying HTML if needed. It showcases the flexibility of such editors, catering to both casual users and those who like to tinker.

WYSIWYG Editors: Making the Web More Writeable for Everyone

The next time you’re writing an email, posting on social media, or even just typing a note, remember that the same ease of use now applies to creating content for the web. WYSIWYG text to HTML editors bridge the gap between human-readable text and the code computers understand.

And while most of us will never be coding experts, features like “Code View” offer a glimpse behind the curtain—a reminder that even the most complex websites start with simple words and a tool that makes putting those words online accessible to everyone.

 

Froala vs Quill in 2026: Which WYSIWYG Editor Actually Has AI?

Froala vs Quill in 2026: Which WYSIWYG Editor Actually Has AI?

If you’re choosing a rich text editor for your app in 2026, the conversation has shifted. Two years ago, the questions were about toolbars, paste handling, and browser support. Today, the first question developers ask is: Does this editor have AI built in, or am I bolting it on myself?

That shift matters more than it sounds. AI-assisted writing, rewriting, and summarisation have gone from “nice to have” to something users expect inside any content editing surface, the same way spell-check became invisible-but-mandatory a decade ago. So this update isn’t just a refresh of feature tables. It’s a look at how Froala and Quill have each responded to that shift, and whether either one is still the right pick for your project. WordPress raises a different set of demands entirely: integration, mobile, security, which our guide to what’s The Best WordPress Content Editor In 2024 works through.

Key Takeaways

  • Froala includes built-in AI features for chat, rewriting, tone adjustment, and translation.
  • Quill remains AI-free and requires custom development for any AI functionality.
  • Froala supports multiple AI providers, including OpenAI, Gemini, Claude, and self-hosted models.
  • Quill 2.0 modernises the editor with TypeScript support and improved architecture.
  • If AI-assisted content creation is a requirement, Froala is the more practical choice in 2026.

Froala: Built-In AI Assist and Provider Flexibility

Froala has spent the last two years pushing further into the AI space rather than away from it. The headline change is the AI Assist plugin, introduced in Froala v5.1, which puts two toolbar buttons directly in the editor for chatting with AI, adjusting tone, and translating content without switching tools or tabs.

What makes this implementation worth paying attention to is the flexibility. Froala didn’t lock AI Assist to a single provider. You can wire it up to OpenAI, Gemini, Claude, a self-hosted model, or your own backend, using one of three integration patterns: a quick direct-API connection for prototyping, a custom backend for production traffic (keeping API keys server-side), or an endpoint configuration option that lets Froala handle the request wiring for you. There are also hooks to intercept AI output before it’s inserted, which matters if you need to validate, filter, or log generated content before it reaches a user’s document.

Quill: Modern Core, But No Built-In AI

Quill, for its part, has continued its slow, deliberate evolution rather than chasing AI features. The big technical news here is Quill 2.0, a significant modernisation: the codebase was rewritten in TypeScript with official type definitions, SVG icons are now inlined (no more bundler loader configuration), and a new registry option allows multiple editor instances with different formats to coexist on the same page.

What Quill has not added is AI. As of 2026, Quill ships with zero built-in AI capabilities. If you want AI-assisted writing inside a Quill-based app, you’re building that integration yourself, wiring up your own API calls and UI around Quill’s existing event system. That’s consistent with Quill’s overall philosophy: a lean, unopinionated core that you extend rather than a packed-in feature set.

Feature comparison: Froala vs Quill in 2026

Now, let’s take a look at the feature comparison:

Feature Froala Quill
AI Assist (chat, rewrite, tone, translate) Yes (v5.1+) No (build your own)
Customization Yes Yes
Cross-platform Yes Yes
Code view Yes No
Full-featured API Yes Yes
Track changes Yes No
Markdown support Yes No
TypeScript support Yes Yes (native, v2.0+)
International / RTL support Yes No
508 / WCAG 2.0 / WAI-ARIA compliant Yes No
File management (Filestack integration) Yes No
License Commercial (subscription or perpetual) Free (BSD)

Is there a real AI comparison between Froala and Quill?

Froala vs Quill comparison in 2026

This is really the central question now, and the honest answer is: there isn’t much of a comparison to make. Froala built a dedicated AI plugin with provider flexibility and developer-facing controls. Mercury sits even further back on that curve, as our Froala vs Mercury comparison lays out.

Quill has none of that, and nothing in its public roadmap suggests it’s coming soon. If AI-assisted editing is a requirement for your product rather than a maybe-later feature, that alone may settle the decision before you look at anything else.

It’s worth noting that several newer, AI-native editors have entered the market specifically to fill the gap Quill leaves open, often built on frameworks like Lexical with AI included by default rather than as a paid add-on. If neither Froala nor Quill quite fits, say you want built-in AI without Froala’s commercial licensing, or you want something more modern than Quill without inheriting Froala’s per-product license model, it’s worth widening your search to that newer generation of editors before committing.

Documentation and AI Integration Guides

Froala still hosts comprehensive documentation on its own site: a quick-start guide, dozens of worked examples, how-to guides, and a dedicated FAQ section pulled from real support tickets. The AI Assist plugin specifically now has its own set of integration guides covering the direct-API, custom-backend, and endpoint-configuration patterns mentioned above.

Quill documentation has been updated alongside the 2.0 rewrite, with a refreshed quick-start guide and configuration reference. Community resources remain the main support channel beyond the official docs; there’s no dedicated AI documentation, since there’s no AI feature to document.

Ease of Use and Setup

Froala remains the easier out-of-the-box experience if your priority is shipping fast. Between the quick-start guide, the dedicated support team, and now a guided path for adding AI without re-architecting your app, most teams can get a fully featured, AI-capable editor running in a day.

Quill is still simple to drop into a project and has a clean, navigable API, especially after the TypeScript rewrite. But the gap has widened slightly: any AI capability now requires custom engineering work that Froala teams get out of the box, and support is still community-driven rather than vendor-backed. How much engineering time that gap actually costs is what our side-by-side WYSIWYG editor comparisons try to put a number on.

Pricing and AI Integration Costs

Froala continues to offer subscription and perpetual licensing across Basic, Professional, and Enterprise tiers, with the Enterprise tier required for SaaS or redistributed products. Perpetual licenses include 12 months of updates and support, with discounted renewal pricing after that window. The AI Assist plugin sits on top of this licensing structure rather than replacing it, and you’ll separately need an API key or budget for whichever AI provider you connect it to.

Quill is still free under the BSD license, with no tiers and no AI-related fees, because there’s no AI feature to charge for. The tradeoff, as before, is support: you’re relying on the open-source community rather than a vendor SLA, and now you’re also absorbing the engineering cost of any AI integration yourself. Quill leaves you to absorb that AI engineering cost; Tiptap charges for a toolkit instead, and Froala vs Tiptap in 2026 covers where that trade lands.

Which WYSIWYG HTML editor should I choose in 2026?

If AI-assisted writing is anywhere on your requirements list, Froala’s AI Assist plugin makes it the more straightforward choice, particularly because it doesn’t lock you into one AI vendor. For SaaS products, intranets, or mobile apps that want a fully packed, AI-ready editor without a custom build, Froala remains the stronger fit, and that’s increasingly true now that AI capability factors into the cost-benefit math, not just toolbar features.

If your project has no AI requirement, a tight budget, and engineering time to spare for customisation, Quill’s free license and modernised 2.0 core still make it a reasonable pick, particularly for teams that want full control over their document model and don’t mind building anything beyond the basics themselves. Balancing that need for manual customization against the feature sets of more robust commercial tools is a primary factor when selecting the best WYSIWYG editors for web developers.

Ready to integrate the right editor for your project? Start your free Froala trial and test AI Assist inside your own app before committing to a full integration.

Unlock the Power of Customizable Toolbars with Froala

Froala Customizable Toolbars

As a content creator, you know that a rich text editor is only as powerful as its customization capabilities. That’s why Froala stands out – it offers a flexible, modular architecture that lets you tailor the editor’s functionality and design to fit your unique needs.

The toolbar is a prime example. With Froala, you can position it at the top or bottom, and display it in a classic view or an inline layout. But the magic happens when you optimize the toolbar for different screen sizes, creating a truly responsive editing experience.

In this guide, we’ll dive deep into Froala’s robust toolbar customization options. You’ll learn how to override the default toolbar, create custom configurations based on device width, and even control the toolbar’s position, direction, and z-index. By the end, you’ll have the skills to craft a rich text editor that seamlessly integrates with your application’s design and workflow.

So if you’re ready to take your content creation tools to the next level, let’s get started unlocking the full potential of Froala’s customizable toolbar.

Custom toolbars for Froala

The Froala Default Toolbar

Let’s start with the following basic HTML template, including Froala’s core stylesheet and JavaScript files.

<!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.min.css' rel='stylesheet' type='text/css' />


<style>

            .container{
                margin: 5% auto;
                width: 80%;
                display: block;
            }


        </style>
    </head>

    <body>
        <div class="container">
            <textarea id="editor">
                <h1>Let's build something beautiful</h1>
                <p>You can customize the Froala toolbar according to your use case. </p>
            </textarea>
        </div>

        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.min.js'></script>

    </body>

</html>

Now, let’s initialize Froala using the default settings.

      <script> 

            var editor = new FroalaEditor('#editor');

        </script>

The Froala’s default toolbar has the following basic format options:

Froala default toolbar

Froala’s modular architecture is based on plugins. If a plugin is not included or deactivated, its toolbar buttons will not be displayed.

By replacing the Froala stylesheet and JavaScript files in the above code with the packaged version, the toolbar will display all the default plugins’ toolbar buttons.

<!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.pkg.min.css' rel='stylesheet' type='text/css' />


<style>

            .container{
                margin: 5% auto;
                width: 80%;
                display: block;
            }


        </style>
    </head>

    <body>
        <div class="container">
            <textarea id="editor">
                <h1>Let's build something beautiful</h1>
                <p>You can customize the Froala toolbar according to your use case. </p>
            </textarea>
        </div>

        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>

    </body>

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

Froala Full Featured Toolbar

If you do not use all these features, you can include the stylesheets and JavaScript files of the plugins you want to use only. This way you can optimize your application performance. Here is a complete list of Froala’s plugins.

Customizing the Froala Toolbar

Overriding The Default Toolbar

There may be situations where you include a plugin file but don’t need to display its toolbar buttons, or you may want to display the buttons of a custom plugin. In either case, to override the default toolbar, you can use the toolbarButtons option. This option allows you to specify the buttons you want to display in the toolbar. By default, this option is set to

{

  '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

  }

}

As you can see, by default, it is an object that has four sub-objects, each representing a toolbar section.

  • moreText
  • moreParagraph
  • moreRich
  • moreMisc

Each of these four objects can have the following properties:

  • buttons: is an array that contains the buttons to be displayed in that section.
  • align: is a string that determines the position of a section on the toolbar. It can have a value of either “right” or “left”. If not specified, the default value is “left”.
  • buttonsVisible: is an integer that represents the number of buttons directly visible on the toolbar. Any additional buttons are hidden behind a “Display More” option.

If you prefer the classic toolbar where all buttons are visible, you can assign an array to the toolbarButtons option instead of an object. To separate buttons into groups, add each group in a separate array within the main array.

    var editor = new FroalaEditor('#editor',{
        toolbarButtons: [
            ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile', 'insertHR'],

            ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],

            ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote'],

            ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
        ]
    });

Full featured classic toolbar

In arrays, you can use the pipe character ‘|’ to add a vertical separator between options on the toolbar.

    var editor = new FroalaEditor('#editor',{
        toolbarButtons: [
            ['insertLink', 'insertImage', 'insertVideo', '|', 'insertTable', 'emoticons', 'fontAwesome'],

            ['bold', 'italic', 'underline', '|', 'strikeThrough', 'subscript', 'superscript',  'fontFamily', 'fontSize', 'textColor', 'backgroundColor', '|', 'inlineClass', 'inlineStyle', 'clearFormatting'],

        ]

    });

Froala toolbar with vertical separator

Use hyphens ‘-’ to add a horizontal separator between options on the toolbar.

   var editor = new FroalaEditor('#editor',{
        toolbarButtons: [
            ['insertLink', 'insertImage', 'insertVideo', '-', 'insertTable', 'emoticons', 'fontAwesome'],

            ['bold', 'italic', 'underline', '|', 'strikeThrough', 'subscript', 'superscript', '-', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', '|', 'inlineClass', 'inlineStyle', 'clearFormatting'],

        ]

    });

Froala custom toolbar with horizontal separator

If you have only one group of buttons, you can put them in a single array instead of the nested array.

    var editor = new FroalaEditor('#editor',{
        toolbarButtons: ['bold', 'italic', 'underline', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],
        
    });

Froala custom toolbar

In this case, adding pipes ‘|’, will insert a white space between options.

   var editor = new FroalaEditor('#editor',{
        toolbarButtons: ['bold', 'italic', 'underline', '|', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', '|', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],
        
    });

Froala custom toolbar with white space

There are many ways to design your toolbar by just playing with the toolbarButtons option. This makes Froala Editor provide a highly customizable toolbar that allows you to tailor the available options to your specific needs. You can choose to display all buttons at once or group them into sections that can be expanded or collapsed. The toolbar can be aligned to the left or right, and you can control the number of directly visible buttons. This flexibility enables you to create a user interface that is both intuitive and efficient for your application.

Custom Froala Toolbar Based on The Screen or Editor Width

Froala provides several options to customize the toolbar buttons based on the screen or editor width. This allows you to optimize the user experience by showing the most relevant toolbar options for different device sizes.

The available options are:

  • toolbarButtonsMD: This option sets the list of buttons that appear in the rich text editor’s toolbar when the screen or editor width is larger than 992px and less than 1200px. If you don’t set this option, the toolbarButtons value will be used.
  • toolbarButtonsSM: This option sets the list of buttons that appear in the rich text editor’s toolbar when the screen or editor width is larger than 768px and less than 992px. If you don’t set this option, the toolbarButtonsMD value will be used.
  • toolbarButtonsXS: This option sets the list of buttons that appear in the rich text editor’s toolbar when the screen or editor width is less than 768px. If you don’t set this option, the toolbarButtonsSM value will be used.

By default, these options are responsive to the screen width. However, you can change this behavior to make the toolbar responsive to the editor width instead. To do this, set the toolbarResponsiveToEditor option to true. This can be useful if you want the toolbar to adapt to the size of the editor, rather than the overall browser window.

These options empower you with many benefits, such as:

  1. Optimized User Experience: By showing the most relevant toolbar options for different device sizes, you can provide a more intuitive and efficient editing experience for your users.
  2. Improved Performance: Reducing the number of toolbar buttons displayed on smaller screens can improve the overall performance and responsiveness of the Froala editor.
  3. Flexibility: The ability to customize the toolbar based on screen or editor width gives you greater control over the user interface, allowing you to tailor the editor to the specific needs of your application.

Here’s an example of how you can use these options to customize the toolbar:

var editor = new FroalaEditor('#editor', {
    toolbarResponsiveToEditor: true,
    toolbarButtonsMD: ['bold', 'italic', 'underline', 'align', 'formatOL', 'formatUL', 'insertLink', 'insertImage'],
    toolbarButtonsSM: ['bold', 'italic', 'underline', 'align'],
    toolbarButtonsXS: ['bold', 'italic', 'underline']
    });

In this example, the toolbar will display a larger set of buttons on medium and larger devices, a reduced set of buttons on small devices, and an even more minimal set of buttons on extra small devices. By making the toolbar responsive to the editor’s width, the layout and button visibility will adapt to the available space within the editor, providing an optimal user experience across different screen sizes.

Toolbar For RTL Language

When using Froala Editor with a right-to-left (RTL) language, you may want your editor toolbar buttons to start from the right. Froala provides the direction option to achieve this. By setting direction: 'rtl', the toolbar buttons will be displayed in the correct order and position for the RTL interface, providing a more natural and intuitive editing experience.

    var editor = new FroalaEditor('#editor', {
        toolbarButtons: ['bold', 'italic', 'underline', '|', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', '|', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],
        direction: 'rtl'    
    });

Froala RTL toolbar

Hide Toolbar Tooltips

You can also hide the tooltips that are shown when getting with the mouse over the buttons from the toolbar. To do this, set the tooltips option to false. However, we recommend keeping it enabled as tooltips can be helpful for users to understand the functionality of each toolbar button.

var editor = new FroalaEditor('#editor', {

 tooltips: false

});

Control Froala Toolbar Position

While you can configure the toolbar with more buttons or fewer buttons, another customization option is changing the toolbar position around the editor.

Bottom Toolbar

In some use cases, for example in chat applications or mobile-focused interfaces, it may be more desirable to position the toolbar at the bottom of the editor. This can be achieved by setting the toolbarBottom: true. This configuration will display the toolbar at the bottom of the editor, providing a more natural and intuitive layout for certain use cases.

Froala toolbar at bottom

Sticky toolbar

Another toolbar position option is the “sticky” toolbar, which keeps the toolbar visible at the top or bottom of the screen as the user scrolls through the content. This can be enabled by setting the toolbarSticky option to true. This ensures that the toolbar remains accessible and in view, even as the user scrolls, providing a more seamless editing experience. The sticky toolbar can be particularly useful when the editor is embedded within a larger page layout.

In this case, you can benefit from the toolbarStickyOffset option, which allows you to specify the vertical space in pixels from the top or bottom of the editor where the sticky toolbar should be fixed. This can be useful if you have other elements at the top of the page that you want the toolbar to remain below. By customizing the toolbar position, you can create a more intuitive and user-friendly interface that aligns with the specific needs of your application and its users.

var editor = new FroalaEditor('#editor', {

    toolbarButtons: ['bold', 'italic', 'underline', '|', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', '|', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],

    toolbarBottom: true,

    toolbarSticky: false,

    toolbarStickyOffset: 100,

    height: 1200

    });

Inline Toolbar

Alternatively, you can choose to display the toolbar in line with the editor content, rather than in a separate bar. This can be achieved by setting the toolbarInline option to true. You can learn more about how to use the inline mode in this guide.

Show information About Your Selection on The Toolbar

Another useful toolbar feature is the ability to display the font size, family, and paragraph format information of the user’s current selection on the toolbar. This can be enabled by setting the fontFamilySelection, fontSizeSelection, and paragraphFormatSelection options to true. This provides users with immediate feedback on the formatting of their selection, allowing them to quickly identify and adjust the font, size, or paragraph style as needed. By surfacing this information directly on the toolbar, the editing experience becomes more intuitive and efficient. These toolbar customization options give you the flexibility to tailor the Froala editor’s user interface to best suit the needs of your specific application and its users, enhancing the overall content creation and editing workflow.

var editor = new FroalaEditor('#editor', {

    toolbarButtons: ['bold', 'italic', 'underline', '|', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', '|', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],

    toolbarBottom: true,

    toolbarSticky: false,

    toolbarStickyOffset: 100,

    height: 1200,

    fontFamilySelection: true,

    fontSizeSelection: true,

    paragraphFormatSelection: true

});

See an example of show selection details in the Froala toolbar.

Control Multiple Editors From a Shared Toolbar

Froala Editor allows you to control multiple editors on the same page using a shared toolbar. This can be useful when you have multiple rich text editors on a single page and want to provide a consistent user experience.

To achieve this, you can use the toolbarContainer option. This option allows you to specify a CSS selector for an external container where the toolbar will be placed. All the editors on the page will then share this common toolbar.

Here’s an example:

<!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' />


<style>

            .container{
                margin: 5% auto;
                width: 80%;
                display: block;
            }


        </style>
    </head>

    <body>
        <div class="container">
            <div id="toolbarContainer"></div>
            <p>Some dummy content.</p>
            <p>Some dummy content.</p>

            <h2>Editor 1</h2>

            <textarea id="editor1">
                <h1>Let's build something beautiful</h1>
                <p>You can customize the Froala toolbar according to your use case. </p>
            </textarea>
            <p>Some dummy content.</p>

            <h2>Editor 2</h2>
            <textarea id="editor2">
                <p>This editor toolbar is in another Div.</p>
            </textarea>
        </div>

        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>


        <script> 
            var editor1 = new FroalaEditor('#editor1', {
                toolbarButtons: ['bold', 'italic', 'underline', '|', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', '|', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],
                toolbarContainer: '#toolbarContainer'
            });
        
            var editor2 = new FroalaEditor('#editor2', {
                toolbarButtons: ['bold', 'italic', 'underline', '|', 'alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', '|', 'undo', 'redo', 'fullscreen', 'print', 'getPDF', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome'],
        
                toolbarContainer: '#toolbarContainer'
            });
        </script>
    </body>

</html>

Shared toolbar

In the above code, we have a shared toolbar container with the ID `#toolbarContainer`. Both editors, `editor1` and `editor2`, are configured to use this shared toolbar container by setting the toolbarContainer option and configuring the toolbarButtons to have the same buttons in both editors. This allows the toolbar to be displayed in a single location, providing a consistent user interface across multiple editors on the same page.

If the toolbarButtons option has different settings for each editor, it will result in two separate toolbars – one for each editor.

By sharing the toolbar, any insertion made in the editor (e.g., inserting an image) will be reflected in the active editor.

The Froala Toolbar Is Not Showing

If the toolbar is not appearing, the problem is most likely in the configuration of the toolbar option. However, sometimes the problem is the toolbar is hidden under other page elements. In this case, you can use the Froala zIndex option to fix this. This option sets the zIndex on the editor toolbars and popups.

For example, if the toolbar is hidden behind a fixed header, you can set the z-index option to a higher value to ensure the toolbar is displayed on top. This can be done by setting the zIndex option when initializing the Froala Editor:

var editor = new FroalaEditor('#editor', {

  zIndex: 2000 // Set a higher z-index value

});

Adjusting the z-index can help resolve issues where the toolbar is obscured by other page elements, ensuring the editor’s functionality remains accessible and intuitive for users.

Unleash the Power of Froala’s Customizable Toolbar

Froala’s flexible and customizable toolbar provides a powerful way to tailor the rich text editor to your specific needs. You can optimize the toolbar layout for different screen sizes and editor widths. You also have the ability to control the toolbar position. This ensures an intuitive and efficient editing experience across devices.

Additional customization options, such as setting the toolbar direction and displaying selection details, give you even greater flexibility to create a polished, user-friendly interface.

By taking advantage of Froala’s robust toolbar customization capabilities, you can craft a rich text editing experience that seamlessly integrates with your application’s design and functionality. Unlock the full potential of Froala and create content management solutions that delight your users.

Ready to build your custom Froala toolbar? Get started today and elevate your content creation workflows!

Making a Simple Cross-Platform Linux WYSIWYG HTML Editor Using React

graphical user interface, icon

Are you building websites on Linux? You might need a cross-platform Linux WYSIWYG HTML editor that lets you edit text easily, just like in a word processor. Let’s talk about how to make one using React with Froala’s React WYWIYG Editor. We’ll also look at ways to make it work well on different Linux web browsers.

Key Points to Remember:

  • Learn about browser issues affecting cross-platform Linux WYSIWYG HTML editors
  • See how to add a WYSIWYG editor to a React website
  • Find out how quick insert helps you add content faster in your cross-platform Linux WYSIWYG HTML editor
  • Get tips to make your editor work smoothly on all systems

Browser Challenges for Cross-Platform Linux WYSIWYG HTML Editors

First, let’s chat about web browsers on Linux. Unlike Windows or Mac, Linux has many different browsers. This can make it hard to be sure your cross-platform Linux WYSIWYG HTML editor works everywhere.

Some common Linux browsers are:

  1. Firefox
  2. Chromium
  3. Opera
  4. Brave
  5. Vivaldi

Each of these browsers might show web pages a bit differently. So, it’s really important to test your editor on all of them. For example, Firefox might display your editor’s toolbar in one way, while Chromium might show it slightly differently. These small differences can add up and affect how people use your editor.

cross browser froala

Adding a WYSIWYG Editor to React

Now, let’s see how to add an editor to your React website. To start, you need to make a new React project. Here’s how:

npx create-react-app linux-wysiwyg-editor
cd linux-wysiwyg-editor

Next, you’ll need to install a text editor package. For this example, we’ll use one called Froala:

npm install react-froala-wysiwyg --save

After that, make a new file called EditorComponent.jsx in your src folder. Here’s what to put in it:

import React from 'react';
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/js/plugins/quick_insert.min.js';
import 'froala-editor/css/plugins/quick_insert.min.css';
import FroalaEditorComponent from 'react-froala-wysiwyg';

function EditorComponent() {
  // Set up a custom button
  FroalaEditor.DefineIcon('customButton', { NAME: 'star', SVG_KEY: 'star' });
  FroalaEditor.RegisterQuickInsertButton('customButton', {
    icon: 'customButton',
    title: 'Add Special Content',
    callback: function() {
      this.html.insert('Special content added!');
    },
    undo: true
  });

  const config = {
    heightMin: 300,
    placeholderText: 'Start writing here...',
    quickInsertEnabled: true,
    quickInsertButtons: ['image', 'table', 'ol', 'ul', 'customButton'],
    quickInsertTags: ['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
    events: {
      'contentChanged': function() {
        console.log('Text updated');
      },
      'quickInsert.commands.before': function(cmd) {
        console.log('About to add:', cmd);
      },
      'quickInsert.commands.after': function(cmd) {
        console.log('Just added:', cmd);
      }
    }
  };

  return (
    <div className="editor">
      <h2>Linux Text Editor</h2>
      <FroalaEditorComponent tag='textarea' config={config} />
    </div>
  );
}

export default EditorComponent;

This code sets up a basic cross-platform Linux WYSIWYG HTML editor with some helpful features. For instance, it includes a special button and quick insert options to help you add content faster.

Understanding the Code

Let’s break down what this code does:

  1. First, we import all the necessary styles and components.
  2. Then, we create a custom button. This button will add some special content when clicked.
  3. We set up the editor configuration. This includes things like the minimum height of the editor and what buttons to show in the quick insert menu.
  4. We also set up some event handlers. These will log messages when content changes or when quick insert commands are used.
  5. Finally, we return the editor component, which will be rendered on the page.

Making Your Cross-Platform Linux WYSIWYG HTML Editor Work on All Browsers

To make sure your editor works well on all Linux browsers, try these ideas:

  1. Use a CSS reset: This helps make things look the same on different browsers. A CSS reset removes the default styling that browsers apply to HTML elements. This gives you a clean slate to work with, making it easier to create a consistent look across browsers.
  2. Test on many browsers: Don’t just use one. Instead, try it on Firefox, Chromium, and others. Each browser may have its own quirks, so testing on multiple browsers helps you catch and fix issues early.
  3. Check for features, not browsers: This is better than looking for specific browsers. Instead of writing code that works differently for each browser, write code that checks if a specific feature is available. This approach, called feature detection, makes your code more flexible and future-proof.
  4. Keep your tools up to date: Regularly update React, your editor, and other tools you use. New versions often include bug fixes and performance improvements that can help your editor work better across different browsers.
  5. Follow web standards: This helps avoid problems with different browsers. When you use standardized HTML, CSS, and JavaScript, you’re more likely to get consistent behavior across browsers.
  6. Use a test computer: If you’re not on Linux, use a virtual machine to test your editor. This lets you see how your editor works on actual Linux systems, which can be different from how it works on Windows or Mac.

Keeping Your Editor Fast

On older Linux computers, your editor might run slowly. However, here are some ways to make it faster:

  1. Only load it when needed: This keeps your whole website fast. If your editor is only used on certain pages, don’t load it on every page. This is called lazy loading, and it can significantly improve your website’s overall performance.
  2. Don’t check for changes too often: Wait a bit before running code for each change. This technique, called debouncing, can greatly reduce the number of times your code runs, making your editor more efficient.
  3. Make images smaller: Big images can slow things down. If your editor allows users to upload images, make sure to compress them before displaying them. This can dramatically reduce load times, especially on slower internet connections.
  4. Be smart with data: This helps when working with long documents. Instead of loading the entire document at once, consider loading it in chunks as the user scrolls. This technique, called virtualization, can make your editor feel much faster when working with large amounts of text.

Adding Advanced Features

Once you have your basic editor working, you might want to add more advanced features. Here are a few ideas:

  1. Spell checking: This can help users catch typos as they write. You could use a library like spellchecker-wasm to add this feature.
  2. Markdown support: If your users are familiar with Markdown, you could add support for Markdown syntax. This would let users write in Markdown and see the formatted result in real-time.
  3. Collaboration: Real-time collaboration can be a powerful feature. You could use a library like yjs to add this capability, allowing multiple users to edit the same document simultaneously.
  4. Auto-save: Automatically saving the user’s work can prevent lost progress. You could implement this by periodically sending the editor’s content to your server.

Wrapping Up

To sum up, making a text editor for Linux using React can be a fun and rewarding project. By using React and adding features like quick insert, you can make a useful tool for writing on websites.

Remember to focus on making it work well in different browsers, keeping it fast, and making it easy to use. Also, test your editor often on different Linux setups to find any problems early.

Lastly, keep learning about new web tools and browser updates. The web is always changing, and knowing what’s new will help you keep your editor working well for everyone who uses it.

With these tips and ideas, you’re ready to start making a great text editor for Linux. Good luck with your coding!

Rich Text to HTML Editors: Making Web Development Easier with Code View

icon

Have you ever wondered how websites let you write fancy text without knowing HTML? That’s where rich text to HTML editors come in handy. These tools are super useful for web developers. Today, we’re going to explore how these editors work, especially the cool “code view” feature.

 

Key Takeaways

  • Rich text editors let anyone create nice-looking content without writing HTML
  • Code view lets developers see and edit the actual HTML
  • Switching between normal view and code view gives more control over content
  • You can make things happen automatically when someone changes the code view
  • Adding code view makes content editing more powerful and flexible

What Are Rich Text to HTML Editors?

First of all, let’s talk about rich text editors. These are tools that make it easy for people to write fancy text on websites. You can make words bold, add pictures, and organize your writing without knowing any complicated code. Behind the scenes, these editors turn your writing into neat HTML code.

Why Code View is Awesome

Now, while most people are happy just writing their content, sometimes developers need to see what’s happening under the hood. That’s where code view comes in. It’s like peeking behind the curtain to see how the magic happens.

Here’s why code view is so cool:

  1. You can fix tricky problems that you can’t see in the normal view
  2. You can add special code to make your content look exactly how you want
  3. It helps make websites easier to use for people with disabilities
  4. You can clean up messy code to make your website faster

How to Use Code View

Let’s look at how you might set up code view in a rich text editor. Don’t worry if this looks complicated – it’s just an example!

var editor = new FroalaEditor('#froala', {
  pluginsEnabled: ['codeView'],
  codeViewKeepActiveButtons: ['selectAll'],
  events: {
    'codeView.update': function () {
      document.getElementById("eg-previewer").textContent = this.codeView.get();
    }
  }
});

This code does a few things:

  • Enable code view: This allows users to directly interact with the code.

  • Maintain “select all” functionality: Ensure users can still easily select all code within code view.

  • Dynamic response to code changes: Trigger an action or update based on modifications made in the code view.

Making Things Happen Automatically

One of the coolest things about code view is that you can make stuff happen automatically when someone changes the code. For example, you could update a preview of your website in real-time as you type.

A Real-Life Example

Let’s put it all together with a real example. Imagine you’re building a website where people can write blog posts. You want to give them a normal editor, but also let them see the HTML if they want to. Here’s how that might look:

<h1>Code View Plugin</h1>
<div id='froala'>
 Open the code viewer, edit the code and close the code view mode, this will trigger the codeView.update event and in this example, the HTML code inside the code view mode will appear under the editor.
</div>
<br/>
<pre id="eg-previewer">
</pre>

And here’s the code that makes it work:

 

var editor = new FroalaEditor('#froala', {
  pluginsEnabled: ['codeView'],
  codeViewKeepActiveButtons: ['selectAll'],
  events: {
    'codeView.update': function () {
      document.getElementById("eg-previewer").textContent = this.codeView.get();
    }
  }
});

 

This code sets up an editor where people can write normally. But if they want to, they can also see and edit the HTML code. Whenever they make a change in code view, it automatically updates a preview of the HTML below the editor.

Wrapping Up

In conclusion, rich text to HTML editors with code view are super helpful tools for web developers. They make it easy for anyone to create nice-looking content, while still giving developers the power to tweak things behind the scenes.

By adding code view to your projects, you’re giving yourself and your users more control and flexibility. Whether you’re building a blog, a website builder, or any other kind of web app, consider using a rich text editor with code view. It’s like having the best of both worlds – easy for beginners, but powerful for experts!

 

Create and Edit Web Content with a Distraction-Free HTML Editor Software

HTML Editor Software

Did you try editing some content before and get annoyed with the editor toolbar or frame? If yes, I have the solution for you. You should try inline distraction-free mode from Froala rich-text HTML editor software. This mode provides a clean and minimalist interface, making it easier to write and edit your content. The editor’s features are still accessible, but they are hidden until needed, providing a seamless and uninterrupted writing experience. This can be particularly useful for tasks such as drafting blog posts, creating web pages, or composing long-form content, where a distraction-free environment is essential for productivity and creativity.

In this article, we will explore the benefits of using distraction-free rich text HTML editor software like Froala. We’ll discuss how it can streamline your content creation process, improve focus, and enhance the overall quality of your web content. Additionally, we’ll explore how to implement it, ensuring a seamless and efficient writing experience. By the end of this article, you’ll have a better understanding of how a distraction-free WYSIWYG editor can revolutionize your content.

Distraction free inline editor

What is Froala WYSIWYG Editor?

Froala WYSIWYG Editor is a powerful and feature-rich text editor that allows you to create and edit web content with ease. It offers a wide range of formatting options, including bold, italic, underline, font size, and color, as well as the ability to insert images, videos, and links. The editor also supports advanced features like tables, math formulas, and custom plugins, making it a versatile tool for web development.

Froala’s default user interface (UI) includes a flat, responsive toolbar, a content editing area, and a bottom toolbar. However, you can easily customize Froala’s interface to fit your specific needs. One of the key features of Froala is its inline distraction-free mode.

What is Froala’s Inline Distraction-Free Mode?

Froala inline distraction-free mode provides a clean and minimalist interface, allowing you to focus on your writing, while still having access to Froala’s powerful formatting and editing tools when needed. In this mode, the editor toolbar is hidden until you click or select the editor content. This allows you to see the page from the end user’s perspective, providing a clear view of how the content and layout will appear to the audience. With this tool, you can easily identify which areas of the page need improvement, without having to switch to the frontend view.

Froala inline mode

This mode can help you maintain a consistent flow of ideas, reduce distractions, and ultimately produce higher-quality content that engages your audience. By leveraging Froala’s distraction-free mode, you can streamline your content creation process and create a more immersive and engaging experience for your readers.

How to use Froala’s as an Inline Editor?

To use Forala as an inline editor, you should set the toolbarInline option to true

Here is a full example:

  1. Open your preferred code editor.
  2. Start a new project.
  3. Add a simple HTML document.
  4. Include Froala stylesheet and JavaScript files.
  5. Add an HTML element to load the editor at.
  6. Add a script with the Froala initialization code.
  7. In the initialization code, set the toolbarInline option to true.
<!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' />


<style>

            .container{
                margin: 5% auto;
                width: 80%;
                display: block;
            }


        </style>
    </head>

    <body>
        <div class="container">
            <textarea id="editor">
                <h1>Let&#39;s build something beautiful</h1>
                <p data-pm-slice="1 1 []" id="isPasted">Froala inline distraction-free mode <span data-testid="ai-text">provides a clean and minimalist interface, allowing you to focus on your writing, while still having access to Froala&#39;s powerful formatting and editing tools when needed.</span> In this mode, the editor toolbar is hidden until you click or select the editor content. This allows you to see the page from the end user&#39;s perspective, providing a clear view of how the content and layout will appear to the audience. With this tool, you can easily identify which areas of the page need improvement, without having to switch to the frontend view. </p>
            </textarea>
        </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('#editor',{
                toolbarInline: true

            });
        </script>
    </body>

</html>

 

Displaying The Editor Toolbar Without Selection

By default, in the Froala Inline mode, the toolbar is displayed only when content is selected. If you want the toolbar to be visible even when the cursor is between content, set the toolbarVisibleWithoutSelection option to true.

var editor = new FroalaEditor('#editor',{

    toolbarInline: true,

    toolbarVisibleWithoutSelection: true,

});

Froala inline mode without selection

This can provide a more intuitive and accessible writing experience, as users can quickly access formatting options without having to explicitly select the content first.

Hiding Character and Word Counts

The Froala editor displays the character and word counts under the content. This is beneficial to many users and helps them track their writing progress. However, if you prefer a more distraction-free experience, you can hide these counts by setting the charCounterCount and wordCounterCount options to false. This will remove the character and word count displays, allowing users to focus solely on the content creation process without being distracted by numerical metrics.

var editor = new FroalaEditor('#editor', {

    toolbarInline: true,

    toolbarVisibleWithoutSelection: true,

    charCounterCount: false,

    wordCounterCount: false

});

Inline Editor Multiple Instances

In some applications, developers came across the need to have multiple Froala inline editors on the same page. This can be achieved by simply initializing the Froala editor on multiple elements on the page. Each instance will have its own toolbar and content area, allowing users to edit different sections of the page independently. This flexibility is particularly useful in scenarios where you need to allow users to edit specific content blocks or sections while maintaining a consistent and distraction-free editing experience across the entire page. By leveraging multiple Froala inline editors, you can create a more modular and customizable content management system tailored to your specific requirements.

If multiple editors have the same options, you can simply pass their IDs in the initialization function.

var editor = new FroalaEditor('div#froala-editor1, div#froala-editor2',{

    toolbarInline: true,

    toolbarVisibleWithoutSelection: true,

    charCounterCount: false,

    wordCounterCount: false

});

Enhance User Experience

Froala gives you over 240 options to tailor your editor to your specific needs and preferences. By leveraging these options, you can create a highly customized and intuitive editing experience for your users. For example, you can adjust the toolbar layout, enable or disable certain features, and even integrate the editor with other tools and services to streamline your content creation workflow. This level of flexibility allows you to tailor the Froala editor to perfectly match your application’s branding, design, and functionality requirements, ensuring a seamless and engaging user experience.

For instance, you can utilize the fontFamilySelection, fontSizeSelection, and paragraphFormatSelection options to immediately view the selected font family, font size, and paragraph format in the WYSIWYG HTML editor’s toolbar.

var editor = new FroalaEditor('#editor',{

    toolbarInline: true,

    toolbarVisibleWithoutSelection: true,

    charCounterCount: false,

    wordCounterCount: false,

    fontFamilySelection: true,

    fontSizeSelection: true,

    paragraphFormatSelection: true

});

Unlock Your Content’s Potential with Froala’s HTML Editor Software Distraction-Free Mode

By now, you’ve seen how Froala’s inline distraction-free mode can revolutionize your content creation process. This powerful tool lets you focus on what matters most – crafting engaging, high-quality web content that resonates with your audience.

No more distractions from cluttered toolbars or unnecessary features. With Froala’s HTML editor software clean, minimalist interface, you can immerse yourself in your writing, refine your ideas, and bring your vision to life. And when you need to access Froala’s advanced formatting options, they’re just a click away, seamlessly integrating into your workflow.

So what are you waiting for? Take the first step towards unlocking your content’s full potential. Implement Froala’s distraction-free mode today and experience the difference it can make in your productivity, creativity, and the overall quality of your web content. Your audience is waiting – let’s get started.

Enhance Your Content with beautiful Photos Using the Image Tui Plugin

TUI plugin - edit images and add filters

WYSIWYG editors simplify web content creation by allowing users to format their content without having coding skills. For instance, you can insert images by uploading them through a simple user interface and see how they will look on the web page. The editor is responsible for writing the HTML code to display the image.

In this article, we aim to enhance the user experience by enabling image manipulation before insertion in the editor. Users can crop, flip, rotate, draw, and add shapes, icons, text, mask filters, and image filters using the Toast UI Image editor. This editor is integrated flawlessly with the Froala editor using its Image Tui Plugin.

With the Image Tui Plugin, users can effortlessly enhance their content with visually striking images that perfectly match their desired aesthetic. This empowers content creators to produce more engaging and visually appealing web pages without the need for specialized image editing software. Let’s learn how it works.

What is The Toast UI Image Editor?

The Toast UI Image Editor is a free, open-source JavaScript tool for editing images using HTML5 Canvas. It offers a user-friendly interface and powerful image filters, making it a convenient tool for image editing. The editor is widely supported across major web browsers, including Chrome, Internet Explorer 10+, Edge, Safari, and Firefox. Its responsive design ensures a good user experience on screens with a minimum size of 550 x 450 pixels. The editor theme can be easily customized using the editor API.

The Toast UI Image Editor Features

The editor comes with a wide range of great photo manipulation features, suitable for most use cases:

  • Load image to canvas
  • Undo/Redo (With shortcut)
  • Download
  • Reset
  • Delete Object(Shape, Line, Mask Image…)
  • Crop
  • Flip
  • Rotation
  • Resize
  • Free drawing
  • Line drawing
  • Shape
  • Icon
  • Text
  • Mask Filter
  • Image Filter
    • Grayscale
    • Invert
    • Sepia
    • Blur Sharpen
    • Emboss
    • Remove-white
    • Brightness
    • Noise
    • Pixelate
    • Color filter
    • Tint
    • Multiply
    • Blend

Integrating The Toast UI Image Editor With The Froala WYSIWYG Editor

The integration between the Toast UI Image Editor and Froala WYSIWYG editor is very simple, thanks to the Image Tui plugin.

Include Froala Editor Files

Let’s begin with a basic setup of Froala editor in a simple HTML web page:

  1. Include Froala Stylesheet and JavaScript files.
  2. Add HTML element to load editor at.
  3. Add a script with the Froala initialization code.
<!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.min.css' rel='stylesheet' type='text/css' />
        <style>
            body{
                background-color: black;

            }
            .container{
                margin: 5% auto;
                width: 80%;
                display: block;
            }

            .container h1{
                color: #fff;
                text-align: center;
            }

        </style>
    </head>

    <body>
        <div class="container">
            <h1 class="header">Let's build something beautiful</h1>
            <div id="example"></div>
        </div>

        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.min.js'></script>  
        <script> 
            var editor = new FroalaEditor('#example');
        </script>
    </body>

</html>

This will load the basic Froala editor features.

Froala core editor

Include The Toast UI Image Editor Files

To use the Toast UI Image Editor, include its stylesheet and JavaScript files.

        <link rel="stylesheet" href="https://uicdn.toast.com/tui-color-picker/latest/tui-color-picker.css">
        
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.6.7/fabric.min.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/tui-code-snippet@1.4.0/dist/tui-code-snippet.min.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/tui-image-editor@3.2.2/dist/tui-image-editor.min.js"></script>

Include The Froala TUI Image Plugin Files

The Froala TUI Image plugin requires Froala’s Image plugin to be active. Let’s include the stylesheet and JavaScript files for the image and TUI plugins.

        <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/plugins/image.min.css' rel='stylesheet' type='text/css' />
        <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/third_party/image_tui.min.css' rel='stylesheet' type='text/css' />
    
        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/image.min.js'></script> 
        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/third_party/image_tui.min.js'></script>

How It Works

When you run the editor with the above setup, you can edit images using the Toast UI Image Editor by following these steps:

  1. Insert an image into the editor.
  2. Click on the image to edit it.
  3. Click on the “Advanced Edit“ button from the displayed popup.
  4. Start editing the image using the Toast UI Image Editor.
  5. Save changes to use the edited image instead of the original one.

Froala TUI plugin

Customizing The Froala Editor

While customizing the editor, keep your eye on the following options to avoid accidentally deactivating the Toast UI Image Editor.

pluginsEnabled

This option tells the editor which plugins are enabled and can be used by users. If you are customizing this option, make sure you have added the image and the imageTUI plugins.

var editor = new FroalaEditor('#example',{

    pluginsEnabled: ['image', 'imageTUI'],

});

toolbarButtons

This option controls the buttons displayed on the Froala toolbar. If you are customizing this setting, ensure that you have included the InsertImage button.

var editor = new FroalaEditor('#example',{

    pluginsEnabled: ['image', 'imageTUI'],

    toolbarButtons: ['insertImage'],

});

imageEditButtons

This option determines the buttons shown on the Edit Image popup. Make sure the imageTUI button is included. This will allow users to open the TUI image editor.

var editor = new FroalaEditor('#example',{

    pluginsEnabled: ['image', 'imageTUI'],

    toolbarButtons: ['insertImage'],

    imageEditButtons: ['imageReplace', 'imageAlign', 'imageCaption', 'imageRemove', 'imageTUI']

});

Customizing The TUI Plugin

The Toast UI Image Editor has a powerful API that helps customize the features displayed to the user and the editor UI. When the Toast UI Image Editor is integrated into the Froala editor through the TUI plugin, you can customize the TUI editor by utilizing the imageTUIOptions option.

            var editor = new FroalaEditor('#example',{
                pluginsEnabled: ['image', 'imageTUI'],
                toolbarButtons: ['insertImage'],
                imageEditButtons: ['imageReplace', 'imageAlign', 'imageCaption', 'imageRemove', 'imageTUI'],
                imageTUIOptions: {
                    includeUI: {
                        initMenu: "filter",
                        menuBarPosition: "right",
                        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"
                        }
                    }
                }

            });

Do I need to subscribe to a specific plan for using the Froala TUI plugin?

The Froala TUI plugin, as well as other Froala plugins, are available in any of the Froala’s plans. Check our pricing page and select the plan that best fits your needs. Froala’s flexible licensing options ensure you can utilize the full capabilities of the TUI plugin, tailored to your specific requirements, with no additional costs or restrictions.

Does Froala Offer a Free Trial?

You can try Froala for free by downloading the editor and using it on your localhost or staging site. The unlicensed editor displays an alert message under the toolbar; however, it doesn’t restrict any features of the editor. Once you are ready to use the editor in production, purchase a license to get the API key and remove the unlicensed message.

Elevate Your Content with Visually Stunning Images

The integration of the Toast UI Image Editor with the Froala WYSIWYG editor through the Image TUI plugin is a game-changer for content creators. This powerful combination empowers you to effortlessly enhance your web content with visually striking, professionally edited images.

No longer are you limited to basic image insertion. With the Toast UI Image Editor, you can unleash your creativity, cropping, flipping, rotating, drawing, and applying a wide range of filters to your images – all within the familiar Froala editor interface. This allows you to produce more engaging, visually appealing content without the need for specialized image editing software.

So what are you waiting for? Start your Froala WYSIWYG editor free trial today. Captivate your audience, boost your brand, and take your online presence to new heights. The tools are at your fingertips – all you need to do is unlock their potential.

Froala vs Tiptap 2026: Which AI Rich Text Editor Is Worth It?

Froala vs Tiptap 2026: Which AI Rich Text Editor Is Worth It?

Froala gives you a ready-made, fully featured editor; Tiptap gives you a headless framework and the freedom (and responsibility) to build your own UI on top of it. That distinction still holds in 2026. What’s changed is that both editors have rebuilt their AI offerings and their pricing models since then, in ways that materially affect which one is the better deal depending on what you’re building.

Froala is still the feature-rich, customizable rich-text editor for teams who want rapid deployment with a polished, ready-made UI. Tiptap is still the open-source headless framework for developers who want to build their own editor from the ground up. But where our original comparison listed AI as a Tiptap-only checkmark, that’s no longer accurate, and Tiptap’s own AI story has changed shape too.

Key Takeaways

  • Froala provides a ready-made editor with built-in AI tools and a polished UI.
  • Tiptap offers a headless framework focused on customisation and developer control.
  • Froala’s AI is designed for end users, while Tiptap’s AI Toolkit targets agent-based workflows.
  • Tiptap excels in collaboration features like comments, version history, and real-time editing.
  • Froala is typically more cost-effective and faster to deploy for content-heavy applications.

User interface

Nothing structural has shifted here. Froala still ships a professionally designed toolbar, content area, and status bar out of the box, customizable through API options, ready-made themes, or custom CSS, with responsive behaviour across screen sizes and built-in accessibility support.

Tiptap still provides no default interface; you write the UI yourself. The one real change since 2024 is that Tiptap’s prebuilt UI Components have matured out of beta and are now a standard part of the platform, giving teams a faster starting point than building every control from scratch, though you’re still assembling and styling them rather than getting a finished toolbar the way you do with Froala.

Features

Froala added AI in v5.1 with its AI Assist plugin: two toolbar buttons for chatting with AI, adjusting tone, and translating content, built to work with any provider (OpenAI, Gemini, Claude, self-hosted models) rather than locking you in, with developer hooks to intercept and validate AI output before it’s inserted into a document.

Tiptap’s AI story has changed shape entirely. The original Content AI extensions (AI Suggestion, AI Changes, AI Assistant) are being deprecated through 2026 in favor of a new AI Toolkit, which reframes the feature from “AI commands inside the editor” to “tools that let an AI agent read, insert, and patch document content”, built for the agentic pattern of AI doing structured edits across a document rather than just generating text on request. It’s model-agnostic and supports schema-aware editing, real-time streaming, and suggestion-based review.

The practical difference: Froala’s AI Assist is a built-in toolbar button experience aimed at end users typing into the editor. Tiptap’s AI Toolkit is infrastructure aimed at developers building an AI agent that operates on documents, which is a more powerful primitive if that’s your use case, but it’s also a separate paid add-on requiring its own integration work, not a feature you flip on.

Beyond AI, the rest of the original feature gap mostly holds. Froala still covers more native rich-text surface area: autolink, autosave, special characters, source code view, color picker, text direction, full screen, advanced image and link editing, an image and file manager, print, predefined links, word count, export to PDF, and translations. Tiptap still leads on structural and collaborative features: comments, code blocks, task lists, drawing, enforced content structure, accordions, document version history, invisible characters, a table of contents, and typography conversion, plus real-time collaboration as a core capability rather than a third-party bolt-on. The sheer volume of native tools provided by Froala often clarifies its lead when reviewing the technical depth found in our WYSIWYG editor comparison roundup.

Setup

Froala is still the faster path to a working, professional editor; just include the files and set initialisation options. Tiptap still requires writing your own code to assemble an editor, and now, if you want the AI Toolkit, a separate integration effort on top of that for wiring up your AI provider and agent logic.

Integrations

Froala continues to offer broader framework coverage, particularly for less mainstream stacks: CakePHP, Craft CMS, Aurelia, Django, Ember, Gatsby, Meteor, Knockout, Rails, Sencha, Symfony, and Yii, alongside the now-standard React, Vue, Angular, Next, and Nuxt support both editors share. Froala also remains the only one of the two offering server-side SDKs for image and video uploads across PHP, .NET, Java, Node.js, Python, and Rails.

Tiptap has closed some of the modern-framework gap and still covers PHP (rendering), Svelte, and Alpine.js, which Froala doesn’t.

Pricing

This is the section that’s changed the most since 2024, on both sides.

Tiptap restructured its entire pricing model. The free plan is gone; new users get a 30-day free trial instead. Pricing is now based on cloud documents stored (anything saved to Tiptap Cloud for collaboration, comments, or version history) rather than the old mix of connection counts and feature tiers.

The current tiers: Start at $49/month (up to 500 cloud documents, 2 environments, 2 developer licenses, the in-line AI extension included, community support), Team at $149/month (up to 5,000 documents, 3 environments, 5 developer licenses, email support), Business at $999/month (up to 50,000 documents, 5 environments, 10 developer licenses), and a custom-priced Enterprise tier for on-premises or global-scale deployments. The AI Toolkit specifically is sold as a paid add-on on top of any plan, billed separately from your underlying AI provider costs. While Tiptap introduces these complex add-on costs, similar questions of feature density versus cost scaling are addressed in the full Froala vs TinyMCE breakdown.

Froala’s structure is comparatively simple and hasn’t changed in kind, just iterated: Professional (around $74.90/month) and Enterprise (around $166.60/month) remain the two main paid tiers, distinguished by number of products, domains, and whether SaaS or redistribution use is allowed, plus a newer Architect tier above Enterprise that adds unminified source code for teams that need to audit or deeply customize the codebase. All Froala plans include the same feature set, including AI Assist, with the AI provider costs (OpenAI, Claude, etc.) sitting outside the license price either way.

Which is the most cost-effective editor in 2026?

Froala vs Tiptap Comparison in 2026

The calculus has shifted somewhat from 2024, mostly because Tiptap’s pricing now scales with document volume rather than connection counts, which changes who it’s cheap for. If you’re a small team prototyping or running a low document volume, Tiptap’s Start tier at $49/month is genuinely inexpensive, and you get the in-line AI extension included. But document-based pricing means costs climb as your content footprint grows, somewhat unpredictably if you’re not tracking it, and the AI Toolkit specifically is an additional cost on top.

Froala remains the steadier, more cost-effective choice for large or content-heavy projects, since pricing is flat and tied to product/domain scope rather than document count, and AI Assist doesn’t carry a separate platform fee the way Tiptap’s AI Toolkit does. The same tension between feature density and budget predictability that makes Tiptap’s tiers hard to plan around also defines the search for a CKEditor alternative.

If you don’t need Tiptap’s real-time collaboration or its agent-oriented AI Toolkit, and you do need predictable costs at scale, Froala is still the more economical path. If your product’s core value is collaborative document editing or you’re building an AI agent that needs deep, structured document manipulation, Tiptap’s purpose-built tools may be worth the platform fee despite the higher and less predictable ceiling.

Why Froala remains a strong Tiptap alternative

Froala is still the faster route to a professional-looking editor with a wide feature set and now a genuinely competitive AI feature, without committing to building and maintaining a custom UI. Tiptap still demands more upfront engineering investment, but rewards it with deeper customisation, native collaboration, and an AI Toolkit built for agentic document editing rather than simple in-editor commands, which is the right tool if that’s specifically the problem you have. Where that upfront investment is worth paying depends on the project, which is the axis we sort the best WYSIWYG editors for developers in 2026 along.

The honest framing for 2026: this is no longer a comparison where one editor “has AI” and the other doesn’t. It’s a comparison of two different AI philosophies, end-user-facing assist buttons versus developer-facing agent infrastructure, on top of the same UI tradeoff that’s always separated these two editors.

Before making your final choice, try Froala for free. The free trial gives you access to all Froala features, including AI Assist, so you can evaluate it against your specific requirements before committing.

 

The Art of Fluid Editing: Froala’s Draggable Plugin

Drag and drop with Froala

Nowadays, users are looking for convenient ways to edit their content. In response to this need, professional WYSIWYG editors with advanced capabilities, such as Froala, have become increasingly popular. For example, the Froala draggable plugin allows moving images and videos within the editor by dragging them, resulting in easily reordering the content and improving the overall content editing experience.

In this article, we will explore the Froala draggable plugin in depth. We will look at setting up the plugin, its options, and different usage examples.

Drag and drop with Froala

What is the Froala Draggable Plugin?

The Froala draggable plugin adds the capability to drag content such as images and videos inside the Froala editor. This allows users to move and rearrange the content using their mouse or touch screen. Using the Froala draggable plugin has several advantages such as

  • Improved user experience:
    Adding a drag-and-drop feature makes your application more user-friendly and improves the overall user experience.
  • Increased productivity
    Dragging content using a mouse or touch screen is much faster than cutting content and re-pasting it. As a result, users will be able to complete more tasks in the same time frame.

Installation and Setup of Froala Draggable Plugin

To set up the Froala Draggable plugin, you have to include its script and stylesheet files alongside the core Froala editor scripts and stylesheet files

<!-- Froala core editor Files -->
<link href='{url_based_on_your_download_option}/css/froala_editor.min.css' rel='stylesheet' type='text/css' />

<script type='text/javascript' src='{url_based_on_your_download_option}/js/froala_editor.min.js'></script>


<!-- Froala Draggable plugin files -->
<link href='{url_based_on_your_download_option}/css/plugins/draggable.min.css' rel='stylesheet' type='text/css' />

<script type='text/javascript' src='{url_based_on_your_download_option}/js/plugins/draggable.min.js'></script>

Note that if we use the .pkgd version of the Froala editor, you do not have to include Draggable plugin scripts and stylesheet files separately. The .pkgd version already includes all Froala’s default plugin files.

Once the plugin files are included, it will be active by default when initializing the editor

new FroalaEditor('#HTMLElement');

However, if you’re customizing the pluginsEnabled option, you must include the Draggable plugin:

new FroalaEditor('#HTMLElement',{

     pluginsEnabled: ['image', 'link', 'video', 'draggable', 'print']

});

Using the Draggable Plugin

If the Draggable plugin is enabled and there are images or videos inside the editor, users can drag these elements as follows:

  • Click on the element.
  • Drag the element into a new position within the editor.
  • Release the element.

Dragging elements as described above is impossible if the Draggable plugin is disabled.

Customizing the Draggable Plugin

Options

The Draggable plugin provides developers with a dragInline API option. This option allows developers to control how the dragged elements are positioned within the editor. When set to true, the dragged items can be placed inside inline elements, such as text. Disabling this option ensures that the dragged elements are positioned between block-level tags. This provides more control over the layout and structure of your content.

new FroalaEditor('#HTMLElement',{
     dragInline: false,
     pluginsEnabled: ['image', 'link', 'video', 'draggable', 'print']

});

draginline
draginline: true

 

draginline-false
draginline: false

 

Events

The plugins register two events:

  • The element.beforeDrop event is fired when the user starts dropping the dragged element into a new or the same position (by releasing a mouse button or hitting the escape key).
  • The element.dropped event is fired when the element is dropped either in a new or the same position.
new FroalaEditor('div#froala-editor', {
  dragInline: false,
  pluginsEnabled: ['image', 'link', 'draggable', 'print'],
  events: {
    "element.beforeDrop": function(element) {
      console.log("beforeDrop");
    },
    "element.dropped": function(element, t) {
      console.log("droppped");
    },

  }
})

Both events pass the dragged element as the first argument of the callback function.

If more control is required over the dragging and dropping process, JavaScript events can be utilized, such as:

  • drag
  • dragend
  • dragenter
  • dragleave
  • dragover
  • dragstart
  • drop

To utilize these events, register an event handler for these events inside the editor’s initialized event using the on method.

new FroalaEditor('div#froala-editor', {
  dragInline: false,
  pluginsEnabled: ['image', 'link', 'draggable', 'print'],
  events: {
    "element.beforeDrop": function(element) {
      console.log("beforeDrop");
    },
    "element.dropped": function(element, t) {
      console.log("droppped");
    },
    'initialized': function() {
      // Do something here.
      var editor = this;

      editor.events.on('drop', function(dropEvent) {
        console.log("drop");
        console.log(dropEvent);

      });
    }
  }
})

Comparison of dragging feature between TinyMCE and Froala

At the time of writing this article, I went to the official TinyMCE full feature example page, I tried to drag the TinyMCE logo image but it didn’t move. Clicking on the image to drag it makes the image selected, but once I try to move it down, it selects the text below instead of dragging the image.

drag-and-drop inTinyMCE

I copied the TinyMCE editor content and pasted it into the Froala editor full-featured example, moving the TinyMCE logo by drag and drop was a piece of cake.

Drag-and-drop in Froala

Moreover, unlike Froala:

  • TinyMCE doesn’t provide options to customize drag-and-drop behavior.
  • TinyMCE only supports browser-native dragging events.

Overall, Froala provides a better user drag-and-drop experience.

Do I need to subscribe to a specific plan for using the Froala Draggable plugin?

The Froala draggable plugin, as well as other Froala plugins, are available in any of the Froala’s plans. Check our pricing page and select the plan that best fits your needs. Froala’s flexible licensing options ensure you can utilize the full capabilities of the draggable plugin, tailored to your specific requirements, without any additional costs or restrictions.

What is the difference between Froala’s annual and perpetual licenses?

Froala’s annual license lets you use the Froala editor for a full calendar year. Within this year, you can update your editor to the new releases. After that, you need to renew your license to continue using the editor in your product.

Froala’s perpetual license lets you use any version of the Froala editor that was released within one year of your license purchase, forever. To use versions that were released after that, you can renew your license at a discounted cost.

Can I test the editor before purchasing a license?

You may download the editor from our download page and test it at any time, without spending money. While testing, an unlicensed message will be displayed, however, it doesn’t limit any of the editor’s features. Once you are ready to use the editor in production, purchase a license to get the API key and remove the unlicensed message.

Conclusion

The Froala draggable plugin offers a seamless and customizable drag-and-drop experience, surpassing the capabilities of TinyMCE’s dragging functionality. With options to control the positioning of dragged elements and events to monitor the dragging process, Froala provides developers with greater control over the content structure. Froala’s flexible licensing, including annual and perpetual options, ensures the draggable plugin can be utilized effectively without additional costs or restrictions, making it a compelling choice for content-rich web.

 

The Developer’s Guide to Implementing Live HTML Preview

Code view

Free HTML code writers with live preview capabilities are enhancing the user experience in web development. By bridging the gap between what users type and the underlying HTML code, these tools create an environment that is both intuitive and educational.

Key Takeaways

  • Importance of Live Preview: Understand why real-time feedback is crucial for user learning and engagement.
  • Detailed Setup Guide: Learn how to integrate Froala’s Code View plugin to allow users to see the HTML code behind their content.
  • Best Practices: Get tips on making the most of your live preview tool.
  • Real-world Examples: See how live preview tools can enhance user engagement and education.

froala code view

Why a Live Preview for HTML Code Writers is Crucial for Users

Providing users with a live preview feature offers several significant benefits:

Instant Learning

Instant feedback allows users to see the HTML code corresponding to their input immediately. This real-time interaction helps users learn HTML as they type, reinforcing the connection between their actions and the resulting code. For instance, when a user types a paragraph, they can instantly see the <p> tags surrounding their text, making the learning process more intuitive and immediate.

Enhanced Engagement

Users are more likely to engage with a tool that provides immediate visual feedback. This engagement can lead to better content creation and a more satisfying user experience, as users can see the effects of their changes instantly. Imagine a user adding a link and immediately seeing the <a> tag in action, making them understand how links are structured in HTML.

Improved Accuracy

By allowing users to see the HTML code behind their text, developers can help them create cleaner, more accurate code. This visibility reduces errors and enhances the overall quality of the content. For example, users can quickly identify and correct issues like unclosed tags or incorrect attributes.

Setting Up Froala Editor with Code View Plugin

One effective way to provide users with the ability to see the HTML code behind their text inputs is by using Froala’s Code View plugin. Froala Editor is a powerful Free HTML code writers with live preview capabilities that enables users to switch between a visual editing mode and a code view mode. This feature is particularly useful for educational platforms, content management systems, and any application where understanding the underlying HTML is beneficial.

Integrating Froala Editor with Code View Plugin

To integrate Froala Editor with the Code View plugin, you first need to include the Froala Editor in your project. For simplicity, we’ll use the CDN for the latest version. This setup will allow users to write content in a visual editor and switch to view the HTML code behind their text.

Step-by-Step Setup

  1. Include Froala Editor in Your Project

First, include the necessary Froala Editor CSS and JS files in your HTML file:

 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Froala Editor with Code View Plugin</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">
</head>
<body>
  <textarea id="froala"></textarea>
  
  <div id="eg-previewer"></div>

  <script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
</body>
</html>

 

  1. Initialize Froala Editor with Code View Plugin

Next, initialize Froala Editor with the Code View plugin enabled. This will allow users to switch between the WYSIWYG editor and the HTML code view.

<script>
  var editor = new FroalaEditor('#froala', {
    pluginsEnabled: ['codeView'],
    codeViewKeepActiveButtons: ['selectAll'],
    events: {
      'codeView.update': function () {
        // Update the live preview
        document.getElementById("eg-previewer").textContent = this.codeView.get();
      }
    }
  });
</script>

In this setup, the codeView.update event is used to update a live preview element with the current HTML code. This way, users can see the immediate effect of their changes both in the visual editor and in the HTML code.

Key Features of Froala’s Code View Plugin

The Code View plugin in Froala Editor enables users to view and edit the HTML code behind the content. Here are some key features:

  • Toggle View: Users can easily switch between the visual editor and the code view.
  • Real-time Updates: Changes made in the code view are immediately reflected in the visual editor and vice versa.
  • Active Buttons: Specific buttons, like selectAll, can remain active in the code view for convenience.

Best Practices for Using the Code View Plugin

Keep Active Buttons Minimal

While it’s useful to have some buttons active in Code View, keeping it minimal ensures a clutter-free interface. Focus on essential buttons that aid your users in coding.

Regular Updates to Live Preview

Ensure the live preview updates frequently to reflect changes accurately. This helps users in spotting and fixing errors quickly.

Secure Your Code

When dealing with HTML, security is paramount. Ensure any input or code handling follows best security practices to prevent vulnerabilities like XSS (Cross-Site Scripting). You can refer to resources like the Mozilla Developer Network (MDN) for best practices in HTML security.

Real-World Examples

Educational Platforms

Educational platforms can leverage Froala’s Code View plugin to teach HTML. By allowing students to see the HTML code behind their text inputs, educators can provide a hands-on learning experience that reinforces theoretical knowledge with practical application. For instance, a coding bootcamp might use this feature to help students understand the relationship between HTML tags and the structure of a webpage.

Content Management Systems (CMS)

Content management systems can integrate Froala’s Code View plugin to give content creators more control over their output. By viewing and editing the HTML code directly, users can fine-tune their content to meet specific requirements, ensuring that it appears exactly as intended. For example, a blog platform might enable this feature to allow bloggers to embed custom HTML elements in their posts.

Conclusion

Integrating a free HTML code writer with live preview into your workflow can significantly enhance the user experience. Froala’s Code View plugin offers a robust solution, allowing users to see the HTML code behind their text inputs and make real-time adjustments. By setting up Froala Editor with the Code View plugin, you can provide your users with an educational, engaging, and efficient tool for HTML content creation.

Whether you’re an educator, content manager, or developer, enabling users to see the HTML code behind their text inputs can transform the way they interact with your tool, making the development process more intuitive and rewarding.

Best-in-Class HTML Editor for Better Workflows

best in class

In the fast-evolving world of web development and content creation, having the right tools is crucial for enhancing productivity and delivering high-quality work. Among these tools, a best-in-class HTML editor with a user-friendly interface can make a significant difference. This article will explore the essential features of such an editor, with a particular focus on modularity, which allows users to customize their experience by adding only the necessary plugins. We will also look at how these features can be practically beneficial for various use cases.

best in class

Key Takeaways

  • Modular Architecture: The benefits of a customizable and scalable editor.
  • User-friendly Interface: The importance of an intuitive and accessible UI.
  • Essential Features: Key functionalities that enhance the user experience.
  • Practical Use Cases: Real-world applications of a modular HTML editor.
  • A Subtle Suggestion: Considering Froala for its modular capabilities.

Modularity: Flexibility and Customization

A hallmark of a best-in-class HTML editor is its modular architecture. This approach allows users to start with a basic, barebones editor and add only the plugins and features they need. This flexibility offers several advantages:

  • Customization: Users can tailor the editor to their specific needs, creating a streamlined and efficient workspace.
  • Performance: Loading only the necessary components ensures that the editor remains fast and responsive.
  • Scalability: As project requirements evolve, additional features can be easily integrated without overhauling the entire setup.

For instance, a content creator working on a blog might only need basic text formatting tools initially. However, as the project grows, they might require additional plugins for embedding multimedia, managing links, or collaborating with team members. A modular editor allows for this incremental enhancement without disrupting the existing workflow.

User-friendly Interface

An intuitive and well-designed user interface (UI) is vital for an HTML editor. A clean layout, easily accessible toolbars, and customizable themes can significantly enhance the user experience. Features like drag-and-drop functionality enable users to insert elements effortlessly, without delving into the underlying HTML code.

Essential Features

To qualify as best-in-class, an HTML editor should offer a range of features that boost productivity and enhance the user experience. Some of these features include:

  • WYSIWYG Editing: What You See Is What You Get (WYSIWYG) editors allow users to see the final output as they create content, making it easier to visualize and adjust the layout.
  • Rich Text Formatting: Tools for bolding, italicizing, underlining, and customizing text styles are essential for creating visually appealing content.
  • Media Embedding: Easy integration of images, videos, and other multimedia elements enriches the content.
  • Real-time Collaboration: Allows multiple users to work on the same document simultaneously, facilitating teamwork and reducing version conflicts.
  • Autosave and Revision History: Automatically saving changes and maintaining a history of revisions ensures that work is never lost and previous versions can be restored if necessary.

Practical Use Cases

The modular and user-friendly nature of a top-tier HTML editor makes it suitable for a wide range of applications. Here are a few practical use cases:

Content Management Systems (CMS)

For CMS platforms, a modular HTML editor can provide a seamless content creation experience. Users can start with basic text editing and gradually add features like SEO tools, spell checkers, and social media integration as needed.

Blogging Platforms

Bloggers can benefit from a clean and intuitive editor that allows them to focus on writing without distractions. As their needs grow, they can add plugins for embedding multimedia, managing comments, and integrating with analytics tools.

Corporate Intranets

In a corporate environment, an HTML editor can be used for creating and editing internal documentation, announcements, and reports. Features like real-time collaboration and autosave ensure that team members can work together efficiently and that no work is lost.

Online Learning Platforms

Educators and students can use an HTML editor to create and edit course materials, assignments, and discussions. The modular approach allows for the addition of specialized tools like math equation editors, video embedding, and quiz creation plugins.

Why Consider Froala

While this article focuses on the general benefits of modular HTML editors, it’s worth mentioning that Froala is a strong contender in this space. Froala’s modular architecture allows users to start with a simple, lightweight editor and add only the features they need. This flexibility, combined with a user-friendly interface and a wide range of essential features, makes Froala a compelling choice for developers and content creators alike.

For example, if you want to just include the Word Counter plugin, you can use this basic setup.

 

  <script>
    let editor = new FroalaEditor('#editor', {
      pluginsEnabled: ['wordCounter'],
      wordCounterCount: true,
      wordCounterMax: 200,
      events: {
        'wordCounter.exceeded': function () {
          console.log('Word limit exceeded: ', this.wordCounter.wordCount());
        },
        'wordCounter.update': function () {
          console.log('Current word count: ', this.wordCounter.wordCount());
        }
      }
    });
  </script>

 

Conclusion

Choosing the right HTML editor can significantly impact your productivity and the quality of your work. A best-in-class editor with a user-friendly interface and modular architecture provides the flexibility to customize your setup and enhance your workflow. Whether you’re a content creator, developer, or educator, investing in a high-quality HTML editor is a smart decision that will pay off in the long run.

By leveraging the right tools, you can streamline your content creation process, reduce errors, and deliver engaging, high-quality content with ease. While there are many excellent HTML editors available, considering a modular option like Froala could provide the flexibility and performance you need to succeed.

 

Froala 4.2.1 release: Word Counter Type definitions, new API options, and More

Froala V4.2.1

Say hello to the Froala Editor V4.2.1! We are thrilled to introduce a range of exciting features and enhancements that will take your editing experience to the next level. In this blog post, we will delve into the key highlights of this new release, including type definitions for the Word Counter plugin, new API options for preserving tab spaces, Track Changes feature enhancements, and bug fixes. Let’s explore what’s new with this update.

Key Features of the New Release

Enhancements for the Word Counter plugin

Froala 4.2 introduced the Word Counter plugin to highlight the word count at the bottom toolbar of the editor. This helps in tracking the number of words in your content. This release continues to build on this feature by providing type definitions for the word counter, ensuring a more seamless integration. Additionally, we fixed a bug that was happening when trying to limit the content using the wordCounterMax API option.

 

Froala 4.2.1

Type Definitions for Word Counter:

In this release, we have incorporated type definitions for the Word Counter. With this integration, the expected data types are explicitly defined, enhancing predictability and reducing the likelihood of errors. This acts as a form of self-documentation, clarifying the required types for each variable. These improvements contribute to a more efficient and error-resistant development process, giving the following benefits to the developers:

  1. Enhanced Error Detection: By incorporating type definitions, developers can identify and rectify potential errors at an early stage through static type checking. This proactive approach aids in mitigating common programming mistakes, ultimately leading to more robust and reliable applications. This means that if you accidentally set one of the Word Counter options to the wrong type, TypeScript will raise a compile-time error. For example, the wordCounterMax API option accepts integers; if you set wordCounterMax to a string, TypeScript will raise a compile-time error. This proactive approach helps in avoiding common programming mistakes and ensures the reliability of applications.
  2. Improved Development Efficiency: The inclusion of type definitions enables advanced IDE features like code completion, streamlining the development process, and enhancing the overall developer experience.
    For example, as you start typing “wordCounterM…“, your IDE will suggest “wordCounterMax“, ensuring you pick the correct option without constantly referring to the documentation.
    This efficiency boost can accelerate the implementation of new features and improvements.
  3. Simplified Maintainability: If a developer tries to expand the Word Counter plugin functionality, managing various data types can become complex. Type definitions serve as a roadmap for understanding the data flow within the plugin, facilitating smoother transitions and minimizing bugs during updates and modifications.

Using type definitions in this manner not only promotes code clarity but also fosters a more robust and reliable development process for the Word Counter plugin integration.

wordCounterMax Bug Fix

The Word Counter plugin introduced the wordCounterMax API option to restrict the number of words in the editor. However, in version 4.2, this feature had a flaw where it only allowed entering one character in the last permitted word. For instance, setting wordCounterMax to “2” would let users input one full word and the initial letter of the second word. By updating to V4.2.1, this issue has been resolved, ensuring that the wordCounterMax API option now functions correctly by restricting the input to the specified word limit without allowing partial words. This fix enhances the overall user experience by accurately enforcing the word count limit set by the developers.

new FroalaEditor('.selector', {
   wordCounterMax: 140
});

New API Option For The Default Font Family and Styles

The Froala V4.2.1 introduces the fontFamilyDefaultSelection and fontSizeDefaultSelection options. These options allow developers to apply a default custom font family and size to the editor content.

To use the fontFamilyDefaultSelection option, developers have to provide the fontFamily property accordingly (in case the asked defaultFontFamily doesn’t belong to the default font-family options).

By setting this option, the editor will add a new  <style id="default-styles"> tag to the webpage <head>. It will contain the default font size and family style for the Froala editor. The class name defined in that style tag will be added to the HTML element defined in the editor.$el property. As a result, all the elements inside the editor can inherit the defined default styles.

new FroalaEditor('#froala-editor',  {
fontFamilyDefaultSelection : "Dosis",
fontSizeDefaultSelection : "30"
});


This feature simplifies the process of customizing the font styles within the editor, offering greater flexibility in design choices.

Tab Spaces Preservation Feature

Starting from Froala V4.2.1, users can now enjoy enhanced control over the preservation of tab spaces (\t character) defined in the initialization content.

By default, tab spaces are removed when content is rendered in the editor. To retain the spaces, set the newly preserveTabSpaces option to true. When preserveTabSpaces is true, the \t character is replaced with the number of spaces specified by the user using the tabSpaces option. If no number of tabSpaces is specified, \t is replaced with 4 spaces, enabling the visualization of tab spaces in the user interface.

new FroalaEditor('#froala-editor',  {
preserveTabSpaces : true,
tabSpaces : 3
});

This feature offers a significant advantage for users such as:

  • Improved Content Formatting
    By enabling the preserveTabSpaces option in Froala V4.2.1, users can maintain the intended layout and alignment of their text, especially when dealing with content where precise spacing is crucial. This ensures that the visual representation of the content remains true to the original formatting, enhancing readability and clarity.
  • Enhanced Code Readability
    For developers and users working with code blocks or technical documentation, preserving tab spaces is essential for maintaining the integrity and readability of the code. With the ability to retain tab characters intact, the code structure is preserved, making it easier to identify and understand different sections of the codebase. This feature simplifies the process of reviewing and editing code within the editor, leading to improved code quality and efficiency.
  • Customizable Tab Space Conversion
    The flexibility offered by the tabSpaces option allows users to customize the conversion of tab characters to spaces according to their preferences. By specifying the number of spaces to replace each tab character, users can tailor the display of content to suit their individual needs.
  • Consistent User Interface Experience
    The standardization of tab space representation across different content types maintains a cohesive user experience, regardless of the original formatting. This ensures a consistent and visually appealing user interface.

The ability to preserve tab spaces in Froala V4.2.1 offers users a valuable feature that enhances content formatting, code readability, customization options, and user interface consistency. This functionality not only improves the editing experience but also empowers users to create and manage content more effectively within the editor environment.

Track Changes Feature Improvements

With Froala, you can keep track of all the changes you make to your content in the editor using the Track Changes plugin. You can enable this plugin using the pluginsEnabled option if you want to use it, as it is not enabled by default. With Track Changes enabled, any text or image additions are shown with a yellow highlight, and changes that are intended to be deleted are highlighted in red with a strikethrough. Later, you can accept your changes or reject them.

In this release, we improved the Track Changes feature and fixed some bugs related to this feature. This includes:

  • Using the ‘Ctrl + X’ keys for multiline cut and paste works as expected when you paste the content again inside the editor.

Tracking changes in your documents is now more intuitive and efficient, providing a clearer overview of the edits made by collaborators. Stay in control of your content revisions with improved tracking capabilities that streamline the editing process.

Bug Fixes

In addition to the new features and enhancements, this release also includes essential bug fixes to ensure a smoother and more reliable editing experience. We have addressed various issues reported by our users to enhance the overall performance and stability of Froala Editor. These include:

  • Resolving the issue of the editor jumping unexpectedly when pasting large content into the editor and subsequently performing actions like scrolling or inserting content that influences the iframe’s height (e.g., pressing Enter) aims to ensure the editor can manage pasted content and changes to the iframe’s height smoothly. This provides a consistent and predictable user experience without any disruptive jumping.
  • Resolving the problem where the font format resets when toggling in and out of table rows using the Tab key with the “keepTextFormatOnTable” setting enabled.

With this, we highlighted the new features and bug fixes in Froala V4.2.1. Your feedback is invaluable to us, and we are committed to delivering a top-notch editing solution.

How Can I Update?

Don’t miss out on the benefits of the latest Froala 4.2.1 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.2.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.2.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Technical Questions

Froala Word Count Plugin: A Comprehensive Guide

word counter thumbnail

Content duration regulation is an absolute necessity in digital content development. The precise word count is essential for adhering to specifications, optimizing search engines, and enhancing readability, regardless of whether you are a writer, editor, or marketer.

With the addition of the remarkable Word Count module in version 4.2, the well-known WYSIWYG (What You See Is What You Get) HTML editor Froala Editor makes it simpler to monitor your real-time word consumption. Using the Froala Word Count feature to its fullest capacity is the subject of this article.

Understanding the Froala Word Count Plugin

The Froala Word Count plugin is an extension for the Froala editor that functions flawlessly. Upon activation, the plugin provides real-time visibility into the word count of your content.

Here’s a breakdown of the primary features supplied by the Froala word count plugin:

  • Real-time Word Count: The plugin continuously monitors your content and displays the precise word count. This eliminates the need to manually count words or rely on external tools, resulting in greater accuracy and efficiency.
  • Clear Visibility: The word count is usually displayed in a specific section of the editor’s interface, making it easily available for quick reference. You can concentrate on your writing without switching between windows or applications.
  • Configurable Limits: Set maximum word to ensure your content stays within desired bounds. However, character limits can be modified via a character plugin.
  • Seamless Integration: Easily integrates with other Froala plugins and tools.

Advantages of Employing the Froala Word Count Plugin

There are numerous benefits to incorporating the Froala word count feature into your writing workflow:

  1. Keep Up with Word Limit: By religiously following up on the number of your written words, you are in a position to ensure that your published document will meet this limit. This advantage is highly appreciated by those who do freelance writing, develop content and engage in academic writing because they have to follow the exact word count boundary.
  2. Enhanced Efficiency in Writing: The writing process is streamlined by providing a real-time word count and no longer requires external tools or manual word counting. This enables you to focus uninterrupted on the composition of your content.
  3. Enhanced Content Planning and Structure: The ability to ascertain the current word count provides the means to strategize and organize content efficiently. You can guarantee a proportionate and balanced structure by assigning word counts to distinct sections of your writing.
  4. Fosters’ Brevity and Clarity: Good writers are conscious of their word counts, which helps them create brief texts that serve the purpose they want to communicate. The number of words can serve as a tacit reminder to avoid repetition or superfluous information in an essay.

Configuring Froala Editor with the Word Count Plugin

Before utilizing the Froala Word Count function, you must incorporate the Froala Editor into your project. Proceed by following these steps:

Step 1: Include Froala Editor Files

Froala Editor files can be incorporated into a project via a CDN or downloaded from the Froala website. How to accomplish this with a CDN:

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Froala Editor with Word Count Plugin</title>
    <!-- Include Froala Editor style files -->
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.2.0/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div id="editor"></div>

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

<!-- Initialize the Froala Editor -->
<script>
    new FroalaEditor('#editor', {
      // Insert the Word Counter Plugin here
    });
</script>

</body>
</html>

 

Step 2: Enable the Word Count Plugin

In the initialization script, enable the wordCounter plugin by including it in the pluginsEnabled array:

 

<script>
    new FroalaEditor('#editor', {
        pluginsEnabled: ['wordCounter']
    });
</script>

 

You have effectively integrated the Word Count feature of the Froala Editor into your project by following these steps.

Customizing the Word Count Display

Froala Editor provides the capability to modify the appearance of the word count. You can display the word count and maximum count limit or both. Here’s how to accomplish it:

Displaying Word Count

To show the word count, the initialization script can be modified as follows:

 

$(function() {
  $('#editor').froalaEditor({
    pluginsEnabled: ['wordCounter'],
    wordCounterCount: true
  });
});

 

Hide Word Count

To hide the word count, the initialization script can be modified as follows:

 

 

$(function() {
  $('#editor').froalaEditor({
    pluginsEnabled: ['wordCounter'],
    wordCounterCount: false
  });
});

 

 

In addition, the Word Count function permits the configuration of maximum limits for words. This feature is especially beneficial in guaranteeing that the duration of your content adheres to designated criteria.

Setting a Maximum Word Limit

In the initialization script, include the ‘wordCounterMax’ parameter to establish a maximum word limit, in our case we have set the limit to 200:

 

$(function() {
  $('#editor').froalaEditor({
    pluginsEnabled: ['wordCounter'],
        wordCounterCount: true,
        wordCounterMax: 200,
  });
});

 

 

Track Your Word Count with Froala’s Word Count Plugin

Froala’s Word Count plugin is invaluable for those who must monitor every word of their content. It features configurable limits, real-time updates, and customizable displays to facilitate the efficient and streamlined management of your writing metrics.

By adhering to the instructions in this tutorial, one can effortlessly incorporate and personalize the Word Count plugin in Froala Editor, guaranteeing that the content consistently satisfies the intended criteria. Regardless of your professional background as a developer, writer, or marketer, attaining proficiency in this feature will undeniably improve your content creation workflow.

Boost Productivity with Intuitive HTML Editor Software for LMS

lms thumbnail

An intuitive user interface (UI) in HTML editor software is crucial for enhancing developer productivity. A well-designed UI reduces the learning curve and allows developers to focus on writing code rather than figuring out how to use the tool. In this article, we’ll explore the importance of an intuitive UI in HTML editors, with a specific focus on Learning Management Systems (LMS). We’ll include code snippets to demonstrate how these features can be leveraged effectively.

Key Elements of an Intuitive User Interface

  1. Clean Layout and Design

    • A clean layout minimizes distractions and helps developers concentrate on coding. Elements such as toolbars, menus, and panels should be organized logically. An intuitive design ensures that the most frequently used features are easily accessible.
    • Example: Froala’s toolbar can be customized to show only the essential tools, providing a clutter-free environment. This customization helps in maintaining focus and improving efficiency.
    <div id="editor"></div>
    
    <script>
      new FroalaEditor('#editor', {
        toolbarButtons: ['bold', 'italic', 'underline', '|', 'insertLink', 'insertImage'],
        toolbarInline: false
      });
    </script>
    
    
    • Additionally, having the option to switch between different themes (light and dark) can further enhance usability by reducing eye strain during prolonged coding sessions.
  2. Syntax Highlighting

    • Syntax highlighting improves code readability by color-coding different elements of the code. This makes it easier to identify errors and understand the structure of the code. Different colors and fonts can be used to distinguish between keywords, variables, strings, and comments.
    • Example: Froala supports syntax highlighting out-of-the-box for various programming languages, which is essential for developers working with multiple languages.
    <div id="editor"></div>
    
    <script>
      new FroalaEditor('#editor', {
        codeMirror: true,
        codeMirrorOptions: {
          mode: 'text/html',
          lineNumbers: true
        }
      });
    </script>
    
    
    • Providing customization options for syntax highlighting can allow developers to choose color schemes that suit their preferences, further enhancing the user experience.
  3. Drag-and-Drop Functionality

    • Intuitive drag-and-drop functionality allows users to easily add and rearrange elements within the editor. This is particularly useful in LMS where content structuring is key. Users can drag elements like text blocks, images, and multimedia components to create interactive and engaging content.
    • Example: Implementing drag-and-drop in Froala for reordering sections.
    <div id="froala-editor">
      <h3>Click here to edit the content</h3>
      <p><img id="edit" class="fr-fil fr-dib" src="https://raw.githubusercontent.com/froala/wysiwyg-editor/master/editor.jpg" alt="Old Clock" width="300"/></p>
      <p>The image can be dragged only between blocks and not inside them.</p>
    </div>
    
    <script>
      new FroalaEditor('#editor', {
        dragInline: true // Enable inline dragging
        pluginsEnabled: ['image', 'link', 'draggable']
      });
    </script>
    
    
    
    • Providing visual cues and guidelines during the drag-and-drop process can help users place elements precisely where they want, ensuring a smooth and intuitive experience.
  4. WYSIWYG (What You See Is What You Get) Editing

    • WYSIWYG editors provide a real-time preview of the final output, making it easier for developers to visualize their work. This is especially beneficial in LMS where content formatting is important. Users can see exactly how their content will appear to end-users as they create it.
    • Example: Using Froala’s WYSIWYG capabilities.
    <div id="editor"></div>
    
    <script>
      new FroalaEditor('#editor', {
        toolbarInline: true,   // Show toolbar inline with the content
        charCounterCount: false // Disable the character counter
      });
    </script>
    
    
    • Enhanced WYSIWYG features can include real-time collaboration, where multiple users can edit the same document simultaneously, and changes are instantly reflected for all collaborators.
  5. Customizable Shortcuts

    • Customizable keyboard shortcuts enhance efficiency by allowing developers to perform frequent actions quickly. This feature can be a significant productivity booster, especially for developers who prefer using the keyboard over the mouse.
    • Example: Defining custom shortcuts in Froala.
    <div id="editor"></div>
    
    <script>
      new FroalaEditor('#editor', {
        // ... your other Froala configuration options ...
      });
    
      // Register custom shortcut (after editor initialization)
      FroalaEditor.RegisterShortcut(49, 'paragraphFormat.apply', 'H1', 'H', false);
    </script>
    
    
    
    • Providing a comprehensive list of default shortcuts and the ability to create custom shortcuts can cater to the diverse preferences of different developers, making the editor more versatile.

Focus on LMS: Enhancing Content Creation

In the context of Learning Management Systems, an intuitive HTML editor UI can significantly enhance the content creation process for educators and administrators. By providing an easy-to-use, feature-rich editor, LMS platforms can ensure that users spend more time creating quality educational content rather than struggling with the editor interface.

  • Media Embedding

    Easily embedding videos, images, and other media types enhances the interactivity of the content. Media-rich content can improve student engagement and comprehension.

    <div id="editor"></div>
    
    <script>
      new FroalaEditor('#editor', {
        toolbarButtons: ['insertVideo', 'insertImage', 'insertFile']
      });
    </script>
    
    
    
    • The ability to embed interactive elements such as quizzes, polls, and discussion forums can further enrich the learning experience.
  • Real-Time Feedback and Grading

    Implementing features that allow for real-time feedback and automated grading of assignments can save educators significant time and effort. This can be achieved through integration with LMS grading systems.

    <script>
      new FroalaEditor('#editor', {
        events: {
          'contentChanged': function() {
            // Custom logic for real-time feedback 
          }
        }
      });
    </script>
    
    
    

Conclusion

An intuitive user interface in HTML editor software is essential for improving developer productivity and creating high-quality content, especially in Learning Management Systems. By focusing on features like a clean layout, syntax highlighting, drag-and-drop functionality, WYSIWYG editing, and customizable shortcuts, developers can work more efficiently and effectively. Froala’s HTML editor exemplifies these principles, making it a valuable tool for developers and educators alike.

By integrating code snippets and practical examples, this article provides developers with a clear understanding of how to leverage an intuitive HTML editor to enhance their workflow. The focus on practical applications within LMS ensures that the content is relevant and immediately useful to developers working in the education sector. You can also view our LMS whitepaper talking about this in depth.

 

What’s the Most Efficient Way to Write Clean, Optimized HTML Code?

clean code

Developing streamlined and optimized HTML code is the cornerstone of any meticulously organized website. It can be difficult to balance efficiency and meticulous attention to detail to attain this level of quality. Utilizing an effective HTML code writer that enables precise and quick code composition is crucial.

An efficient HTML code writer functions as a virtual workspace, offering the necessary aids for composing, revising, and structuring HTML code.

Although simple text editors such as Notepad are functional, they need to possess the necessary functionalities to expedite the process of HTML development. Manual code writing becomes laborious, error-prone, and time-intensive when dealing with intricate web page layouts.

Basic HTML Code Writer Process

So, what is the typical approach for writing HTML code?

1. Plan and structure

The first step is to map out the overall structure of your web page. This includes defining elements like the header, navigation, main content section, sidebar, and footer. You must also select items for each section, such as headings, paragraphs, images, and forms.

2. Hand-coding Markup

Once the structure is built, you’ll start creating HTML code. This includes using HTML tags to specify the various items on the webpage. The element denotes the header section, whereas the tag indicates a level-one heading.

3. Debugging and Optimization

Unfortunately, even with thorough planning, errors are unavoidable. Typos, missing closing tags, and incorrect element nesting can all cause unexpected behavior on your website. Debugging involves identifying and repairing errors, sometimes requiring switching between code editor and web browser for testing and iteration.

4. Optimizing for Performance

Beyond functionality, clean and optimized code ensures that your website loads quickly and efficiently. This covers measures like decreasing the number of unnecessary tags, optimizing image sizes, and ensuring proper indentation for readability.

Challenges and Potential for Error

While the HTML code writing procedure is easy, the following issues may arise:

  • Syntax Mistakes: If you miss or mix up tags, use attributes incorrectly, or create other syntax errors, the page may crash or show inaccurately.
  • Coding Structure: Keeping a well-organized and easy-to-understand codebase can be hard, especially for bigger tasks.
  • Browser Compatibility: Ensuring that the code works consistently across browsers requires rigorous testing and, in certain circumstances, further code changes.
  • Productivity Issues: Basic text editors lack features that could improve productivity, such as code recommendations, auto-completion, and live previews.

Limitations of Basic Text Editors

Basic text editors like Notepad or TextEdit provide an easy environment for developing HTML code. However, they have significant limitations.

  • No Syntax Highlighting: Basic text editors do not highlight HTML syntax, making it harder to identify errors and understand code structure at a glance.
  • Lack of Auto-completion: These editors lack auto-completion functions, slowing the coding process.
  • No Validation capabilities: Basic text editors lack built-in validation capabilities for checking HTML code for errors.
  • Limited Usability: Simple text editors lack capabilities such as drag-and-drop, live previews, and code recommendations, making them less suitable for creating complex websites.

Presenting Froala, A WYSIWYG Method for Simplified HTML Code Writing

When this occurs, WYSIWYG editors like Froala become useful. Without writing code, you can concentrate on content generation and page structure with Froala’s intuitive interface.

Key Features of Froala

  • Intuitive Interface: Froala offers an intuitive interface that presents a graphical representation of the webpage, enabling users to observe the composition and formatting of their content in real-time. This facilitates visualizing the result and enables iterative design refinement.
  • Drag-and-Drop Functionality: The functionality of dragging and dropping allows for easy addition, relocation, and resizing of elements, eliminating the necessity to generate HTML code for positioning and layout manually.
  • Rich Text Editing: Rich text editing is facilitated by Froala, which functions similarly to a word processor. Users can format text, add and edit videos and images, and establish tables.
  • Real-time Collaboration: Multiple users’ ability to modify the same webpage concurrently facilitates content creation and collaboration.
  • Code View: For developers who prefer to work with unprocessed HTML code, Froala offers a code view. Users are granted enhanced versatility in their tasks through the ability to transition between the WYSIWYG interface and HTML code.
  • Support for a Wide Variety of Plugins: Froala provides an extensive catalog of modules that augment its functionality. This contains modules that execute various operations, including file administration, spell-checking, and image editing.
  • A flexible layout: In contemporary web development, the editor must guarantee that the HTML material is adaptable and compatible with many devices.

A Step-by-Step Guide to Using Froala

The following are detailed guidelines on how to create and edit HTML content using Froala effectively:

Step 1: Setting Up Froala

Download and Include Froala: Download the Froala editor from the official website. Add the required CSS and JavaScript files in your project.

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Froala Editor Example</title>
    <!-- Include Froala Editor style files -->
    <link href="https://cdn.jsdelivr.net/npm/froala-editor@4.0.10/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css">
    <!-- Include Froala Editor script files -->
    <script src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.10/js/froala_editor.pkgd.min.js"></script>
</head>
<body>
    <!-- Froala Editor container -->
    <textarea id="froala-editor"></textarea>
</body>
</html>

 

Initialize the Editor: Initialize Froala on a textarea or a div element where you want the editor to appear.

 

<script>
    new FroalaEditor('#froala-editor', {
        // Additional options can be configured here
        heightMin: 300,
        toolbarButtons: ['bold', 'italic', 'underline', '|', 'formatOL', 'formatUL', '|', 'insertImage', 'insertLink', 'html'],
        events: {
            'contentChanged': function () {
                console.log('Content was changed.');
            }
        }
    });
</script>

 

Step 2: Creating HTML Content

  1. Open Froala Editor: Once the editor is set up, open it in your browser. You’ll see a toolbar with various options for formatting text and inserting elements.
  2. Insert and Format Text: Start by typing your content. Format the text using the toolbar, including adding bold, italic, or underlining. Additionally, headings, columns, and blockquotes can be generated.
  • Bolded Text: Click the “B” icon on the toolbar after selecting the text.
  • Add a Heading: From the toolbar drop down select heading level in which you wish to format text.
  1. Insert Images and Links: The images can be inserted easily by clicking on the image icon, place it in the file. You can also create a URL on text by highlighting the text and selecting the link icon,

Step 3: Organizing Content

  • Drag and Drop Elements: Froala allows drag and drop elements in the content organization part. For example, if you want to move an image (or even a paragraph), transferring that object anywhere on the page is very easy. I am talking about all areas of flexibility as we speak.
  • Use Tables: Just click on the table icon and type as many rows and columns as needed to insert a table. Now, data can be directly entered in the column of this table.

Step 4: Preview and Edit HTML Code

  • Live Preview: As you make changes, use the live preview feature to see how the content will look on the webpage. This helps in making immediate adjustments.
  • Toggle Code View: If you need to fine-tune the HTML code, switch to the code view by clicking the HTML icon on the toolbar. This allows you to edit the raw HTML code directly.

Step 5: Save and Export HTML

  1. Save Changes: Once satisfied with the content, save the changes. Froala generates clean HTML code that you can integrate into your webpage.

 

<script>
    var html = new FroalaEditor('#froala-editor').html.get();
    // Use the HTML content as needed
</script>

 

 

  1. Export HTML: If you need to export the HTML code, you can easily copy it from the code view and paste it into your project files.

Conclusion

Compiling clear, optimized HTML code is essential when creating high-quality websites. Although the typical approach includes multiple steps and potential obstacles, implementing a comprehensive text editor such as Froala can substantially optimize the workflow.

With its extensive feature set, WYSIWYG interface, live preview, and drag-and-drop functionality, Froala is an outstanding option for novice and seasoned programmers. Adhering to the provided instructional guide, one can effectively utilize Froala to generate and modify HTML content, guaranteeing that their webpages possess sound organization, responsiveness, and aesthetic appeal.

 

Optimizing React CMS Applications With Lazy Loading of The React WYSIWYG Editor

lazy-loading Froala in React CMS

React CMS applications are popular, especially in modern web development. One of their main components is the React WYSIWYG editor, which helps content creators generate and organize content within the CMS.

In a React CMS application, initializing the React WYSIWYG editor after clicking an external button can improve the user experience in case the editor is not needed immediately when the page loads. This approach, known as lazy loading, helps to speed up the initial page load time, which is a critical factor in user experience.

Why are React CMS Applications popular?

React CMS Applications are popular because they offer a powerful combination of React’s component-based architecture and the flexibility of a Content Management System (CMS), making them a go-to choice for developers looking to build dynamic, scalable, and efficient web applications.

React CMS applications are popular for several reasons:

  1. Scalability: React CMS applications can handle large amounts of traffic and data without breaking down, making them perfect for businesses that experience sudden spikes in traffic or have many users.
  2. Flexibility: Whether it’s a change in design or functionality, React CMS applications can be easily customized and adapted to meet the specific needs of a business.
  3. Fast development cycles: developers can quickly create and deploy new features and updates in React CMSs, allowing businesses to respond fast to changing market demand and customer needs.
  4. Seamless user experience: React CMS applications provide a seamless user experience, with fast loading times and intuitive navigation, increasing customer satisfaction and loyalty.
  5. Community support: React CMS has a large and active community of developers, which means plenty of resources are available for troubleshooting and solving problems.
  6. Integration with other technologies: React CMS can be easily integrated with other technologies, such as server-side rendering, GraphQL, and state management libraries, allowing developers to create complex and sophisticated applications.
  7. Performance: React CMS applications are optimized for performance, using techniques such as lazy loading and code splitting, to ensure that the application loads quickly and runs smoothly.

Why Does React CMS Use WYSIWYG Editors?

WYSIWYG (What You See Is What You Get) editors enable users to create and edit content while applying the inserted format in real time. Moreover, it doesn’t require users to be familiar with coding. This streamlines the content creation and management process, making it more accessible for non-technical users. Professional WYSIWYG editors can provide your team with many editing features, helping them create professional-looking content easily. The powerful React WYSIWYG editor, Froala, has over 100 features.

How to Lazy Load Froala WYSIWYG Editor in React application

Let’s look at how to use lazy loading to keep the Froala React WYSIWYG Editor from loading until needed.

Prerequisites

  • JavaScript (including some of the newer, ES2015 features)
  • Basic understanding of React
  • Node.js and npm installed

Setting Up The React Project

If you don’t already have a React project set up, the create-react-app makes it easy to create one:

npm uninstall -g create-react-app

npm install -g create-react-app

npx create-react-app lazy-load-froala-app

Cd lazy-load-froala-app

Next, install the react-froala-wysiwyg package, which provides the Froala Editor component for React:

npm install react-froala-wysiwyg --save

The --save flag is important to add the React Froala WYSIWYG editor package to the dependencies in your package.json file. This ensures that the Froala editor is included in your deployed application.

Integrating The Editor

You should integrate the editor into where you want to display the editor. For simplicity, we will suppose we want to display on the homepage. Edit the app.js file.

  • Import the editor CSS stylesheet so the editor UI appears correctly.
  • Import the FroalaEditorComponent so you can use the component inside the app function.
  • Import the required plugins.
  • Add the customization options
  • Add initialization text
import React, { useState  } from 'react';
import './App.css';

//froala_style.min.css: Only needed if you display the editor content outside the rich text editor to preserve the look of the edited HTML.
import 'froala-editor/css/froala_style.min.css';

//froala_editor.pkgd.min.css: Contains the editor UI styles, such as the toolbar, buttons, popups, etc.
import 'froala-editor/css/froala_editor.pkgd.min.css';

// Import all Froala Editor component;
import FroalaEditorComponent from 'react-froala-wysiwyg';

// Import all Froala Editor plugins;
import 'froala-editor/js/plugins.pkgd.min.js';

// Render Froala Editor component.
function App() {
  const [model, setModel] = useState("the integration of CMS with React has become a significant trend in web development, offering developers the best of both worlds: the robustness of a CMS and the agility of React.");

  const handleModelChange= (event) =>{

    setModel(event)
  
  }  


  //Froala custom options
    let config = {
      heightMin: 300,
      events : {
        'contentChanged' : function(e, editor) {
          console.log('test');
        }
      }
    };

    return (
    <div className="App">
      <header className="App-header">
      <h1>Lazy load Froala app</h1>
        <FroalaEditorComponent
            model={model}
            onModelChange={handleModelChange}
            config={config}
          />

      </header>
    </div>
  );
}

export default App;

Running the app will display the Froala editor.

React WYSIWYG editor

For more explanation about the above code, refer to the “Integrate Froala with React“ guide.

Displaying the Editor on the Button Click

To display the editor on click, we need to implement the following:

  • Set up a state to track whether Froala should be displayed or removed.
  • Create a button that, when clicked, updates the state to initialize Froala.
    • A button to display the editor.
    • A button to hide the editor and display its content only.
  • Conditionally render the Froala Editor based on the state.
  • Import the FroalaEditorView component to display the editor content outside the editor correctly.
import React, { useState  } from 'react';
import './App.css';

//froala_style.min.css: Only needed if you display the editor content outside the rich text editor to preserve the look of the edited HTML.
import 'froala-editor/css/froala_style.min.css';

//froala_editor.pkgd.min.css: Contains the editor UI styles, such as the toolbar, buttons, popups, etc.
import 'froala-editor/css/froala_editor.pkgd.min.css';

// Import core Froala Editor component;
import FroalaEditorComponent from 'react-froala-wysiwyg';

// Import the component to display the editor content outside the editor;
import FroalaEditorView from 'react-froala-wysiwyg/FroalaEditorView';

// Import all Froala Editor plugins;
import 'froala-editor/js/plugins.pkgd.min.js';

// Render Froala Editor component.
function App() {
  const [model, setModel] = useState("the integration of CMS with React has become a significant trend in web development, offering developers the best of both worlds: the robustness of a CMS and the agility of React.");

  const handleModelChange= (event) =>{

    setModel(event)
  
  }  

  //Set up a state to track whether Froala should be displayed or removed.
  const [initializeEditor, setInitializeEditor] = useState(false);

  const handleButtonClick = (flag) => {
  setInitializeEditor(flag);
  };

  //Froala custom options
    let config = {
      heightMin: 300,
      events : {
        'contentChanged' : function(e, editor) {
          console.log('test');
        }
      }
    };

    return (
    <div className="App">
      <header className="App-header">
      <h1>Lazy load Froala app</h1>
      {
        //Conditionally render the Froala Editor based on the state.
      }
        { initializeEditor && <FroalaEditorComponent
            model={model}
            onModelChange={handleModelChange}
            config={config}
          />
        }
        
        { !initializeEditor && <FroalaEditorView
          model={model}
        />
        }

      { 
      // Add button
       }
      <button onClick={() => handleButtonClick(true)}>Edit Content</button>
      <button onClick={() => handleButtonClick(false)}>View Content</button>


      </header>
    </div>
  );
}

export default App;

React CMS

Conclusion

Enabling the Lazy loading technique in React CMS improves the overall user experience of your application. Ask yourself if you need the Froala React WYSIWYG Editor component to be initialized immediately after the page loads. If not, implement the lazy load technique as described above.

Try it yourself and once you are ready to use Froala in production, subscribe to the plan that suits you.
Download Froala Editor

 

Gemini AI Integration in Froala Editor: AI-powered Chat and Generate Feedback Features

Gemini AI Integration in Froala WYSIWYG Editor

Would you like to give your users the power of using AI inside their WYSIWYG editor to help them compose content, rewrite some blocks, or get feedback on their writing? That would be easy if you have a powerful WYSIWYG editor that makes it easy to extend its functionality such as Froala. Since it was made by developers for developers, Froala has been built with a modular architecture based on plugins making it easy to add new functions to the editor. Choosing Froala helps you to provide your users with new features developed for your specific use case. Moreover, you will not miss new technologies waiting for the editor team to build it for you, you can easily build it for yourself.

Generative AI tools, such as Gemini, are becoming an essential part of any product, used to create content, looking for success. “Powered by AI” is a successful marketing statement that helps in promoting your product to many categories.

Integrating Froala with ChatGPT or Gemini is a magic recipe for incorporating success for your product and it’s a piece of cake. In this article, you will learn how to build a custom Froala plugin for integrating Gemini into your Froala editor. We will add a popup to chat with Gemini and a button to allow users to receive SEO feedback on various aspects of their writing.

Froala meets AI

What is Gemini?

Gemini is an AI-powered chat service developed by Google to enhance creativity and productivity. It’s designed to assist with writing, planning, learning, and more, leveraging Google’s AI technology. Initially introduced as Bard, it functions similarly to a conversational chatbot and uses information from the web to provide fresh, high-quality responses.

How to integrate Gemini With Froala?

To integrate Gemini into 3rd party tools, you need first to get a Gemini API key. This API key should be kept secret for security purposes. That’s why we strongly recommend that you call the Google AI Gemini API only server-side. If you embed your API key directly in your web app or fetch it remotely at runtime, you risk potentially exposing your API key to malicious actors. That’s why we will perform this tutorial in the Node.js environment using Express Framework.

Integrate Froala with Express Framework

We already created a tutorial about using the Froala editor in the Node.JS server using Express Framework. We will make a quick recap here but for more details, you can go back to that tutorial.

Create a new Node.js app

npm init

Set the entry point to “app.js”

Install Dependencies

Install the Express framework, Embedded JavaScript templates (EJS), and Froala WYSIWYG editor

npm install froala-editor ejs express

Set up the Express Framework

Create a new file named “app.js” in the root directory of our project. Open “app.js” and add the following code:

var express = require('express');

var app = express();

// Set EJS as the view engine
app.set('view engine','ejs');

//Froala editor CSS & JS files
app.use('/froalacss',express.static(__dirname+'/node_modules/froala-editor/css/froala_editor.pkgd.min.css'));
app.use('/froalajs',express.static(__dirname+'/node_modules/froala-editor/js/froala_editor.pkgd.min.js'));

// Define routes 
app.get('/',(req,res)=>{
 res.render('editor');
});

var port = process.env.PORT || 3000;
app.listen(port,()=>console.log('server run at port '+port));

Init Froala Editor

Create a new directory called “views”. Inside it, create a new file called “editor.ejs” with the following code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/froalacss">
    <script src="/froalajs"></script>
    <title>Document</title>
</head>
<body>
    <h1>Froala Editor</h1>
    <textarea id="example"></textarea>
    <script>
            var editor = new FroalaEditor("#example");
     </script>
</body>
</html>

Run your node.js App

node app.js

Open http://localhost:3000\ in your browser, your app should be running and you should be able to see and play with the Froala Editor.

If you feel you missed something or need more explanation refer to the “using the Froala editor in the Node.JS server using Express Framework” tutorial.

Integrate Gemini With Froala

The idea is we will create a custom Froala plugin that will introduce custom Froala buttons. Once the new custom button is clicked it will send a request to the node.js server with a custom AI prompt, the server should handle the request by making a Gemini API call and return a response with the returned output from the Gemini API call. The Froala custom plugin will display the server response, which is the text generated by Gemini API, after making any needed modifications.

Install Dependencies

First, we will need to install the following packages:

  • Install the GoogleGenerativeAI package for Node.js
  • Install dotenv package so we can access the Gemini API key from the .env file. This package will make the .env variables accessible through process.env.
  • Install the marked package. We will use it to convert Gemini API response from mark-down syntax to HTML code.

run

npm install @google/generative-ai dotenv marked

Secure Your API Keys

To keep your Gemini API key safe, create a new .env file at the root directory and add your API key to it

GEMINI_API_KEY=***

Replace *** with your API key value.

Initialize the generative model

Open app.js and add

require('dotenv').config();
const marked = require('marked');

const { GoogleGenerativeAI } = require("@google/generative-ai");

// Access your API key as an environment variable (see "Set up your API key" above)
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);

// For text-only input, use the gemini-pro model
const model = genAI.getGenerativeModel({ model: "gemini-pro"});

In the above code, we initialized the generative model for the Gemini API using the GoogleGenerativeAI package and accessed the API key securely from the .env file. We are using the “gemini-pro” model which allows text-only input. You can specify another model based on your use case.

Define Route to Generate Text From Text-only Prompt Using Gemini API

Define a POST route to handle user prompts using Gemini API and return the AI-generated text.

// Middleware to parse JSON bodies
app.use(express.json());

// Define the /gemini POST route
app.post('/gemini', async (req, res) => {

    // Extract the prompt variable from the request body
    const { prompt } = req.body;
    
    try {
    
        const result = await model.generateContent(prompt);
        
        const response = await result.response;
        
        const responseText = marked.parse(response.text());
    
        // Send the response back to the client
        res.json({ response: responseText });

    } catch (error) {
        // Handle any errors that occur during the API call
        res.status(500).json({ error: error.message });
    }
});

In the above code, the route extracts the prompt from the request body, generates content using the Gemini model, and sends the generated text back to the client after converting it from markdown syntax to HTML. Any errors that occur during the API call are handled appropriately.

Build Froala Custom Plugin for Gemini

Basic Structure

Froala custom plugin is a custom JavaScript function that is added to FroalaEditor.PLUGINS object. Usually, it is defined inside a self-executed function that takes FroalaEditor object as a parameter. The starting point for your plugin should be a public method with the name _init(). The plugin should include a public method for sending requests to the server to generate text using AI. This method is an asynchronous function since we should wait for the response from Gemini API.

        (function (FroalaEditor) {
            // Define the plugin.
            // The editor parameter is the current instance.
            FroalaEditor.PLUGINS.Gemini = function (editor) {


                async function generateText(prompt) {
                    const response = await fetch('/gemini', {
                        method: 'POST',
                        headers: {
                        'Content-Type': 'application/json',
                        },
                        body: JSON.stringify({ prompt }),
                    });

                    return await response.json();
                    
                }

                
                // The start point for your plugin.
                function _init () {}

 
                return {
                _init: _init,
                generateText
                }
            }
            })(FroalaEditor);

Custom Froala popup

Now we need a custom popup that will contain an input for users to enter their prompts and display the AI response.

Gemini AI integrated with Froala editor

Asking Gemini and generating response

Displaying Gemini response in Froala editor

Also, it will contain a button to ask AI to give SEO feedback about the content in the editor.

Generating SEO feedback about the content inside the Froala editor

AI-feedback

The custom popup requires the following:

  • Define the popup structure/template.
    • This will contain a div for displaying the chat and an input to enter the user prompt
    • // Load popup template.
      var template = {
          buttons: popup_buttons,
          custom_layer: `<div id="chat-container"></div>
          <div id="chat-form">
            <input id="chat-form-input" type="text" placeholder="Ask AI" />
            <button id="chat-form-button" type="button">Send!</button> 
          </div>
        `
      };
  • initPopup method for creating the popup
  •                 // Create custom popup.
                    function initPopup () {
                        // Load popup template.
                        var template = FroalaEditor.POPUP_TEMPLATES.Geminipopup;
                        if (typeof template == 'function') template = template.apply(editor);
    
                        // Popup buttons.
                        var popup_buttons = '';
    
                        // Create the list of buttons.
                        if (editor.opts.geminiPopupButtons.length > 1) {
                        popup_buttons += '<div class="fr-buttons">';
                        popup_buttons += editor.button.buildList(editor.opts.geminiPopupButtons);
                        popup_buttons += '</div>';
                        }
    
                        // Load popup template.
                        var template = {
                            buttons: popup_buttons,
                            custom_layer: `<div id="chat-container"></div>
                            <div id="chat-form">
                                <input id="chat-form-input" type="text" placeholder="Ask AI" />
                                <button id="chat-form-button" type="button">Send!</button> 
                            </div>
                            `
                        };
    
                        // Create popup.
                        var $popup = editor.popups.create('Gemini.popup', template);
    
                        return $popup;
                    }
  • showPopup method for displaying the popup
  •                 // Show the popup
                    function showPopup () {
                        // Get the popup object defined above.
                        var $popup = editor.popups.get('Gemini.popup');
    
                        // If popup doesn't exist then create it.
                        // To improve performance it is best to create the popup when it is first needed
                        // and not when the editor is initialized.
                        if (!$popup) $popup = initPopup();
    
                        // Set the editor toolbar as the popup's container.
                        editor.popups.setContainer('Gemini.popup', editor.$tb);
    
                        // This custom popup is opened by pressing a button from the editor's toolbar.
                        // Get the button's object in order to place the popup relative to it.
                        var $btn = editor.$tb.find('.fr-command[data-cmd="AI"]');
    
                        // Compute the popup's position.
                        var left = $btn.offset().left + $btn.outerWidth() / 2;
                        var top = $btn.offset().top + (editor.opts.toolbarBottom ? 10 : $btn.outerHeight() - 10);
    
                        // Show the custom popup.
                        // The button's outerHeight is required in case the popup needs to be displayed above it.
                        editor.popups.show('Gemini.popup', left, top, $btn.outerHeight());
                    }
    • Inside showPopup method, we need to register a click event handler for the “Send prompt” button
    • const chatButton = document.getElementById("chat-form-button");
      chatButton.addEventListener('click', _chatButtonHandler);
      

      The private method, _chatButtonHandler, handles the button click event by displaying the user prompt in the chat area and sending it to the Gemini API to show the response. A loading message will be displayed while waiting for the server response to keep the user informed. Implementing a validation process for user input is essential for app security, but it will be left for you to implement.

    •                 function _chatButtonHandler () {
                          const prompt = document.getElementById("chat-form-input").value;
                              editor.Gemini.displayPrompet(prompt);
      
                              editor.Gemini.loadingMessage();
      
                              editor.Gemini.generateText(prompt).then(result => {
      
                              editor.Gemini.displayAiResponse(result);
      
                              }).catch(error => {
                                  // Handle any errors here
                                  console.error('Error:', error);
                              });                    
                      }
    • Add a public method for displaying the loading message
    •                 // Display a loading message
                      function loadingMessage(){
      
                          const chatContainer = document.getElementById("chat-container");
                          const loadingMessage = document.createElement('p');
                          loadingMessage.id = 'chat-loading-response';
                          loadingMessage.textContent = 'Generating response... Please wait.';
                          chatContainer.append(loadingMessage);
      
                      }

      Add a public method for displaying user prompts in the chat area

    •                // Display prompt
                      function displayPrompet(prompt){
      
                          const chatContainer = document.getElementById("chat-container");
                          const loadingMessage = document.createElement('p');
                          loadingMessage.className = 'chat-prompt';
                          loadingMessage.textContent = prompt;
                          chatContainer.append(loadingMessage);
      
                      }

      Add a public method for displaying the response from Gemini AI in the chat area

    •                 function displayAiResponse(result){
                          const chatContainer = document.getElementById("chat-container");
                          const loadingMessage = document.getElementById('chat-loading-response');
      
                          // Remove the loading message
                          chatContainer.removeChild(loadingMessage);
      
                          // Create a new paragraph element for the response
                          const p = document.createElement('p');
                          p.className = 'chat-ai-response';
                          // Set the text content to the resolved data
                          p.innerHTML = result.response; 
      
                          // Prepend the new paragraph to the chat container
                          chatContainer.append(p);
                      }
  • hidePopup method to hide the popup
  •                 // Hide the custom popup.
                    function hidePopup () {
                        document.getElementById("chat-form-button").removeEventListener('click',_chatButtonHandler);
                        editor.popups.hide('Gemini.popup');
                    }
  • A custom Froala button for opening the popup
                // Define an icon and command for the button that opens the custom popup.
                FroalaEditor.DefineIcon('AI', {NAME: 'AI', template: 'text'});            
                FroalaEditor.RegisterCommand('AI', {
                title: 'Display Gemini AI Popup',
                icon: 'AI',
                undo: false,
                focus: false,
                popup: true,
                // Buttons which are included in the editor toolbar should have the plugin property set.
                plugin: 'Gemini',
                callback: function () {
                    if (!this.popups.isVisible('Gemini.popup')) {
                    this.Gemini.showPopup();
                    }
                    else {
                    if (this.$el.find('.fr-marker')) {
                        this.events.disableBlur();
                        this.selection.restore();
                    }
                    this.popups.hide('Gemini.popup');
                    }
                }
                });
  • Custom buttons will appear on the popup
    • Define a custom button for closing the popup
    •             FroalaEditor.DefineIcon('hideAI', { NAME: 'close', SVG_KEY: 'close'});
                  FroalaEditor.RegisterCommand('hideAI', {
                  title: 'Close',
                  icon: 'hideAI',
                  undo: false,
                  focus: false,
                  callback: function () {
                      this.Gemini.hidePopup();
                  }
                  });
    • Define a custom button for clearing the chat area
    •             FroalaEditor.DefineIcon('clearChat', { NAME: 'clear', SVG_KEY: 'remove'})
                  FroalaEditor.RegisterCommand('clearChat', {
                      title: 'Start A New Chat',
                      icon: 'clearChat',
                      undo: false,
                      focus: false,
                      callback: function () {
                      
                          this.Gemini.clearChat();
                      }
                  });
      • the clearChat public method
      • function clearChat(){
            const chatContainer = document.getElementById("chat-container");
           // Prepend the new paragraph to the chat container
           chatContainer.textContent="";
        }
    • Define a custom button for using Gemini to generate feedback about editor content
    •             // Define custom popup 1.
                  FroalaEditor.DefineIcon('getFeedback', { NAME: 'star', SVG_KEY: 'star'})
                  FroalaEditor.RegisterCommand('getFeedback', {
                  title: 'Get Feedback on Your Writing',
                  icon: 'getFeedback',
                  undo: false,
                  focus: false,
                  callback: function () {
      
                      const editorTextContent = this.$el[0].textContent;
                      const proPrompt = "Hello AI, could you please provide SEO feedback on my writing? I am looking for insights on keyword optimization, readability, and meta description effectiveness. Here is the text:"+editorTextContent+". Thank you!"
                      
                      this.Gemini.displayPrompet("Generate feedback about my writing (editor content)");
      
                      this.Gemini.loadingMessage();
      
                      this.Gemini.generateText(proPrompt).then(result => {
      
                              this.Gemini.displayAiResponse(result);
      
                          }).catch(error => {
                              // Handle any errors here
                              console.error('Error:', error);
                          });
                      }
                  });

      In the above code, we defined a custom button for requesting AI feedback on editor content. It retrieves the editor’s text content and creates a prompt for the AI to generate feedback on SEO aspects. The AI is asked to provide insights on keyword optimization, readability, and meta-description effectiveness. The `generateText` method is called with the generated prompt, and upon receiving the result, the displayAiResponse function is invoked to show the AI’s feedback in the chat area. Any errors encountered during this process are logged.

  • styling the popup
  • <style>
            #chat-container{
                width: 600px;
                overflow: scroll;
                height: 300px;
    
            }
            #chat-form{
                padding: 15px;
            }
            #chat-form-input{
                width: 80%;
                padding: 10px;
                border-radius: 5px;
                border: 1px solid #999;
            }
    
            #chat-form-button{
                padding: 10px;
                background: #1978de;
                color: #fff;
                border: 1px solid;
                border-radius: 6px;
                cursor: pointer;
            }
    
            #chat-form-button:hover{
                background: #065cb8;
    
            }
            .chat-prompt, .chat-ai-response{
                padding: 15px;
                text-align: justify;
            }
    
            .chat-prompt{
                background: #eee;
                width: auto;
                padding: 10px;
                margin: 15px 100px 0 0;
                border-radius: 15px;
                border-top-left-radius: 0;
            }
    
        </style>

Combining all the code creates the Gemini plugin script

     <script>
        (function (FroalaEditor) {

            // Define popup template.
            Object.assign(FroalaEditor.POPUP_TEMPLATES, {
            'Gemini.popup': '[_BUTTONS_][_CUSTOM_LAYER_]'
            });

            // Define popup buttons.
            Object.assign(FroalaEditor.DEFAULTS, {
                geminiPopupButtons: ['hideAI', '|', 'getFeedback','clearChat'],
            });

            // Define the plugin.
            // The editor parameter is the current instance.
            FroalaEditor.PLUGINS.Gemini = function (editor) {

                // Create custom popup.
                function initPopup () {
                    // Load popup template.
                    var template = FroalaEditor.POPUP_TEMPLATES.Geminipopup;
                    if (typeof template == 'function') template = template.apply(editor);

                    // Popup buttons.
                    var popup_buttons = '';

                    // Create the list of buttons.
                    if (editor.opts.geminiPopupButtons.length > 1) {
                    popup_buttons += '<div class="fr-buttons">';
                    popup_buttons += editor.button.buildList(editor.opts.geminiPopupButtons);
                    popup_buttons += '</div>';
                    }

                    // Load popup template.
                    var template = {
                        buttons: popup_buttons,
                        custom_layer: `<div id="chat-container"></div>
                        <div id="chat-form">
                            <input id="chat-form-input" type="text" placeholder="Ask AI" />
                            <button id="chat-form-button" type="button">Send!</button> 
                        </div>
                        `
                    };

                    // Create popup.
                    var $popup = editor.popups.create('Gemini.popup', template);

                    return $popup;
                }

                function _chatButtonHandler () {
                    const prompt = document.getElementById("chat-form-input").value;
                        editor.Gemini.displayPrompet(prompt);

                        editor.Gemini.loadingMessage();

                        editor.Gemini.generateText(prompt).then(result => {

                        editor.Gemini.displayAiResponse(result);

                        }).catch(error => {
                            // Handle any errors here
                            console.error('Error:', error);
                        });                    
                }
                                
                // Show the popup
                function showPopup () {
                    // Get the popup object defined above.
                    var $popup = editor.popups.get('Gemini.popup');

                    // If popup doesn't exist then create it.
                    // To improve performance it is best to create the popup when it is first needed
                    // and not when the editor is initialized.
                    if (!$popup) $popup = initPopup();

                    // Set the editor toolbar as the popup's container.
                    editor.popups.setContainer('Gemini.popup', editor.$tb);

                    // This custom popup is opened by pressing a button from the editor's toolbar.
                    // Get the button's object in order to place the popup relative to it.
                    var $btn = editor.$tb.find('.fr-command[data-cmd="AI"]');

                    // Compute the popup's position.
                    var left = $btn.offset().left + $btn.outerWidth() / 2;
                    var top = $btn.offset().top + (editor.opts.toolbarBottom ? 10 : $btn.outerHeight() - 10);

                    const chatButton = document.getElementById("chat-form-button");
                    chatButton.addEventListener('click', _chatButtonHandler);

                    // Show the custom popup.
                    // The button's outerHeight is required in case the popup needs to be displayed above it.
                    editor.popups.show('Gemini.popup', left, top, $btn.outerHeight());
                }

                // Hide the custom popup.
                function hidePopup () {
                    document.getElementById("chat-form-button").removeEventListener('click',_chatButtonHandler);
                    editor.popups.hide('Gemini.popup');
                }

                async function generateText(prompt) {
                    const response = await fetch('/gemini', {
                        method: 'POST',
                        headers: {
                        'Content-Type': 'application/json',
                        },
                        body: JSON.stringify({ prompt }),
                    });

                    return await response.json();
                    
                }

                // Display a loading message
                function loadingMessage(){

                    const chatContainer = document.getElementById("chat-container");
                    const loadingMessage = document.createElement('p');
                    loadingMessage.id = 'chat-loading-response';
                    loadingMessage.textContent = 'Generating response... Please wait.';
                    chatContainer.append(loadingMessage);

                }

                // Display prompt
                function displayPrompet(prompt){

                    const chatContainer = document.getElementById("chat-container");
                    const loadingMessage = document.createElement('p');
                    loadingMessage.className = 'chat-prompt';
                    loadingMessage.textContent = prompt;
                    chatContainer.append(loadingMessage);

                }

                function displayAiResponse(result){
                    const chatContainer = document.getElementById("chat-container");
                    const loadingMessage = document.getElementById('chat-loading-response');

                    // Remove the loading message
                    chatContainer.removeChild(loadingMessage);

                    // Create a new paragraph element for the response
                    const p = document.createElement('p');
                    p.className = 'chat-ai-response';
                    // Set the text content to the resolved data
                    p.innerHTML = result.response; 

                    // Prepend the new paragraph to the chat container
                    chatContainer.append(p);
                }

                function clearChat(){
                    const chatContainer = document.getElementById("chat-container");

                    // Prepend the new paragraph to the chat container
                    chatContainer.textContent="";
                }

                // The start point for your plugin.
                function _init () {}

 
                return {
                _init: _init,
                generateText,
                loadingMessage,
                displayPrompet,
                displayAiResponse,
                clearChat,
                showPopup,
                hidePopup
                }
            }


            // Define an icon and command for the button that opens the custom popup.
            FroalaEditor.DefineIcon('AI', {NAME: 'AI', template: 'text'});            
            FroalaEditor.RegisterCommand('AI', {
            title: 'Display Gemini AI Popup',
            icon: 'AI',
            undo: false,
            focus: false,
            popup: true,
            // Buttons which are included in the editor toolbar should have the plugin property set.
            plugin: 'Gemini',
            callback: function () {
                if (!this.popups.isVisible('Gemini.popup')) {
                this.Gemini.showPopup();
                }
                else {
                if (this.$el.find('.fr-marker')) {
                    this.events.disableBlur();
                    this.selection.restore();
                }
                this.popups.hide('Gemini.popup');
                }
            }
            });

            // Define custom popup close button icon and command.
            FroalaEditor.DefineIcon('hideAI', { NAME: 'close', SVG_KEY: 'close'});
            FroalaEditor.RegisterCommand('hideAI', {
            title: 'Close',
            icon: 'hideAI',
            undo: false,
            focus: false,
            callback: function () {
                this.Gemini.hidePopup();
            }
            });

            
            // Define custom popup 1.
            FroalaEditor.DefineIcon('getFeedback', { NAME: 'star', SVG_KEY: 'star'})
            FroalaEditor.RegisterCommand('getFeedback', {
            title: 'Get Feedback on Your Writing',
            icon: 'getFeedback',
            undo: false,
            focus: false,
            callback: function () {

                const editorTextContent = this.$el[0].textContent;
                const proPrompt = "Hello AI, could you please provide SEO feedback on my writing? I am looking for insights on keyword optimization, readability, and meta description effectiveness. Here is the text:"+editorTextContent+". Thank you!"
                
                this.Gemini.displayPrompet("Generate feedback about my writing (editor content)");

                this.Gemini.loadingMessage();

                this.Gemini.generateText(proPrompt).then(result => {

                        this.Gemini.displayAiResponse(result);

                    }).catch(error => {
                        // Handle any errors here
                        console.error('Error:', error);
                    });
                }
            });

            // clear chat button
            FroalaEditor.DefineIcon('clearChat', { NAME: 'clear', SVG_KEY: 'remove'})
            FroalaEditor.RegisterCommand('clearChat', {
                title: 'Start A New Chat',
                icon: 'clearChat',
                undo: false,
                focus: false,
                callback: function () {
                
                    this.Gemini.clearChat();
                }
            });
            
    })(FroalaEditor);
     </script>

Customize Froala Editor to Use Gemini Plugin

Finally, edit the Froala toolbar to display the new Gemini dropdown button.

    <script>

        var editor = new FroalaEditor("#example",{
            toolbarButtons: [['AI', 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript'], ['fontFamily', 'fontSize', 'textColor', 'backgroundColor'], ['inlineClass', 'inlineStyle', 'clearFormatting']]

        });

    </script>

Now once you run the application again, you should see the “AI” button on the toolbar. By clicking the “AI” button, you can display the Gemini AI popup. The popup allows you to interact with the Gemini plugin, enabling users to prompt Gemini to get responses and generate feedback on their writing.

Similarly, you can code new custom buttons to add more AI functions within the Froala editor. These custom functionalities enhance the Froala Editor’s capabilities and provide a seamless user experience for content creation and editing.

Get The Application Code

We made this tutorial code available for free download from this GitHub repo. This way you can quickly implement these features, customize them to your needs, and improve your content creation workflows.

If you would like a tutorial on using the “gemini-pro-vision” model for generating text from text and image inputs (multimodal mode), please leave a comment.

Unleash the Power of AI in Your Froala Editor

Incorporating Gemini AI into your Froala Editor is not just an enhancement—it’s a transformation. By enabling AI-powered features like chat interfaces and instant feedback within your editor, you equip your users with the tools to elevate their content creation process, making it more efficient, engaging, and error-free. Don’t let your application lag behind in harnessing the capabilities of AI.

Take action today! Start by purchasing Froala and integrate the Gemini AI with your Froala Editor to see immediate improvements in user engagement and content quality. Enhance your product, empower your users, and lead the way in innovative content creation.

Utilizing Froala HTML editor software in Angular standalone component with SSR disabled

HTML editor software

Angular 17 gives preference to standalone components in new projects. This streamlines development by eliminating the requirement for NgModules and advocates for a cleaner, modular code design.

In this guide, we will demonstrate how to integrate the Froala WYSIWYG editor within a standalone Angular component, particularly when Server-Side Rendering (SSR) is disabled. The Froala editor is known for its rich text capabilities and user-friendly interface, making it perfect for applications needing powerful content management abilities. By integrating Froala, developers can provide users with a robust editing tool that improves the functionality and user experience of web applications.

HTML editor software with Angular

Start Developing Your Angular App

For those who are fresh, make sure you have Angular CLI installed. The Angular CLI is a tool on the command line that allows you to initialize and manage Angular projects right from the terminal.

If it is not installed, run this command:

npm install -g @angular/cli

Now you can run “ng” commands in your terminal.

Run the following command to create a new Angular app:

ng new froala-standalone-app

This will prompt you with the following

  1. Which stylesheet format would you like to use? (CSS/SCSS/Sass/Less)
    Select your preferred format.
  2. Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? (y/N)
    It inquires if you would like to configure your application to render pages on the server side and create static HTML files for your pages while building. Type “N” to turn off SSR.
    Enabling SSR and SSG means that your Angular app will be more performant and SEO-friendly, but it also implies a different build and deployment process, as you’ll need to handle the server-side and static aspects of your application. We will not cover this in this tutorial.

install new Angular app

After completing the prompts, an Angular project structure will be created in a new folder called “froala-standalone-app”. Navigate into the project directory using

cd froala-standalone-app

As of Angular 17, using the “ng new” command generates standalone components as the default. No longer will an “app.module.ts” exist.

Open the folder in your IDE. The project structure is as follows:

Angular 17 folder stracture

In the “src” folder, you will find the “index.html” file and the default component “app”.

Angular 17 app component

Integrate Froala With a Standalone Angular App

Let’s create another component with the name “wysiwyg“ to use for integrating the Froala editor into your application:

ng generate component wysiwyg

create a new Angular component

The command above will create a new folder, “wysiwyg”, inside the “src/app” directory. This folder will contain the following files for the “wysiwyg” component:

  • wysiwyg.component.css
  • wysiwyg.component.html
  • wysiwyg.component.spec.ts
  • wysiwyg.component.ts

Froala HTML editor software inside Augular standalone component

Install the Froala Angular SDK

let’s install the Froala Angular rich-text editor into your Angular application. The Froala Angular SDK includes the essential tools and components to easily integrate the functionality of the Froala editor software into your standalone Angular components.

npm install angular-froala-wysiwyg

install Froala Angular SDK

Once the installation is complete, the “angular-froala-wysiwyg” will appear in the “dependencies” section of the package.json file.

Styling the Froala Editor

Ensure that Froala’s style resources are included in your standalone Angular application. In angular.json, add Froala stylesheets under the “styles“ array.

"styles": [

"src/styles.css",

"node_modules/froala-editor/css/froala_editor.pkgd.min.css",

"node_modules/froala-editor/css/froala_style.min.css"

],

The “froala_editor.pkgd.min.css“ includes the styles for the core editor and all Froala plugins.

The “froala_style.min.css“ includes the styles needed for displaying the content created by the editor outside the editor.

Setting Up The Froala Component

Open the “wysiwyg.component.ts“ and import the FroalaEditorModule and FroalaViewModule components and add them to the “imports“ array

import { Component } from '@angular/core';
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';

@Component({
  selector: 'app-wysiwyg',
  standalone: true,
  imports: [FroalaEditorModule, FroalaViewModule],
  templateUrl: './wysiwyg.component.html',
  styleUrl: './wysiwyg.component.css'
})
export class WysiwygComponent {

}

Navigate to “wysiwyg.component.html” and add

<div [froalaEditor]>Hello, Froala!</div>

Now we can use “wysiwyg“ component to display the Froala editor in any other component in your Angular application.

Displaying Froala on the main page

Let’s add “wysiwyg“ component to the “app” component to display Froala on the main page.

Open “app.component.ts“ and import WysiwygComponent

import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterOutlet } from '@angular/router';

import { WysiwygComponent } from './wysiwyg/wysiwyg.component';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [CommonModule, RouterOutlet, WysiwygComponent],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css'
})
export class AppComponent {
  title = 'froala-standalone-app';
}

Open “app.component.html“ and add the following code to include the “wysiwyg” component:

<app-wysiwyg></app-wysiwyg>

This code will render the Froala editor on the main page of your Angular application.

Start your App

Next, you can serve the app by running `ng serve`. This command compiles the application and serves it locally, typically on `http://localhost:4200/`. You can now access your Angular app in a web browser to see the initial application setup.

The editor will be displayed on the homepage.

Display Froala WYSIWYG editor inside Angular standalone component

Including Froala Plugins

You may notice that Froala is displayed with just its basic features. That’s because we haven’t included the plugin’s JavaScript files. Open the “wysiwyg.component.ts“ and add

import 'froala-editor/js/plugins.pkgd.min.js';

This will include all Froala default plugins. Return to `http://localhost:4200/`, you will find the full-featured editor is loaded.

Full-featured WYSIWYG editor in Angular 17

If you are using just a few features, you can include the JavaScript files for the required plugins instead of “plugins.pkgd.min.js”. For example:

// import 'froala-editor/js/plugins.pkgd.min.js';

// Import plugins one by one

import 'froala-editor/js/plugins/align.min.js';

import 'froala-editor/js/plugins/image.min.js';

Customizing the Editor Options, Initial Content, and Setup Events

By adjusting the options, setting the initial content, and defining event handlers, you can create a unique and personalized editing experience for your users based on your specific requirements.

Inside the “WysiwygComponent“ class, define:

  • A string with the editor’s initial HTML content
  • An array containing the customized options, including the “events” option where you can set your editor events handlers.
import { Component } from '@angular/core';
import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
// import 'froala-editor/js/plugins.pkgd.min.js';
// Import plugins one by one
import 'froala-editor/js/plugins/align.min.js';
import 'froala-editor/js/plugins/image.min.js';

@Component({
  selector: 'app-wysiwyg',
  standalone: true,
  imports: [FroalaEditorModule, FroalaViewModule],
  templateUrl: './wysiwyg.component.html',
  styleUrl: './wysiwyg.component.css'
})
export class WysiwygComponent {
  
  editorContent = 'Learn more about <a href="https://froala.com/angular-rich-text-editor/">Froala Angular WYSIWYG Editor</a>';
  
  public options: Object = {

    toolbarButtons: ['alignRight', 'bold', 'insertImage'],

    events: {
      'froalaEditor.contentChanged': function () {
        console.log('Content updated!');
      },
    },
  };
  
}

Then, open “app.component.html“ and modify it

<div [froalaEditor]="options" [(froalaModel)]="editorContent"></div>

Now the editor should look like

Froala HTML editor software inside Angular 17

Using the editor instance from the callback arguments, you can call editor methods as described in the method docs.

Using the editor content outside the editor

To display the editor content in other elements in your application, you can utilize the froalaView component and the variable you have passed to the froalaModel attribute of the froalaEditor component. Open the “app.component.html“ file and modify it to

<p>wysiwyg works!</p>

<div [froalaEditor]="options" [(froalaModel)]="editorContent"></div>

<h2>Preview the editor content </h2>

<hr>

<div [froalaView]="editorContent"></div>

Now open your homepage, start editing the editor content, and notice your changes appear outside it too.

two-way binding between Froala and Angular

Conclusion

By integrating the Froala HTML editor software in the Angular standalone component using the Angular Froala SDK, you can enhance the editing experience and functionality in your application.

In this article, we explored how to integrate the Froala editor into a standalone Angular component while Server-Side Rendering is disabled. By following our step-by-step guide, you learned how to create a new Angular app, set up the Froala Angular rich-text editor, customize editor options, and display editor content outside the editor.

Now that you have the tools to enhance your Angular application with the Froala editor, why not give it a try? Start creating dynamic and interactive content for your users today by incorporating this powerful editor into your projects. Happy coding!

 

Simple Integration Guide: Adding Math Equations and Chemistry Formulas to Froala Editor

integrating Froala with mathType

Wondering how to type math equations and chemistry formulas in Froala Editor?

By integrating Froala with MathType, you can easily insert math equations and chemistry formulas in the Froala editor. In this blog post, we will learn how to integrate Froala and mathType.

What is MathType?

MathType is an intuitive solution for creating quality math formulas in your documents and digital content. It is the leading formula editor and equation writer used by K-12 and university STEM students and faculty worldwide.

MathType has a user-friendly interface that makes writing scientific content on your computer fun. Forget about having to learn LaTeX to write math on a computer.

MathType has a handwriting interface powered with AI to convert your handwritten formula into a clean digital equation ready to be used in the editor.

MathType is not just for math equations but also provides a tool for handling chemistry formulas.

MathType is designed to meet accessibility standards in order to make the software accessible to individuals with disabilities. It follows the WCAG 2.0 guidelines from W3C, making sure content can be read by assistive technologies and operated with a keyboard.

Incorporating Froala HTML editor includes MathType capabilities, enabling easy writing of math equations and chemical formulas in your WYSIWYG editor.

How Can I Integrate MathType With Froala?

  • include Froala stylesheet and scripts files and the element you want to initialize the editor in your HTML page
<!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" />
        // Froala Stylesheet
        <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
    </head>

    <body>
        <!-- HTML element for displaying the editor -->
        <div id="editor"></div>
        <!-- Froala JS file -->
        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>  

    </body>

</html>
  • Install the MathType for Froala npm module by running the following command:
npm i @wiris/mathtype-froala3
  •  Include the MathType-Froala plugin script in your HTML page
<script src="node_modules/@wiris/mathtype-froala3/wiris.js"></script>
  • Initialize the editor
new FroalaEditor('#editor', {
   // Add MathType and ChemType buttons to the toolbar and the image menu:
   toolbarButtons: ['wirisEditor', 'wirisChemistry'], 
   quickInsertButtons: ['image', 'table', 'wirisEditor', 'wirisChemistry'],
   // Allow all tags, in order to allow MathML:
   htmlAllowedTags:  ['.*'],
   htmlAllowedAttrs: ['.*'],
   // Allow empty tags on these next elements for proper formula rendering:
   htmlAllowedEmptyTags: ['mprescripts', 'none', 'textarea', 'a', 'iframe', 'object', 'video', 'style', 'script', '.fa', '.fr-emoticon', '.fr-inner', 'path', 'line', 'hr'],
});

In the above code:

  • We customized the editor toolbar buttons to display a button for adding math equations “wirisEditor“ and a button for adding chemistry formulas “wirisChemistry“ using `toolbarButtons` option.
  • We also customized the `quickInsertButtons` option to display the MathType buttons on the Quick Insert toolbar. This toolbar appears when you have the cursor on a blank new line.
  • Additionally, we set the `htmlAllowedTags`, `htmlAllowedAttrs`, and `htmlAllowedEmptyTags` properties to ensure proper rendering of formulas in the editor and while displaying it later on the HTML page outside the editor.
    • htmlAllowedTags is an array containing allowed tags to be inserted in the editor, by default it’s set to
      ['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']

      Since MathType uses other HTML tags, we customized htmlAllowedTags to be

      htmlAllowedTags:  ['.*'],

      This allows MathType custom tags to be inserted in the editor.

    • htmlAllowedAttrs is an array containing allowed attributes to be used for tags, by default it’s set to
      ['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']

      Since MathType uses other HTML attributes, we customized htmlAllowedAttrs to be

      htmlAllowedAttrs: ['.*'],
    • htmlAllowedEmptyTags is an array containing a list of tags that are not removed when they have no content inside. We have added ‘mprescripts’ and ‘none’ tags since these tags can be inserted by MathType and could be empty.

Customize MathType Editor

MathType offers various choices for adjusting its design, enabling you to coordinate it with your application’s interface and enhance the user’s experience. Refer to the MathType documentation for a comprehensive list of available choices. Use the mathTypeParameters option to send these parameters. One way to adjust the MathEditor language is by following this process.

mathTypeParameters: { 
 editorParameters: { Language: 'es' },
},

You can also disable the handwriting interface by setting the detectHand option to false.

mathTypeParameters: { 
 editorParameters: { Language: 'es' },
       detectHand: false
},

Here is the full page code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
    <title>Froala & MathType integration</title>
</head>

<body>
    <!-- HTML element fo displaying the editor -->
    <div id="editor"></div>

    <!-- Froala JS file -->
    <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>  

    <script src="node_modules/@wiris/mathtype-froala3/wiris.js"></script>

    <script>
        new FroalaEditor('#editor', {
            // Add MathType and ChemType buttons to the toolbar and the image menu:
            toolbarButtons: ['wirisEditor', 'wirisChemistry'], 
            quickInsertButtons: ['image', 'table', 'wirisEditor', 'wirisChemistry'],
            // Allow all tags, in order to allow MathML:
            htmlAllowedTags:  ['.*'],
            htmlAllowedAttrs: ['.*'],
            // Allow empty tags on these next elements for proper formula rendering:
            htmlAllowedEmptyTags: ['mprescripts', 'none', 'textarea', 'a', 'iframe', 'object', 'video', 'style', 'script', '.fa', '.fr-emoticon', '.fr-inner', 'path', 'line', 'hr'],
            //mathType options
            mathTypeParameters: { 
                editorParameters: { 
                    Language: 'es',
                    backgroundColor: '#333',
                    detectHand: false
                 },
            },
        });
    </script>
</body>
</html>

How Can I Render MathML Data and Store Generated Images Locally?

The MathType npm package uses remotely hosted services to display MathML content remotely. Nevertheless, we suggest that you set up these services on your backend. This will enable you to, among other capabilities, set up the service and save the images produced by MathType on your server.

Plugins are available for Java, PHP, .NET, and Ruby on Rails. If you are using any of these technologies, make sure to get the plugin for your backend technology from here.

How To Display Math Equations and Chemistry Formulas Outside The Editor?

To display mathematical formulas on the webpage where content produced by the Froala HTML editor will be visible, the target page needs to include the MathType script. For example, for the default setting, this would be:

<script src="https://www.wiris.net/demo/plugins/app/WIRISplugins.js?viewer=image"></script>

How To Insert Math Equations and Chemistry Formulas Effortlessly?

Once you integrate MathType, there will be two icons added to the Froala toolbar.

Integrate Froala and MathType editor

Clicking on the square root icon will display all the symbols available for math equations. Once you are done, click on the OK button. The equation will be inserted into your WYSIWYG editor.
MathType editor

Clicking on the C icon will display all the symbols available for chemistry formulas. Once you are done, click on the OK button. The formula will be inserted into your WYSIWYG editor.
Button to open chemType editor

ChemType editor

Conclusion

To sum up, integrating Froala with MathType provides a seamless solution to include math equations and chemistry formulas in your content creation workflow. By following the instructions provided in this blog post, you can enhance the functionality of Froala Editor, making it easier to create and display complex scientific content. Whether you are a student, educator, or professional in the STEM field, leveraging MathType’s capabilities within Froala Editor can streamline your workflow and improve the accessibility of your mathematical and chemical content. Embracing this integration opens up a world of possibilities for effectively communicating scientific concepts in a visually appealing and interactive manner.

Are you prepared to enhance your content by including flawless math equations and chemistry formulas? Try out the combination of Froala Editor and MathType now to see their powerful capabilities. Begin generating visually impressive and engaging scientific content with ease. Give it a try now and access a higher level of creativity!

Download Froala Editor

Efficient Handling of Special Characters in HTML with Froala WYSIWYG Editor

special characters in HTML pages

Have you ever wondered how developers add cool symbols like copyright signs to websites? It’s all about special characters! This blog post will show you how to use special characters in HTML pages. We’ll explain the differences between Unicode values and HTML entities to represent special characters in a way that’s easy to understand. Plus, we’ll introduce you to the Froala editor, a handy tool that makes working with special characters a breeze.

Get ready to learn the secrets of special characters and level up your web design skills. Let’s make your web pages stand out with special characters that add a touch of magic!

What are Special Characters?

Special characters are characters that are not part of the standard alphanumeric or punctuation characters found on a typical keyboard. These characters serve specific functions or have special meanings in various contexts, such as programming languages, markup languages like HTML, and text processing.

Special characters can include symbols, diacritics, mathematical symbols, currency symbols, punctuation marks, and other characters used for specific purposes. Some common examples of special characters include:

  1. & (ampersand): Used in HTML to start an entity reference.
  2. # (hash or pound sign): Used in programming languages for comments or to indicate numbers.
  3. $ (dollar sign): Used to represent currency or variables in programming.
  4. @ (at sign): Used in email addresses and social media handles.

Special characters can have different meanings and functions depending on the context in which they are used. It is important to handle them correctly using HTML entities or Unicode values to avoid formatting issues or errors in the display of web content.

How to Include Special Characters in HTML?

Special characters in HTML can be handled using HTML entities or Unicode values. Both values are used in HTML to represent special characters that cannot be easily typed on a keyboard or may cause formatting issues if used directly in the code. They are used to display characters such as copyright symbols, arrows, and accented letters on web pages.

Using HTML entities or Unicode values, you can effectively include special characters in HTML and ensure they are displayed correctly on your web pages.

What is the Difference Between HTML Entity and Unicode for Special Characters?

An HTML entity and Unicode are both used to represent special characters in HTML, but they serve different purposes and have different formats.

An HTML entity is a named code that represents a specific character in HTML. For example, &copy; is the HTML entity for the copyright symbol ©. HTML entities begin with an ampersand (&) and end with a semicolon (;). Entities are easier to read and understand in the code, making them more human-friendly.

Unicode, on the other hand, is a universal character encoding standard that assigns a unique numerical value to every character and symbol in almost all the world’s writing systems. Unicode values are typically represented in HTML using the hexadecimal format &#xXXXX; (where XXXX is the Unicode value in hexadecimal). For example, the Unicode value for the copyright symbol © is 00A9, so it can be represented in HTML as &#x00A9;.

In summary, HTML entities are named codes for special characters in HTML, while Unicode provides a universal standard for encoding characters across different writing systems. HTML entities are easier to use and understand in the code, while Unicode allows for a broader range of characters to be represented in a standardized way.

Simplifying Handling HTML special characters in web pages

Developers face challenges in using special characters due to the need for accurate HTML symbol codes, entities, or Unicode values for each character. Mishandling these characters can result in formatting problems or display errors on websites. While there are reference websites available for these codes and values, a more effective solution is to utilize an editor that gives you a dropdown menu for selecting special characters visually. Using a text editor that supports Unicode encoding ensures correct display and saving of characters.

Froala Wysiwyg editor is an example of a powerful editor that supports special characters efficiently by providing a convenient way to select and insert symbols without the need to remember specific codes or values. This editor simplifies the process of incorporating special characters into web content, ensuring accurate display and compatibility across different browsers. By utilizing tools like the Froala Wysiwyg editor, developers can enhance the visual appeal and functionality of their websites with ease.

How does Froala manage special characters?

Froala offers two plugins for managing special characters in the editor.

Special Characters Plugin

The special Characters plugin adds a toolbar button that opens a dropdown menu. This menu contains a list of special characters for users to select from. By utilizing the specialCharactersSets option, you can specify the special characters to be displayed and categorize them. For example, consider the following initialization code:

new FroalaEditor('div#froala-editor', {
  // Set custom buttons.
  toolbarButtons: ['bold', 'italic', 'underline', 'specialCharacters', 'html'],
  specialCharactersSets: [    
  {
      title: "Letters",
      "char": "&Imacr;",
      list: [{
        "char": "&imacr;",
        desc: "LOWERCASE I WITH MACRON"
      }],
    },
    {
      title: "Punctuation",
      "char": "&copy;",
      list: [{
        "char": "&reg;",
        desc: "REGISTERED TRADE MARK SIGN"
      }, {
        "char": "&copy;",
        desc: "COPYRIGHT SIGN"
      }]
    },

  ],
})

In the code above, the editor toolbar was customized with a limited selection of buttons, including the “specialCharacters” button. Two categories of special characters were defined to be displayed when the user clicks on this button using the specialCharactersSets option.

The first category is “Letters,” represented by the uppercase letter I with macron (Ĩ), and includes only one symbol: “the lowercase letter i with macron (ĩ)”. The second category, “Punctuation,” contains two symbols: the copyright © and the registered trademark ® signs.

special characters in Froala editor

Now when using the editor, you can conveniently select and insert the defined special characters without having to remember specific codes or values. This simplifies the process of incorporating special characters into web content, ensuring accurate display and compatibility across different browsers.

However, if you insert the “ĩ” and then switch the editor to the code view mode, you will find that it is still showing as “ĩ” and not converted to the corresponding entity value ”&imacr;”. That’s why the Froala Entities plugin comes in to fix this problem.

Froala special characters plugin

Entities Plugin

The Entities plugin displays HTML entities in the code view when their related special character symbol is inserted in the editor. Use the entities option to specify the HTML entities that should be displayed in the code view when their related special character symbol is inserted in the editor. For instance, using the following initialization code will convert “ĩ” to the corresponding entity value ”&imacr;” in the code view.

new FroalaEditor('div#froala-editor', {

  entities: '&imacr;'

})

The power of using Special Characters and Entities Plugins together

Combining the functionality of the Special Characters and Entities plugins provides a comprehensive solution for handling special characters seamlessly within the Froala Wysiwyg editor. This integration enhances the editing experience and ensures the proper display of special characters in the HTML code.

For example, consider the following initialization code:

new FroalaEditor('div#froala-editor', {
  // Set custom buttons.
  toolbarButtons: ['bold', 'italic', 'underline', 'specialCharacters', 'html'],
  specialCharactersSets: [    
  {
      title: "Letters",
      "char": "&Imacr;",
      list: [{
        "char": "&imacr;",
        desc: "LOWERCASE I WITH MACRON"
      }],
    },
    {
      title: "Punctuation",
      "char": "&copy;",
      list: [{
        "char": "&reg;",
        desc: "REGISTERED TRADE MARK SIGN"
      }, {
        "char": "&copy;",
        desc: "COPYRIGHT SIGN"
      }]
    },

  ],
  entities: '&imacr;&reg;&copy;'
})

Using the above code, the Special Characters plugin will display a popup containing ĩ, ©, and ® symbols. When one of them is selected, the entities plugin converts it to their respective HTML entity – ĩ to “&imacr;“, © to “ &copy;“, and ® to “ &reg;“ in the code view.

Froala Entity Plugin

By combining the Special Characters and Entities Plugins, users no longer need to search for special character entity values every time they want to use one. They can simply select the icon from the dropdown menu.

Conclusion

The Froala WYSIWYG editor with its Special Characters and Entities Plugins streamlines the process of inserting special characters, eliminating the need to memorize specific codes or values. This powerful editor not only enhances the editing experience but also guarantees the proper display of special characters within the HTML code.

By simplifying the handling of special characters, developers can focus on enhancing the visual appeal and functionality of their websites without worrying about formatting issues. The comprehensive solution offered by Froala empowers developers to effortlessly incorporate special characters, adding a touch of magic to their web pages and creating a seamless user experience.

Embrace the power of special characters in your HTML projects by utilizing the Froala WYSIWYG editor with its Special Characters and Entities Plugins. Experience the seamless integration, streamlined workflow, and accurate display of special characters. Try Froala editor today and unleash your creativity in web design!

Download Froala Editor

Best Practices for Text to HTML Editors: Prioritizing Code Quality

Learn to Convert Plain Text to HTML Easily with Froala

Developing engaging content is merely a portion of the challenge in web development. Your message comes to life by delivering that information impactfully on a webpage. However, numerous experts face challenges when transitioning from plain text to HTML with text to html editors.

This guide functions as a directional tool, systematically describing a direct strategy for accomplishing this conversion procedure.

Acquiring a comprehensive understanding of HTML will enable you to utilize a text to HTML editor effectively, converting your written compositions into interactive and visually captivating web content. This transformation allows your content to seamlessly connect with your intended audience, effectively enhancing engagement and retention.

Understanding Plain Text and HTML

Let’s start by learning about the building blocks. Plain text is any unformatted text document. It’s essentially the same as a simple notepad file: pure text with no additional formatting or graphic components. Plain text is fantastic for raw content but cannot define a webpage’s organization, design, or interactivity.

HTML is the foundation for webpages, offering a set of instructions browsers utilize to interpret and display content.  These components instruct the web browser on presenting the content, including formatting such as headings, paragraphs, and bolded text.

Headings are denoted by h1>, paragraphs by p>, and bold text by b>, all typical foundational elements. Utilizing these identifiers enables one to delineate the fundamental arrangement and structure of the content on a webpage.

Why Use a WYSIWYG Editor?

While HTML provides exact control, manual coding can be time-consuming and difficult, particularly for inexperienced people.  Consider crafting lengthy chapters full of arcane tags only to achieve basic formatting. In such situations, WYSIWYG editors emerge as transformative tools.

The intuitive interface of WYSIWYG editors serves as an intermediary between plain text and HTML. An alternative approach to code entry involves using tools, menus, and icons to represent the intended layout visually. Do you need to bold a sentence? Click the “bold” button.

Want to make a bulleted list? Use the list-creation tool.  This eliminates the need to memorize or manually write code, simplifying content development.

Learn to Convert Plain Text to HTML Easily with Froala

Getting Started with Froala

Froala is a strong text to HTML Editor. Froala integrates seamlessly into your web project. Typically, you will include the Froala JavaScript library on your web pages.  This library includes all of the functionality required for the editor to function. 

Alternatively, Froala provides plugins for major frameworks such as WordPress and React, allowing for smooth integration with existing workflows. 

Once set up, Froala gives a toolbar with straightforward buttons and choices, allowing you to format text, add images, and structure your material without writing a single line of code.

HTML offers full control over web page structure and functionality. But, there are obvious benefits to using a text-to-HTML editor like Froala:

Markdown Plugin

Froala has a powerful Markdown plugin, which expands the possibility of authoring your content. Markdown is a simple markup language that employs plain text characters to determine formatting. This enables you to compose text familiarly while maintaining a rich page layout.

Simplified Creation

Froala Text-to-HTML editor has a simple interface. It has familiar formatting options like you are using MS Word or Google Docs. It is easier for non-coders or those new to HTML to create web content.

Froala Markdown

 

<h2 id=“ftoc-real-time-online-html-editor” class=“ftwp-heading”>Realtime online HTML editor</h2><p>Create and edit ca
href=“https://validator.w3.org/” rel=“nofollow” target=“blank” title=“W3C HTML validator”>W3C valid HTML code</a> without writing a single line of code. The WYSIWYG editor on the left helps non- developers write their own <em>high-quality HTML code.</em></p>

Increased Efficiency

Froala increases efficiency. It automates repetitive tasks, such as code generation and formatting. This lets you focus on creating content and reduces development time.

Froala Markdown2

<h2 id=“ftoc-real-time online-html-editor” class=“ftwp-heading” style=“text-align: center; “>
  Time is Money, <u>And We Are Saving it for You.</u>
</h2>

Visual Representation

The WYSIWYG interface provides a real-time preview of your HTML code. It shows you how your content will appear as you work.

Froala Markdown3

<h1 dir=“ltr” style=“line-height: 2.1;margin-top:12pt;margin-bottom: 12pt;”>
  Visual Representation
</h1>
<p dir=“ltr” style=“line height:2.1;margin-top:12pt;margin-bottom: 12pt;” id=“isPasted”>
  See Your Code is Alway (Right) There.
</p>

Rich Content Capabilities

Froala text-to-HTML editor often offers features beyond basic formatting. It allows you to add images, tables, and other multimedia elements easily and convert them into Pure HTML Code.

Froala Markdown4

 

<h2 id=“ftoc-real-time-online-html-editor” class=“ftwp-heading”>Real- time online HTML editor</h2>
<p>Create and edit <a href=“https://validator.w3.org/” rel=“nofollow” target=“blank” title=“W3C HTML validator”>W3C valid HTML code</a> without writing a single line of code. The WYSIWYG editor on the left helps non- developers write their own <em>high-quality HTML code</em>
</p>
<p align=“center”>
  <img src=“https://froala.com/up- content/uploads/2021/11/agefis-v1108b04XTe-unsplash-scaled.jpg” alt=“Editor photo” class=“fr-fic fr-dii” width=“300”>
</p>
<h3 id=“ftoc- know-some-code” class=“ftup-heading”>Know some code? <span class=“fr- emoticon fr-deletable fr-emoticon-img” style=“background: url(https://cdnjs.cloudflare.com/ajax/libs/emojione/2.0.1/assets/svg/1 f600.svg);”>&nbsp;</span>
</h3>
<p>The editing works both ways, with live visual feedback. Write some markup code on the right, which will appear in the left editor.</p>

Exploring the Power of Froala’s Markdown Plugin

 

While Froala excels at text formatting, it can go even further with the strong Markdown plugin. This add-on enables a more simplified approach to article generation using Markdown, a lightweight formatting language known for its simplicity and efficiency.

Markdown made simple: Write and preview simultaneously

 

Froala’s Markdown plugin adds a user-friendly split-screen view. As you write in Markdown syntax (basic text characters with specified functionalities), the prepared content will appear on the other side in real time. 

 

This visual feedback allows you to create and see your content simultaneously, ensuring it looks exactly as you planned.

Rich Text Formatting is at your fingertips

 

The charm of Froala’s Markdown plugin resides in its extensive support for numerous formatting styles. You can use markdown syntax to create:

 

  • Headings: Organize your information into hierarchies using heading levels (H1, H2, etc.).
  • Emphasis: Highlight important points with bold, italic, or strikethrough formatting.
  • Lists: Present information rationally using ordered or unordered lists.
  • Code Blocks: Display code snippets with suitable formatting to improve readability.
  • Quotes: Use block quotes to highlight quotations or borrowed text.
  • Links and photos: Use Markdown syntax to integrate hyperlinks and photos into your writing seamlessly.
  • Tables: Organize complex data into well-structured and understandable tables.

 

The plugin includes extra features such as footnotes and task lists to meet various content development demands.

Mastering Text Formatting for Compelling Content

Although a fundamental framework is critical for every webpage, genuine interaction resides in engrossing content. Froala enables users to surpass basic skills and effectively format their texts to enhance readability and impact. Its fundamental capabilities can enhance your content as follows:

  • Font Styling: Select from various fonts and modify their dimensions, hue, and weight to establish an aesthetically pleasing design.
  • Aligning Text: To attain the intended layout on a webpage, align the text to the left, right, center, or justify position.
  • Indentation and Line Spacing: Control indentation and line spacing for improved readability, especially for lengthy text sections.
  • Hyperlinks: Effortlessly create hyperlinks by selecting text and specifying the target URL. Froala streamlines the process, removing the need for manual HTML code insertion.
  • Line Breaks and Paragraphs: Insert line breaks and create new paragraphs with a single click, ensuring proper content structure and organization.

Froala Markdown5

Bottom Line

Froala is a powerful text to HTML editor. It lets you easily convert plain text into visually appealing and compelling HTML content. Its essential capabilities create a solid foundation for text formatting, while the Markdown plugin opens up a world of efficient content development. 

Whether you prefer a WYSIWYG approach or the simplicity of Markdown, Froala has you covered, making the shift from plain text to rich online content a seamless and fast procedure. 

 

 

 

Froala & Quasar Integration: Mastering the Best WYSIWYG HTML Editor

Integrating Froala with Quasar

Froala 4.1 release has been a significant step in the history of the developer-friendly best WYSIWYG HTML Editor. It is the release where Froala supports React 18, Angular 15+ with Ivy Engine, and Vue 3. This allows developers to easily integrate Froala into applications using these technologies. For example, Froala can now straightforwardly integrate with Quasar framework V2 which utilizes Vue 3.

In this technical guide, we will explore integrating the powerful Froala as the best WYSIWYG html editor with the Quasar Framework. By leveraging the capabilities of both tools, developers can create rich text editing experiences that meet the needs of modern web development. This guide is designed to be beginner-friendly and will walk you through the process step by step.

What is the Quasar framework?

Quasar framework is an MIT-licensed open-source Vue.js-based framework, which allows you as a web developer to create responsive websites and applications in many flavors quickly:

  • SPAs (Single Page App)
  • SSR (Server-side Rendered App) (+ optional PWA client takeover)
  • PWAs (Progressive Web App)
  • BEX (Browser Extension)
  • Mobile Apps (Android, iOS, …) through Cordova or Capacitor
  • Multi-platform Desktop Apps (using Electron)

Prerequisites

We assume you have a working knowledge of:

  • JavaScript (including some of the newer, ES2015 features)
  • Vue 3
  • How to use the terminal/command line
  • Make sure that you have Node >=14 (or any newer LTS Node.js version) and NPM >=6.14.12 installed on your machine.

Quasar framework integration

Step 1: Setting Up Quasar Project

Open your terminal, navigate to the location where you want to create your project and run the following command:

npm init quasar

you’ll be prompted with some options. Depending on your needs, you can select the CLI type (Vite or Webpack) and you can add things like TypeScript support or a different CSS preprocessor. If you are unsure about any of the options, just take the defaults (hit enter) and you’ll be good to go. You can change the options, except for the CLI type, later if you wish.

Here are our selections:

install Quasar Framework

And we agreed to install project dependencies using NPM.

NPM install

When we were prompted to enter the project name, we entered “my-project“.

Navigate to the project directory

cd my-project

Step 2: Installing Vue WYSIWYG editor

Following the Froala Vue SDK docs, install Froala’s Vue WYSIWYG editor by running the following command:

npm install vue-froala-wysiwyg --save

 Step 3: Integrating Froala Editor

3.1: Import Froala Vue component

As per the Froala document, we need to inject the Froala component before the root Vue app instance is instantiated.

Since you won’t have access to any /main.js file in the Quasar framework (so that Quasar CLI can seamlessly initialize and build the same codebase for SPA/PWA/SSR/Cordova/Electron), Quasar provides an elegant solution to that problem by allowing users to define so-called boot files.

By using Quasar Boot files, you can easily set up and configure the Froala Editor Vue component to be available globally in your Quasar application.

To import the Froala Editor Vue component using Quasar Boot files, you can create a boot file (e.g. froala-editor.js) in the src/boot/ directory of your Quasar project. In this boot file, you can import and configure the Froala Editor Vue component, and then use app.use() to make it available globally.

Here’s an example of how you can set up the best wysiwyg html Editor Vue component in a Quasar Boot file:

//Import Froala Editor plugins
import 'froala-editor/js/plugins.pkgd.min.js';

// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';

// Import Froala Editor component
import VueFroala from 'vue-froala-wysiwyg';

export default async ({ app }) => {
  // Use Froala Editor Vue component
  app.use(VueFroala);
};

After creating the boot file, you need to register it in the quasar.config.js file under the boot property to ensure that it is loaded when your Quasar application starts:

boot: [

'froala-editor'

],

By following this approach, you can easily import the Froala Editor Vue component using Quasar Boot files in your Quasar application.

3.2 Configure and Initializing the Froala Editor

Ideally, you may need to define a route for a subpage where you’ll display the Froala editor but for our basic tutorial, we will edit the main page to display the Froala editor directly.

Open src/pages/IndexPage.vue, and somewhere inside the <template> tag call the Froala component.

<template>
  <q-page class="flex flex-center">
    <froala id="edit" :tag="'textarea'" :config="config" v-model:value="model"></froala>
  </q-page>
</template>

Inside the <script> tag defines the config and model variables where you can pass the editor options and the initialization content.

<script>
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'IndexPage',
  data () {

    return {

      config: {

        heightMin: 300,

        events: {

          initialized: function () {

            console.log('initialized')

          }

        }

      },

      model: '<i>Edit Your Content Here!</i>'

    }

  }
})
</script>

Step 4: Run the project

After the integration is complete, it’s time to run your project to see the editor in action.

To start your local development server and see your application, run the following command in your terminal:

npx quasar dev

This command will start the development server and open the default browser at http://localhost:9000/

Froala runing inside Quasar

You can always stop the server by using the CTRL + C command.

Customizing Your Froala’s Vue WYSIWYG editor

You can learn about the Vue Froala component tags and how to customize the editor from the Vue SDK docs and the following articles:

If you encounter any issues, comment below and I’ll be glad to help.

Conclusion

Integrating Froala Editor with the Quasar Framework can enhance the editing capabilities of your web application. By following the steps outlined in this guide, you can easily incorporate a feature-rich WYSIWYG editor into your project. Experiment with different customization options to tailor the editor to your specific needs and create a seamless editing experience for your users.

Download Froala Editor

Enhance Your Editing with Froala 4.2: Word Count and MS Word Pasting Improvements

Froala Word Count Feature

We are super excited to announce the release of Froala 4.2, which introduces the new Word Counter. This feature was highly requested by our users and we are thrilled to finally bring it to you.

In addition to adding the Word Count plugin, we’ve made several other improvements to our powerful text editor. We believe this new addition will greatly enhance your editing experience with Froala.

New Features

  • Introduce the word count feature.
  • Support the new Safari 17 Range API.

Improvements

  • Enhance the pasting of content from MS Word.

Let’s dig deeper into the Froala 4.2 release!

Fraola 4.2 release - Word Count Plugin

Word Counter Plugin

The Word Count plugin lets you easily track the number of words in your content, providing valuable insights into your text’s length. This simple yet powerful tool helps you optimize your writing and ensures your content meets certain word count requirements.

The Word Count feature is beneficial for bloggers, content creators, and writers alike. It allows them to meet their SEO requirements, evaluate their progress with written pieces, and set targets for future writing sessions.

However, Froala already has a character count feature. Adding the word count feature provides another layer of information and flexibility. Knowing the exact number of words in your content lets you make more informed decisions about editing, formatting, and optimizing your text.

WordCount Plugin

Word Count Plugin API

The Word Count plugin comes with powerful API options, events, and methods, allowing you to seamlessly customize and integrate the plugin into your existing workflows.

Word Counter Plugin API Options

The plugin offers two options:

  • wordCounterCount to turn the word count display on or off, according to your preference.
  • wordCounterMax limits the number of words in the editor.
new FroalaEditor('.selector', {

     wordCounterCount: true,

     wordCounterMax: 1200

});

Word Counter Plugin API Events

The plugin provides two API events:

  • wordCounter.exceeded is triggered when the wordCounterMax is exceeded.
  • wordCounter.update is triggered when the word count is updated.
new FroalaEditor('.selector', {

  events: {

    'wordCounter.update': function () {

      // Do something every time the word count is updated.

      // this is the editor instance.

      console.log(this);

    },

    'wordCounter.exceeded': function () {

      // Do something after the wordCounterMax is exceeded. 

      // this is the editor instance.

      console.log(this);

    },    

  }

});

Word Counter Plugin API methods

The plugin added the wordCounter.wordCount API method to return the word count in the editor.

var editor = new FroalaEditor('.selector', {}, function () {

     // Call the method 

     let words = editor.wordCounter.wordCount();

})

Word Counter is a handy feature that adds another layer of functionality to the Froala text editor. Its API options, events, and methods give you full control over the Word Count plugin and allow you to customize it according to your needs.

Support the new Safari 17 Range API

Safari 17 comes with improved interoperability for the Range API and Selection API. These APIs play a crucial role in interacting with selected content and manipulating the text range in the Safari browser. In this release, Froala added support for the new Safari Range API and Selection API, providing a seamless editing experience for Safari users.

We’re committed to providing the best for all our users, regardless of their chosen browser. Froala continues to deliver a powerful and reliable text editing solution to Safari users by supporting the new Safari 17 Range API and Selection API.

Enhanced Pasting Content from MS Word

MS Word documents contain rich formatting such as bold, italics, font styles, and bullet points. When you paste content from MS Word into the editor, it is crucial to preserve this formatting to ensure the content appears as intended.

In the Froala 4.2 release, we made significant improvements to the way content is pasted from MS Word, especially when it comes to pasting lists. These enhancements ensure that the formatting of the pasted lists is retained, allowing you to seamlessly transfer your content from MS Word to the Froala editor without any loss of list styling, alignment, or structure. Whether you’re pasting ordered, unordered, or nested lists, the pasted content will match the original content from MS Word.

We didn’t just improve the pasting of lists; we also enhanced the functionality to correctly display the icons from the Word document. This means the Froala editor will accurately reproduce any pasted icons.

We have also improved pasting tables to ensure they appear correctly in the Froala editor. We have resolved issues with adding columns and changing cell text colors in pasted tables, making editing the pasted tables more seamless and efficient.

By preserving the formatting while pasting content from MS Word, you can save valuable time and effort that would otherwise be spent reapplying styles and formatting manually. With Froala 4.2, you can confidently transfer your content from MS Word to the editor, knowing that it will preserve your content formatting.

How Can I Update?

Don’t miss out on the benefits of the latest Froala 4.2 release. Update today and experience the enhanced editing features and improvements.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.2/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.2/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Technical Questions

Froala Paragraph Styles for Online JavaScript Editors

Paragraph style

Transforming ordinary paragraphs into iconic statements is now within your reach with the powerful Froala online javascript editor. By harnessing the capabilities of the Froala Paragraph Style plugin, you can effortlessly infuse your text with a touch of creativity and sophistication. Whether you aim to emphasize crucial details, craft a distinct visual identity, or simply engage your audience on a deeper level, this plugin equips you with the tools to make your paragraphs truly stand out.

In this article, we will learn how to use the Froala Paragraph Style plugin to enhance the appearance of your text. You can apply different formatting options to make your paragraphs visually striking. Additionally, you can experiment with various font styles, colors, and sizes to create a unique and captivating design. Let’s dive into the features and functionalities of this plugin to elevate your paragraph presentation.

How does the Froala Paragraph Style Plugin Work?

When the Froala Paragraph Style plugin is activated, a button appears on the editor toolbar that opens a list of predefined styles. These styles are defined using CSS classes through the paragraphStyles API option. Choosing a style will apply its corresponding class to the selected paragraphs allowing you to effortlessly enhance the visual appeal of your text. By experimenting with different fonts, colors, and sizes, you can create a unique and captivating design for your paragraphs. This plugin offers a user-friendly way to make your text more engaging and visually appealing, helping you stand out with iconic paragraph styles with your online javascript editor.

paragraph style feature

What does the Froala Paragraph Style Plugin API do?

The Froala Paragraph Style plugin offers two options and one method for customizing paragraph styles in the editor.

The Froala Paragraph Style Plugin Options

1. paragraphStyles:

The paragraphStyles option enables developers to create custom styles for selected paragraphs. It is an object where the property name represents a CSS class and its corresponding value is the text shown in the dropdown menu when the “Paragraph Styles” button is clicked. For example, if the assigned object is

{

'fr-text-gray': 'Gray',

'fr-text-bordered': 'Bordered',

}

This will display two options on the dropdown menu.

  • Gray: once selected, the editor will check the selected paragraph. If it does not have the ‘fr-text-gray’ class, the editor will add it. If the selected paragraph already has that class, the editor will remove it.
  • Bordered: once selected, the editor will check the selected paragraph. If it does not have the ‘fr-text-bordered’ class, the editor will add it. If the selected paragraph already has that class, the editor will remove it.

By default, the paragraphStyles option has the following value:

{

'fr-text-gray': 'Gray',

'fr-text-bordered': 'Bordered',

'fr-text-spaced': 'Spaced',

'fr-text-uppercase': 'Uppercase'

}

You can also define your custom styles and their corresponding classes. When you add your custom class name, make sure you have defined that class in the page stylesheet.

2. paragraphMultipleStyles

Using the paragraphMultipleStyles option, developers can choose whether users can apply a single style or multiple styles from the defined styles in the paragraphStyles option. This gives you control over the number of styles that should be applied to each paragraph using the Paragraph Styles feature. By default, the paragraphMultipleStyles option is set to true.

The Froala Paragraph Style Plugin Methods

The Froala Paragraph Style plugin provides the paragraphStyle.apply(className) method to programmatically apply a specific CSS class to selected paragraphs. This method can be called within editor events or used to create custom buttons for applying paragraph styles.

var editor = new FroalaEditor('.selector', {}, function () {

    // Call the method inside the initialized event.

    editor.paragraphStyle.apply('light');

})

This flexibility in styling empowers you to create visually appealing and unique paragraph designs effortlessly. Experimenting with different font styles, colors, and sizes can help you enhance the visual appeal of your text effectively.

Installation and Setup of The Froala Paragraph Style Plugin

Step 1: Add the Froala Paragraph Style plugin files.

If you have included the Froala packaged files in your web application, then the Paragraph Style plugin JavaScript file is included by default. Skip to step #2.

<link href='{url_based_on_your_download_option}/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />

<script type='text/javascript' src='{url_based_on_your_download_option}/js/froala_editor.pkgd.min.js'></script>

Otherwise, you should include the plugin script file. The plugin doesn’t have a stylesheet file.

<!-- The editor core files -->

<link href='{url_based_on_your_download_option}/css/froala_editor.min.css' rel='stylesheet' type='text/css' />

<script type='text/javascript' src='{url_based_on_your_download_option}/js/froala_editor.min.js'></script>



<!-- The plugin script file -->

<script type='text/javascript' src='{url_based_on_your_download_option}/js/plugins/paragraph_style.min.js'></script>

Step 2: Activate the plugin

By default, the plugin is activated when its JavaScript file is added. However, if the pluginsEnabled option is customized, you should include the paragraphStyle in its assigned value. This ensures that the plugin is active and ready to be used.

new FroalaEditor('#HTMLElement',{

pluginsEnabled: ['image', 'link', 'video', 'paragraphStyle']

});

Step 3: Add the Paragraph Styles Button to the Froala Toolbar

The Paragraph Styles Button is shown by default when the plugin is active. If the toolbarButtons option is customized, include paragraphStyle in the assigned value to display the button.

new FroalaEditor('#HTMLElement',{

    pluginsEnabled: ['image', 'link', 'video', 'paragraphStyle'],

    toolbarButtons: ['bold','insertLink', 'insertImage', 'insertVideo','paragraphStyle']

});

Do the same with the toolbarButtonsMD, toolbarButtonsSM, toolbarButtonsXS options. These options indicate the buttons to be displayed on medium, small, and extra small screens, respectively. By default, these options display the same buttons defined in the toolbarButtons option.

Common use cases of the Paragraph Styles feature

The Paragraph Styles feature is very popular among users as it helps them with

  • Highlighting Important Information: Use different styles to draw attention to key points or important information within your paragraphs.
  • Creating a Consistent Design: Maintain a uniform look throughout your document by applying predefined styles to different sections.
  • Enhancing Readability: Experiment with font styles, colors, and sizes to improve the readability of your text and make it more visually appealing.
  • Adding Emphasis: Apply unique styles to specific paragraphs to emphasize their significance or create a visual hierarchy in your content.

And much more…

Conclusion

The Froala Paragraph Style plugin offers a versatile toolkit to elevate your content presentation. By highlighting important information, creating a consistent design, enhancing readability, and adding emphasis, you can captivate your audience with visually appealing paragraphs. Take your writing to the next level with the power of customization at your fingertips.

Ready to make your paragraphs iconic? Start transforming your text today with the Froala and unleash your creativity like never before!

Download Froala Editor

 

Responsive Video Design for Online JavaScript Editors: A Vue WYSIWYG Guide

Vue WYSIWYG editor

Imagine a world where videos seamlessly adapt to any screen size or device, captivating viewers with their dynamic display. In today’s digital landscape, where content consumption spans across various platforms and gadgets, the need for responsive videos has never been more crucial. Enter the “Responsive Video” feature Froala; an online javascript editor—a game-changer that ensures your videos always shine, regardless of the viewing platform.

We recently answered ten questions about the Froala video plugin customization. However, we did not cover some features, including the “Responsive Video” feature. This article will explore this important feature and demonstrate how to use it with our Vue WYSIWYG editor.

What is the Responsive Video feature in Froala?

The “Responsive Video” feature in Froala online javascript editor allows videos to adjust their size based on the screen or container they are displayed in, ensuring they look good on any device or screen size. Implementing this feature can enhance the user experience by ensuring videos are displayed responsively across various devices.

Unlike the normal mode, you cannot manually resize the added video by dragging and dropping. Additionally, users cannot modify video display or alignment properties. They also cannot change the video dimensions through the Edit video popup.

By enabling this option, the video edit pop-up menu will have three buttons only:

  • Video Replace button
  • Video Remove button
  • Auto-play button

Video feature

Responsive Videos Use Cases

Many use cases can benefit from the Responsive Videos feature. For instance, imagine a scenario where a fashion e-commerce website utilizes the “Responsive Video” feature to showcase dynamic runway videos of its latest collections. These videos seamlessly adapt to the varying screen sizes of users, whether they are browsing on a laptop, tablet, or smartphone. This not only ensures a consistent visual experience for shoppers but also reinforces the brand’s commitment to delivering high-quality content across all devices.

Moreover, consider an educational platform that leverages the responsive video functionality to deliver interactive learning materials to students. With videos adjusting intelligently to fit the screen size, learners can engage with course content effortlessly, regardless of the device they are using. This feature eliminates the need for manual adjustments, allowing educators to focus on creating impactful video lessons without worrying about compatibility issues.

In a marketing context, a travel agency could utilize the “Responsive Video” feature to showcase breathtaking destination videos on their website. By enabling automatic resizing, these videos captivate potential travelers on desktops, tablets, or smartphones, painting an immersive picture of the travel experiences they offer. This seamless display ensures that the agency’s promotional content is visually striking and accessible to a wide audience.

How to enable the “Responsive Video” feature in Froala?

To enable the “Responsive Video” feature in Froala online javascript editor, you can simply set the videoResponsive option to true within the editor configuration.

new FroalaEditor('.selector', {

  videoResponsive: true

});

By activating this feature, videos embedded using Froala will automatically adjust their dimensions to fit the screen or container they are placed in. This dynamic resizing ensures that videos appear correctly sized and formatted on any device or screen resolution.

responsive videos

A Demonstration of the Froala Responsive Video Feature on Vue 3

Let’s create a working example of the Froala Responsive Video Feature on Vue 3. Following a few simple steps, you can easily incorporate this feature into your Froala Vue WYSIWYG editor setup.

Start by creating a new Vue project. Simply use the command below:

vue create video-responsive-project

Once the project is created, navigate to the project directory:

cd video-responsive-project

After that, install the Froala Vue WYSIWYG editor package and its dependencies using npm:

npm install vue-froala-wysiwyg

The vue-froala-wysiwyg NPM package is a wrapper around the Froala editor that simplifies the integration between Froala and Vue.js applications, allowing users to easily create and edit content with a What You See Is What You Get interface.

After installing the vue-froala-wysiwyg package, import it into your project to set up and customize the Froala editor in your Vue.js application.

Open the main Vue component file (main.js)

import { createApp } from 'vue'

import App from './App.vue'

//Import Froala Editor plugins
import 'froala-editor/js/plugins.pkgd.min.js';

// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';


// Import Froala Editor component
import VueFroala from 'vue-froala-wysiwyg';
  • Register the Froala Vue WYSIWYG editor component globally:
const app = createApp(App);          

app.use(VueFroala);

app.mount('#app');

Now you can use the Froala editor component anywhere in your Vue.js project.

The Froala editor component has three attributes:

  1. :tag attribute specifies the tag on which the editor is initialized, typically set to “textarea”.
  2. :config attribute which is used to pass the editor options that allow you to customize the editor settings based on your requirements. It provides flexibility in configuring the editor’s behavior, appearance, and functionality. Using this attribute, you can tailor the Froala editor to suit your specific needs and enhance the editing experience for users interacting with your Vue.js application.
  3. v-model:value attribute is used to display and edit content in the editor with two-way binding.

To enable the video responsive feature, we will set the videoResponsive option to true inside the :config attribute.

Open the “App.vue” file and edit it as

<template>
    <froala
    :tag="'textarea'"
    :config="config" 
  ></froala>

</template>
<script>
export default {
  name: "App",
    data () {

    return {

      config: {
        videoResponsive: true,
        toolbarButtons: ['insertVideo']
        }
      }
    },
  }
</script>

Run the below NPM command to run your Vue application on your local development server.

npm run serve

Visit http://localhost:8080 to view the running example we created. Note, on the Froala editor’s toolbar, there is a button to insert Videos. When a video is inserted, it automatically spans the full width of the editor and cannot be manually resized.

Conclusion

By incorporating the “Responsive Video” feature in Froala, you can ensure that videos adjust their size according to the screen or container they are displayed in, providing a consistent viewing experience across various devices. This dynamic resizing feature enhances user interaction by optimizing video displays on different screen sizes.

Froala can act as your Vue WYSIWYG editor. Enabling the videoResponsive option in the Froala Vue WYSIWYG editor allows for seamless integration of this feature, making it easy to create and edit responsive videos within your Vue.js application.

10 FAQs on Customizing the Froala Editor HTML Editor Software

html editor software

Video has become one of the most powerful mediums for storytelling and communication in the digital age. It offers more engagement than text or images for the simple reason that it combines audio, video, and text. Froala is a professional html editor software that supports inserting and editing videos. Our mission is to not only provide these features but also to simplify and innovate the process of inserting and editing videos within your content.

In a previous article, we discussed the installation, setup, and usage of the Froala Video plugin. This article will focus on addressing frequently asked questions regarding customizing the Video plugin. This comprehensive FAQ delves into various aspects of video plugin usage, offering valuable guidance on how to tailor the video plugin to their specific requirements, enhancing the overall functionality of the editor.

html editor software

1. What is the Video Plugin API?

The comprehensive API of the Video plugin provides developers with a wide range of options, events, and methods to customize the video editing experience. With twenty options, eleven events, and six methods at your disposal, you have the flexibility to create engaging and interactive content seamlessly within the Froala html editor software.

The Video plugin options allow you to customize the appearance, behavior, and functionality of the plugin to suit your needs. By leveraging the available events, you can enhance user interactions and create a great editing UX. Additionally, the methods provided enable you to manipulate videos programmatically, giving you full control over the editing process.

2. Can I restrict the use of the “Paste Video URL” to specific platforms?

Froala html editor software allows you to restrict the use of “Paste Video URL” to specific platforms. This feature provides additional control over the sources from which videos can be embedded. By defining the platforms where users can paste video URLs, you can ensure content consistency and compliance with your guidelines. This functionality enhances the overall user experience and content management within the Froala Editor, contributing to a more streamlined editing process.

To achieve this, use the videoAllowedProviders API option. This option accepts an array of allowed video providers where you can specify the allowed platforms.

For example:

new FroalaEditor('.selector', {

  videoAllowedProviders: ['youtube', 'vimeo']

});

The above code allows inserting videos from YouTube and Vimeo. If a user tries to insert videos from another platform using the “Paste Video URL” option, he will get an error message. However, users are still able to embed videos from restricted platforms using the embed video option.

3. Can I limit the types of videos that can be inserted?

Developers can easily manage the types of videos that users can insert into the editor by utilizing the videoAllowedTypes option. This option accepts an array with the allowed video types. By default, ‘mp4’, ‘webm’, and ‘ogg’ are allowed. This feature enables you to specify the supported video formats, ensuring that only the designated file types can be uploaded. Limiting the video formats enhances content control, maintains consistency in the content being added, and improves application security.

new FroalaEditor('.selector', {

  videoAllowedProviders: ['youtube', 'vimeo'],

  videoAllowedTypes: ['mp4']

});

4. How can I restrict the size of uploaded videos?

Developers can also utilize the videoMaxSize option to limit the size of uploaded videos, ensuring optimal performance and efficient content management. By specifying a maximum size for video uploads, you can control the file size of inserted videos, preventing large files from impacting the editor’s performance. By default, The Froala Video plugin allows users to upload videos up to 30MB.

new FroalaEditor('.selector', {

  videoAllowedProviders: ['youtube', 'vimeo'],

  videoAllowedTypes: ['mp4'],

  videoMaxSize: 1024 * 1024 * 15

});

5. How do I change the default alignment of inserted videos?

The default alignment of inserted videos is controlled by the videoDefaultAlign option. By default, videos are aligned to the center, but you can customize this setting to align videos left or right. This flexibility in alignment options allows you to control the visual presentation of videos within your content seamlessly. Customizing the alignment default value to the most frequently used position makes aligning multiple videos easier and boosts user productivity.

new FroalaEditor('.selector', {

  videoAllowedProviders: ['youtube', 'vimeo'],

  videoAllowedTypes: ['mp4'],

  videoMaxSize: 1024 * 1024 * 15,

  videoDefaultAlign: 'left'

});

6. How could I insert videos within the text flow?

When inserting a video within the Froala editor, the default behavior causes the text to break, appearing above and below the video rather than beside it. This layout is due to the video being wrapped in a span element with the class fr-dvb which enforces a block display style.

.fr-view .fr-video.fr-dvb {

    display: block;

    clear: both;

}

To integrate videos seamlessly into text content, developers can override this default behavior by customizing the videoDefaultDisplay option.

new FroalaEditor('.selector', {

  videoDefaultDisplay: 'inline'

});

By setting this option to inline, videos can be inserted within the text flow. This adjustment ensures that the videos are displayed in line with the surrounding text. In this case, The video’s parent span element will have the class fr-dvi instead of fr-dvb, which sets its display to inline-block.

.fr-view .fr-video.fr-dvi {

    display: inline-block;

}

By controlling the display behavior of videos, developers can create a more cohesive and engaging user experience within the Froala html editor software.

7. How to remove the predefined width for inserted videos?

Developers can also set a predefined width for inserted videos using the videoDefaultWidth option. This feature allows specifying a default width for all videos inserted into the editor, ensuring consistent sizing across your content. By defining a specific width value, you can control the visual presentation of videos and maintain uniformity in their display. Customizing the default width enhances the overall layout of your content and contributes to a more polished and professional appearance.

By default, the inserted videos will have a 600px width. To insert videos without a predefined width, set the videoDefaultWidth option to 0.

new FroalaEditor('.selector', {

  videoAllowedProviders: ['youtube', 'vimeo'],

  videoAllowedTypes: ['mp4'],

  videoMaxSize: 1024 * 1024 * 15,

  videoDefaultAlign: 'left',

  videoDefaultDisplay: 'inline',

  videoDefaultWidth: 0

});

8. What videoSplitHTML option do?

The videoSplitHTML is set to false by default. This causes the text before the video to be wrapped in <p> element, and the video along with the text after it to be wrapped in another <p> element when inserting a video within a text paragraph.

For instance, consider the paragraph in the editor:

The responsive video features enable you to insert videos from YouTube or Vimeo and have them change based on your device screen.</i

Inserting a video after “The responsive video features enable you to insert“ will generate the following HTML:

  <p>The responsive video features enable you to insert&nbsp;</p>

  <p><span contenteditable="false" draggable="true" class="fr-video fr-dvi fr-draggable"><video src="blob:https://fiddle.jshell.net/ab5319af-2522-4525-8ad7-4500191ec6b8" style="width: 600px;" controls="" class="fr-draggable ">Your browser does not support HTML5 video.</video></span>videos from Youtube or Vimeo and have them change based on your device screen.</p>

Alternatively, if you set the videoSplitHTML to true.

new FroalaEditor('div#froala-editor', {

        videoSplitHTML: true,        

 })

This will result in the text before the video, the video itself, and the text after the video being wrapped in separate <p> elements.

In the mentioned example, the HTML generated after inserting the video will be:

  <p>The responsive video features enable you to insert </p>

  <p><span contenteditable="false" draggable="true" class="fr-video fr-dvi fr-draggable"><video src="blob:https://fiddle.jshell.net/2a9277dd-415e-45b0-8a35-1b715b8f38fa" style="width: 600px;" controls="" class="fr-draggable ">Your browser does not support HTML5 video.</video></span></p>

  <p>videos from YouTube or Vimeo and have them change based on your device screen.</p>

By customizing the videoSplitHTML option in the Froala Editor, developers can control how the text and videos are structured within the editor. This feature allows for greater flexibility in the layout of content when inserting videos. This fine-grained control over the HTML structure enhances the customization capabilities of the Froala Editor.

9. How to disable video dragging?

You can prevent users from dragging videos around the editor by setting the videoMove option to false. This feature restricts the movement of videos within the content, ensuring they remain in their designated positions.

new FroalaEditor('.selector', {

  videoMove: false

});

10. Can I add, remove, or rearrange the buttons on the video edit popup?

Developers can customize the video edit popup to their preferences by adding, removing, or rearranging the buttons displayed using the videoEditButtons option. This option accepts an array and by default, it is set to ['videoReplace', 'videoRemove', '|', 'videoDisplay', 'videoAlign', 'videoSize', 'autoplay']

where:

  • videoReplace is a button for removing the selected video and replacing it with a new video.
  • videoRemove is a button for removing the selected video.
  • videoDisplay is a drop-down menu that allows you to change the video display between “block” or “inline” options.
  • videoAlign allows users to change the video alignment.
  • videoSize allows users to change the video width and height.
  • autoplay adds and removes the “autoplay“ attribute for the video HTML element.

By rearranging, adding, or removing buttons in the video edit popup, developers can enhance the functionality and usability of the Froala Editor for managing videos efficiently.

Conclusion

Developers have a wide range of options to customize the behavior and appearance of videos within the Froala Editor, from setting default widths to controlling drag-and-drop functionalities. By leveraging features like videoSplitHTML and videoEditButtons, developers can tailor the editor to suit their specific needs and enhance user interactions. These customization options empower developers to create a more engaging and polished user experience when working with videos in the Froala Editor.

Download Froala Editor

Building a Support System with Laravel PHP and Froala HTML Editor Sofware – part 3

Froala WYSIWYG Editor PHP SDK

In this article, we will continue building a rich-text support system using the Laravel PHP Framework and the Froala html editor software. If you haven’t read the previous articles in this series, we recommend doing so as we will be building upon them.

 

 

Part 1: Building a Support System Using Laravel PHP Framework and Froala Rich Text Editor

Part 2: Simplify Froala Image Management in Laravel using Froala PHP SDK

A Quick Recap

In the previous articles, we built a page containing a form for users to send their issues to the support team. We used Froala to allow users to send a rich-text message. Users can include images within their messages to help them describe their issues better. We used Froala PHP SDK to validate the images and store them on the server. Once the user is done with their messages and submits the form, the data is saved into the database using our html editor software.

Retrieving and Displaying User Messages for Site Administrators

In this article, we will learn how to retrieve user messages from the database and display them to the site administrators. This will allow the administrators to respond to the users’ issues. We will not cover the implementation of a login system for the administrators, as there are already many resources available for setting up authentication in Laravel. Instead, we will focus on creating a page that lists all the user tickets and another page that displays the details of a specific ticket for the administrators to respond to.

List User Requests

Let’s create a new resource controller to allow the support team to review and read the submitted requests.

php artisan make:controller AdminRequestController --resource

Add the route in web.php

Route::resources(['admin/requests' => App\Http\Controllers\AdminRequestController::class]);

Open the AdminRequestController.php and add the following line at the top to allow us to use the Request model within the controller.

use App\Models\Request as RequestModel;

Edit the index function to

    public function index()
    {
        //
        $requests = RequestModel::all();

        return view('requests.index', ['request'=>$request]);

    }

The above code fetches all the user messages from the database using the RequestModel::all() method. Then it passes the retrieved data to the requests.index view.

We need to create the requests.index view to display the user tickets on the page. Let’s create a new file called index.blade.php in the resources/views/requests directory. In this file, we can iterate over the $requests variable using a @foreach loop and display the necessary information for each ticket.

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Support App.</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">

        <!-- Styles -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>


    </head>
    <body>
        <div class="container">
            <div class="row justify-content-center">
                <h1 class="col-md-8 my-5 text-center">
                    All Requests
                </h1>

            </div>
            <div class="row justify-content-center">
                <table class="table">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">Subject</th>
                        <th scope="col">date</th>
                        <th scope="col">View</th>
                      </tr>
                    </thead>
                    <tbody>
                        @foreach ($requests as $i => $request)


                      <tr>
                        <th scope="row">{{$i}}</th>
                        <td>{{$request->subject}}</td>
                        <td>{{$request->created_at}}</td>
                        <td>
                            <a href="{{route('requests.show', $request->id )}}" type="button" class="btn btn-info">View</a>
                        </td>
                      </tr>
                      @endforeach

                    </tbody>
                  </table>
            </div>
        </div>
    </body>

Once we have the index.blade.php view set up, we can navigate to the /admin/requests route to see the list of user tickets.

Laravel support system

Request Details View

Next to each ticket, there is a button to view the ticket details. Clicking on it redirects the support team member to the /admin/requests/{ID} URL, where ID is the unique identifier of the ticket.

To handle the route for viewing a specific ticket, we need to update the AdminRequestController show function. This function will retrieve the ticket details from the database based on the ID and pass them to the requests.show view.

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {

        $request = RequestModel::findOrFail($id);

        return view('requests.show', ['request'=>$request]);
    }

Next, let’s create a new file called show.blade.php in the resources/views/requests directory. In this file, we can display the details of a specific ticket by accessing the properties of the $request variable. We can show the subject, description, date, and any other relevant information.

On this page, it is crucial to include the CSS stylesheet provided below in the page header to ensure the accurate display of the data that users entered using the Froala html editor software.

<link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_style.min.css' rel='stylesheet' type='text/css' />

The show.blade.php full code is:

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Support App.</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">

        <!-- Styles -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

        <!-- CSS file for showing Froala content outside the editor -->
        <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />


    </head>
    <body>
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-md-8 my-5 ">
                <h1>
                    {{$request->subject}}
                </h1>
                <p>{!!$request->request!!}</p>
                </div>
                <div class="card col-md-4 my-5 ">
                    <div class="card-header">
                        Requester Details
                    </div>
                    <ul class="list-group list-group-flush">
                        <li class="list-group-item">{{$request->name}}</li>
                        <li class="list-group-item">{{$request->email}}</li>
                        <li class="list-group-item">{{$request->created_at}}</li>
                    </ul>
                </div>


            </div>

        </div>
    </body>

The above code will display the subject of the ticket, the content of the request (which includes HTML code), and the details of the requester’s name and email. We use Bootstrap to style the card that contains the requester details.

Displaying Froala Editor content Outside The Editor

In addition to adding froala_style.min.css to the header, it is important to note that we use {!! !!} instead of {{ }} to display the request variable that contains Froala Content. This is because it contains HTML code, which should be rendered as is without any character escaping.

Laravel PHP support system ticket details

The support team can now view the ticket and requester details. They have the option to manually email the requester with a solution to their issue. We could improve this process by including a “Reply” button that opens a Froala editor. This editor would enable the support team to draft a message that is automatically sent back to the requester. If you would like me to address this topic in another article, please leave a comment.

Conclusion

In this article, we have learned how to configure the index view to showcase a list of user tickets. We have also explored handling the route for viewing a specific ticket and presenting its details in the show.blade.php file. Bootstrap was utilized for styling, along with including the necessary CSS files for displaying Froala content outside the editor. This ensures that user-entered content is displayed accurately.

As a next step, consider enhancing system security by implementing authentication features that limit access to authorized administrators. Laravel provides built-in authentication capabilities that can be seamlessly integrated into the support system, offering an additional layer of control and privacy.

Overall, this article emphasizes the simplicity and effectiveness of showcasing Froala content outside the editor within the Laravel PHP framework. With this knowledge, you can handle user tickets and provide exceptional support within your application.

Start using Froala in your Laravel application now. For any queries or assistance, do not hesitate to reach out to us. Happy coding!

Froala Image Management in Laravel: Easy for HTML Code Writers

Froala PHP SDK

If you’re using the Froala html code writer in your Laravel project to offer rich-text editing options for your users, they can use it to insert images in their content. These images are not saved to your PHP server by default, but you need to handle storing these images using the Froala events. Since uploading images to a PHP server could be a complex task for many developers, Froala offers a PHP SDK to simplify this process. The SDK provides a set of functions and methods that streamline the image management process, allowing you to upload, edit, and delete images with ease.

This article is the second part of the “Building a Support System Using Laravel PHP Framework and Froala html editor software“ series. We will use the Froala PHP SDK to enhance the support system we created by adding the functionality to store, validate, and remove images in the contact form. By doing this, we can display the uploaded images within the “Request Details” field to the admin at a later stage.

Get Started

To get started, you’ll need to install the Froala PHP SDK in your Laravel project. Include the SDK as a dependency in your composer.json file.

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.75",
        "laravel/sanctum": "^2.11",
        "laravel/tinker": "^2.5",
        "twbs/bootstrap": "5.3.2",
        "froala/wysiwyg-editor-php-sdk" : ""
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^5.10",
        "phpunit/phpunit": "^9.5.10"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Run the composer update command

composer update

This command will update the dependencies specified in the composer.json file and install the latest versions of the packages.

Before we dive in, make sure your server has the FileInFo extension enabled. You can do this by opening your server “php.ini“ file and removing the “;“ before “extension=fileinfo” if it exists.

The SDK also requires the Imagick extension to be enabled. To install the Imagick extension on XAMPP, you can follow these steps:

  1. Download the appropriate Imagick DLL file for your PHP version from the PECL website.
  1. Copy the downloaded php_imagick.dll file to the “ext” directory in your XAMPP installation.
  1. Copy other DLL files to the PHP root directory (where you have php.exe). Ex: For XAMPP users, `C:\xampp\php\` folder.
  2. Open the “php.ini” file in the “php” directory of your XAMPP installation.
  3. Add the following line to the “php.ini” file:

extension=php_imagick.dll

  1. Save the changes to the “php.ini” file and restart the Apache server in XAMPP.

Once you have completed these steps, the Imagick extension will be installed and ready to be used in your XAMPP environment. Now you can proceed to use the Froala html code writer PHP SDK in your Laravel application.

Upload images using the Froala PHP SDK

Before proceeding with the process of uploading images, it is necessary to configure certain Froala API options and events:

  • imageUploadParam is the name of the parameter that contains the image file information in the upload request. The default value is “file,” but you can change it to whatever name you want.
  • imageUploadURL is the URL where the upload request is being made.
  • imageUploadParams are additional parameters that are passed in the upload request to the server.
  • imageUploadMethod is the HTTP request type.
  • imageMaxSize is the maximum image size that can be uploaded.
  • imageAllowedTypes is an array with the image types allowed to be uploaded.
  • image.beforeUpload event is triggered before starting the upload request and it can be used to change the upload params or cancel the action.
  • image.uploaded event is triggered after a successful image upload request, but before inserting the image into the editor.
  • image.inserted event is triggered after inserting the image into the editor.
  • image.replaced event is triggered after replacing the image in the editor.
  • image.error event is triggered if any errors occur during the upload process.

Go ahead to the `welcome.blade.php` and edit the script to

       <script>
            // to protect your application from cross-site request forgery (CSRF) 
            let token = document.querySelector('[name="_token"]').value;

            new FroalaEditor("#request", {

                toolbarButtons: [
                    ['fontSize', 'bold', 'italic', 'underline', 'strikeThrough'],
                    [ 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify','textColor', 'backgroundColor'],
                    ['formatOLSimple', 'formatUL', 'insertLink','insertImage','insertFile'],
                ],

                //Set the request type
                imageUploadMethod:'POST',
                
                //Set the image upload URl.
                imageUploadURL:'/support-app/public/upload',

                //To avoid getting 419 bad request
                imageUploadParams: {
                    _token: token
                }
            });
        </script>

The code above configures the image upload method and URL so that when a user inserts an image in the editor, an HTTP request is automatically sent to the ‘/upload’ URL.

To prevent server errors and protect against CSRF attacks, we included the CSRF token generated by Laravel for each active user session in the request. This was done using the imageUploadParams option in Froala.

Next, we need to create a route and controller to handle the HTTP request for inserted images. Use the following command to generate the controller.

php artisan make:controller ImageHandlerController

create Laravel controller

Then, open our “web.php” and define a route for the URL assigned to the imageUploadURL option.

use App\Http\Controllers\ImageHandlerController;




Route::post('/upload', [ImageHandlerController::class, 'store']);

Open the newly created controller to add the store function. In this function, we will use the Froala PHP SDK upload method to store the uploaded images in the storage\app\public\uploads folder.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use FroalaEditor_Image;

class ImageHandlerController extends Controller
{
    /**
     * Store the uploaded image
     */
    public function store()
    {
        return FroalaEditor_Image::upload('/support-app/storage/app/public/uploads/');
    }
}

The upload method returns the URL of the uploaded image, which is then assigned to the src attribute of the inserted image by Froala.

Now, when a user inserts an image in the Froala html code writer, it will be automatically uploaded to the specified URL and stored in the designated folder.

After submitting the form, the database will store the permanent URLs of the inserted images within the “request details” content. These images can then be displayed on the admin dashboard for reviewing user requests.

Server-side image upload validation

Froala editor offers imageAllowedTypes and imageMaxSize options for client-side validation of image type and size. Additionally, the Froala PHP SDK upload method enables server-side validation of uploaded images. This provides an extra layer of security and ensures that only valid images are accepted.

The second parameter of the FroalaEditor_Image::upload accepts an array for validating the uploaded image.

To validate image uploads on the server side, make the following modifications to the store function in the ImageHandlerController

    public function store()
    {
        $options = array(
            'validation' => array(
            'allowedExts' => array('jpeg', 'jpg'),
            'allowedMimeTypes' => array('image/jpeg', 'image/pjpeg')
            )
        );
        return FroalaEditor_Image::upload('/support-app/storage/app/public/uploads/', $options);
    }

The code above sets Froala to accept only JPEG and JPG images. Uploading any other image type will trigger an error message.

Froala PHP SDK - server-side validation

By implementing image upload validation on the server side, we can ensure that only valid images are accepted and stored in the designated folder. This helps to maintain the integrity and security of the application.

Removing Images From the Server

Unlike uploading, Froala does not have a built-in option for making a server request to delete uploaded images. However, we can utilize the froalaEditor.image.removed event to send an AJAX request to the server when the user selects the “remove image” button. This event is triggered after the image has been removed from the editable area.

Open welcome.blade.php and add the following code to the Froala initialization code.

                events:{
                    'image.beforeRemove': function ($img){
                       
                        const url = '/support-app/public/image-delete',
                        params ={
                            src: $img[0].src
                        };

                        // Send Ajax call to delete the image
                        fetch(url,{
                            method: 'delete',
                            headers: {
                                'Content-Type': 'application/json',
                                'X-CSRF-TOKEN': token
                            },
                            body: JSON.stringify(params)
                        })
                        .then(response => {
                            const reposList = response.json();
                            console.log(reposList);
                        })
                        .catch(err => console.log(err))
                    }
                }

The code above sends a delete request to the “/image-delete” URL, including the image src attribute of the image that will be deleted.

Let’s define the “/image-delete” URL in the “web.php“ file.

Route::delete('/image-delete/', [ImageHandlerController::class, 'remove']);

This route action is controlled by the remove method in the ImageHandlerController. Open the `ImageHandlerController.php` to define this method.

    /**
     * Remove the uploaded image
     */
    public function remove(Request $request)
    {
        $search = request()->getScheme().'://'.$_SERVER['SERVER_NAME']; //
        $src= str_replace($search, '', $request->src);
        return FroalaEditor_Image::delete($src);
    }

The remove method utilizes the FroalaEditor_Image::delete method from the Froala PHP SDK to delete the image from the server.

Testing Image Upload and Removal Functionality

To test if everything is working properly, follow these steps:

  1. Upload an image to the editor.
  2. Navigate to the storage\app\public\uploads directory to view the uploaded image. The image should be there.
  3. Return to the editor and click on the image. Then, choose the “Remove Image” option from the “Edit Image” popup.
  4. Open the storage\app\public\uploads directory again. The image shouldn’t be there anymore.

froala php sdk and Laravel

Replace the uploaded image

The Froala “Edit Image“ popup allows users by default to replace the current image with a new one. This enhances the user experience by enabling them to quickly update the image without needing to remove the current uploaded image first. However, while Froala automatically replaces the image on the front-end, the functionality of removing the selected image from the server and storing the new one must be implemented separately. We can utilize the Froala PHP SDK to accomplish this task efficiently. Nonetheless, this article will not cover the implementation process. Instead, we will hide the “Replace Image” option, requiring users to remove the existing image before uploading a new one.

Edit the Froala initialization code at welcome.blade.php to

            // to protect your application from cross-site request forgery (CSRF)
            let token = document.querySelector('[name="_token"]').value;

            new FroalaEditor("#request", {

                toolbarButtons: [
                    ['fontSize', 'bold', 'italic', 'underline', 'strikeThrough'],
                    [ 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify','textColor', 'backgroundColor'],
                    ['formatOLSimple', 'formatUL', 'insertLink','insertImage','insertFile'],
                ],

                imageEditButtons: ['imageAlign', 'imageCaption', 'imageRemove', '|', 'imageLink', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageAlt', 'imageSize'],


                //imageMaxSize: 1024 * 1024 * 3,

                //Set the request type
                imageUploadMethod:'POST',

                //Set the image upload URl.
                imageUploadURL:'/support-app/public/upload',

                //To avoid getting 419 bad request
                imageUploadParams: {
                    _token: token
                },

                events:{
                    'image.beforeRemove': function ($img){

                        const url = '/support-app/public/image-delete',
                        params ={
                            src: $img[0].src
                        };

                        // Send Ajax call to delete the image
                        fetch(url,{
                            method: 'delete',
                            headers: {
                                'Content-Type': 'application/json',
                                'X-CSRF-TOKEN': token
                            },
                            body: JSON.stringify(params)
                        })
                        .then(response => {
                            const reposList = response.json();
                            console.log(reposList);
                        })
                        .catch(err => console.log(err))
                    }
                }


            });

In the above code, we customized the `imageEditButtons` API option by removing the ‘imageReplace’ from the array.

Conclusion

Integrating the Froala PHP SDK into your Laravel project provides a seamless solution for handling image management within the Froala JavaScript WYSIWYG editor. By leveraging the SDK’s functions and methods, developers can simplify the process of uploading, validating, and deleting images, offering a user-friendly experience for content creators.

Incorporating the Froala PHP SDK into your Laravel project not only simplifies image management but also enhances the support system you’ve built. By enabling users to upload and display images within the contact form, you can provide a more interactive and engaging experience for both users and administrators.

As you continue to build your Laravel project and leverage the power of the Froala PHP SDK, we hope that the insights and instructions provided in this article have proven helpful. Remember to stay updated with the latest SDK version and explore additional features and functionalities it offers. With Froala and Laravel at your disposal, you can create a truly dynamic and visually appealing content creation platform.

Build a Google Docs-like Online JavaScript Editor Using Froala Vue WYSIWYG Editor

Vue WYSIWYG editor

Google Docs has become a household name when it comes to online word processing. If you would like to build a similar application, there is a wide range of development languages and frameworks to use. One of the top options is Vue.js. With our Froala online javascript editor, you can have a similar one for your inhouse app.

Vue.js, a progressive JavaScript framework, has gained significant traction in the web development community due to its simplicity, flexibility, and excellent performance. Leveraging Vue.js allows developers to create powerful and interactive user interfaces, making it an ideal choice for building a Google Docs alternative.

While building a document editing application from scratch is a viable option, it can be a time-consuming and complex process. This is where third-party WYSIWYG (What You See Is What You Get) editors come into play. These editors provide a pre-built foundation for creating rich text editors, saving developers valuable time and effort. One such editor is the Froala Vue WYSIWYG editor, which offers a comprehensive set of features, customization options, and compatibility with Vue.js.

In this article, we will learn how to use the Froala Vue WYSIWYG editor to build a Google Docs alternative. We will explore its features, and demonstrate its suitability for implementing web document editing.

Vue web document editing

Understanding the Froala Vue WYSIWYG Editor

The Froala Vue WYSIWYG Editor stands out as a top choice when it comes to building a Google Docs alternative. Its extensive range of features and rapid development capabilities make it an ideal solution for creating rich text editors. Here are some of its features:

  • Rich Text Editing: The Froala Vue WYSIWYG editor provides a comprehensive set of tools and options for editing text. Users can easily format text, change fonts, styles, and colors, add links, insert images and videos, create tables, and more.
  • Vue.js Integration: Froala 4.1 provides a Vue component that can be easily integrated into Vue.js projects, making it simple to incorporate rich text editing capabilities into Vue.js applications.
  • Document-ready mode: The Froala Vue WYSIWYG editor has a document-ready mode that makes the editor interface resemble a word processor document by default.
  • Cross-browser and Cross-platform Compatibility: The editor is designed to work seamlessly across different browsers and platforms, ensuring a consistent editing experience for users regardless of their device or browser choice.
  • Responsive Design: The editor is built with a responsive design, which means it automatically adapts to different screen sizes and resolutions, providing an optimal editing experience on both desktop and mobile devices.
  • Accessibility: The editor is designed with accessibility in mind, ensuring that users with disabilities can easily navigate and use the editing interface. It includes features like keyboard navigation, support for screen readers, and adherence to accessibility standards.
  • Extensibility: The editor is highly extensible, allowing developers to customize and extend its functionality to meet specific requirements. It provides a plugin system that enables the addition of custom buttons, options, and features.
  • Modern and User-Friendly Interface: The editor features a modern and intuitive user interface, with a clean and clutter-free design. It offers a seamless editing experience, allowing users to focus on content creation without distractions.
  • Comprehensive Documentation and Support: Froala provides extensive documentation and support resources for developers using their editor. This includes detailed API documentation, guides on how to get started, examples, and more.

By leveraging the Froala Vue WYSIWYG editor, developers can quickly and easily build a Google Docs alternative that meets their specific needs. Whether it’s for collaborative document editing, online word processing, or any other application that requires rich text editing capabilities, the Froala Vue WYSIWYG editor provides a reliable and feature-rich solution.

In the next section, we will dive into the process of integrating the Froala Vue WYSIWYG editor into a Vue.js project.

Setting up the Development Environment

You’ll need to install the Froala Vue component to use the Froala Vue WYSIWYG editor in your Vue.js project. Here’s a step-by-step guide:

  1. Start by creating a new Vue.js project using the Vue CLI. Open your terminal and run the following command:
vue create my-project
  1. Next, navigate to the project directory:
cd my-project
  1. Install the Froala Vue WYSIWYG editor package and its dependencies using npm:
npm install vue-froala-wysiwyg

This command will install the required packages and add them to your project’s package.json file.

Configuration and Integration of Froala Vue WYSIWYG Editor with a Vue.js Project

Once the necessary dependencies are installed, you can configure and integrate the Froala Vue WYSIWYG editor with your Vue.js project.

  1. Open the main Vue component file (main.js) and import the Froala Vue WYSIWYG editor component:
import { createApp } from 'vue'
import App from './App.vue'

//Import Froala Editor plugins
import 'froala-editor/js/plugins.pkgd.min.js';


// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';


// Import Froala Editor component
import VueFroala from 'vue-froala-wysiwyg';
  1. Register the Froala Vue WYSIWYG editor component globally:
const app = createApp(App);          

app.use(VueFroala);
app.mount('#app');

This step allows you to use the Froala online javascript editor component anywhere in your Vue.js project.

  1. Finally, you can start using the Froala Vue WYSIWYG editor component in your Vue.js templates. For example, in the (App.vue) file:
<template>
    <froala
    id="edit"
    :tag="'textarea'"
  ></froala>

</template>
<script>
export default {
  name: "App",
  }}
</script>

By doing this, you have successfully set up the development environment and integrated the Froala Vue WYSIWYG editor into your Vue.js project.

  1. Run the below NPM command to run your Vue application on your local development server.
npm run serve

Now you can start using the editor’s features to create and edit HTML content at http://localhost:8080

Optimizing the Froala Vue WYSIWYG Editor for a Google Docs-Like Layout

To make your Froala Vue online javascript editor layout look like Google Docs and other online document editing applications, you need to enable the documentReady API option. Enabling this option will automatically set the optimal settings for creating online documents. The editor toolbar button will be customized to display the most frequently used buttons for these types of applications. The print and export as PDF buttons will be moved to a more visible location. The editable area will be expanded, and a margin will be added between it and the editor’s borders.

Open the App.vue file and edit your template to

<template>
    <froala
    id="edit"
    :tag="'textarea'"
    :config="config"
  ></froala>

</template>
<script>
export default {
  name: "App",
  data() {
    return {
      config: {
        documentReady: true
      }
    };
  },
  
  };
</script>

Conclusion

The Froala Vue WYSIWYG editor is a powerful tool for building a Google Docs alternative or any other application that requires rich text editing capabilities. It offers a seamless editing experience with its responsive design, accessibility features, and modern user-friendly interface.

To integrate the Froala Vue WYSIWYG editor into a Vue.js project, you need to set up the development environment by installing the necessary dependencies. Then, you can configure and integrate the editor by importing the component, registering it globally, and using it in your Vue.js templates.

To optimize the editor for a Google Docs-like layout, you can enable the `documentReady` API option, which sets optimal settings for creating online documents.

Learn more about Froala Vue WYSIWYG editor.

Using Froala as a Vue Visual HTML Editor for Markdown: A Guide

Froala WYSIWYG editor

If you want to provide text formatting options for your users, you have two popular choices: a visual html editor or a Markdown editor. Froala offers both options. Essentially, Froala is a visual html editor with the ability to convert to a Markdown editor. Since the Froala V4.1 release, it has supported Vue 3. This makes it a powerful Vue 3 WYSIWYG Markdown editor component. In this article, we will learn how to use Froala as a Markdown editor in your Vue app.

What’s a Markdown editor?

A Markdown editor is a text editor that allows users to write using Markdown syntax. Markdown is a lightweight markup language that uses plain text formatting to create structured documents. It is easy to read and write, making it a popular choice for content creation. Markdown editors provide a user-friendly interface for writing and editing Markdown content. With a Markdown editor, users can create well-formatted documents without needing to learn complex HTML or CSS. It is a great tool for users who want a simple and efficient way to create and format content.

What is the difference between WYSIWYG and Markdown editors?

A WYSIWYG editor, which stands for “What You See Is What You Get”, allows users to create and edit content in a visual manner. Users can see the final appearance of the content as they are editing it, including formatting, images, and other elements. It provides a more intuitive and familiar experience for users who are not familiar with coding or markup languages.

On the other hand, a Markdown editor requires users to write content using Markdown syntax. Markdown is a plain text formatting language that uses simple syntax to indicate formatting elements such as headings, lists, links, and more.

Is Froala a WYSIWYG editor or a Markdown editor?

Froala is primarily a WYSIWYG editor, but it also has a Markdown plugin that you can use to enable editing content using Markdown syntax. This allows users to have the flexibility to choose between the two editing modes based on their preferences and needs.

Does Froala Support Vue 3?

Froala V4.1 supports Vue 3 out of the box. This means you can easily integrate Froala visual html editor into your Vue 3 app and take advantage of its powerful features. With the Froala Vue component, you can create a WYSIWYG editor or a Markdown editor in your Vue app with just a few lines of code.

How do we integrate the Froala WYSIWYG editor with Vue 3?

Check out this guide on integrating the Froala WYSIWYG editor with Vue 3 for a detailed explanation. In summary, you will need to install the Froala Vue package using npm.

npm install -g @vue/cli

vue create my-froala-vue-app

cd my-froala-vue-app

npm install vue-froala-wysiwyg --save

Once installed, you can import the Froala Vue component in the “main.js” file.

import { createApp } from 'vue'
import App from './App.vue'

//Import Froala Editor plugins
import 'froala-editor/js/plugins.pkgd.min.js';


// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';


// Import Froala Editor component
import VueFroala from 'vue-froala-wysiwyg';

const app = createApp(App);          

app.use(VueFroala);
app.mount('#app');

Then add the component to your Vue template.

<template>
  <froala
    id="edit"
    :tag="'textarea'"
    :config="config"
  ></froala>

</template>
<script>
export default {
  name: "App",
  data() {
    return {
      config: {},
    };
  },
};
</script>

You can customize the editor’s toolbar, configure its options, and handle events such as content changes.

Froala also provides extensive documentation and examples to help you get started quickly.

Vue Markdown editor

How to use the Froala Vue WYSIWYG editor as a Vue Markdown editor?

By default, the Froala editor toolbar displays an option for switching between Markdown and the WYSIWYG editor. But in case you want to display the Markdown editor only, you will need to customize the editor as follows.

First, remove the editor toolbar by setting the “toolbarButtons“ API option to an empty array.

config: {
toolbarButtons: [""],
}

Then, on the initialized API event, toggle to the Markdown editor using the markdown.toggle() API method.

    config: {
        toolbarButtons: [""],
        events: {
          initialized: function () {
            // Do something here.
            // this is the editor instance.
            if (!this.markdown.isEnabled()) this.markdown.toggle();
          },
        },
      },

By doing this, you have integrated Froala into our app as a Vue Markdown editor.

Conclusion

Froala is a powerful Vue WYSIWYG editor. Using its Markdown plugin, you can allow users to create well-formatted content using Markdown syntax. Froala supports both WYSIWYG and Markdown editing modes, providing users with flexibility. Froala V4.1 supports Vue 3 out of the box, making it easy to integrate into your Vue app. You can install the Froala Vue package and import the Froala Vue WYSIWYG editor component to get started. The toolbar can be customized to display only the Markdown editor option. With Froala, you can create a user-friendly and efficient editing experience for your Vue app.

See a working example.

useState Hook: Manage Froala React WYSIWYG Editor State

React WYSIWYG Editor

React has evolved to make state management and side effects efficient and expressive. One significant addition to React is the hooks, which allow functional components to manage state and side effects traditionally associated with class components.

In this article, we will explain a basic introduction to React Hooks, with a focus on the “useState“.

Additionally,  Using the “useState” hook, we will show how the Froala React WYSIWYG editor can manage its state and dynamically display the editor changes.

React WYSIWYG editor

React Hooks Overview

Before the hooks, state and lifecycle methods were exclusive to class components.

Hooks were introduced in React to enable functional components to manage local state and other React features without the need for class components. They provide a concise way to handle stateful logic.

The useState is a fundamental hook used for adding state to functional components. It allows you to declare state variables in functional components, making them dynamic.

The basic syntax for “useState” is:

const [state, setState] = useState(initialState);

Here, state is the current state value, and setState is a function that allows you to update the state. The “initialState” is the initial value of the state variable.

Integrating Froala React WYSIWYG Editor

Now, let’s explore how to integrate the Froala with React and the “useState” hook.

The Froala React WYSIWYG editor is a powerful WYSIWYG editor that allows users to easily create rich content. First, install the necessary packages on your React project:

npm install react-froala-wysiwyg --save

Next, create a new React component and import the required dependencies on the “App.js” file:

import React, { useState } from 'react';

import FroalaEditorComponent from 'react-froala-wysiwyg';

import FroalaEditorView from 'react-froala-wysiwyg';

import 'froala-editor/css/froala_style.min.css';

import 'froala-editor/css/froala_editor.pkgd.min.css';

import 'froala-editor/js/plugins.pkgd.min.js';
  1. React and useState are imported from the ‘react’ library. useState is a React hook used for managing state in functional components.
  2. FroalaEditorComponent and FroalaEditorView are components provided by the ‘react-froala-wysiwyg’ package. They are used for integrating the Froala WYSIWYG editor into a React application.
  3. This code imports the styles and scripts for the Froala WYSIWYG editor. These include CSS files for styling and a packaged JavaScript file (plugins.pkgd.min.js) that contains bundled plugins for the editor.

Now, let’s use the “useState” hook to manage the editor’s content:

function App() {

  const [model,setModel] = useState("Example Set");

  const handleModelChange= (event)=>{

    setModel(event)

  }

  return (

    <div className="App">

      <FroalaEditorComponent 

        tag='textarea'

        onModelChange={handleModelChange}

      />

      <FroalaEditorView

        model={model}

    />

    </div>

  );

}

export default App;
  1. The component uses the useState hook to define a state variable named model with an initial value of “Example Set”. This state will hold the content of the Froala editor.
  2. The handleModelChange function is a callback function that will be called when the content of the Froala editor changes.
  3. Inside the function, it updates the model state using setModel(event), effectively updating the content of the editor.
  4. The return statement renders JSX for the component.
  5. The component is wrapped in a div with the class name “App”.
  6. FroalaEditorComponent is rendered with a textarea as the underlying HTML tag. The onModelChange prop is set to the handleModelChange callback function.
  7. FroalaEditorView is rendered with the model prop set to the model state. This component is used to display the content of the Froala editor.
  8. The App component is exported as the default export of the module, making it available for use in other parts of the application.

Maneging Froala React WYSIWYG editor using useState hook

In this example, we’ve created a React component named App. It uses the “FroalaEditorComponent” for editing and the “FroalaEditorView” for displaying the content.

The model state variable is used to manage the content of the editor.

When the content changes, the “handleModelChange” function is called. It updates the model state and triggers a re-render with the new content.

This integration demonstrates how the “useState” hook can manage the state of the Froala. It’s used in a React functional component.

Conclusion

React hooks have upgraded how developers manage state in functional components. The “useState” hook, in particular, is a key part of this upgrade.

Using hooks provides a more concise and readable syntax. It also makes it easier to work with stateful logic in functional components.

Integrating Froala with React enhances the development experience. It allows for seamless content creation and management within your applications. You can manage the editor’s state using the “useState” hook. It enables dynamic creation.

As you explore React hooks and their integration with libraries like Froala React WYSIWYG editor, you’ll find that the combination of these lets you easily build feature-rich web applications.

Building a Support System Using Laravel PHP Framework and Froala HTML Editor Software – Part 1

Laravel support system

Laravel, a popular PHP framework, provides a robust and efficient platform for building web applications. It offers various features and tools to make development easier and faster.

We will use Laravel and the Froala Rich-text editor to create a comprehensive support system for your web application. In this series of tutorials, we will cover how to set up the Laravel project, integrate the Froala editor, save data to a MySQL database, manage support tickets, and more. Let’s dive in and start building!

What should you expect to learn from this tutorial?

This series of articles will include:

In this article, we will create a page with a form that lets users submit requests to the support team. We will integrate the Froala editor to support rich text requests. Finally, we will store the submitted data in the MYSQL database.

The second article will explain how to configure the Froala Editor to upload images and files and how to store them on our PHP server. We may cover this topic over multiple articles.

In the last article, we will create a page for the support team to view all submitted requests. They can access these requests from that page and modify, update, or delete them.

Prerequisites

In this tutorial, I will use XAMPP as my local PHP development environment. XAMPP includes Apache, MySQL, and PHP, which allows you to set up a local server on localhost to test PHP web applications. You can also use alternatives such as WAMP or LAMP, as long as you install and configure them properly.

Also, make sure you install Composer, a dependency manager for PHP, on your computer.

Create a new Laravel project.

After installing PHP and Composer, open your XAMPP server “htdocs”, and create a new Laravel project in your terminal using the command:

composer create-project laravel/laravel support-app

This command downloads the Laravel framework and creates a new project for you.

Once you create the project, navigate to the project directory using the cd command:

cd support-app

Configure the Project Database

Use your preferred IDE, such as Visual Studio Code, to open the project folder. Open the .env file at the root of your application. Update the database configuration values.

DB_CONNECTION=mysql 

DB_HOST=127.0.0.1 

DB_PORT=3306 

DB_DATABASE=laravel 

DB_USERNAME=root 

DB_PASSWORD=

Setup the Database Tables

Run this command in your terminal to create a migration file for the table that will store the support requests:

php artisan make:migration create_requests_table

This above command creates a new migration file in the database/migrations directory. Open the file and define the requests table schema inside the up function.

/**

* Run the migrations.

*

* @return void

*/

public function up()

{

   Schema::create('requests', function (Blueprint $table) {

     $table->id();

     $table->string('name');

     $table->string('email');

     $table->string('subject');

     $table->text('request');

     $table->timestamps();

  });

}

This will create a table with the following columns:

  • id (auto-incrementing integer)
  • name (string) to store the username
  • email (string) to store the user’s email
  • subject (string) – the subject of the request
  • request (text) – the request details
  • created_at (timestamp)
  • updated_at (timestamp)

Once you have defined the schema, ensure your MySQL server runs and contains a database with the name you specified in the .env file.

Run the following command in your terminal to migrate the database and create the table:

php artisan migrate

This command will execute the migration and create the “requests” table in your database.

The request DB table structure

Create a Support Table Model

Create an Eloquent model to interact with the “requests” table by running the command

php artisan make:model Request -crR

The -crR code instructs Laravel to generate model, controller, and request files for the “request” table.

Create the Request Page

We will add a request page to the homepage. Navigate to resources/views/welcome.blade.php, and replace the existing code with the form code. We will use a Bootstrap form to save time.

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Support App.</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">

        <!-- Styles -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
    </head>
    <body>
        <div class="container">
            <div class="row justify-content-center">
                <h1 class="col-md-8 my-5 text-center">
                    Welcome To Our Support App
                </h1>
            </div>
            <div class="row justify-content-center">
                <div class="col-md-8">
                    <div class="card">
                        <div class="card-header">Submit a Support Request</div>

                        <div class="card-body">
                            <form method="POST" > 
                                @csrf
                                <div class="mb-3">
                                    <label for="name" class="form-label">Full Name</label>
                                    <input type="text" class="form-control" id="name">
                                </div>
                                <div class="mb-3">
                                    <label for="exampleInputEmail1" class="form-label">Email address</label>
                                    <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
                                    <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
                                </div>
                                <div class="mb-3">
                                    <label for="subject" class="form-label">Subject</label>
                                    <input type="text" class="form-control" id="subject">
                                </div>

                                <div class="mb-3">
                                    <label for="request" class="form-label">Request Details</label>
                                    <textarea class="form-control" id="request" rows="5"></textarea>
                                </div>

                                <button type="submit" class="btn btn-primary">Submit</button>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>

The above code creates a basic HTML form for submitting a support request, including input fields for the user’s name, email, subject, and request details.

Open “http://localhost/support-app/public/“ on your browser to see the page in action.

laravel request form

Integrate the Froala WYSIWYG Editor into your Laravel application

Integrate the Froala WYSIWYG Editor into our Laravel application to transform the “More Details“ field into one that accepts rich-text editing, which lets users format their requests with advanced styling and formatting options. In the welcome.blade.php file, perform the following steps

  • Add the Froala stylesheet and scripts to the page.
<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>
  • Initialize the editor by using the constructor function FroalaEditor and pass the ID value of the requested field as the first parameter.
<script>
   new FroalaEditor("#request");
</script>
  • Reload your page to display the Froala rich text editor instead of the request field.

froala integrated in Laravel app.

Customize the Froala Editor

The Froala editor’s API provides powerful customization options. Refer to the documentation to discover options, events, and methods that will help you adapt the editor to your needs. In this tutorial, we will use the toolbarButtons API option to customize the editor’s toolbar buttons.

<script>
   new FroalaEditor("#request", {

       toolbarButtons: [
            ['fontSize', 'bold', 'italic', 'underline', 'strikeThrough'],
            [ 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify','textColor', 'backgroundColor'],
            ['formatOLSimple', 'formatUL', 'insertLink','insertImage','insertFile'],
       ]

    });
</script>

Handle the Form Submission

Create a route for the RequestController in routes/web.php to manage form submissions. Since the RequestController is a resource controller, add the following route definition.

Route::resources(['requests' => App\Http\Controllers\RequestController::class]);

We will use the store method in the RequestController to process the form submission. In the welcome.blade.php file, add the action attribute to the form tag, like:

<form method="POST" action="{{ route('requests.store') }}" >

In the store method, add the following code to save the submitted data to the database:

    /**
     * Store a newly created resource in storage.
     *
     * @param  \App\Http\Requests\StorerequestRequest  $request
     * @return \Illuminate\Http\Response
     */
    public function store(StorerequestRequest $request)
    {
        // Retrieve form data and save it to the database

        $model = new Request;

        $model->name = $request->input('name');
        $model->email = $request->input('email');
        $model->subject = $request->input('subject');
        $model->request = $request->input('request');

        $model->save();

        // Redirect back to the form page with a success message
        return redirect()->back()->with('success', 'Your support request has been submitted successfully.');

    }

Make sure the authorize method in the StorerequestRequest.php file returns true to allow visitors to submit the form.

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StorerequestRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {

    }
}

Now, upon form submission, data will be saved in the database, including content from the Froala editor. Then, it redirects the user back to the form page and displays a success message.

Form Validation

To avoid errors when saving the form data to the database, we need to add validation rules. Update the rules method in the StorerequestRequest class found in the App\Http\Requests namespace.

    public function rules()
    {
        return [
            'name' => 'required',
            'email' => 'required|email',
            'subject' => 'required|max:255',
            'request' => 'required',
        ];
    }

In this example, we added validation rules for the “name”, “email”, “subject”, and “request” fields. The “name” field is mandatory, the “email” must be valid, and both the “subject” and “request” fields must be filled. The “subject” field must not exceed 255 characters.

When an invalid input is submitted via the form, the Laravel blade @error and old methods can be used to identify and display an error message as well as repopulate the form fields with previously entered values. This prevents the user from having to re-enter values incorrectly in the fields without having an error.

Update the code in the welcome.blade.php file like the following

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Support App.</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">

        <!-- Styles -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

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

    </head>
    <body>
        <div class="container">
            <div class="row justify-content-center">
                <h1 class="col-md-8 my-5 text-center">
                    Welcome To Our Support App
                </h1>
            </div>
            <div class="row justify-content-center">
                <div class="col-md-8">
                    <div class="card">
                        <div class="card-header">Submit a Support Request</div>

                        <div class="card-body">
                            <form method="POST" action="{{ route('requests.store') }}" >
                                @csrf
                                <div class="mb-3">
                                    <label for="name" class="form-label">Full Name</label>
                                    <input type="text" class="form-control @error('name') is-invalid @enderror" id="name" name="name" value="{{(old('name') ? old('name')  : '')}} ">
                                    @error('name')
                                    <span class="invalid-feedback">
                                            <strong>{{ $errors->first('name') }}</strong>
                                        </span>
                                     @enderror
                                </div>
                                <div class="mb-3">
                                    <label for="email" class="form-label">Email address</label>
                                    <input type="email" class="form-control @error('email') is-invalid @enderror" name="email" id="email" value="{{(old('email') ? old('email')  : '')}} " aria-describedby="emailHelp">
                                    <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
                                    @error('email')
                                    <span class="invalid-feedback">
                                            <strong>{{ $errors->first('email') }}</strong>
                                        </span>
                                     @enderror
                                </div>
                                <div class="mb-3">
                                    <label for="subject" class="form-label">Subject</label>
                                    <input type="text" class="form-control @error('subject') is-invalid @enderror" id="subject" name="subject" value="{{(old('subject') ? old('subject')  : '')}} " >
                                    @error('subject')
                                    <span class="invalid-feedback">
                                            <strong>{{ $errors->first('subject') }}</strong>
                                        </span>
                                     @enderror
                                </div>

                                <div class="mb-3">
                                    <label for="request" class="form-label">Request Details</label>
                                    <textarea class="form-control @error('request') is-invalid @enderror"
                                    id="request" name="request" rows="5">{{(old('request') ? old('request')  : '')}}</textarea>

                                    @error('request')
                                    <span class="invalid-feedback">
                                            <strong>{{ $errors->first('request') }}</strong>
                                        </span>
                                    @enderror
                                </div>

                                <button type="submit" class="btn btn-primary">Submit</button>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>

        <script>
            new FroalaEditor("#request", {

                toolbarButtons: [
                    ['fontSize', 'bold', 'italic', 'underline', 'strikeThrough'],
                    [ 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify','textColor', 'backgroundColor'],
                    ['formatOLSimple', 'formatUL', 'insertLink','insertImage','insertFile'],
                ]

            });
        </script>
    </body>
</html>

Once you submit the form, the data will be validated using the specified rules. If validation fails, the user will be returned to the form page with error messages displayed, and the form inputs will be repopulated with the previously entered values.

Form with validation

 

Conclusion

In this tutorial, we explored the powerful combination of Laravel and the Froala Rich-text editor to create a comprehensive support system for web applications. By following this series, you learned how to set up the Laravel project, set up your MySQL database, and integrate the Froala editor. We also implemented form submission handling and form validation.

Utilizing Laravel’s robust features and the flexibility of the Froala editor enhances the user experience, empowers your support team, and streamlines the process of handling support requests.

Stay tuned for the next part of this series where you will learn how to save images uploaded with the Froala Editor and store them on a PHP server. We will use the Froala PHP SDK for a smooth experience.

If you have any questions or need further assistance, leave a comment below. Happy coding!

Froala 4.1.4 Release: XSS Vulnerability, Enhancements

Froala 4.1.4 release

We are excited to share Froala version 4.1.4, addressing security vulnerabilities, improving stability, boosting performance, and delivering an enhanced user experience. Update now and enjoy a better Froala. Our commitment to the safety and satisfaction of all users remains our top priority.

Key Highlights

This release comes with several improvements and enhancements. Let’s take a look at the key highlights:

  • Resolving XSS vulnerabilities
  • Froala’s Sticky Toolbar is Now Working as Expected
  • Enter a Custom Text Color and Background Colors are Now Fixed
  • and More.

Froala 4.1.4 release

Let’s dig deep into the most significant changes in this release.

Resolving XSS vulnerabilities

There were three cross-site scripting (XSS) vulnerabilities reported by the CVE program. These vulnerabilities are:

  • CVE-2023-41592: A Cross-site scripting (XSS) vulnerability in Froala Editor v.4.1.1 allows attackers to manipulate the preview text when inserting a link in the document, allowing the insertion of XSS codes.
  • CVE-2023-43263: A Cross-site scripting (XSS) vulnerability in Froala Editor v.4.1.1 allows attackers to execute arbitrary code via the Markdown component.
  • CVE-2023-42426: A Cross-site scripting (XSS) vulnerability in Froala Froala Editor v.4.1.1 allows remote attackers to execute arbitrary code via the ‘Insert link’ parameter in the ‘Insert Image’ component.

The technical team modified the editor code to prevent hackers from using these vulnerabilities to attack the editor users and ensure the security of the Froala Editor. Examples of such attacks are

  • The attacker can alter the content of the page viewed by the user.
  • An attacker could lead you to a fraudulent website.
  • Attackers can obtain information through malicious input and fake forms.
  • Others.

Update to Froala 4.1.4 today and ensure a secure environment for your content to thrive. making sure your content stays safe and your users are protected

Froala’s Sticky Toolbar is Now Working as Expected

Unfortunately, some users have encountered problems using Froala’s Sticky toolbar since version 4.0.18. By setting the toolbarSticky  API option to true, users expected the toolbar to stick to the editor when scrolling. However, this feature was not functioning as expected in previous versions. We are happy to announce that in Froala 4.1.4, we have fixed this issue. Now, when the `toolbarSticky` option is enabled, the toolbar will remain visible while scrolling down the page. This feature enhances the user experience and makes it easier for users to access the toolbar while working with the editor. Update to Froala 4.1.4 now and enjoy this fixed feature.

Here is an example of a Froala with a Sticky Toolbar.

Enter a Custom Text Color and Background Colors are Now Fixed

When selecting text in Froala Editor to apply a text or background color, a color picker appears with user-defined colors and input to enter a custom Hex code. However, in older versions, when a user enters a color Hex code into the Froala input, the text selection is removed resulting in the color not being applied after clicking the “submit” button.

Froala color picker

This issue has been fixed in Froala 4.1.4. This fix ensures that users can easily customize the appearance of their content.

And More

By upgrading to the 4.1.4 release, you will also enjoy the following fixes:

  1. Fix the cursor jumping during editing within a table.
  2. Fix scrolling issues in specific scenarios, such as
    • A scrolling issue when pressing Enter while the ENTER_BR option is enabled.
    • A scrolling issue when pasting large content containing images while the editor height is set to a fixed value.

All these improvements and more come together to make an already powerful WYSIWYG editor even better. Please find the complete changelog list here.

It’s time to update!

Don’t miss out on the benefits of the latest Froala 4.1.4 release. Update today and experience a safer, more efficient, and smoother content editing platform.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to learn how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.1.4/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.1.4/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Technical Questions

Froala Blog Call To Action

Mastering Froala Paragraph Styles in an Html Code Writer

Froala Paragraph Styles

Paragraph Styles in a text editor are defined sets of formatting rules that can be applied to paragraphs of text in a document. These styles allow users to format their content by defining how text should appear. The options are font, size, color, spacing, and all typographic elements.

Paragraph Styles are used to keep the formatting consistent in a document for a unified look. Instead of changing each paragraph’s settings, users can use a Paragraph Style to get a pre-set format.

Paragraph Styles mean consistency, efficiency, and customization. They can update the whole document when formatting requirements change.

Modern text editors, including WYSIWYG (What You See Is What You Get) editors and HTML code writers like Froala, provide interfaces for managing Paragraph Styles. Users can access these styles through a dropdown menu or toolbar, making the process friendly.

Froala’s WYSIWYG editor and HTML code writer provides a customizable solution for handling text content. We will explain how to use Froala Paragraph Styles in a React project. This plugin allows you to take the text editing capabilities to the next level with our react rich text editor.

Froala WYSIWYG editor provides a customizable solution for handling text content. We will explain how to use Froala Paragraph Styles in a React project. This plugin allows you to take the text editing capabilities to the next level with our react rich text editor.

Understanding Froala

Froala is a feature-rich and easy-to-use text editor that provides various tools for formatting text, handling images, and managing other multimedia elements. It is highly customizable and can be integrated seamlessly into various web applications. One of the standout features of Froala is its support for Paragraph Styles.

Setting Up Your React Project

To get started, make sure you have Node.js and npm installed on your machine.

Create a new project using the Create React App, or use your existing project if you have one. Open your project in your preferred code editor.

npx create-react-app froala-styles-demo

cd froala-styles-demo

npm start

Installing Froala WYSIWYG Editor

Next, you’ll need to install Froala WYSIWYG Editor. You can do this by running the following command in your project directory:

npm install react-froala-wysiwyg --save

This package provides a React wrapper for the Froala editor, making it easy to integrate into your React application.

Creating a new Froala component on the project

Now, let’s create a simple React component that includes the Froala editor. Use the file App.js.

import './App.css';

import FroalaEditorComponent from "react-froala-wysiwyg";

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import "froala-editor/js/plugins.pkgd.min.js";




function App() {




  let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

  

  return (

    <div id="froala-editor">

      <h1>Froala</h1>

      <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

        }}

      />

    </div>

  )

}

export default App;

Let’s break down the provided React code for the Froala Editor component:

  • import ‘./App.css’; This line imports the CSS styles from the “App.css” file. 
  • import FroalaEditorComponent from “react-froala-wysiwyg”;This line imports the FroalaEditorComponent from the “react-froala-wysiwyg” package.
  • import “froala-editor/css/froala_style.min.css”;

import “froala-editor/css/froala_editor.pkgd.min.css”;

import “froala-editor/js/plugins.pkgd.min.js”;

These lines import plugins for the Froala Editor. The first two lines import CSS styles, and the third line imports the packaged JavaScript plugins for the editor.

  • function App() { – Defines a functional React component named App.
  • let model = ‘<p><a href=”https://froala.com”>Froala WYSIWYG Editor</a></p>’; – Declares a variable named model and assigns it a string containing HTML code.
  •  return (

     <div id=”froala-editor”>

Begins the component’s JSX markup, returning a div element with the id “froala-editor”.

  • <h1>Froala</h1> – Includes an h1 element with the text “Froala”.
  • <FroalaEditorComponent

         tag=”textarea”

         model={model}

         config={{

         }}

       />

Includes the FroalaEditorComponent, configuring it with the tag (“textarea”), initial model content, and an empty configuration object. This is where the Froala Editor will be rendered.

</div> ) } – Closes the JSX markup for the component.

export default App; – Exports the App component as the default export of this module.

 

The standard Froala Editor component has some Paragraph Styles already formatted as gray, bordered, spaced, and uppercase.

  • Gray Style: This style involves setting the text color to gray.
  • Bordered Style: A bordered style allows adding a border around an element.
  • Spaced Style: Adding spacing between elements makes setting margins or padding.
  • Uppercase Style: To make text uppercase, you can use the text-transform property.

Froala Paragraph Styles

Styling Paragraphs with Froala

Now that we have the basic editor set up, let’s explore how to customize Paragraph Styles.

You can customize the appearance of each paragraph style by modifying the Froala configuration. On the config use this code:

      config={{

          paragraphStyles: {

            class1: 'Class 1',

            class2: 'Class 2'

          },

        }}

On the file App.css, use this code:

.class1 {

  text-align: center;

  font-weight: bold;

}

.class2 {

  font-weight: 300;

  font-size: 30px;

}

This code is a set of CSS rules that define styles for HTML elements with specific class names.

  • text-align: center; – This rule centers the text within the element horizontally.
  • font-weight: bold; – This rule makes the text bold.
  • font-weight: 300; – This rule sets the font weight to 300, which is relatively light or normal weight.
  • font-size: 30px; – This rule sets the font size to 30 pixels.

custom Froala Paragraph Styles

Conclusion

In this article, we’ve covered the integration of Froala WYSIWYG Editor into a React project and explored how to implement and customize Paragraph Styles.

With the ability to define custom styles and easily apply them, Froala provides a powerful solution for creating rich text editors in your web applications.

Explore Froala’s extensive documentation for more advanced features and customization options.

The key to mastering Paragraph Styles is experimentation. Play around with the configurations, try different styles, and see how they impact your editor.

Image Management in Express Framework: Froala Node.JS SDK

Froala Node.js SDK

Express framework is a popular web application framework for Node.JS. It provides a simple and minimalistic approach to building web applications. Froala is an advanced WYSIWYG editor for effortless content creation and editing. We discussed the integration between Froala and Express framework before. However, uploading images and files into the Node server needs additional configuration. The Froala Node.js SDK simplifies uploading images and files to Froala in an Express application. With this SDK, you can easily handle image uploads, validate them, store them, and delete them on your server. This makes it incredibly convenient to integrate Froala into your Express application and provide a seamless image-uploading experience for your users.

Throughout this tutorial, we will cover the steps to set up the uploading image process in your Express application using the Froala Node.JS SDK. We will continue from where we left off in the integration article. We recommended reading the integration guide first.

Install Froala Node.JS SDK

You can install the Froala Node.JS SDK by running the following command in your terminal:

npm install wysiwyg-editor-node-sdk

Import the SDK into your Express application after installing it by adding this line of code in the app.js file.

var FroalaEditor = require(__dirname+'/node_modules/wysiwyg-editor-node-sdk/lib/froalaEditor.js');

Configure the Froala Editor

We will need to configure the Froala initialization function to assign the image upload options and events. There are six API options and five events related to this feature.

  • imageUploadParam: is the name of the parameter that contains the image file information in the upload request. The default value is “file” but you can change it to whatever name you want.
  • imageUploadURL: is the URL where the upload request is being made.
  • imageUploadParams: are additional parameters that are passed in the upload request to the server.
  • imageUploadMethod: is the HTTP request type. It is ‘POST’ by default.
  • imageMaxSize: sets the upper limit for image size during uploading.
  • image.beforeUpload: Froala triggers this event before starting the upload request and it can be used to change the upload params or cancel the action.
  • image.uploaded: Froala triggers this event after a successful image upload request, but before inserting the image into the editor.
  • image.inserted: Froala triggers this event after inserting the image into the editor.
  • image.replaced: Froala triggers this event after replacing the image in the editor.
  • image.error: Froala triggers this event if any errors occur during the upload process.

In the “editor.ejs” file, change the initialization method to

var editor = new FroalaEditor("#example", {

imageUploadURL: '/upload_image'

});

The above code will configure the Froala Editor to upload images to the ‘/upload_image’ URL.

Handle the Image Upload Request

We need to define the ‘/upload_image’ route in our Express application to handle the image upload request. It will receive the image file and save it on the server using the FroalaEditor.Image.upload method.

Add the following code to your app.js file:

app.post('/upload_image', function (req, res) {
    // Store image.

    FroalaEditor.Image.upload(req, '/uploads/', function(err, data) {

    // Return data.

    if (err) {

         return res.send(JSON.stringify(err));

     }

     res.send(data);

   });

});

The above code will create a POST route in your Express application at ‘/upload_image’. When this route receives a request, it will use the FroalaEditor.Image.upload method to store the uploaded image in the ‘/uploads/’ directory on the server. If there are any errors during the upload process, it will return the error as a JSON string. Otherwise, it will send the data object containing information about the uploaded image as the response.

Create an “uploads” folder in the root of our Express app to store uploaded images.

Also, add the below code to the “app.js” file to give the server access to the static files in the root directory. This will allow images and files in ‘/uploads/’ to be accessed.

app.use(express.static(__dirname + '/'));

Now, when you upload an image with the Froala Editor, it will be saved in the ‘/uploads/’ directory and accessible through the ‘/uploads/’ URL.

The full app.js code is

var express = require('express');

var FroalaEditor = require(__dirname+'/node_modules/wysiwyg-editor-node-sdk/lib/froalaEditor.js');

var app = express();

// Set EJS as the view engine

app.set('view engine','ejs');

//Froala editor CSS & JS files

app.use('/froalacss',express.static(__dirname+'/node_modules/froala-editor/css/froala_editor.pkgd.min.css'));

app.use('/froalajs',express.static(__dirname+'/node_modules/froala-editor/js/froala_editor.pkgd.min.js'));

//So images can be displayed after stored

app.use(express.static(__dirname + '/'));

// Define routes

app.get('/',(req,res)=>{

  res.render('editor');

});


// Path to upload image.

app.post('/upload_image', function (req, res) {

     // Store image.

     FroalaEditor.Image.upload(req, '/uploads/', function(err, data) {

    // Return data.

    if (err) {

    return res.send(JSON.stringify(err));

    }

    res.send(data);

   });

});

var port = process.env.PORT || 3000;

app.listen(port,()=>console.log('server run at port '+port));

Test the Image Upload Functionality

Now that we have configured the Froala Editor and created a route to handle the image upload request, we can test the functionality. Start your Express application by running the following command:

node app.js

Once your application is running, open http://localhost:3000/ and start working with the editor. Upload an image using the editor and see if it gets stored in the “uploads” directory. You should be able to successfully upload and store images using the Froala Editor in your Express application.

Upload image using Froala Node.js SDK

Image Validation

To further enhance the image upload functionality, you can add validation to ensure that only specific image types and sizes are allowed. Froala Node.JS SDK simplifies the image validation process.

Using the SDK, you can pass an object with the validation roles at the third parameter of the FroalaEditor.Image.upload method. The supported validation rules are:

  • allowedExts: Contains the allowed image extensions
  • allowedMimeTypes: Contains the allowed mime types

In the following code, we altered the “/upload_image“ route handler to allow only JPEG and JPG image types to be uploaded through Froala editor

// Path to upload image.

app.post('/upload_image', function (req, res) {

var options = {

  validation: {

   'allowedExts': [ 'jpeg', 'jpg'],

   'allowedMimeTypes': [ 'image/jpeg', 'image/pjpeg']

  }

}

// Store image.

FroalaEditor.Image.upload(req, '/uploads/', options, function(err, data) {

   // Return data.

   if (err) {

     return res.send(JSON.stringify(err));

   }

   res.send(data);

  });

});

However, if you want to perform other validation, it is possible too. You can pass a custom method instead of the validation object with filePath, mimetype, and callback parameters. This gives you full control over what types of images you want to store on disk. Learn how the custom validation works.

Deleting Images with Froala Node.JS SDK

The Froala Node.JS SDK also simplifies deleting images on the editor from the server. When You click on an image in the editor, a pop-up appears. On that pop-up, there is a delete image button. When a user clicks on that button, the editor triggers two events:  froalaEditor.image.beforeRemove and froalaEditor.image.removed. You can use either option to delete the image from the server, but it’s recommended to use the second one to ensure that the image is removed from the editable area.

In the froalaEditor.image.removed event, we will send a request to the server to delete the image. In the “app.js” you will need to define a route to handle the delete request. This handler will use the FroalaEditor.Image.delete() method from the Node.JS SDK to remove the image from the server.

Unlocking the other capabilities of the Froala Node.JS SDK

The Froala Node.JS SDK will help you also store images on the Amazon S3 bucket, display the uploaded images on Froala Image Manager, and handle other files on your Node.JS server.

Streamlining the editor Image handling in Express with Froala Node.JS SDK

With these configurations and code in place, you have successfully simplified uploading images to Froala Editor in an Express framework application using the Froala Node.js SDK. The Froala Node.JS SDK provides a convenient way to handle image uploads, validate them, and store them on your server. This integration allows you to provide a seamless image-uploading experience for your users. You can now continue building your Express application with the enhanced functionality of Froala Editor.

Angular CMS Development: Integrate Froala WYSIWYG Editor

Angular CMS

With a Content Management System (CMS), you can easily create, modify, manage, and publish content in a user-friendly way. Starting with HTML to add text, forms, images, navigation bars, and other essential website components is straightforward. That’s why having a secure, intelligent, fast, and robust HTML code writer is crucial.

Froala, the next-generation WYSIWYG HTML code writer, has become a go-to solution for users, enabling them to shape content without diving into intricate code. This editor seamlessly integrates with any framework like React, Vue, Angular, etc., providing rich text editing capabilities for your CMS.

This article will explore how you can use the WYSIWYG HTML code writer to build a feature-rich CMS using Angular and integrate Froala’s HTML code writer for a modern design and more customizable experience.

What is a Content Management System (CMS)?

A CMS is software that helps you create, organize, and modify website content, such as text, images, and videos, without having any technical knowledge. Moreover, it provides tools for user management and collaborative workflows and offers features for version controls and scheduling content publication. Some Popular CMS systems include WordPress, Joomla, Drupal, etc.

HTML Code Writer For Seamless CMS Development

The role of a WYSIWYG HTML editor in CMS development is paramount. WYSIWYG, or What You See Is What You Get, editors are instrumental in simplifying content creation within a CMS. An intuitive WYSIWYG HTML editor is a crucial component of a CMS that allows seamless content creation, enhances user experience, and enables efficient content management without requiring coding skills.

The following section will explore building a CMS using Froala, a WYSIWYG HTML editor. We are choosing Froala for CMS development because its developer-friendly feature makes it easy to integrate with multiple frameworks, including angular, and allows developers to create and modify content with more control.

How to Build a CMS with Froala using Angular?

Make your CMS development easier, flexible, robust, and faster by integrating Froala with Angular. This powerful combination offers a sophisticated platform for building a feature-rich Content Management System, blending Froala’s intuitive design with the robust capabilities of Angular for a seamless development experience with our angular rich text editor.

Prerequisites

Before starting, you will need

  • Node.js and npm: Visit Node.js site to get the latest version of Node.js. Note that npm comes as a part of the package with node.js.
  • Angular CLI: Launch the command prompt of the terminal to set up the Angular CLI on your machine. Run the command below:
npm install -g @angular/cli
  • Visual Studio Code: A text editor for building and compiling the code.

Step 1: Setup the Angular Project

First of all, open the terminal in the Visual Studio Code and set up your AngularJS project by running the following command.

ng new my-app

Angular project

After that, navigate to your app folder.

cd my-app

Step 2: Install and Integrate the Froala Editor

Now, let’s install the Froala Editor.

npm install angular-froala-wysiwyg --save

Once it’s installed, you need to import the Froala Editor module into your Angular module. Open ‘src/app/app.module.ts’ file and add the following code.

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';

@NgModule({
declarations: [
// your components here
],
imports: [
FroalaEditorModule.forRoot(),
FroalaViewModule.forRoot(),
// other modules here
],
bootstrap: [AppComponent],
})
export class AppModule {}

Step 3: Create a Content Management System (CMS)

Here we will create a content management system using AngularJS and Flora with the help of multiple components.

Create an Editor Component

In the terminal of VS Code, run the following to create an editor component. This will create a new folder named ‘editor’ with the necessary files.

ng generate component editor

Angular editor component

Open ‘src/app/editor/editor.component.html’ and add the Froala Editor.

<div [froalaEditor]></div>

Now, in your ‘src/app/app.component.html’ file, replace the existing content with:

<header>

<div class="header-content">

<h1>Content Management System</h1></div>

</header>

<app-editor></app-editor>

Add the following design code for the header in the ‘src/app/app.component.css’ file.

header {
background-color: #f0f0f0; /* Add your desired background color */
padding: 10px;
}.header-content {
text-align: center;
}h1 {
margin: 0;
}

 Create a Service for Data Management

Now, let’s add the ability to save the content entered in the Froala Editor. We’ll create a service to handle data management. First, create a new service.

ng generate service content

This will create a file named ‘content.service.ts’ in the src/app folder.

Angular service

Open ‘src/app/content.service.ts’ and add the following:

import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable({
  providedIn: 'root',
})
export class ContentService {
  private contentSubject = new BehaviorSubject<string>('');

  getContent() {
    return this.contentSubject.asObservable();
  }

  updateContent(content: string) {
    this.contentSubject.next(content);
  }
}

 Modify Editor Component

Now, let’s modify our ‘editor.component.ts’ to use this service.

import { Component, OnInit } from '@angular/core';
import { ContentService } from '../content.service';

@Component({
  selector: 'app-editor',
  templateUrl: './editor.component.html',
  styleUrls: ['./editor.component.css'],
})
export class EditorComponent implements OnInit {
  
  content: string = '';
  
  constructor(private contentService: ContentService) {}

  ngOnInit() {}

  onContentChanged(content: string) {
    this.contentService.updateContent(content);
  }
}

Update ‘editor.component.html’ to pass the content to the service when it changes:

<div [froalaEditor] [(froalaModel)]="content" (froalaModelChange)="onContentChanged($event)"></div>

 Create a Viewer Component

Now, let’s create a new component to display the saved content. Run:

ng generate component viewer

Angular Viewer

Open ‘src/app/viewer/viewer.component.ts’ and add the following code.

import { Component, OnInit } from '@angular/core';
import { ContentService } from '../content.service';

@Component({
  selector: 'app-viewer',
  templateUrl: './viewer.component.html',
  styleUrls: ['./viewer.component.css'],
})
export class ViewerComponent implements OnInit {
  content: string = '';

  constructor(private contentService: ContentService) {}

  ngOnInit() {
    this.contentService.getContent().subscribe((content) => {
      this.content = content;
    });
  }
}

Update ‘viewer.component.html’ to display the content.

<div [froalaView]="content"></div>

Now, update ‘app.component.html’ to include both the editor and the viewer.

<header>
  <div class="header-content">
  <h1>Content Management System</h1></div>
</header>

<app-editor></app-editor>
<app-viewer></app-viewer>

Step 4: Run the CMS Application

Start your Angular development server using the command:

ng serve

Now go to http://localhost:4200 and check your application running on the following port.

Froala runing in Angular

The CMS application has been successfully built and running.

Step 5: Test the Data Management on CMS

To test the data storage and display on the screen using the viewer component, we have to pass some text in the text field shown above in the CMS dashboard. Let’s write some text and test.

Angular WYSIWYG editor

As the data is displayed in the screen below the dashboard, the CMS has been successfully tested and displaying the correct data.

Make CMS Development Fast, Robust, and Secure with Froala WYSIWYG HTML Editor

Froala is a WYSIWYG HTML editor that, when combined with Angular, enables seamless CMS development. This collaboration, combining Froala’s user-friendly interface and rich features with Angular’s capabilities, provides developers with a toolkit for crafting efficient and customizable CMS solutions.

With Froala, you can format text, put in images, and include different things easily. Your CMS becomes more than just plain text—it can have lists, pictures, and more. You can adjust it to fit what you need for your CMS, making it simple and good for users.

Get started with Froala today for seamless CMS development!

Learn to Integrate Froala Visual HTML Editor into Your NodeJS App

Froala in NodeJS and Express

NodeJS is a popular runtime environment that allows you to run JavaScript on the server side. It offers various frameworks to build web applications, and one of the most popular ones is Express. In this tutorial, we will learn how to integrate Froala, a powerful visual HTML editor, into a NodeJS application built with Express. Froala provides an easy-to-use interface for users to create and edit rich text content.

Before diving in, we assume you have a working knowledge of:

  • JavaScript
  • NodeJS and npm
  • Express Framework
  • How to use the terminal/command line

Create a new NodeJS app

To create a new NodeJS app, open your terminal or command line and navigate to the desired directory where you want to create your app. Then, run the following command:

npm init

This will initialize a new NodeJS project inside the selected directory. You will be prompted with some questions for filling the `package.json` file. Accept the default values except for “main”, which we will set to “app.js”.

Install Dependencies

Next, we need to install the Express framework, Embedded JavaScript templates (EJS), and Froala WYSIWYG editor

Run the following command:

$ npm install froala-editor ejs express

This will install the required dependencies for our NodeJS application. Once the installation is complete, we can proceed to integrate Froala visual html editor into our Express application.

Set up the Express application

First, let’s create a new file named “app.js” in the root directory of our project. This file will serve as the entry point for our Express application.

Open “app.js” in your preferred text editor and add the following code:

var express = require('express');

var app = express();

// Set EJS as the view engine
app.set('view engine','ejs');

//Froala editor CSS & JS files
app.use('/froalacss',express.static(__dirname+'/node_modules/froala-editor/css/froala_editor.pkgd.min.css'));
app.use('/froalajs',express.static(__dirname+'/node_modules/froala-editor/js/froala_editor.pkgd.min.js'));

// Define routes 
app.get('/',(req,res)=>{
 res.render('editor');
});

var port = process.env.PORT || 3000;
app.listen(port,()=>console.log('server run at port '+port));

In the above file, we first import the Express framework and an instance of it using the `express()` function.

Next, we set EJS as the view engine by using the `app.set()` method.

Then, we use the `app.use()` method to serve the Froala editor CSS and JS files as static files.

After that, we define a route for the root URL (“/”) and render the “editor” view using the `res.render()` method.

Finally, we set the port for the server to listen on and start the server using the `app.listen()` method.

Create the views

Next, let’s create the views for our application. Inside the root directory of your project, create a new directory called “views”. Inside the “views” directory, create a new file called “editor.ejs”.

Open “editor.ejs” in your preferred text editor and add the following code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/froalacss">
    <script src="/froalajs"></script>
    <title>Document</title>
</head>
<body>
    <h1>Froala Editor</h1>
    <textarea id="example"></textarea>
    <script>
            var editor = new FroalaEditor("#example");
     </script>
</body>
</html>

In the above file, we create a basic HTML structure with a title and a heading. We include the Froala editor CSS file and the Froala editor JS file using the `<link>` and `<script>` tags respectively. Inside the body, we create a textarea element with the id “example”. Finally, we initialize the Froala editor by creating a new instance of the FroalaEditor class and passing in the textarea element’s id as a parameter.

Test the application

To test the application, run the following command in your terminal or command line:

$ node app.js

This will start the server and your application will be accessible at `http://localhost:3000\`.

You should be able to see the Froala Editor interface with a textarea where you can create and edit rich text content. You can test the functionality of the editor by typing in the textarea and applying various formatting options provided by Froala.

Congratulations! You have successfully integrated Froala into your NodeJS application built with Express.

Customize The Froala Editor

One benefit of using Froala editor rather than other WYSIWYG editors is its extensive customization options. Froala allows you to tailor the editor to fit the specific needs of your application.

To customize the Froala editor, you can modify the initialization code in the “editor.ejs” file. The FroalaEditor class accepts an options object as a parameter, where you can specify various configuration settings.

For example, you can customize the toolbar buttons by setting the “toolbarButtons” property. You can choose which buttons to include in the toolbar and in what order they should appear.

Here’s an example of how you can customize the toolbar buttons:

            var editor = new FroalaEditor("#example", {

             toolbarButtons: ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'color', 'backgroundColor', 'align', 'formatOL', 'formatUL', 'indent', 'outdent', 'insertImage', 'insertLink', 'insertTable', 'insertVideo', 'undo', 'redo']

              });

In the above example, we set the “toolbarButtons” property to an array of button names. This will customize the toolbar to only include the specified buttons.

You can explore the Froala documentation to find more customization options and configure the editor according to your requirements.

froala nodejs sdk

Uploading Images, Videos, and Files

To upload images, videos, and files using Froala, we need to make some changes to our existing code. For simpification Froala provides NodeJS SDK to handle file uploads. We will cover how to use the Froala NodeJS SDK in another article.

Do I need to Secure the Froala integration?

Froala WYSIWYG HTML Editor has robust XSS attack prevention. Generally, you won’t have to worry at all about this, however, additional server-side checks are recommended.

Conclusion

We have successfully integrated the Froala editor into our NodeJS application built with Express. We have created the necessary files and views, tested the application, and explored customization options for the editor. We have also discussed the possibility of uploading images, videos, and files using the Froala NodeJS SDK. The editor also provides a strong defense against XSS attacks, ensuring the security of your application. So why wait? Start integrating Froala into your NodeJS application today and take your content editing experience to the next level.

Improve React Project Engagement: Custom Emoticons with HTML Editor Software

Froala custom emoticons

In 2023, having an engaging user interface is crucial for keeping people interested. One effective way to enhance user experience is by incorporating emoticons into your application.

Emoticons, or emojis, have evolved from being mere embellishments to essential elements in development. They play a significant role in enhancing communication across platforms.

Emoticons are important because they help us express ourselves and engage users more effectively. They personalize messages, making communication more relatable and engaging.

Additionally, emoticons serve as a universal language, boosting branding efforts by adding a visual element to text, making content more compelling.

They also contribute to storytelling by conveying emotions and context within limited space. Integrating emoticons using advanced HTML editor software can significantly elevate your application’s user interface and overall experience.

The Froala WYSIWYG editor lets you do this with its Custom Emoticons feature. In the blog post, we will explore how to integrate Froala Custom Emoticons into a React project with our versatile react rich text editor.

Froala HTML Editor Software Custom Emoticons

Take a moment to see how Froala Custom Emoticons can help your application. Froala is a tool that helps developers make advanced text editors for web apps.

Users can add their own emoticons or emojis using the Custom Emoticons feature, expanding the editor’s capabilities.

Users can use Custom Emoticons to add their own personal touch to messages, instead of using the standard emojis.

Prerequisites

Before we start, make sure you have the following prerequisites installed:

  • Node.js and npm (Node Package Manager): Ensure that you have Node.js installed on your machine.
  • Create React App: Install Create React App globally using the following command:
npm install -g create-react-app

Now that we have the prerequisites in place, let’s proceed with the integration.

Setting Up a React Project

To get started, create a new React project using the Create React App. Open your terminal and run the commands:

npx create-react-app froala-custom-emoticons-demo

cd froala-custom-emoticons-demo

This will create a new React project named froala-custom-emoticons-demo and navigate into its directory.

Installing Froala Editor

To use Froala Custom Emoticons in our React project, we need to install the Froala Editor package. In your project directory, run the command:

npm install react-froala-wysiwyg --save

This package provides a React wrapper for the Froala Editor, making it easy to integrate into our application.

Integrating Froala Editor

Now that we have the Froala Editor installed, let’s integrate it into our React project. Open the “src/App.js” file in your code editor and replace its contents with the following code:

import './App.css';

import FroalaEditorComponent from "react-froala-wysiwyg";

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import "froala-editor/js/plugins.pkgd.min.js";

function App() {

  let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

  return (

    <div id="froala-editor">

      <h1>Froala</h1>

      <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

        }}

      />

    </div>

  )

}

export default App;

 

  1. The import App.css statement imports the styles specific to the App component.
  2. FroalaEditorComponent is a React component provided by the “react-froala-wysiwyg” package.
  3. The next 3 lines are about importing the Froala editor styles and plugins.
  4. The App function is a functional React component.
  5. The model variable contains the initial content of the Froala editor. It’s a simple HTML string with a link.
  6. Inside the return statement, there’s a div with the id “froala-editor” and an h1 element with the text “Froala.”
  7. The FroalaEditorComponent is used to render the Froala editor. It is configured to use a textarea as its underlying element (tag=”textarea”), and the initial content is set using the model prop.
  8. The App component is exported as the default export of this module.

emoticons in React

Using Custom Emoticons in Froala Editor

Froala Editor provides flexibility in customizing the display of emoticons. The following code must be put on the config part.

In the toolbarButtons define the button emoticons.

You can control how many emoticons show up in each row of the emoticons menu by using the emoticonsStep property in the FroalaEditor component’s config prop.

The emotionsSet allows you to personalize the emotions displayed.

       toolbarButtons: ["emoticons"],

          emoticonsStep: 4,

          emoticonsSet: [{

            id: 'people',

            name: 'Smileys & People',

            code: '1f600',

            emoticons: [

             { 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' }

            ]

            }, {

            id: 'nature',

            name: 'Animals & Nature',

            code: '1F435',

            emoticons: [

              { code: '1F412', desc: 'Monkey' },

              { code: '1F415', desc: 'Dog' },

              { code: '1F429', desc: 'Poodle' },

              { code: '1F408', desc: 'Cat' },

              { code: '1F405', desc: 'Tiger' },

              { code: '1F406', desc: 'Leopard' },

              { code: '1F40E', desc: 'Horse' },

              { code: '1F402', desc: 'Ox' },

              { code: '1F403', desc: 'Water Buffalo' },

            ]

          }]

        }}

Here’s an explanation:

  1. toolbarButtons: [“emoticons”]: This adds an “emoticons” button to the toolbar, indicating that users can interact with emoticons.
  2. emoticonsStep: 4: This is related to some intervals for emoticons.
  3. emoticonsSet: An array containing sets of emoticons. In this case, there are two sets: “Smileys & People” and “Animals & Nature”.
  4. For “Smileys & People” (id: ‘people’):
    • code: ‘1f600’: Identifier for this set.
    • emoticons: An array of objects, each representing an emoticon with a code (e.g., ‘1f600’) and a description of the emoji (‘Grinning face’, ‘Grinning face with smiling eyes’, ‘Face with tears of joy’, ‘Smiling face with open mouth’, ‘Smiling face with open mouth and smiling eyes’, ‘Smiling face with open mouth and cold sweat’, ‘Smiling face with open mouth and tightly-closed eyes’, ‘Smiling face with halo’).
  1. For “Animals & Nature” (id: ‘nature’):
    • code: ‘1F435’: Another identifier for this set.
    • emoticons: Array of objects, each representing an animal or nature-related emoticon (‘Monkey’, ‘Dog’, ‘Poodle’, ‘Cat’, ‘Tiger’, ‘Leopard’, ‘Horse’, ‘Ox’, ‘Water Buffalo’).

Running the React App

Now that we’ve set up the Froala Editor in our React project, let’s run the application and see our Custom Emoticons in action. In your terminal, run the following command:

npm start

This will start the development server, and you can view your React app by navigating to http://localhost:3000 in your web browser.

Add emoticons in React

Conclusion

This article shows how to add Froala Custom Emoticons to a React project. It makes communication more expressive and personal.

You can make a text editor with lots of features. Users can add their own emoticons, which makes the app more fun and interactive.

Froala Editor has many features for developers, like Custom Emoticons.

As you work on your React project, try using Froala Editor to improve your web app’s features and user experience.

Creating a Rich Text Form in NextJS Using an Online JavaScript Editor

NextJS rich text forms

NextJS is a powerful React framework that enables developers to build server-side rendered and static web applications with ease. An online JavaScript editor, like Froala, is a highly customizable, rich-text editor for web and mobile applications. When these two powerful tools are combined, they provide an efficient way to create dynamic, rich-text forms for your web application. In this simple tutorial, we will walk you through building a Contact Us form in NextJS, finishing with the integration of an online JavaScript editor for users to craft attractive, organized messages. Using an online JavaScript editor ensures a seamless, user-friendly experience, enhancing the overall functionality and aesthetics of your web application.

We will cover the configuration and customization of your rich-text form.

Create a new NextJS project

To create a new NextJS application, run the following NPM command:

npx create-next-app@latest

install nextJS

Answer the prompted questions like:

√ What is your project named? contact-form

√ Would you like to use TypeScript? Yes

√ Would you like to use ESLint? Yes

√ Would you like to use Tailwind CSS? Yes

√ Would you like to use src/ directory? Yes

√ Would you like to use App Router? (recommended) Yes

√ Would you like to customize the default import alias (@/*)? … No

This will scaffold a new NextJS project named “contact-form“ in your current directory. Once created, navigate into your new project by running:

cd contact-form

Creating a simple contact form

In this tutorial, we will use the react-hook-form for creating our form component. The react-hook-form is a lightweight, performant form library for React that leverages the use of hooks. It’s easy to use, requires little boilerplate code, and includes features such as form validation and error handling built right in.

To install react-hook-form, run the following NPM command:

npm install react-hook-form

After installing react-hook-form, let’s create our form component.

  • Create the `components` directory, if it doesn’t exist.
  • Create a new component file named `contact.tsx` Inside the `components` directory.
  • Open the `contact.tsx` using your preferred IDE to start editing it.
  • Since this component will run on the client side not the server side, add the following on the first line:
'use client';
  • react-hook-form provides a form builder that you can use to easily create your form and it will display the component code on the right.

form builder

Use this builder to build the form fields you like to have on your page, then copy the code in the `contact.tsx` file we created. Note that the form code doesn’t have a style for the form, so we will add some Tailwind CSS classes to make the form visually appealing. After all, this how our Contact component code looks like.

'use client';

import React from 'react';
import { useForm } from 'react-hook-form';.

export default function Contact() {

  const { register, handleSubmit, formState: { errors } } = useForm();

  const onSubmit = (data: any) => console.log(data);

  console.log(errors);

  
  return (

    <form

    className="w-full max-w-5xl"

    onSubmit={handleSubmit(onSubmit)}>

      <div className='mb-5'>

        <label

          htmlFor='name'

          className='mb-3 block text-base font-medium text-black'

        >

          Full Name

        </label>

        <input

          type='text'

          placeholder='Full Name'

          className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

          {...register('name', { required: true })}

        />

      </div>

      <div className='mb-5'>

        <label

          htmlFor='email'

          className='mb-3 block text-base font-medium text-black'

        >

          Email Address

        </label>

        <input

          type='email'

          placeholder='example@domain.com'

          className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

          {...register('email', { required: true })}

        />

      </div>

      <div className='mb-5'>

        <label

          htmlFor='Mobile number'

          className='mb-3 block text-base font-medium text-black'

        >

          Mobile number

        </label>

      <input 

       type="tel"

       placeholder="Mobile number"

       className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

        {...register("Mobile number", {required: true, minLength: 6, maxLength: 12})}

      />

      </div>

      <div className='mb-5'>

        <label

          htmlFor='message'

          className='mb-3 block text-base font-medium text-black'

        >

          Message

        </label>

        <textarea

          rows={5}

          placeholder='Type your message'

          className='w-full resize-none rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

          {...register('message', { required: true })}

        ></textarea>

      </div>

      <div>

        <button className='hover:shadow-form rounded-md bg-white border py-3 px-8 text-base font-semibold outline-none text-gray-700'>    

          Submit

        </button>

      </div>

    </form>

  );

}

As you can see on the above code, the Contact component will handle the form submission at the moment.

When a user submits the form, the validation starts. If there is a validation error, the errors will be logged on the console. If there are no validation errors, the input data will also be logged on the console. In a real-world application, we will need to change this behavior so the data is sent to the site administrator.

Test The Form

Display the Form in our application

To display the form on the homepage, let’s replace the code on “app/page.tsx” with the following code

import Contact from '@/components/contact';

export default function Home() {

return (

<main className="flex min-h-screen flex-col items-center justify-between p-24">

<Contact />

</main>

)

}

The above code imports the `Contact` component that we just created and renders it in the `Home` component. The Home component is the main component that is displayed when the user lands on the homepage. The `Contact` component is wrapped in the `main` tag, which is styled using Tailwind CSS to center the form on the page.

Run the NextJS app

Now, run the application using the following command:

npm run dev

This will start the Next.js development server.

Result

NextJS form

Open your web browser and navigate to `localhost:3000`. You should now see the contact form on your homepage. Open the browser console, and try submitting the form with different inputs to test the validation. If the validation fails, you will see the error messages logged in the console. If the form is submitted successfully, you will see the form data logged in the console.

The next step will be enhancing the message field to support rich text.

Enhance React Forms by Integrate Froala Rich-text

Now that our basic contact form is working as expected, we can enhance it to enable users to write rich text messages. For this, we will use the Froala WYSIWYG editor. It offers a wide range of features, including text formatting, image and video insertion, tables, and more. Moreover, it is easily integrated with NextJS since it already has a ready React rich-text editor component.

Install Froala Editor React component

First, install the Froala Editor package in your Next.js application using the following command:

npm install react-froala-wysiwyg --save

Import Froala Editor Component and stylesheets

inside “contact.tsx” file, and add

import 'froala-editor/css/froala_style.min.css';

import 'froala-editor/css/froala_editor.pkgd.min.css';

import FroalaEditorComponent from 'react-froala-wysiwyg';

Display the Froala React rich-text editor

Inside the return statement, add the Froala component after the Message field so it appears under it and before the submit button. Update the code as follows:

return (

<form

className="w-full max-w-5xl"

onSubmit={handleSubmit(onSubmit)}

>

<div className='mb-5'>

<label

htmlFor='name'

className='mb-3 block text-base font-medium text-black'

>

Full Name

</label>

<input

type='text'

placeholder='Full Name'

className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

{...register('name', { required: true })}

/>

</div>

<div className='mb-5'>

<label

htmlFor='email'

className='mb-3 block text-base font-medium text-black'

>

Email Address

</label>

<input

type='email'

placeholder='example@domain.com'

className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

{...register('email', { required: true })}

/>

</div>

<div className='mb-5'>

<label

htmlFor='Mobile number'

className='mb-3 block text-base font-medium text-black'

>

Mobile number

</label>

<input

type="tel"

placeholder="Mobile number"

className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

{...register("Mobile number", {required: true, minLength: 6, maxLength: 12})}

/>

</div>

<div className='mb-5'>

<label

htmlFor='message'

className='mb-3 block text-base font-medium text-black'

>

Message

</label>

<textarea

rows={5}

placeholder='Type your message'

className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'

{...register('message', { required: true })}

>

</textarea>

</div>

<div className="mb-5">

<FroalaEditorComponent

tag="textarea"

/>

</div>

<div>

<button className='hover:shadow-form rounded-md bg-white border py-3 px-8 text-base font-semibold outline-none text-gray-700'>

Submit

</button>

</div>

</form>

);

Once you open the webpage, you’ll see the Froala WYSIWYG editor is on the form. You can use it to write and make your text look nice. But, when you send the form, the editor’s content isn’t checked or sent along with it.

Submit Froala editor content along with react-hook-form submitted data in NextJS app

To validate and submit the Froala editor content along with react-hook-form submitted data, we will use the react-hook-form’s `Controller` component. This component is useful for creating a field that updates its value based on an externally controlled component, such as the Froala React rich-text editor component

First, import the `Controller` component:

import { useForm, Controller } from 'react-hook-form';

Then, Add a new variable `control` which will be used with the `Controller` component.

const { register, handleSubmit, control, formState: { errors } } = useForm();

Finally, replace the message field and Froala Editor component code with the `Controller` component :

<div className='mb-5'>

        <label htmlFor='message' className='mb-3 block text-base font-medium text-black'>

Message

</label>

<Controller

name="message"

rules={{ required: true }}

control={control}

defaultValue=""

render={({ field }) => (

<FroalaEditorComponent

tag="textarea"

model={field.value}

onModelChange={field.onChange}

/> )}

/>

</div>

In the `Controller` component:

  • We used the `name` property to identify the data when the form is submitted. The `control` property is used to control the form.
  • We used the rules property to set the validation rules.
  • The `render` method is used to render the editor and connect it with the form. inside it:
    • we used the `field` argument to get the current value and the onChange event of the form field.
    • The `model` property is used to bind the current value to the Froala Editor.
    • The `onModelChange` event is used to update the form field value when the Froala Editor content changes.

This way, the Froala Editor is fully integrated with the form, and its content is validated and submitted along with the other form fields.

Now, when you open the app and submit the form, the content of the Froala Editor will be included in the form data. The error messages, if any, will be displayed in the console.

NextJs rich text form

Customize the editor

To customize the editor toolbar, you can pass an options object to the Froala Editor component. This object should contain the desired configuration options from the Froala API options. Here’s an example:

const options = {

toolbarButtons: [ 'bold', 'italic', 'underline', 'outdent', 'indent', 'undo', 'redo', 'clearFormatting', 'selectAll'  ],

charCounterMax: 140

}

You can then pass the options object to the Froala Editor component’s config property like so:

<FroalaEditorComponent

tag="textarea"

model={field.value}

onModelChange={field.onChange}

config={options}

/>

This will customize the toolbar to only include the specified buttons and set the maximum character count to 140 characters.

Note that some editor buttons and functions require additional plugins to be loaded. You have to import the plugin file

import 'froala-editor/js/plugins/align.min.js';

import 'froala-editor/js/plugins/char_counter.min.js';

Include it in the `pluginsEnabled` option, and add the buttons to be displayed in the `toolbarButtons` option:

const options = {

toolbarButtons: [ 'bold', 'italic', 'underline', 'alignRight', 'alignCenter',  'alignLeft', 'outdent', 'indent', 'undo', 'redo', 'clearFormatting', 'selectAll'  ],

pluginsEnabled: ['align', 'charCounter'],

charCounterMax: 140

}

custom Froala rich text editor in NextJS

Full Code

Here is the complete code of “contact.tsx” component with all the changes:

'use client';

import React from 'react';
import { useForm, Controller } from 'react-hook-form';

import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/js/plugins/align.min.js';
import 'froala-editor/js/plugins/char_counter.min.js';

import FroalaEditorComponent from 'react-froala-wysiwyg';

export default function Contact() {
  const { register, handleSubmit, control, formState: { errors } } = useForm();
  const onSubmit = (data: any) => console.log(data);
  console.log(errors);

  const options = {
    toolbarButtons: [ 'bold', 'italic', 'underline', 'alignRight', 'alignCenter',  'alignLeft', 'outdent', 'indent', 'undo', 'redo', 'clearFormatting', 'selectAll'  ],  
    pluginsEnabled: ['align', 'charCounter'],
    charCounterMax: 140
  } 

return (
    <form
    className="w-full max-w-5xl"
    onSubmit={handleSubmit(onSubmit)}
    >
      <div className='mb-5'>
        <label
          htmlFor='name'
          className='mb-3 block text-base font-medium text-black'
        >
          Full Name
        </label>
        <input
          type='text'
          placeholder='Full Name'
          className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'
          {...register('name', { required: true })}
        />
      </div>
      <div className='mb-5'>
        <label
          htmlFor='email'
          className='mb-3 block text-base font-medium text-black'
        >
          Email Address
        </label>
        <input
          type='email'
          placeholder='example@domain.com'
          className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'
          {...register('email', { required: true })}
        />
      </div>

      <div className='mb-5'>
        <label
          htmlFor='Mobile number'
          className='mb-3 block text-base font-medium text-black'
        >
          Mobile number
        </label>
      <input 
       type="tel"
       placeholder="Mobile number"
       className='w-full rounded-md border border-gray-300 bg-white py-3 px-6 text-base font-medium text-gray-700 outline-none focus:border-purple-500 focus:shadow-md'
        {...register("Mobile number", {required: true, minLength: 6, maxLength: 12})}

      />
      </div>

      <div className='mb-5'>
      <label
          htmlFor='message'
          className='mb-3 block text-base font-medium text-black'
        >
          Message
        </label>
      <Controller   name="message" rules={{ required: true }}  control={control}   defaultValue=""   render={({ field }) => ( 
            <FroalaEditorComponent 
                    tag="textarea"
                    model={field.value}
                    onModelChange={field.onChange}
                    config= {options}
             /> )}
        />
      </div>

      <div>
        <button className='hover:shadow-form rounded-md bg-white border py-3 px-8 text-base font-semibold outline-none text-gray-700'>
          Submit
        </button>
      </div>
    </form>
  );
}

Concluding Remarks

The Froala WYSIWYG editor provides a rich set of options for text manipulation, and its React component allows for easy integration with your React and NextJS applications. Using the `react-hook-form` library’s `Controller` component, we can seamlessly integrate the Froala editor into a form created using `react-hook-form`, ensuring its content is validated and submitted alongside other form data. With the configuration options provided by the Froala API, we can customize the editor to fit our application’s needs.

Whether you are building a blog, a CMS, or any other application that requires text editing, the Froala WYSIWYG editor is a powerful tool that can enhance your project’s functionality and user experience. Start your free trial now and enable your users to create and manage content in a visually appealing and intuitive way.

Froala 4.1.3 for Enhanced Security and Performance

froala-4-1-3-feature-image

We are always trying to make web writing tools better, and we stress how important it is to switch to Froala version 4.1.3. It’s important to understand that this update goes beyond normal software improvements; it’s a big step toward making your web content safer and faster overall. This version of Froala isn’t just another update in the series; it’s a highly important upgrade that was carefully made to protect your online presence from new cyber threats and make the user experience better.

If you use Froala 4.1.3, you’ll not only have access to the newest features, but you’ll also be strongly committed to keeping your web work as safe and efficient as possible.

froala-4-1-3

Understanding XSS Vulnerability: A Developer’s Perspective

What is XSS?

  • Cross-Site Scripting Explained: Cross-Site Scripting, or XSS, is a common security risk in which criminals add harmful scripts to web pages that other users view. This kind of abuse can allow people to get into user info without their permission and do other bad things.

Why is Addressing XSS Critical?

  • Protecting User Data and Trust: Froala 4.1.3 is very important for keeping your users’ info safe because it fixes XSS problems. This keeps trust and integrity in your web applications.

Key Updates in Froala 4.1.3

1. Enhanced Security Against XSS Attacks:

  • Strong defense systems: The newest version of Froala makes security stronger against XSS attacks, so these attacks can’t hurt your content or user data.

2. Extended Platform Compatibility:

  • Safari iPad Support: Froala 4.1.3 supports a wide range of devices by bringing its famous editing experience to iPad users through Safari. This fills in gaps in accessibility and usefulness.

3. Improved Table Management:

  • More advanced features for resizing tables: With the new features for resizing tables, developers have more control over making sure that tables fit the needs of the content correctly.

4. Streamlined Content Pasting:

  • Easy integration from outside sources: Enhanced algorithms for pasting content from applications like Word ensure error-free and format-consistent integration.

Why Developers Should Prioritize This Update

Balancing Technicality with User-Friendly Interfaces:

  • For Developers, By Developers: Froala 4.1.3 is designed to be both technically advanced and easy to use. This makes it a popular choice among coders who want to work quickly and safely.

A Step Towards a More Secure Web:

  • Your Role in Web Security: Developers are very important in making the internet a safer place by updating to Froala 4.1.3. This protects both content authors and end users from new web threats.

Embrace the Change, Elevate Your Experience

Therefore, after installing Froala 4.1.3, you’ll not only be able to use new features, but you’ll also be helping to make web editing safer and more efficient. We’re committed to giving developers and content makers a tool that is both powerful and safe, and this version shows that.

Don’t Delay, Update Today!

Join us in this critical step towards enhancing web security and user experience. Update to Froala 4.1.3 and be a part of a safer, more efficient, and user-friendly web development community.

 

Froala Blog Call To Action

Customize the Froala Font Family Plugin in React App Project

Font Family Plugin

The choice of font family plays a significant role in the communication effectiveness of the content. Different font families can convey varying tones of a message.

Some key reasons to use different fonts are readability, clarity, hierarchy, branding, consistency, compatibility, and accessibility.

Froala is a WYSIWYG HTML editor that offers a range of plugins to enhance the editing experience. One plugin is the Froala Font Family Plugin, which allows users to change fonts in their text.

Here, we will walk you through the process of including the Froala Font Family Plugin, as in this example, in a React project, step by step with Froala’s react rich text editor.

Font Family Plugin

Step 1: Setting up your React Project

If you already have a React project, you can skip this step.

Otherwise, open your terminal and run the below commands:

npx create-react-app froala-font-family-demo

cd froala-font-family-demo

This will create a new React project called “froala-font-family-demo.”

Step 2: Install Froala Editor

You need to have the Froala Editor integrated into your React project.

npm install react-froala-wysiwyg --save

Step 3: Create the component

Once you have installed Froala Editor, you need to import the editor in Froala default mode into your React component.

You can use this code on the App.js file of the React App project.

import './App.css';

import FroalaEditorComponent from "react-froala-wysiwyg";

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import "froala-editor/js/plugins.pkgd.min.js";

function App() {

let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

return (

<div id="froala-editor">

<h1>Froala</h1>

<FroalaEditorComponent

tag="textarea"

model={model}

config={{

}}

/>

</div>

);

}

export default App;

Let’s break down the code:

Import Statements:

  • import ‘./App.css’; – The line imports a CSS file named App.css.
  • import FroalaEditorComponent from “react-froala-wysiwyg”; – The line imports the Froala Editor react component from “react-froala-wysiwyg” library.
  • The following lines import CSS and JavaScript files of the Froala Editor.

function App() { … } – This code defines a function component named App. In React, function components are used to create UI elements.

model Variable – let model initialize a model variable with an HTML string, that represents the initial content that will be displayed.

JSX Structure – The return statement contains a JSX structure, which defines the rendered output. JSX is a syntax extension for JavaScript often used with React.

<div id=”froala-editor”> – This div element has an id of “froala-editor.” It serves as a container for the component.

<h1>Froala</h1> – This is an <h1> heading that displays the text “Froala.”

<FroalaEditorComponent> – The code is the core component from the “react-froala-wysiwyg” library, which embeds the editor in the app.

tag=”textarea” – This prop specifies that it should be rendered as a textarea element.

model={model} – This prop provides the initial content to be displayed in the editor.

config={{}} – This prop can be used to pass additional configuration options to the editor.

export default App; – This line exports the App component as the default export of this module. This makes it available for use in other parts of the application.

 

Step 4: Add & Customize the Froala Font Family Plugin

Now that you have set up the Froala Editor in your React component, the Froala Font Family Plugin is added by default as we have included the “froala-editor/js/plugins.pkgd.min.js” file which imports all Froala plugins, and we have kept the pluginsEnabled API option unchanged.

Now it’s time to add more font families to the editor using the Froala Font Family Plugin.

This can be done by including the fontFamily API option in the Froala editor component config. Specify the font families that will be available in the editor.

Here we are using Roboto, Oswald, Montserrat, and Open Sans.

return (

<div id="froala-editor">

<h1>Froala</h1>

<FroalaEditorComponent

tag="textarea"

model={model}

config={{

fontFamily: {

"Roboto,sans-serif": 'Roboto',

"Oswald,sans-serif": 'Oswald',

"Montserrat,sans-serif": 'Montserrat',

"'Open Sans Condensed',sans-serif": 'Open Sans Condensed'

},

fontFamilySelection: ['true']

}}

/>

</div>

);

The code is an extension of the previous code.

fontFamily – This configuration defines a mapping between font families and their display names. It allows users to select fonts for their text content within the editor. Roboto, Oswald, Montserrat and Open Sans.

fontFamilySelection – This option is set to [‘true’], which indicates that the font family selection feature is enabled.

add fonts using Font Family Plugin

Step 5: Including the CSS code of the fonts

You need to include the fonts that will be used in your application. These are CSS-type codes.

In this project, we will use four Google fonts: Roboto, Oswald, Montserrat, and Open Sans Condensed.

In the file index.html, which is on the project file, use the following code in the <head>:

<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,700,700italic&subset=latin,vietnamese,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek' rel='stylesheet' type='text/css'>

<link href='https://fonts.googleapis.com/css?family=Oswald:400,300,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>

<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,greek,greek-ext,vietnamese,cyrillic-ext,cyrillic,latin-ext' rel='stylesheet' type='text/css'>

The code is a set of HTML <link> elements that are used to include fonts in a page.

These fonts are hosted on the Google Fonts service, and the code specifies which fonts and font variations to include on the web page.

Let’s break down each of the <link> elements. The <link> for the “Roboto” font:

<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,700,700italic&subset=latin,vietnamese,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek' rel='stylesheet' type='text/css'>

The href attribute is the URL of the font stylesheet. The rel specifies that this is a stylesheet link. The type indicates the type as ‘text/css’.

In the URL, Roboto weights and styles included are 400 regular, 300 light, 300 italic, 400 italic, 700 bold, 700 italic.

&subset=latin,vietnamese,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek specifies which character subsets to include.

The next element references the Google Fonts API for the “Oswald” font family. It specifies the weights 400, 300, and 700 for the font. It includes character subsets for Latin and Latin-extended characters.

<link href='https://fonts.googleapis.com/css?family=Oswald:400,300,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>

The next <link> is for the “Montserrat” font family. It includes font weights 400 and 700.

<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

The next element references the Google Fonts API for the “Open Sans Condensed” font family.

It specifies font weights 300, 300 italic, and 700. It includes multiple character subsets, such as Latin, Greek, Greek extended, Vietnamese, Cyrillic extended, Cyrillic, and Latin extended.

<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,greek,greek-ext,vietnamese,cyrillic-ext,cyrillic,latin-ext' rel='stylesheet' type='text/css'>

Font Family Plugin customized

Conclusion

Incorporating the Froala Font Family Plugin into your React project is a way to enhance rich text editing capabilities.

In this article, we have covered the step-by-step process of adding the Froala Font Family Plugin to your React application.

Froala Editor and its plugins offer a range of features and options, making it a versatile tool for web developers.

You can create a user-friendly text editing experience for your application’s users. In other words, you can continue to improve the functionality of a rich text editor in a React project.

User Experience with Bootstrap and Froala WYSIWYG Editor

Detailed aspects or features of Froala Editor, focusing on user experience and capabilities.

Bootstrap is a popular CSS framework that offers a variety of pre-designed components for building responsive, mobile-first web applications. Froala, on the other hand, is a powerful and flexible WYSIWYG editor that enhances the user experience by allowing them to create and edit rich text content directly on the web page.

When combined, these two tools can greatly enhance the functionality and user experience of your web forms. In this article, we will demonstrate this by creating a responsive form with Bootstrap and then integrating Froala to allow users to format their messages with different styles, fonts, and colors. This can make their queries more organized and clear, leading to better communication.

Start with a simple Bootstrap form

You can easily create a responsive HTML form using the Bootstrap form component. Moreover, there are many free ready-made Bootstrap form examples that we can copy their code. This is a good example. Let’s copy and modify it a little to make it consistent with your brand:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Bootstrap WYSIWYG Editor</title>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<style>




body{

background-color: #25274d;

}




.col-md-3{

background: #ff9b00;

border-top-left-radius: 0.5rem;

border-bottom-left-radius: 0.5rem;

}




.col-md-9{

background: #fff;

padding: 3%;

border-top-right-radius: 0.5rem;

border-bottom-right-radius: 0.5rem;

}




h1{

color:white;

width:100%;




}




</style>

</head>

<body>

<!------ Include the above in your HEAD tag ---------->




<div class="container py-5">

<div class="row">

<div class="col-md-12 pt-5 pb-3">

<h1 class="text-center">Please let us know how we can help you !</h1>

</div>

</div>

<div class="row">

<div class="col-md-3 pt-5">

<div>

<h2>Contact Us</h2>

<p>We would love to hear from you !</p>

</div>

</div>

<div class="col-md-9 ">

<div class="contact-form pt-2">

<div class="form-group">

<label class="control-label col-sm-2" for="fname">First Name:</label>

<div class="col-sm-10">

<input type="text" class="form-control" id="fname" placeholder="Enter First Name" name="fname">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="lname">Last Name:</label>

<div class="col-sm-10">

<input type="text" class="form-control" id="lname" placeholder="Enter Last Name" name="lname">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="email">Email:</label>

<div class="col-sm-10">

<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="comment">Comment:</label>

<div class="col-sm-10">

<textarea class="form-control" rows="5" id="comment"></textarea>

</div>

</div>

<div class="form-group">

<div class="col-sm-offset-2 col-sm-10">

<button type="submit" class="btn btn-primary">Submit</button>

</div>

</div>

</div>

</div>

</div>

</div>




</body>

</html>

In the above code, we have included the Bootstrap stylesheet in the head section

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

We created two columns and added the form inside the right column. The form contains fields for the user’s first name, last name, email, and a comment section.

<div class="container py-5">

<div class="row">

<div class="col-md-12 pt-5 pb-3">

<h1 class="text-center">Please let us know how we can help you !</h1>

</div>

</div>

<div class="row">

<div class="col-md-3 pt-5">

<div>

<h2>Contact Us</h2>

<p>We would love to hear from you !</p>

</div>

</div>

<div class="col-md-9 ">

<div class="contact-form pt-2">

<div class="form-group">

<label class="control-label col-sm-2" for="fname">First Name:</label>

<div class="col-sm-10">

<input type="text" class="form-control" id="fname" placeholder="Enter First Name" name="fname">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="lname">Last Name:</label>

<div class="col-sm-10">

<input type="text" class="form-control" id="lname" placeholder="Enter Last Name" name="lname">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="email">Email:</label>

<div class="col-sm-10">

<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-2" for="comment">Comment:</label>

<div class="col-sm-10">

<textarea class="form-control" rows="5" id="comment"></textarea>

</div>

</div>

<div class="form-group">

<div class="col-sm-offset-2 col-sm-10">

<button type="submit" class="btn btn-primary">Submit</button>

</div>

</div>

</div>

</div>

</div>

</div>

We used Bootstrap classes to style the form and make it responsive. The “container” class creates a container with a responsive fixed width, while the “row” and “col-md-*” classes create a flexible grid system.

For the page background and text colors, we added them using custom styles.

body{

background-color: #25274d;

}

.col-md-3{

background: #ff9b00;

border-top-left-radius: 0.5rem;

border-bottom-left-radius: 0.5rem;

}

.col-md-9{

background: #fff;

padding: 3%;

border-top-right-radius: 0.5rem;

border-bottom-right-radius: 0.5rem;

}

h1{

color:white;

width:100%;

}

Contact us Bootstrap form

Integrating Froala with the form

Now that we have a basic comment field where users can’t style their message. Let’s make it more dynamic by integrating the Froala rich text editor. This will allow users to send a rich text message which is much more engaging.

To incorporate Froala into your Bootstrap form, you first need to include the Froala stylesheets and scripts in our HTML file.

<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>

We used CDN links to load Froala. The term froala-editor@latest in the URL ensures that we always get the latest version of Froala.

The term froala_editor.pkgd.min.js in the URL will Load the editor and all its plugins. If you want to just load the core editor replace it with froala_editor.min.js

After that, you can initialize the Froala editor on the comments field or any other field in your form.

Since the comments field defined ID is “comment“, the Froala initializing function will be called like this:

<script>

new FroalaEditor('#comment');

</script>

Now, when you reload your page, you will see a rich text editor in place of the comment field.

bootstrap form with Froala WYSIWYG editor

Because it’s just a basic contact form, you don’t need to include all the advanced editor features. Use the toolbarButtons API option to display the needed buttons only.

<script>

new FroalaEditor('#comment', {

toolbarButtons: {

'moreText': {

'buttons': ['bold', 'italic', 'underline', 'strikeThrough'],

'buttonsVisible': 4

},

'moreParagraph': {

'buttons': ['alignLeft', 'alignCenter', 'alignRight', 'alignJustify'],

'buttonsVisible': 4

},

'moreRich': {

'buttons': ['formatOLSimple', 'formatUL',  'paragraphFormat', 'undo', 'redo', 'fullscreen', 'fontSize', 'textColor', 'backgroundColor','insertLink']

},

}

});

</script>

bootstrap WYSIWYG editor

You can also set the iframe API option to true so that the editor’s style is not affected by other page styles.

Explore other Froala API options and customize them to your needs.

Add focus to the Bootstrap form

 

bootstrap form with Froala WYSIWYG editor

Bootstrap form input elements are known for their box shadow effect that appears when they are focused. Initializing Froala on a Bootstrap form input will make the box shadow effect not work. Let’s put it back so that form inputs look consistent when focused. Change the initializing code to the following.

new FroalaEditor('#comment', {

toolbarButtons: {

'moreText': {

'buttons': ['bold', 'italic', 'underline', 'strikeThrough'],

'buttonsVisible': 4

},

'moreParagraph': {

'buttons': ['alignLeft', 'alignCenter', 'alignRight', 'alignJustify'],

'buttonsVisible': 4

},

'moreRich': {

'buttons': ['formatOLSimple', 'formatUL',  'paragraphFormat', 'undo', 'redo', 'fullscreen', 'fontSize', 'textColor', 'backgroundColor','insertLink']

},

},

events : {

initialized(){

this.$box[0].style.transition = "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out";

},

focus(){

this.$box[0].style.boxShadow = "0 0 0 .2rem rgba(0, 123, 255, .25)";

},

blur(){

this.$box[0].style.boxShadow = "";

}

}

});

</script>

In the above code, we used the Froala focus and blur events to handle adding a box shadow around the editor when it is focused and removing it when it is not.

The `initialized()` function is called when the editor is first created. Here we add a CSS transition property to the Froala editor box. This will give a smooth transition when the box-shadow is added or removed.

The `focus()` function is called when the editor is focused. Here we add a box-shadow around the editor box. This will be the same as the Bootstrap input focus box-shadow.

The `blur()` function is called when the editor is unfocused. Here we remove the box-shadow.

Testing the Form

After integrating Froala with your form, it’s time to test it. Refresh your web page and try typing and formatting text in the comment section. If everything is set up correctly, your text should appear in the chosen format.

Displaying the contact form content

On the page you will display the data submitted through the contact form we created don’t forget to include the froala_style.min.css stylesheet

<link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_style.min.css' rel='stylesheet' type='text/css' />

and display the comment data inside an HTML element with the fr-view class.

<div class="fr-view">

Here comes the HTML edited with the Froala rich text editor.

</div>

These steps are required to preserve the look of the edited HTML outside of the rich text editor.

Insert Images or files in the comments field

In case you want to enable your users to insert images or files into the comments field, Froala also provides an easy way to do so. Besides, you need to include the additional buttons for file and image upload in the toolbarButtons option, you will need to handle uploading the images or files into your server.

For specific instructions on how to perform each of these tasks with the Froala editor in the most popular server-side languages, check out our detailed guides.

The Froala editor also has documentation on a multitude of server-side SDKs in many languages to ease your development process.

Take Your Bootstrap Forms to the Next Level with Froala Rich Text Content Editor

The Froala Rich Text Content Editor is a powerful tool that can be seamlessly integrated into your Bootstrap forms. It provides an intuitive WYSIWYG interface, offering a plethora of features such as text formatting, image upload, and embedding options. With Froala, you can create rich, engaging form inputs that go beyond simple text fields. From bullet lists to embedded videos, the possibilities are endless. Plus, it’s highly customizable, allowing you to tailor the editor to your specific needs. Start enriching your forms today with Froala.

How to Use the Froala Markdown Plugin: Item-by-Item

Froala Markdown Plugin

Markdown is a lightweight markup language used for formatting and structuring plain text. It provides a way to create rich text content, such as headings, bold text, italics, code blocks, and lists without the need for complex HTML.

Markdown was born in the early 2000s, drawing inspiration from markup languages that had surfaced a decade earlier. These markup languages were initially used for emails and web posts during the early days of the Internet’s rise to popularity.

Markdown is especially popular in web development, documentation, and content creation.

Froala Markdown Plugin serves as a powerful tool, enabling seamless integration of Markdown capabilities into your web applications. This provides a user-friendly and efficient method for formatting content.

In this guide, we will explore how to use the Froala Markdown Plugin and provide detailed examples of Markdown features. We will cover the following Markdown elements:

  • Headings
  • Bold Text
  • Italic Text
  • Blockquotes
  • Ordered Lists
  • Unordered Lists
  • Code
  • Fenced Code Blocks
  • Horizontal Rules
  • Links
  • Images
  • Tables
  • Footnotes
  • Strikethrough
  • Task Lists

Markdown editor

Markdown button

In Froala, the Markdown button is the default on the toolbar. But you can customize the buttons on the toolbar and to include this option you must use the following code.

toolbarButtons: [...,'markdown',...]

Markdown button

Headings

Markdown headings are created using hashtags (#). Headings are essential for structuring your document and making it more readable. They allow you to create sections. Markdown provides an intuitive way to define headings using the hashtag symbol (#).

There are multiple levels of headings, and the number of symbols determines the heading level.

# Heading 1

## Heading 2

Heading 3

Markdown Heading

Bold and Italic Text

Markdown provides a straightforward way to format text as bold and italic.

These formatting styles are commonly used for emphasizing text in documents.

To make text bold in Markdown, you can enclose the text in double asterisks (**):

This is **bold** text.

Italicized text is created by enclosing the text in single asterisks (*):

This is *italic* text.

Markdown bold text

Blockquotes

Blockquotes in Markdown allow you to visually set apart and emphasize text, making it clear that the content is a quotation or excerpt from another source. They help improve the readability and structure of t documents.

Markdown uses the greater-than sign (>) to create blockquotes.

> This is a blockquote.

Markdown Blockquotes

Ordered and Unordered Lists

Ordered lists are created using numbers followed by periods. Each list item should start with a number, and Markdown will take care of numbering automatically:

  1. Item 1
  2. Item 2
  3. Item 3

Unordered lists are created using asterisks (*), plus signs (+), or hyphens (-) as list markers. Markdown will format them as bullet points:

* Item 1

* Item 2

* Item 3

Markdown list

Inline Code and Fenced Code Blocks

In Markdown, you can easily include code snippets and code blocks using backticks (`) and fenced code blocks. These features are useful for documenting code and sharing programming examples.

To format text as inline code, enclose the code within backticks (`).

Inline code is typically used for short code snippets or referencing code elements within sentences or paragraphs.

This is `inline code`.

Fenced code blocks are used to display longer code snippets, complete code examples, or multiline code.

They are enclosed by triple backticks ( “`), and you can specify the programming language for syntax highlighting immediately after the opening backticks.

“`

// This is a fenced code block

function example() {

console.log(‘Hello, World!’);

}

“`

Markdown code block

Horizontal Rules

Horizontal rules, also known as horizontal lines or thematic breaks, are used in Markdown to separate content visually.

They are an effective way to create visual divisions within your text. Horizontal rules are often used to denote changes in topics, sections, or content breaks.

To create a horizontal rule in Markdown, use three or more hyphens (—), asterisks (***), or underscores (___) on a separate line:

Links and Images

In Markdown, you can create hyperlinks and embed images in your text using an intuitive syntax. This makes it easy to add links to external websites, and internal resources, and include images within your Markdown documents.

To create hyperlinks in Markdown, you typically use the following format:

Link Text: This is the text that will be displayed as a clickable link.

URL: This is the web address or destination to which the link points.

Markdown allows you to create hyperlinks by enclosing the link text in square brackets ([]) and the URL in parentheses (()):

[Froala](https://froala.com)

Markdown allows you to embed images within your documents using a similar syntax to links. The primary difference is that you precede the URL with an exclamation mark (!).

Alt Text: This is a description of the image. It’s used for accessibility and is displayed when the image cannot be loaded.

Image URL: This is the web address of the image you want to embed.

![Froala Logo](https://froala.com/wp-content/uploads/2022/06/froala-1.png )

Markdown image element

Tables

In Markdown, you can create tables to present data in a structured and organized format. Markdown tables are easy to create and offer a simple way to display information with columns and rows.

To create tables in Markdown, you use a combination of pipe characters (|) and hyphens (-) to define the structure of the table and pipe characters for the content within each cell.

| Header 1 | Header 2 |

|———-|———-|

| Data 1   | Data 2   |

| Data 3   | Data 4   |

The first row defines the table headers, which are separated by the pipe character (|) and enclosed with pipes on both sides.

The second row, consisting of hyphens (-), indicates the alignment and separates the header row from the content rows.

Subsequent rows contain the data cells, which are separated by pipe characters.

Markdown tables

Footnotes

Footnotes in Markdown provide a way to add additional information or references to your content without cluttering the main text.

Create the reference point in your main text: To indicate where you want to add a footnote, place a caret (^) or a superscript number in your text. For example, you might write something like this:

This is a sentence with a footnote reference[^1].

Add the footnote content: At the bottom of your document or section, create a separate section to define the footnotes. This is done by placing the caret or number again followed by a colon and then the content of the footnote.

[^1]: This is the content of the footnote. It can be multiple sentences or even paragraphs.

markdown footernotes

Strikethrough

Strikethrough in Markdown is a way to visually indicate that text should be crossed out or deleted. This is typically used to show that a word or phrase has been removed or is no longer valid.

To apply strikethrough formatting in Markdown, use double tilde (~~) characters. Here’s how it works:

This is some ~~strikethrough text~~.

Markdown strikethrough

Task Lists

Task lists are used to create to-do lists with checkboxes.

To create a task list in Markdown, use square brackets ([]) to represent incomplete tasks and [x] to represent completed tasks:

– [x] Task 1

– [ ] Task 2

– [ ] Task 3

Markdown task lists

Conclusion

The Froala Markdown Plugin is a versatile tool for integrating Markdown support into your web applications.

It allows you to easily create and render Markdown content, making it a valuable addition to your text editing solutions.

In this guide, we’ve covered the basics of using the Froala Markdown Plugin and provided examples for various Markdown features.

Whether you’re building, the Markdown Plugin can streamline the process and enhance the user experience.

With customization options, you can ensure that Markdown content seamlessly integrates with your website’s design.

So, go ahead and explore the possibilities of the Froala Markdown Plugin in your projects. Happy editing!

Froala 4.1.3 Release – XSS vulnerability resolved, and more

Froala Release 4.1.3

We are pleased to announce the release of Froala version 4.1.3. This release is a must-have for all users as it addresses critical security vulnerabilities, ensures stability, improves performance, and delivers a seamless user experience. This release emphasizes our commitment to providing a safer and smoother experience for all users. We encourage you to update to this latest version and enjoy an even better Froala.

Key Highlights

This release comes with several improvements and enhancements. Let’s take a look at the key highlights:

  • Resolving XSS vulnerability in the insert link field
  • Safari iPad Support
  • Improvements for table resizing
  • Improvements for content pasting from different sources.
  • and More.

Froala 4.1.3 release

Let’s dig deep into the most significant changes in this release.

Resolving XSS vulnerability in the insert link field

We’ve discovered a cross-site scripting (XSS) vulnerability that lets attackers use the insert link field to add and run code. Examples of such attacks are

  • The attacker can change what the user sees on the original page.
  • The attacker can redirect you to a phishing screen.
  • The attacker can collect or solicit information via input and fake forms.
  • Others.

Froala’s latest release stops these attacks, making sure your content stays safe and your users are protected. Update to Froala 4.1.3 today and ensure a secure environment for your content to thrive.

Safari iPad Support

Froala is famous for working well on various platforms, and now we’ve added support for Safari on iPad. This means you can enjoy the same easy editing experience on your iPad as you do on your PC, creating, editing, and managing content with ease.

Improvements for table resizing

Tables are an important component of web content. Many users use tables for organizing and presenting data in a structured manner.

Froala simplifies the creation and editing of tables. In this release, we have made significant improvements to table resizing.  We’ve improved how you can resize tables, making it easier and more precise to adjust their size.  This ensures that you can create tables that perfectly fit your content and layout needs.

When it comes to table resizing, Froala empowers you with complete control. You have the capability to enable or disable cell resizing, as well as set the resizing offset and limit. To accomplish this, simply leverage the following API options:

  • tableResizer: Enables resizing table cells. By default it is true.
  • tableResizerOffset: The distance in pixels from the table cell’s left or right border to show the resizer. The default value is 5.
  • tableResizingLimit: The minimum width in pixels of a table cell is allowed while resizing. The resizer cannot be dragged over this limit. The default value is 20.

Improvements for content pasting from different sources

We understand it’s vital for users to copy and paste content without losing its look and quality. When it comes to pasting content from 3rd party tools, Froala is more efficient than TinyMCE and CKEditor. However, some users saw an error in the console when pasting from Word documents. 

By updating Froala 4.1.3, no errors will appear on the console after pasting content from Word. Moreover, we have improved the editor code to prevent the creation of unwanted newlines when users copy and paste text.

Also, in the past, some users had problems with pasted images being wider than the original when the imageOutputSize API option was set to true.  Enabling imageOutputSize sets the image width and height attributes but it shouldn’t change the image width when it is pasted. That’s exactly the behavior of the editor you will get when updating to Froala 4.1.3.

These updates help users copy and paste content without losing formatting or errors.

And More!

Fixed the issue where the editor could not convert external styles of HTML elements to inline when the useClasses API option was set to false.

It’s time to update!

Don’t miss out on the benefits of the latest Froala 4.1.3 release. Update today and experience a safer, more efficient, and smoother content editing platform.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to know how to download the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Technical Questions

Froala Blog Call To Action

How to customize Froala Image Edit Buttons in a React App

diagram

The Froala Editor lets users create and edit content with rich text formatting. One of its powerful features is the ability to work with images.

This article explains how to use Image Edit Buttons from Froala Editor in a React app project with a cheap react rich text editor.

Prerequisites

Before you get started, make sure you have the following prerequisites in place:

  • Node.js and npm are installed on your computer.
  • A React application set up.
  • Knowledge of React and HTML.
  • Setting up Froala Editor in a React App

First, we need to install the required packages. After that, we can initialize the Froala Editor.

We will make a React component called App.js. In this component, we will set up and use the Froala Editor along with the Image Edit Buttons.

1. Installation and Setup

First, install the required packages. You can do this by running the following command in your React project directory:

npm install react-froala-wysiwyg

cd react-froala-wysiwyg

npm install react-froala-wysiwyg --save

These commands install the Froala Editor and its React wrapper.

2. Importing Dependencies

In your App.js file, import the necessary dependencies.

Here’s the beginning of the file with the imports:

import { useState } from "react";

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import "froala-editor/js/plugins.pkgd.min.js";

import FroalaEditorImg from "react-froala-wysiwyg/FroalaEditorImg";


We imported useState from React to manage the component state in the code above.

We imported the react-froala-wysiwyg package’s styles, plugins, and components.

 

3. Setting Up the Component

Next, create the App component and set up the basic structure.

We’ll use the FroalaEditorImg component to render the Froala Editor. Here’s the code for the App component:

export default function App() {

  const [state, setState] = useState({

    src: "https://fakeimg.pl/350x200/?text=Click to test"

  });




  const handleModelChange = (model) => {

    setState({

      content: model

    });

  };




  const config = {

    imageEditButtons: [

      "imageReplace",

      "imageAlign",

      "imageCaption",

      "imageRemove",

      "|",

      "imageLink",

      "linkOpen",

      "linkEdit",

      "linkRemove",

      "-",

      "imageDisplay",

      "imageStyle",

      "imageAlt",

      "imageSize"

    ]

  };




  return (

    <div>

      <FroalaEditorImg

        config={config}

        model={state}

        onModelChange={handleModelChange}

      />

      <br /> <br />

    </div>

  );

}


Now, let’s break down the code step by step:

We start by defining the App component as a functional component.

Inside the component, we use the useState hook to manage the state.

The state object holds the initial image source, displayed in the editor.

export default function App() {

  const [state, setState] = useState({

    src: "https://fakeimg.pl/350x200/?text=Click to test"

  });

We define the handleModelChange function, which will be called when the editor content changes. In this function, we update the state with the new content.

  const handleModelChange = (model) => {

    setState({

      content: model

    });

  };

The config object holds the Froala Editor’s configuration, including the imageEditButtons property.

This property specifies the set of image editing buttons you want to display.

  const config = {

    imageEditButtons: [

      "imageReplace",

      "imageAlign",

      "imageCaption",

      "imageRemove",

      "|",

      "imageLink",

      "linkOpen",

      "linkEdit",

      "linkRemove",

      "-",

      "imageDisplay",

      "imageStyle",

      "imageAlt",

      "imageSize"

    ]

  };

Finally, we build the FroalaEditorImg element, passing as props the config, model, and onModelChange.

This component will display the Froala Editor with the specified image edit buttons.

  return (

    <div>

      <FroalaEditorImg

        config={config}

        model={state}

        onModelChange={handleModelChange}

      />

      <br /> <br />

    </div>

  );

}

Explaining the imageEditButtons Configuration

The imageEditButtons configuration is a crucial part of this implementation. It defines the set of buttons that will appear when you click on an image in the Froala Editor.

Let’s break down the buttons included in the configuration:

“imageReplace”: This button allows you to replace the selected image with a new one.

“imageAlign”: It enables you to set the alignment of the image (left, center, right, or justify).

“imageCaption”: This button adds a caption to the image.

“imageRemove”: It lets you remove the selected image.

“|”: The pipe character (|) is used to create a separator between groups of buttons.

“imageLink”: You can link the image to another URL.

“linkOpen”: This button opens the link in a new window or tab.

“linkEdit”: It allows you to edit the image’s link.

“linkRemove”: This button removes the link from the image.

“-“: The hyphen character (-) is used to create a separator between groups of buttons.

“imageDisplay”: It controls the display settings for the image, such as size and alignment.

“imageStyle”: You can apply custom styles to the image.

“imageAlt”: This button adds an alternative text (alt text) to the image, which is essential for accessibility.

“imageSize”: It allows you to adjust the dimensions of the image.

These buttons give users a variety of options for customizing and modifying photos within the Froala Editor.

Using the Froala Editor with Image Edit Buttons

Now that we’ve configured the Froala Editor with the desired image edit buttons, let’s discuss how to use the editor in your React app.

The FroalaEditorImg component is used to render the editor. Here’s how we set it up:

<FroalaEditorImg

  config={config}

  model={state}

  onModelChange={handleModelChange}

/>


We pass the config object as a prop, which contains our button configuration.

The model prop is set to state, allowing the editor to manage its content based on the state defined in the component.

The onModelChange prop is set to the handleModelChange function, which updates the state with the new editor content.

With this setup, the Froala Editor will be displayed with the specified image edit buttons, and you can interact with the image in various ways, as defined by the imageEditButtons configuration.

Testing the Implementation

To see the Image Edit Buttons in action, run your React app.

Make sure to start your development server using the following command:

npm start

This command will start your development server, and you should be able to access your React app in a web browser.

In your app, you’ll see the Froala Editor with the initial image and the configured Image Edit Buttons.

When you click on the image, the Image Edit Buttons will show up, allowing you to change the image, add a caption, align the image, and more.

As you make changes, the editor’s content will be updated, and you can observe this change in the handleModelChange function.

Froala image edit buttons

Conclusion

In this article, we have explained how to install Image Edit Buttons in a Froala Editor within a React app.

First, we set up the necessary dependencies.

Then, we configured the imageEditButtons property. We ended up using the FroalaEditorImg component.

It displays the editor and image editing options.

The imageEditButtons configuration has many image editing and customization features.

It is a powerful tool for working with images in your application.

By following the steps in this article, you can improve the user experience of your React app. Users will be able to edit and customize images.

You can also customize the image edit buttons to fit your needs.

Froala Editor User Experience Tips – part 2

froala tips and tricks

Froala WYSIWYG editor has a powerful API with over 240 API options, 100+ events, and 220+ methods. In the “Froala’s tips and tricks – part 1” article, We started to explain how to use the Froala editor API to maximize and enhance the user experience, usage, and productivity. We are excited to continue on this journey by uncovering more valuable tips and tricks of the Froala editor.

Highlighting and Beautifying HTML Code for a Seamless User Experience

WYSIWYG editors were invented to allow users to create rich-text content without needing to know HTML. However, for tech-savvy users or developers, Froala provides a built-in feature to write and edit the content HTML code.

When dealing with large amounts of content within the editor, modifying the HTML code can become quite challenging, even for experienced developers, unless it is properly highlighted and beautified.

To address this issue, Froala has developed the CodeBeautifier plugin, which helps in arranging the code in a more readable format. With the help of this plugin, users can easily comprehend and modify the structure of the HTML code.

Furthermore, it is easy to integrate Froala with codeMirror which highlights the code making the editing process quite handy for developers.

To integrate codeMirror with Froala, simply ensure that the necessary CodeMirror stylesheet and script files are included within your webpage before calling the Froala scripts.

  • Make sure to configure the following API options correctly:

Display Shortcut Commands Hints in the Froala Editor

Another user-friendly feature of the Froala editor is the ability to use shortcuts for quick and easy to perform many editor commands. For example, you can use the (Ctrl+B or ⌘ Cmd + B) shortcut to bold the selected text in the editor. Using shortcuts is a real time-saver and efficiency booster for your users who are familiar with these shortcuts.

Users may not know these shortcuts are available and they can use them. To help them, you can display the shortcut code in the button tooltip by setting the shortcutsHint API option to true.

new FroalaEditor('.selector', { shortcutsHint: true });

Now, when the user hovers over any toolbar options, they will see a tooltip with the corresponding keyboard shortcut, providing a quick reference for users who prefer to use the keyboard over the mouse.

However, users can see the full list of available shortcuts by clicking on the editor help button, displaying the shortcodes in the tooltip can be an effective way to educate users about these productivity features.

Control Froala Editor with External Buttons

When it comes to developing your app, you may encounter situations where you need to have control over certain editor actions through an external button. No problem, with Froala you can do this easily. Before invoking the external button function, you need to ensure that the editor is correctly loaded and retrieve the editor instance to access its methods. This can easily done inside the initialized API event.

Let’s say you want to clear the editor’s content using an external button. To achieve this, you’ll need to add a click event listener inside the editor-initialized event. This way, when the user clicks on the clear button, the event will be triggered and you can use Froala API’s html.set method to clear the editor content. This method allows you to set the editor’s content in HTML format. In our case, we want to clear the content, so we’ll call the method with an empty argument. Here’s an example:

const editorInstance = new FroalaEditor('#edit', {

  events: {

    initialized: function () {

      const editor = this

      document.getElementById('clearButton').addEventListener("click", function () {

         editor.html.set('')

        editor. events.focus()

      })

    }

  }

})

In the above example, by clicking on the button with ID ‘clearButton’, the editor content will be cleared and the editor will be focused, ready to accept new input from users.

You can perform different actions by utilizing different Froala API methods to manipulate the editor’s behavior.

These sorts of interactions may allow an enhanced, user-friendly navigation and editing experience.

Control Multiple Editors Using A Shared Toolbar

Yet another brilliant feature of the Froala Editor is the ability to use one toolbar to perform actions in multiple editor instances on the same page. This can be extremely useful in cases where you have different editable sections but want to have centralized control over them using one toolbar. This shared toolbar can be positioned anywhere on the webpage and works in sync with the active editor instance.

To set up a shared toolbar, you need to set the toolbarContainer API option to the CSS selector of the element you want to use as your toolbar. Here’s an example:

new FroalaEditor("#edit1, #edit, #edit2", {

   toolbarContainer: '#foo',

    toolbarButtons: [ ['bold', 'italic', 'underline', 'strikeThrough', 'textColor', 'backgroundColor', 'emoticons'], ['paragraphFormat', 'align', 'formatOL', 'formatUL', 'indent', 'outdent'], ['insertImage', 'insertLink', 'insertFile', 'insertVideo', 'undo', 'redo'] ]

})

In the above example, we created three different editors on the following elements `#edit1`, `#edit`, and `#edit2` on the page. The shared toolbar of the three editors is placed inside the `#foo` HTML element.

By using this shared toolbar, users will only need to familiarize themselves with one toolbar to manage multiple editors, simplifying their editing experience and promoting efficiency.

Remember as we discussed in a previous article, when you are using multiple instances of the Froala editor on the same page, it is better to set the initOnClick option to true to lazy load the editors and improve the page performance.

Make Your Froala Editor Toolbar Sticky for Easy Navigation

The toolbar is an important element in WYSIWYG editors. It is the element where buttons are available to allow users to interact with the content. In a case where you have a lot of content in the editor, the toolbar might disappear as users scroll down the page, leading to a less efficient and user-friendly experience.

To address this, Froala offers the stickyToolbar API option. When set to true, the toolbar will move as users scroll in the editor box. Here’s an example of how you can activate this feature:

new FroalaEditor('div#froala-editor', {

toolbarSticky: true

})

Boosting User Experience with Advanced Features and Customization Options

In this article, we have discussed various features of the Froala WYSIWYG editor that enhance the user’s editing experience. We have covered respective aspects like displaying shortcut hints, using external buttons to perform actions, controlling multiple editors with a shared toolbar, and finally, incorporating a scrollable toolbar for easy and efficient navigation. Using these features, developers can ensure their applications provide a user-friendly and efficient editing experience to their end-users.

Remember, the power of the Froala editor is not confined to these features alone. Froala offers a multitude of APIs and options that developers can utilize to tailor the editor’s behavior to the specific needs of their applications. Explore the Froala documentation now, try it for free, and when you are ready, pick a plan that suits your project needs to leverage the full capabilities of this powerful editing tool without the unlicensed banner.

Happy coding!

Creating React Rich Text Editor for Right-to-Left Languages

RTL rich text React editor

Web apps must be ready for diverse audiences in a globalized world, including those who read and write in RTL languages such as Arabic, Hebrew, and Persian.

Languages that are written and read from right to left are called RTL languages.

In contrast to left-to-right languages like English, where text flows from left to right, RTL languages follow a reversed direction.

This means that the first letter in a word is on the right side of the page. The other letters go to the left.

When a sentence starts, it begins on the right side and progresses to the left.

One phase example in Arabic:

هذا مثال على الجملة العربية.

This is an example of an Arabic sentence.

In any media written in RTL languages, text alignment, and layout are reversed compared to LTR languages.

The right margin is considered the “starting” point, and the text is aligned right-justified.

Numerical values are typically written with the most significant digit on the right.

React editor for RTL language

Introduction to Froala Editor

Froala Editor is a popular WYSIWYG (What You See Is What You Get) editor that allows users to create and edit rich content in a user-friendly way.

In this project, we will integrate the Froala Editor into a React application, a great way to empower users to create and format text and images with our react rich text editor.

For RTL languages, some additional configurations are needed.

Step 1: Set Up Your React Project

If you haven’t already, create a new React project using create-react-app:

npx create-react-app froala-rtl-editor

cd froala-rtl-editor

Step 2: Install Froala Editor

Next, install Froala Editor by running the following commands:

npm install react-froala-wysiwyg --save

Step 3: Configuration Froala Editor

Once installed, open the App.js file and now, you can import the Froala Editor styles and the React component:

import React from 'react'; 

import FroalaEditorComponent from 'react-froala-wysiwyg'; 

import 'froala-editor/css/froala_style.min.css'; 

import 'froala-editor/css/froala_editor.pkgd.min.css';

Now, you can use the FroalaEditorComponent in your React component’s method:

 

 

With this integration, you can have a basic Froala Editor running in your React application.

Step 4: Configuration RTF

The official Froala Editor documentation provides a comprehensive guide on how to configure the editor for RTL languages.

According to the documentation, you should set the direction property in the configuration object to ‘rtl’ to enable RTL mode:

  <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

          direction: 'rtl'

        }}

      />

    </div>

Running the Application

With the configuration and components in place, you can now start your React application:

npm start

Open your browser and navigate to http://localhost:3000 to see the Froala Editor integrated into your React app with RTL support.

RTL rich text react editor

Conclusion

This tutorial shows how to make a Froala Editor in a React app that supports right-to-left (RTL) languages.

Froala Editor is a strong tool for adding text editing features to your app. It can also be set up to work with RTL text, reaching more people.

Remember to customize the editor’s configuration to suit your specific project needs. Follow these steps to make your React application more accessible for RTL language users.

Gaining Comprehensive Control over Rich Text Editing with Froala React SDK Components

Froala React sdk components

Froala 4.1 brings support for the LTS version of React V18. With Froala 4.1 React SDK, integrating Froala into your React app is straightforward. The React SDK provides several components to enable rich-text editing capabilities as well as editing images, links, buttons, and inputs. In this article, we will explore the various components offered by the Froala React SDK and provide a comprehensive guide on how to effectively utilize them.

Intro

Before using any of the React SDK components, it is crucial to familiarize yourself with the Froala React integration process. Let me provide you with a quick overview of the essential steps that need to be followed before using the Froala React components.

  1. Install the Froala React SDK using
npm install react-froala-wysiwyg --save
  1.  Import the editor CSS stylesheets and the required plugin scripts
// Import the Froala Editor Stylesheet for displaying content outside the editor
import 'froala-editor/css/froala_style.min.css';


// Import the Froala Editor Stylesheet
import 'froala-editor/css/froala_editor.pkgd.min.css';


// Import all Froala Editor plugins;
import 'froala-editor/js/plugins.pkgd.min.js';

Froala React SDK components

Now we will be able to import and use the editor components.

Rich Text Editor Component

The text editor component is the cornerstone of Froala’s rich text editing capabilities. You can use it when you want to initialize the Froala WYSIWYG editor in your React app. Whether you want to use the full-featured WYSIWYG editor or make a customized version of it, this component is highly adaptable and configurable. It provides a host of options that allow you to custom-tailor the editor’s features to your specific use case. You can add or remove toolbar buttons, change the theme, or even set rules for HTML tag usage.

  1. Import the component
import FroalaEditorComponent from 'react-froala-wysiwyg';
  1.  Use it in your template where you want to display the editor
<FroalaEditorComponent

tag='textarea'

config={config}

model={model}

onModelChange={handleModelChange}

/>

The component has the following properties:

  • tag: used to tell on which tag the editor is initialized
  • config: used to customize the editor API options and events
  • model: used to hold the current value of the editor
  • onModelChange: a function triggered each time the value changes

Display Editor Content Component

Froala provides you with a component to display content created with the Froala editor

<FroalaEditor

model={content}

onModelChange={handleModelChange}

/>

Image Editor Component

The Image Editor component is another useful feature used to initialize the Froala editor on an image to enable image editing capabilities for your app. The users can replace and edit images directly in their content. The Image Editor supports various editing operations such as resizing, aligning, adding an image caption, adding an ALT keyword, and changing the image display property.

  1. Import the component
import FroalaEditorImg from "react-froala-wysiwyg/FroalaEditorImg";
  1. Use it in your template where you want to display the image editor
<FroalaEditorImg

config={config}

model={model}

onModelChange={handleModelChange}

/>

The component has the following properties:

  • config: used to customize the editor API options and events.

For image, button, input, and link components you can use reactIgnoreAttrs special API option to define the attributes that you want to ignore when the editor updates the froalaModel

config: {

reactIgnoreAttrs: ['class', 'id']

},
  • model: The model must be an object containing the attributes for your img tag
model={{

src: 'path/to/image.jpg',

width:"300px",

alt:"Old Clock"

}}
  • onModelChange: a function triggered each time the value changes

You can use the Image Editor Component to implement a free image uploader in your React app.

Full Image Editor Component Example:

import "./styles.css";

// Import the Froala Editor Stylesheet for displaying content outside the editor
import "froala-editor/css/froala_style.min.css";

// Import the Froala Editor Stylesheet
import "froala-editor/css/froala_editor.pkgd.min.css";

// Import all Froala Editor plugins;
import "froala-editor/js/plugins.pkgd.min.js";

import FroalaEditorImg from "react-froala-wysiwyg/FroalaEditorImg";

import { useState } from "react";

export default function App() {

const [state, setState] = useState({

src: "https://fakeimg.pl/350x200/?text=Click%20on%20me",

id: "froalaEditor",

tmpattr: "This attribute will be ignored on change."

});

const handleModelChange = (model) => {

setState({

content: model

});

};

const config = {

reactIgnoreAttrs: ["tmpattr"],

imageEditButtons: [

"imageReplace",

"imageAlign",

"imageCaption",

"imageRemove",

"|",

"imageLink",

"linkOpen",

"linkEdit",

"linkRemove",

"-",

"imageDisplay",

"imageStyle",

"imageAlt",

"imageSize"

]

};

return (

<div className="App">

<FroalaEditorImg

config={config}

model={state}

onModelChange={handleModelChange}

/>

<br /> <br />

<div> For More Info. Visit: https://froala.com/image-uploader/ </div>

</div>

);

}

Button Editor Component

The Button Editor component is a specialized component provided by Froala React SDK. It allows you to initialize the Froala editor on a button, offering custom button editing options.

  1. Import the component
import FroalaEditorButton from "react-froala-wysiwyg/FroalaEditorButton";
  1. Use it in your template where you want to display the button editor
<FroalaEditorButton

config={config}

model={model}

onModelChange={handleModelChange}

/>

The component has the following properties:

  • config: This is used to customize the editor API options and events
  • model: The model must be an object containing the attributes for your button tag. You can specify the button text using a special attribute named innerHTML which inserts the inner HTML of the element
model={{innerHTML: 'Click Me'}}
  • onModelChange: This is a function triggered each time the value changes

Full Button Editor Component Example:

import "./styles.css";

// Import the Froala Editor Stylesheet for displaying content outside the editor
import "froala-editor/css/froala_style.min.css";

// Import the Froala Editor Stylesheet
import "froala-editor/css/froala_editor.pkgd.min.css";

// Import all Froala Editor plugins;
import "froala-editor/js/plugins.pkgd.min.js";

import FroalaEditorButton from "react-froala-wysiwyg/FroalaEditorButton";

import { useState } from "react";

export default function App() {

const [state, setState] = useState({

innerHTML: "Click Me",

id: "myButton",

style: "color:red; padding:20px"

});

const handleModelChange = (model) => {

setState({

content: model

});

};

return (

<div className="App">

<FroalaEditorButton model={state} onModelChange={handleModelChange} />

</div>

);

}

Link Editor Component

The Link Editor component is another important part of the Froala React SDK, allowing the initialization of the Froala editor on hyperlink elements. With this, you can edit, remove, and style hyperlinks in your application content. The editor provides a range of options for hyperlink customization including URL entry, target attribute setting, and CSS class addition.

  1. Import the component
import FroalaEditorA from 'react-froala-wysiwyg/FroalaEditorA';
  1. Use it in your template where you want to display the link editor
<FroalaEditorA

config={config}

model={model}

onModelChange={handleModelChange}

/>

The component has the following properties:

  • config: This is used to customize the editor API options and events
  • model: The model must be an object containing the attributes for the hyperlink element. This could include the link URL, target attribute, and any CSS classes.
model={{

href: 'https://www.froala.com/',

target: '_blank',

}}
  • onModelChange: This is a function triggered each time the value changes

Full Link Editor Component Example:

import "./styles.css";

// Import the Froala Editor Stylesheet for displaying content outside the editor

import "froala-editor/css/froala_style.min.css";
// Import the Froala Editor Stylesheet

import "froala-editor/css/froala_editor.pkgd.min.css";

// Import all Froala Editor plugins;

import "froala-editor/js/plugins.pkgd.min.js";

import FroalaEditorA from "react-froala-wysiwyg/FroalaEditorA";

import { useState } from "react";

export default function App() {

const [state, setState] = useState({

innerHTML: "Click Me",

href: "https://www.froala.com/",

target: "_blank"

});

const config = {

linkEditButtons: ["linkOpen", "linkStyle", "linkEdit", "linkRemove"]

};

const handleModelChange = (model) => {

setState({

content: model

});

};

return (

<div className="App">

<FroalaEditorA

config={config}

model={state}

onModelChange={handleModelChange}

/>

</div>

);

}

Input Editor Component

The Input Editor component allows you to initialize the Froala editor on an input element of your React app, enabling customization of input fields. This is convenient when you want to provide users with a rich text input field instead of plain text.

  1. Import the component
import FroalaEditorInput from 'react-froala-wysiwyg/FroalaEditorInput';
  1. Use it in your template where you want to display the input editor
<FroalaEditorInput

config={config}

model={model}

onModelChange={handleModelChange}

/>

The component has the following properties:

  • config: This is used to customize the editor API options and events
  • model: The model must be an object containing the attributes of the input element.
model: {

placeholder: 'I am an input!'

}
  • onModelChange: This is a function triggered each time the value changes

Enhance Your React App with Powerful and Customizable Rich Text Editing Components

By using the Froala Editor React.js SDK, you gain a powerful set of tools to modify and enhance your app’s content, all with a high degree of customization. Whether you need to edit text, images, buttons, links, or inputs, Froala provides an effortless way to do so. With these components at your disposal, your React application can offer an enhanced user experience.

With its powerful and adaptable components, you will not only get an advanced WYSIWYG editor but also the ability to create an image uploader tool or a modern drag-and-drop webpage builder tool. Start your free trial now and experience the flexibility of Froala Editor SDK for React.js. Whether you’re building a blog, an e-commerce website, or any other web application that requires rich content editing, Froala Editor SDK for React.js is a tool worth considering.

Ultimate Guide to Migrating from TinyMCE to Froala in React

migrating from TinyMCE to Froala in React

In the latest release of Froala, version 4.1, we made a significant update by supporting the LTS React version among several other popular JavaScript frameworks. With this major update, we expect a considerable migration from TinyMCE to Froala. Whether you’re already a fan of Froala or currently facing challenges with TinyMCE and are considering a switch to Froala for your React app, this article aims to provide you with a smooth and efficient transition process. Throughout this guide, we will walk you through every step, ensuring a seamless migration from TinyMCE to Froala React SDK. From removing the TinyMCE component to installing and configuring the powerful Froala rich text editor React component, our goal is to equip you with the knowledge and confidence to make the switch.

 Why do users migrate from TinyMCE to Froala?

There are several reasons for users to migrate from TinyMCE to Froala, such as:

  1. Technology:
    Froala editor has its own unique way of handling content, leading to distinct and cleaner HTML outputs. Additionally, the Froala editor boasts different API structures. It introduces a developer-friendly API where its options, events, and methods are comprehensive and easy to use. This API enables effortless customization of the editor’s functionality and allows for the creation of custom elements and plugins, empowering developers with endless possibilities.
  2. Transparent Pricing:
    Froala distinguishes itself with a transparent pricing model that guarantees no hidden fees. Moreover, in all plans, all of Froala’s plugins are included, and there are no restrictions on editor usage. In contrast, TinyMCE’s pricing plans come with limitations on the number of page loads. For instance, the free plan only allows for 1000-page loads. For example, a company with 10 users each loading a page containing the TinyMCE editor 10 times per day, would exhaust the capacity in just 10 days, forcing them to pay $40 for an additional 1000 loads. This would result in a monthly expense of $80, or a whopping $960 annually. Remarkably, the cost of Froala’s professional plan is actually lower than this. What’s more, the free Tinymce plan is limited to a single domain, lacks access to all plugins, and does not provide professional support.
  3. Multiple React components:
    In contrast to Tinymce, Froala React SDK stands out for its versatility, offering not just one but multiple React components. These components include a main component for rendering the editor, a component to preview the editor’s content, and some special components for initializing the editor on the <img>, <button>, <input>, and <a> HTML elements. With Froala React SDK, you’re equipped with a powerful toolkit to enhance both the functionality and presentation of your content.
  4. Design:
    The Froala UI has gained immense popularity among users for its sleek and captivating design. From its modern flat layout to captivating SVG icons, Froala Editor truly stands apart from other options available. Its design has particularly caught the attention of users in search of a clean and contemporary interface, making it an appealing choice for a wide range of individuals.

    1. Toolbar:
      Froala’s innovative toolbar ingeniously organizes the vast array of features into four distinct and conveniently grouped context categories: Text, Block, Media, and More. By using this simple yet intuitive toolbar, your navigation through the editor becomes effortless. You still have the option to customize it displaying only the toolbar buttons you needed.
    2. Responsive UI
      The Froala toolbar takes user experience to a whole new level with its seamless and user-friendly design. It cleverly adapts to your screen width, ensuring a perfect fit for any device. It’s like having a personal assistant that knows exactly what buttons you need the most. With just one click, you can access a plethora of features that are neatly organized, making content editing a breeze. Whether you’re on a tablet or a phone, the Froala toolbar guarantees optimal navigation and editing, regardless of screen size. On the other hand, TinyMCE maintains its toolbar buttons but struggles to adjust the toolbar width based on screen size, often leading to the annoyance of a horizontal scrollbar. This cluttered layout can be a real hassle for users trying to find specific buttons, ultimately slowing down their content editing process. Choose Froala and enjoy an efficient and hassle-free editing experience!
  5. Feature quality:
    It is crucial to understand that even if two editors have a feature with identical or similar names, their functionalities may differ. This emphasizes the importance of testing each feature in both editors instead of assuming they will produce equivalent results. For instance, when we examined how each editor handles content pasted from third-party tools, Froala effectively maintained the pasted content styles. On the other hand, TinyMCE, which named its feature “PowerPaste” and made it a premium feature, failed to do so. View the comparison results here.
  6. Other reasons
    Many reasons could make users migrate from TinyMCE to Froala. Share your thoughts in the comments section and let us know why you are considering migrating from TinMCE to Froala.

Migration Fron TinyMCE to Froala

How to migrate from TinyMCE to Froala in a React app?

The migration from TinyMCE to Froala is easy and straightforward. Follow these steps for a hassle-free process:

Uninstall TinyMCE Vue NPM Package

the initial task would involve uninstalling Tinymce from your application. In case you are using npm, you can execute the following command within your local project directory to successfully uninstall Tinymce

npm uninstall -g @tinymce

This will remove the TinyMCE React package as well as remove it from the application’s list of dependencies.

Install Froala React NPM Package

The next step in transitioning from TinyMCE to Froala is to install the Froala React NPM package in the application. To install Froala, use the following command:

npm install react-froala-wysiwyg

After the installation process is completed, you can find the react-froala-wysiwyg folder inside your npm_modules folder.

Replace TinyMCE with Froala in your components

The final step involves replacing any references to TinyMCE in your components with Froala.

Remove TinyMCE component Import statements

Search for the line

import { Editor } from "@tinymce/tinymce-react";

and replace it with the import of Froala component, stylesheets, and required plugins

// Require Editor CSS files.
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';

// Import all Froala Editor plugins
// Note: you can import a single plugin if needed
import 'froala-editor/js/plugins.pkgd.min.js';


//import Froala component
import FroalaEditorComponent from 'react-froala-wysiwyg';

Substitute all instances of TinyMCE with Froala

Search for <Editor which defines the TinyMCE component inside the template files and replaces it with the <FroalaEditorComponent. The two components have different tags. Therefore, it is important to replace these tags. Here is a list of TinyMCE tags and how we should handle them when migrating to Froala.

Before we start, let us consider an example of the TinyMCE Editor component:

class App extends Component {

constructor() {

  super();

}

render() {

 return (

   <Editor

     apiKey="limjfdlb66u3w96h1skw5m93kdvmf55zt4ohb3ol4jeb3q6m"

     cloudChannel='5-stable'

     disabled={false}

     initialValue='test initialValue'

     inline={false}

     onEditorChange={ }

     plugins=''

     tagName='div'

     textareaName=''

     toolbar=''

     value=''

     outputFormat='html'

     init={{

         height: 500,

         menubar: false,

         plugins: [

                   'advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak', 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'emoticons', 'template', 'help'

                  ],

         toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullscreen | forecolor backcolor emoticons | help',

     }}

   />

  );

 }

}

render(<App />, document.getElementById('root'));

Some of the tags will no longer be needed when migrating to Froala. Go ahead and remove them directly. they are:

  • api-key
  • cloudChannel
  • disabled
  • output-format
  • scriptLoading
  • tinymceScriptSrc
  • rollback
  • textareaName

For other tags:

id

This tag is used in both components to define the “id” attribute of the element that the editor is initialized on; therefore, we keep it as it is.

init

TinyMCE uses this property for setting the editor options. for example:

 

<editor

init = {{
        width: 600,
        height: 300,
        plugins: [

            'advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak', 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'emoticons', 'template', 'help'

        ],

        toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullscreen | forecolor backcolor emoticons | help',

        menu: {

            favs: {
                title: 'My Favorites',
                items: 'code visualaid | searchreplace | emoticons'
            }

        },

        menubar: 'favs file edit view insert format tools table help',

        content_css: 'css/content.css'

    }}

/>

When migrating to Froala, find the equivalent Froala API option and use it inside the config parameter of the Froala component

<FroalaEditorComponent
config = {{
        width: 600,
        height: 300,
        pluginsEnabled: [
            'lists', 'link', 'image', 'imageManager', 'charCounter', 'fullscreen', 'lineBreaker', 'codeBeautifier', 'codeView', 'colors', 'draggable', 'video', 'table', 'emoticons', 'wordPaste'
        ],
        toolbarButtons: {
            'moreText': {
                'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'clearFormatting']
            },
            'moreParagraph': {
                'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
            },
            'moreRich': {
                'buttons': ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'insertHR']
            },
            'moreMisc': {
                'buttons': ['undo', 'redo', 'fullscreen', 'selectAll', 'html', 'help'],
                'align': 'right',
                'buttonsVisible': 2
            }
        }
    }}
/>

In case the selector property is defined in TinyMCE init, this should be passed to the tag prop of the Froala component as it represents the HTML element where the editor will be initialized at.

For example, the below code

<editor

init = {{

        selector: 'textarea',

        width: 600,

        height: 300,

        menu: {

            favs: {
                title: 'My Favorites',
                items: 'code visualaid | searchreplace | emoticons'
            }

        },

        menubar: 'favs file edit view insert format tools table help',

        content_css: 'css/content.css'

    }}

/>

Should be converted to

<FroalaEditorComponent

tag = 'textarea'

config = {{

        width: 600,

        height: 300,

    }}

/>
inline

Used by TinyMCE to set the editor to inline mode. In Froala, set the toolbarInline: true inside the config tag options object.

Example:

<editor

   inline={true}

/>

This will be converted to

<FroalaEditorComponent

   config={{toolbarInline: true}}

/>
tagName

Is an optional prop to define the HTML element for the editor in the inline mode instead of using selector inside the init prop.

When you are migrating to Froala, the tagName value should be passed to the tag prop for the Froala component.

For example, the below code

<editor

inline={true}

tagName='div'

/>

Should be converted to

<FroalaEditorComponent

tag='div'

config={{toolbarInline: true}}

/>
initialValue

The initial content of the editor when the editor is initialized. Assign the initial value to the “model” prop for the Froala component.

Example

<Editor

initialValue='<p>Once upon a time...</p>'

/>

This will be converted to

<FroalaEditorComponent

tag='div'

model="<p>Once upon a time...</p>"

/>
plugins

Used to include plugins for the editor. In Froala, set the pluginsEnabled API option to the equivalent Froala plugins and add it within the config prop.

It is important to note that certain core functionalities of TinyMCE are implemented through plugins in Froala; while some functionalities provided by Froala plugins are already available by default in TinyMCE.

For example, TinyMCE has font size as a core function, whereas a Froala plugin is required to add this option.

Example

<Editor

plugins="emoticons wordcount help code lists"

/>

Will converted to

<FroalaEditorComponent

config={{ pluginsEnabled: ['emoticons', 'charCounter', 'help', 'codeView', 'lists'] }}

/>
Toolbar

Used to set the editor toolbar buttons. while migrating your code to Froala, configure the Froala toolbarButtons API option with the desired buttons and add it to the config prop.

In Froala, you can also set the toolbarButtonsMD, toolbarButtonsSM, and toolbarButtonsXS API options to customize the toolbar buttons based on the screen size.

Example:

<editor

 toolbar="bold italic underline code"

/>

Will be converted to

<FroalaEditorComponent 
config={{ toolbarButtons: ['bold', 'italic', 'underline', 'html'] }}
/>
 Events

Examine the events being used and locate their corresponding names in the Froala API events list. It may also be necessary to alter the function assigned to the event. In this case, some Froala API methods can be used to achieve the desired functionality.

Example:

<Editor onClick={this.handlerFunction} />

Will be converted to

<FroalaEditorComponent config={{ events: { 'click':handlerFunction } }} />
Full Code Example

Considering all these changes, now let’s see an example of how the code will change after migrating the TinyMCE React component to the Froala React component.

import React, { Component } from 'react';
import { render } from 'react-dom';
import { Editor } from "@tinymce/tinymce-react";

class App extends Component {
    constructor() {
        super();
    }

    render() {
        return ( <Editor
           apiKey = "limjfdlb66u3w96h1skw5m93kdvmf55zt4ohb3ol4jeb3q6m"
            cloudChannel = '5-stable'
            disabled = {
                false
            }
            initialValue = 'test initialValue'
            inline = {
                false
            }
            onEditorChange = {}
            plugins = ''
            tagName = 'div'
            textareaName = ''
            toolbar = ''
            value = ''
            outputFormat = 'html'
            init = {{
                    height: 500,
                    menubar: false,
                    plugins: [

                        'advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak', 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'emoticons', 'template', 'help'

                    ],

                    toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullscreen | forecolor backcolor emoticons | help',
                }}
            />
        );
    }
}

render( < App / > , document.getElementById('root'));

 

This will be converted to

import React, { Component } from 'react';
import { render } from 'react-dom';

// Require Editor CSS files.
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';

// Import all Froala Editor plugins
// Note: you can import single plugin if needed
import 'froala-editor/js/plugins.pkgd.min.js';

//import Froala component
import FroalaEditorComponent from 'react-froala-wysiwyg';

class App extends Component {
    constructor() {
        super();
    }

    render() {
        return ( <FroalaEditorComponent
            model = "test initialValue"
            tag = "div"
            init = {
                {
                    Key: "***", //Editor Key
                    height: 500,
                    pluginsEnabled: [
                        'lists',
                        'link',
                        'image',
                        'imageManager',
                        'charCounter',
                        'fullscreen',
                        'lineBreaker',

                        'codeBeautifier',
                        'codeView',
                        'colors',
                        'draggable',
                        'video',
                        'table',
                        'emoticons',
                        'wordPaste',
                    ],

                    toolbarButtons: {
                        moreText: {
                            buttons: [
                                'bold',
                                'italic',
                                'underline',
                                'strikeThrough',
                                'clearFormatting',
                            ],
                        },

                        moreParagraph: {
                            buttons: [
                                'alignLeft',
                                'alignCenter',
                                'formatOLSimple',
                                'alignRight',
                                'alignJustify',
                                'formatOL',
                                'formatUL',
                                'paragraphFormat',
                                'paragraphStyle',
                                'lineHeight',
                                'outdent',
                                'indent',
                                'quote',
                            ],
                        },

                        moreRich: {
                            buttons: [
                                'insertLink',
                                'insertImage',
                                'insertVideo',
                                'insertTable',
                                'emoticons',
                                'insertHR',
                            ],
                        },

                        moreMisc: {
                            buttons: [
                                'undo',
                                'redo',
                                'fullscreen',
                                'selectAll',
                                'html',
                                'help',
                            ],

                            align: 'right',

                            buttonsVisible: 2,
                        },
                    },
                }
            }
            />
        );
    }}

render( < App / > , document.getElementById('root'));
 Still Need Help?

Are you using custom plugins? This tutorial will help you to migrate them to Froala.

For more information, we check our migration from TinyMCE to the Froala feature matching guide.

With these implementations, your transition from TinyMCE to Froala should be complete!

Testing and Verifying Your Changes

After switching from TinyMCE to Froala, check all updates are functioning properly. Test the editor function and confirm that the application works the same or better than before.

Conclusion

Integrating Froala into your React app is a seamless process that will not only simplify your editing tasks but also boost the productivity of your React app. With Froala, you gain access to a wide range of comprehensive tools designed specifically for efficient rich text editing. Switch from TinyMCE to Froala now and leverage the robust features that define Froala.

Maximize User Experience with Froala WYSIWYG Editor – part 1

Froala's tips and tricks

Froala is a great WYSIWYG editor that is used by numerous users to create rich content. Developers use its powerful API to create an intuitive editing experience specific to their project usage case. You can customize the Froala WYSIWYG editor in a variety of ways to meet the needs of your project. In this article, we will discuss some tips and tricks to enhance your users’ usage and productivity.

Edit Link Attributes

Froala is used to edit links through a simple pop-up. By default, the pop-up only allows you to set the URL and the text of the link with an option to open the link in a new tab. Your users could be disappointed if they would like to edit more link attributes such as the title, rel, and class attributes. You may not know, but you can display more attributes in the Froala edit link pop-up easily using the link attributes API option. This option accepts an object with additional attributes that could be customized for a link.

In case you want to add the ability to change the link title attribute, you’ll need to set the linkAttributes like:

new FroalaEditor('textarea.edit', {

linkAttributes: {

title: 'Enter Title'

},

});

Now, if you try to insert or edit a link in your Froala editor, you will see an additional field asking for a ‘Title’. Similarly, you can add other attributes such as the link’s rel, target, and class attributes with more control over the customization. This not only simplifies the editing process but also enhances the user experience.

Setting a Character Limit in Froala for Efficient Content Management

This tip is useful if you are using Froala as an input and want to limit the number of characters that your users can enter. Often, this is important to maintain the required number of the database field. Many developers don’t know that implementing a character limit is pretty straightforward in Froala.

You can use the charCounterMax API option to restrict your users from adding more than a specified number of characters to their content. To implement this, you need to add the charCounterMax option to your Froala editor.

new FroalaEditor('textarea.edit', {

charCounterMax: 500,

});

In this case, users cannot add over 500 characters to the content. If they try to go beyond the set limit, the editor will not accept additional characters.

You can go beyond this and provide a custom message to users when they hit the maximum limit. This can be done by customizing the charCounter.exceeded API event which is triggered when the charCounterMax value is exceeded. For simplicity, you can display an alert with a “You have exceeded the max character limit” message when the limit is reached:

new FroalaEditor('textarea.edit', {

charCounterMax: 500,

events: {

'charCounter.exceeded': function () {

alert('You have exceeded the max character limit');

},

},

});

Here, an alert will pop up once users hit the limit, helping them recognize and adjust their text to the specified character restriction.

You’re not allowed to enter more than 70 characters.

Tips and tricks - Froala

Customizing Text Color to Match Your Brand

Froala allows you to choose from a wide set of colors for text editing by default. Additionally, a text box is available for typing any Hex color code. However, there might be situations where you want to limit the color options, such as maintaining consistency with your brand identity or simplifying the user interface.

To set the limitation on text colors, you can modify the colors option in your Froala editor settings. You will need to specify the colors in an array and assign them to the colorsText API option then hide the HEX input to enter a custom color by setting the colorsHEXInput API option to false.

new FroalaEditor('textarea.edit', {

colorsText: ['#61BD6D', '#1ABC9C', '#54ACD2', '#2C82C9', '#2B272B'],

colorsHEXInput: false,

});

With this setup, users can only choose from the five different colors specified in the array when coloring their text.

Try to change the text color.

Improves the page performance with editor lazy loading

Lazy loading is a technique that allows you to defer the initialization or loading of an object or a resource until it is actually needed. Lazy loading aims to save memory and bandwidth, as it avoids loading unnecessary data or code. If you are searching for a way to lazy load Froala editor, you don’t need to look far away.

Froala supports this functionality right out of the box. You just need to set the initOnClick option in your Froala editor instance. By setting this option to true, the editor will initialize only the basic code when the page is loaded and the rest of the code when clicking in the editable area.

This can greatly improve the performance of your page, especially if you have multiple instances of the Froala editor on the same page.

new FroalaEditor('textarea.edit', {

initOnClick: true

});

Disable Right Click within the editor

For some websites or applications, disabling right-click within the editor may be necessary to avoid undesired user actions such as copying, pasting, or inspecting the HTML code. This also makes it possible to override the default browser menu with a custom one from your creation.

Fortunately, Froala provides an easy method to achieve this. By setting the disableRightClick API to true, whenever users right-click within the editor, no contextual menu will pop up.

new FroalaEditor('.selector', {

disableRightClick: true

});

Disabling this option is also recommended if you are using the inline mode and you set the toolbarVisibleWithoutSelection to Keep the editor visible next to the cursor even when there is no selection.

To create a custom action instead of the default browser context menu, you can first detect if the user right-clicked the editor by listening for the mousedown event and checking if the right mouse button was pressed, then do whatever you want. Here is an example:

new FroalaEditor('textarea.edit', {

disableRightClick: true,
events: {

'mousedown': function (e) {

if (e.which == 3) {

console.log('Right-click detected.');

}

}

},

});

In the above example, the console will log a message every time the user right-clicks within the editor.

Conclusion

Froala is an excellent WYSIWYG editor that gives you a range of customization options to suit your unique needs. With its friendly UI and rich features, it allows you to enhance the editing process and improve the overall user experience. Whether it is setting character limits, customizing text colors, lazy loading for improved performance, or disabling right-click for more control, Froala’s functionalities pay heed to every minor detail. Master these tips, and you can maximize the potential of content management with Froala.

Try experimenting with these features and witness how Froala transforms your regular content into interactive and engaging ones. Remember, the ability to adapt and customize according to your requirements is what makes an editor truly powerful. And, Froala stands out in this aspect. Start your free trial now!

Character Counter for Froala Editor in Angular App Project

Character Counter

Integrating Character Counter on Froala WYSIWYG Editor Running on an Angular App Project

Froala WYSIWYG Editor is a powerful and customizable  angular rich text editor that can enhance the text editing experience in your Angular applications.

One useful feature that you may want to add is the Character Counter plugin to keep track of the number of characters in the editor.

In this tutorial, we’ll walk you through integrating the Character Counter plugin from Froala into your Angular app editor.

Prerequisites

Before we begin, make sure you have the following prerequisites:

  • Node.js and npm (Node Package Manager) are installed on your system.
  • Angular CLI (Command Line Interface) is installed on your machine.

If you haven’t installed it, you can do so using the following command:

npm install -g @angular/cli

Now, you can create a new Angular app using the Angular CLI:

ng new myApp

cd myApp

Replace “my-app” with your preferred app name.

Character Counter

Step 1: Installing Froala WYSIWYG Editor

In your Angular app project, navigate to the project root folder and install Froala WYSIWYG Editor using npm:

npm install angular-froala-wysiwyg

This command will install the required packages for Froala integration.

Step 2: Update index.html

Open the index.html file in your project’s src folder and add the following code inside the <head> tag:

<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>MyApp</title>

  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="icon" type="image/x-icon" href="favicon.ico">

  <link href="node_modules/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet">

</head>

<body>

  <app-root></app-root>

</body>

</html>

This code includes the Froala Editor CSS stylesheet.

Step 3: Update app.module.ts

Open the app.module.ts file in your project’s src/app folder and make the following changes:

import { NgModule } from '@angular/core';

import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';

import 'froala-editor/js/plugins.pkgd.min.js'; 

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';


@NgModule({

  declarations: [AppComponent],

  imports: [

    BrowserModule,

    FroalaEditorModule.forRoot(),

    FroalaViewModule.forRoot(),

  ],

  providers: [],

  bootstrap: [AppComponent],

})

export class AppModule {}


In this code, we import the Froala Editor module and configure it using FroalaEditorModule.forRoot() and FroalaViewModule.forRoot().

Step 4: Update angular.json

Open the angular.json file in your project root folder and add the Froala Editor CSS styles to the “styles” array:

"styles": [

  "src/styles.css",

  "node_modules/froala-editor/css/froala_editor.pkgd.min.css",

  "node_modules/froala-editor/css/froala_style.min.css"

],

This ensures that the Froala Editor styles are included in your Angular app.

Step 5: Update app.component.html

Open the app.component.html file in your project’s src/app folder and add the following code:

<div class="content" role="main">

  <div [froalaEditor]="options" [(froalaModel)]="editorContent"></div>

</div>

This code creates a div element with the [froalaEditor] directive to initialize the Froala Editor component.

Step 6: Update app.component.ts

Open the app.component.ts file in your project’s src/app folder and replace its contents with the following code:

import { Component } from '@angular/core';

@Component({

  selector: 'app-root',

  templateUrl: './app.component.html',

  styleUrls: ['./app.component.css'],

})

export class AppComponent {

  editorContent = '<a href="https://froala.com/">Froala Angular WYSIWYG Editor</a>';

  public options: Object = {

    events: {

      'froalaEditor.contentChanged': function () {

        console.log('Content updated!');

      }

    }

  };

}

We import the necessary Angular module and define the AppComponent class. We set the editorContent variable with the initial HTML content for the Froala Editor.

We define the options object to specify event handling.

In this example, we’ve added a content change event that logs a message when the editor’s content changes.

Step 7: Include the Character Counter plugin

To enable the character counter feature, you need to configure the options object in your component’s TypeScript file. Here’s an example:

import { Component } from '@angular/core';

@Component({

  selector: 'app-root',

  templateUrl: './app.component.html',

  styleUrls: ['./app.component.css'],

})

export class AppComponent {

  editorContent = '<a href="https://froala.com/">Froala Angular WYSIWYG Editor</a>';

  public options: Object = {

    charCounterCount: true,

    charCounterMax: 140,

    events: {

      'froalaEditor.contentChanged': function () {

        console.log('Content updated!');

      }

    }

  };

}


In this example, we set charCounterCount to true to enable the character counter. You can also specify the charCounterMax property to define the maximum character limit for your editor.

This plugin serves a specific purpose: it enables you to limit the number of characters that users can input or edit within the WYSIWYG editor.

  • Character Limitation: The primary function of the char_counter.min.js plugin is to enforce a character limit. This is particularly useful when you want to restrict the amount of text or content that users can add to a specific area, such as a comment box, a description field, or any other input field where text input needs to be controlled.
  • Real-Time Character Count: The plugin typically provides a real-time character count feature. It counts and displays the number of characters currently entered or edited by the user. This count is often displayed near the editor, allowing users to monitor their input as they type.
  • Limit Exceedance Handling: When the user exceeds the specified character limit, the plugin can be configured to prevent further input or display a warning or error message. This ensures that users know the limit and can’t go beyond it.
  • Customization: Depending on the plugin’s capabilities and the integration into your application, you may have options to customize the appearance and behavior of the character counter, such as changing the color or style of the counter display or the error message.
  • Ease of Use: Implementing this plugin is usually straightforward. You include the plugin’s JavaScript file in your project, initialize it, specify the character limit, and set up any event handlers or display elements as needed.

Step 8: Run Your Angular App

With all the necessary changes made, you can now run your Angular app:

npm start

This command will start a development server, and your app will be available at http://localhost:4200/ by default.

Froala Character Counter plugin

Conclusion

You have successfully integrated Froala WYSIWYG Editor into your Angular app.

Now, when you navigate to your app’s URL, you will see the Froala Editor in action, complete with the initial content and event handling as configured.

The Character Counter plugin is a valuable tool for enforcing character limits and providing real-time character count feedback within a WYSIWYG HTML editor.

It helps maintain content quality, prevents excessive input, and enhances the user experience when dealing with text or content input fields in web applications.

Froala WYSIWYG Editor provides a wide range of features and customization options, allowing you to create rich text editing experiences tailored to your needs.

Explore the Froala documentation for more details on how to utilize its features in your Angular application.

Customizing Link Styles with Froala WYSIWYG Editor in React

Customizing Link Styles

The Froala WYSIWYG Editor streamlines content creation and editing for websites. Its vast array of features positions it as a go-to for developers keen on integrating rich text editing into their web platforms. One standout feature allows users to style links using custom CSS classes through the “linkStyles” configuration option.

Introduction

What is Froala WYSIWYG Editor?

The Froala WYSIWYG Editor is a robust HTML text editor that simplifies content creation and editing on websites.

It offers a wide range of features, making it a popular choice for developers looking to implement a rich text editing experience in their web applications.

Why Customize Link Styles?

Tailoring link styles ensures your website maintains a polished, consistent appearance. With the Froala Editor, you can set distinct link styles – from text decorations to color – aligning with your site’s branding and aesthetics, enriching the visitor’s experience.

Customizing Link Styles in Froala & Vue

Prerequisites

Before we dive into the implementation, ensure you have the following prerequisites in place:

  • Node.js and npm (Node Package Manager) are installed on your machine.
  • A basic understanding of React and how to create React applications.
  • Access to the Froala WYSIWYG Editor React component.

Setting Up the React Project

Let’s begin by creating a new React project and integrating the Froala WYSIWYG Editor as your react rich text editor.

Follow these steps:

  • Create a new React app using Create React App or your preferred method:
npx create-react-app froala-link-styles-demo

cd froala-link-styles-demo
  • Install the Froala WYSIWYG Editor React component and its dependencies:
npm install react-froala-wysiwyg --save
  • Import the necessary styles and the FroalaEditorComponent into your src/App.js file:
import './App.css';

import FroalaEditorComponent from "react-froala-wysiwyg";

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import "froala-editor/js/plugins.pkgd.min.js";

In your src/App.js file, create a React functional component (App) and configure the FroalaEditorComponent with the “linkStyles” option:

function App() {

  let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

  return (

    <div id="froala-editor">

      <h1>Froala WYSIWYG Editor</h1>

      <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

        }}

      />

    </div>

  );

}


In the config object of the FroalaEditorComponent include this example of the code of the “linkStyles”.

linkStyles: {

  className1: 'Class 1',

  className2: 'Class 2'

},

This code sets up a basic React component with the FroalaEditorComponent and configures the “linkStyles” option to apply two custom CSS classes: Class 1 and Class 2 to links.

In your src/App.css file, define the custom CSS classes (className1 and className2) that you want to apply to links:

.className1{

  text-decoration: underline dotted red;

}

.className2 {

  color: green;

}

In this example, className1 adds an underline dotted in red to the links, while className2 changes the link text color to green.

You can customize these styles to suit your design preferences.

Testing the “linkStyles” Feature

Now that you’ve set up the project and configured the Froala WYSIWYG Editor with the “linkStyles” option, you can test it by running your React application:

npm start

This will start your development server, and you can access your app in a web browser.

You should see the Froala WYSIWYG Editor with the custom link styles applied when you insert or edit links within the editor.

In our example, links will have underlines dotted red and green text color, reflecting the styles defined in the className1 and className2 CSS classes.

Customizing Link Styles in Vue and Froala

Additional Styling Options

You can further enhance your link styling by modifying the CSS classes defined in src/App.css. Experiment with different CSS properties to achieve the desired visual effects.

For example, you can change the font size, and font family, or add hover effects to your links.

The “linkStyles” configuration applies styles to newly inserted or edited links within the Froala editor.

To style existing links in your content, you can use the editor’s built-in tools to select and apply the desired link styles.

Conclusion

In this tutorial, you learned how to use the “linkStyles” configuration option in the Froala WYSIWYG Editor React component to apply custom CSS classes to links.

By following these steps, you can enhance the styling of links within the editor to match your application’s design requirements.

Froala’s rich features make it a powerful tool for implementing a WYSIWYG editor in your React projects.

Customizing link styles in the Froala WYSIWYG Editor for React is a valuable feature for creating visually appealing and consistent web content.

In this guide, we’ve covered the step-by-step process of implementing custom link styles in a React app project using the FroalaEditorComponent.

You’ve learned how to set up the project, define custom CSS classes, and configure the editor to apply these styles to links.

By following these instructions and experimenting with advanced customization options, you can create a rich text editing experience that seamlessly integrates with your website’s design and enhances the user experience.

The Froala WYSIWYG Editor, combined with React, provides a powerful toolset for building feature-rich web applications with beautifully styled content.

 

Froala Blog Call To Action

Web Editing with Froala’s Special Tags in Vue App

Froala’s Special Tags in Vue

The people who are crazy enough to think they can change the world are the ones who do

— Steve Jobs.

When the Froala WYSIWYG editor idea started, many WYSIWYG editors were already on the market. The goal wasn’t to add another standard editor. We were obsessed with offering an out-of-box experience that would revolutionize web editing. It was founded on improving the drawbacks and exposing the strengths of the pre-existing editors, including TinyMCE.

From introducing the most mobile-friendly editor toolbar to being the first WYSIWYG editor with the popup with formatting controls appearing the same on mobile devices as on desktops, Froala continued pushing the boundaries in ways never seen before in the WYSIWYG editor market. With every update and new feature added, the underlying goal was to enhance the web editing process for the end-users and developers alike. Ensuring that, as Steve Jobs said, we are “the ones who do”.

Vue SDK special tags

Froala initialization modes

While other WYSIWYG editors were developed to provide the same user interface regardless of the HTML element they initialized on, Froala innovated this, making initializing the editor on different HTML elements generate a different user interface suitable for editing that element specifically.

For example, initializing the editor on the HTML <a> element will not open the full editor with the hundreds of toolbar buttons. Instead, it will display Froala’s Edit Link popup, which easily lets you change the URL and display the text of the hyperlink. This focus on user-centered design facilitated ease of interaction and enhanced the user experience tenfold.

<script>

var editor = new FroalaEditor('a#example');

</script>

If you prefer a more comprehensive editing experience, you can easily initialize the editor on a ‘textarea’ or a regular ‘div’ element.

<script>

var editor = new FroalaEditor('textarea#example');

</script>

In <img> element instance, when Froala initializes, it brings up a simple window to replace the image, adjust its alignment, insert alt text, and other relevant properties.

<script>

var editor = new FroalaEditor('img#example');

</script>

Besides the <img> and <a> HTML tags, it also outputs a specific user interface when used on the <button> and <input> elements.

This flexibility to adopt initiative UI depends on the specific HTML element it initializes upon distinguishing Froala from many of its competitors. It underlines our commitment to offering a highly personalized experience that eases and expedites the editing process for the end user.

This flexibility allows Froala to be used as a standalone Image uploader or in building a modern drag-and-drop web page builder.

How to implement initialization modes in the Vue app?

First, let us quickly recap how we can add Froala to a Vue app. It is a simple 3-step process:

  1. Install the Froala package via NPM. Use the command
    npm install vue-froala-wysiwyg

    in the terminal to download and add it to your project’s node_modules folder.

  2. After successfully installing the package, you need to import it into your main.js file. Add the code below to complete this:
    import { createApp } from "vue";
    
    import App from "./App.vue";
    
    //Import Froala Editor plugins
    
    import "froala-editor/js/plugins.pkgd.min.js";
    
    // Import Froala Editor css files.
    
    import "froala-editor/css/froala_editor.pkgd.min.css";
    
    import "froala-editor/css/froala_style.min.css";
    
    // Import Froala Editor component
    
    import VueFroala from "vue-froala-wysiwyg";
    
    const app = createApp(App);
    
    app.use(VueFroala);
    
    app.mount("#app");
  3. Finally, to display the editor, all you need to the Froala component inside your template
    <froala tag=’textarea’ :config="config"></froala>

    See the following complete example:

    <template>
      <img alt="Vue logo" src="./assets/logo.png">
      <froala id="edit" :tag="'textarea'" :config="config" v-model:value="model"></froala>
    </template>
    
    <script>
    
    export default {
      name: 'App',
      data () {
        return {
          config: {
              toolbarButtons: {
    
                'moreText': {
    
                  'buttons': [ 'italic', 'underline', 'bold', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting']
    
                },
    
                'moreParagraph': {
    
                  'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple']
    
                },
    
                '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
    
                }
    
              },
            events: {
              initialized: function () {
                console.log('initialized')
              }
            }
          },
          model: '<i>Edit Your Content Here!</i>'
        }
      }
    }
    </script>
    
    <style>
    #app {
      font-family: Avenir, Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-align: center;
      color: #2c3e50;
      margin-top: 60px;
    }
    </style>
    

The Froala Vue component attributes are:

  •  `tag` – This should match the HTML element on which you want to initialize the editor. By default, the tag is ‘textarea’. We set its value to ‘a’, ‘img’, ‘button’, or ‘input’ which we call the special tags, to implement the other initialization modes.
  •  `config` – This is an optional attribute where you can pass the Froala configuration options.
  •  v-model – Using this with the ‘froala’ component, Vue can handle automatic synchronization between the component and its underlying data model. This proves useful when integrating Froala alongside other components within your Vue application, as it promotes interactive and dynamic content creation.

Special tags

The Froala editor Vue special tags are img, button, input, and a tags. using these tags you can have different initialization modes. In this case, there are some considerations:

  1. The model must be an object containing the attributes for your special tags.
  2. The model can contain a special attribute named innerHTML which inserts innerHTML in the element, for example, If you are using ‘button’ tag, you can specify the button text like this
    buttonModel: {
    
    innerHTML: 'Click Me'
    
    }
  3. Froala provides an additional option when using special tags. This option is
    vueIgnoreAttrs
    : (default: null) This option is an array of attributes that you want to ignore when the editor updates the v-model:

    config: {
    
    vueIgnoreAttrs: ['class', 'id']
    
    }

Examples of using special tags:

  1. Img

<template>
  <froala
    id="edit"
    :tag="'img'"
    :config="imageOptions"
    v-model:value="imgModel"
  ></froala>
</template>

<script>
export default {
  name: "app",

  data() {
    return {
      imgModel: {
        src: "https://fakeimg.pl/350x200/?text=Click%20on%20me",
      },

      imageOptions: {
        vueIgnoreAttrs: ["style"],
      },
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;
}
</style>

In the above example,  we have set the :tag attribute to “img”.

<froala :tag="img" :config="imageOptions" v-model:value="imgModel"></froala>

The model must be an object containing the attributes for your special tags. In the case of the img element, you must declare the “src“ attribute so you can render the image.

imgModel: {

src: "https://fakeimg.pl/350x200/?text=Click%20on%20me",

}

Note, the model will change as the attributes change during usage.

and we used the special option vueIgnoreAttrs to preventStyle” from being updated in the model.

imageOptions: {

vueIgnoreAttrs: ["style"],

},

When you run your Vue app, you’ll see an image. Clicking on it will open the Froala edit image popup, allowing you to replace the image, add ALT text, insert a caption, and more.

  1. Button

<template>
  <froala id="edit" :tag="'button'" v-model:value="buttonModel"></froala>
</template>

<script>
export default {
  name: "app",

  data() {
    return {
      buttonModel: {
        innerHTML: "Click Me",
      },
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;
}
</style>

In the above example, you can see we have set the :tag attribute to “button”.

<froala id="edit" :tag="'button'" v-model:value="buttonModel"></froala>

We used the model’s special attribute “innerHTML” to specify the button

buttonModel: {

innerHTML: 'Click Me'

},

As the editor changes the button text, the innerHTML attribute from buttonModel model will change too.

When you run your Vue app, you’ll see a button with the text ‘Click me‘. Clicking on it will open a popup to update the button text.

  1. input tag

<template>
  <froala id="edit" :tag="'input'" v-model:value="inputModel"></froala>
</template>

<script>
export default {
  name: "app",

  data() {
    return {
      inputModel: {
        placeholder: "I am an input!",
      },
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;
}
</style>

In the above example, you can see we have set the :tag attribute to “input”.

<froala id="edit" :tag="'input'" v-model:value="inputModel"></froala>

We used the model to set the input placeholder attr

inputModel: {

placeholder: 'I am an input!'

},

This will show an input field with the placeholder text “I am an input!”. Clicking on it will open a popup to update the input text.

  1. a tag

<template>
  <froala id="edit" :tag="'a'" v-model:value="linkModel"></froala>
</template>

<script>
export default {
  name: "app",

  data() {
    return {
      linkModel: {
        href: "https://www.froala.com/wysiwyg-editor",
      },
    };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;
}
</style>

In the above example, you can see we have set the :tag attribute to “a”.

  <froala id="edit" :tag="'a'" v-model:value="linkModel"></froala>

We used the model to assign the href attribute to the desired URL.

      linkModel: {
        href: "https://www.froala.com/wysiwyg-editor",
      },

This will show a link named “My link” and has the URL “https://www.froala.com/wysiwyg-editor”. When this link is clicked, the Froala edit link popup will open allowing the link’s properties to be updated.

Easily edit multiple HTML elements

These examples illustrate how you can simplify the task of revising HTML tags in your Vue app while maintaining a dependable link to v-model values. This enables faster, more reactive application updates with minimal effort. Whether it’s tweaking an image property, editing button text, adjusting a link, or updating an input text, Froala provides a seamless and intuitive editing experience. By utilizing special tag attributes in combination with v-model, you can instantly reflect changes made in the editor on your Vue App. The potential of this feature paves the way for more flexible, user-friendly applications enhanced by real-time responses and modifications.

Start using the Froala editor Vue SDK now.

Learn how to migrate From TinyMCE to Froala.

Here are several Froala Vue WYSIWYG editor examples you can try:

Froala 4.1.2 release – Typescript Support Enhancements

graphical user interface

A new Froala Editor release is here, packed with exciting TypeScript support enhancements. Say hello to Froala 4.1.2. This new version has a lot of improvements to quality and stability, as well as fixes for our customers’ reported issues. Stay connected with our team to ensure swift, high-quality releases tailored to your needs.

Besides updating the index.d.ts file, this release includes:

  • Improved link paste function.
  • Enable font size adjustments for non-editable content.
  • And More..

Update your editor now to enjoy a better editing experience. To help you update your editor as smoothly as possible, we’ve added a detailed section at the end of the post.

A Deep Dive Into The New Froala Editor V4.1.2

Froala new release

Complete missing type definitions.

We have introduced Typescript support in the 4.1 release. For developers who prefer using TypeScript during web development. This significantly enhances their workflow and productivity. TypeScript offers strict type checking, improved error detection, and enhanced tooling, which not only makes code maintenance easier but also provides developers with better code suggestions and auto-completion.

In the 4.1.1 release, we have addressed major gaps in our type definitions, making it much better.

With this latest Froala Editor release, we have updated the index.d.ts file to include the missing method definitions, resulting in a smoother and more efficient development experience. Get ready to amplify your TypeScript capabilities as you dive into this incredible update!

Examples of methods that have been fixed are as follows:

And you should no longer see the following errors:

  • Property 'el' does not exist on type 'FroalaEditor'.
  • Argument of type 'Partial<RegisterCommandParameters>' is not assignable to parameter of type 'FroalaEditor'.
  • Property '$box' does not exist on type 'FroalaEditor'.
  • Property '$wp' does not exist on type 'FroalaEditor'.

Improved link Plugin

The Froala’s link plugin is one of the most used features in text editing. It not only lets you conveniently insert and edit hyperlinks within the Froala Editor but also it is used to insert a predefined style to your links.

But the superiority of Froala’s link plugin doesn’t end here; it also enables creating a set of predetermined links, which users can choose from when adding or editing a link.

This plugin comes with a powerful API options, for example, you can:

  • Specify if the links should always be open in a new tab.
  • Specify that the rel="nofollow" attribute should be added on all links
  • Let the editor convert the inserted email addresses to mailto: links.
  • Disables adding the noopener attribute when a link opens in a new tab
  • Disables adding the noreferrer attribute when a link opens in a new tab.
  • Sets the default URL prefix.
  • Specify the attributes that could be customized for a link.

Click on the link to see all the Froala’s link options.

The plugin also provides powerful API methods and events such as triggering an event when a bad link is typed for insertion into the Froala Rich Text Editor.

In this release, we improved the link-pasting function and fixed the link plugin’s stopped-working issue when using V4.1 in Iframe mode.

Improved Link Pasting

When using the Froala WYSIWYG editor, a handy trick to enhance productivity is to paste a URL directly into the editor, and immediately start typing right after the pasted URL without adding a space, your text will automatically become part of the link. This feature saves you time and effort by eliminating the need to open the edit link popup. Moreover, the latest update has made this even more user-friendly as it now even works if you type a comma after pasting the link.

This release also cleans the pasted link encoding so that (amp) in the pasted link will no longer add an extra amp; on the HTML code.

Fix the Link Plugin Incompatibility with Iframe Mode in Froala v4.1.

Iframe mode in Froala Editor ensures better isolation and prevents potential interference with other stylesheets loaded on the page. You can turn it on by configuring the `iframe` option to `true` in the initialization options.

<script>

new FroalaEditor(‘div#froala-editor’, {

iframe: true

})

</script>

However, in v4.1, there were some issues reported regarding the incompatibility of the link plugin when operating in the iframe mode.

In this 4.1.2 update, we have efficiently resolved this issue, reinforcing the efficiency of the link plugin under this mode. Therefore, web developers can now relish an uninterrupted, seamless editing experience with Froala, be it in standard or iframe mode.

Enable font size adjustments for non-editable content.

Many developers set some editor content inside contenteditable=false elements. This helps maintain parts of the content non-modifiable. Developers usually use this when they want to provide templates to users where they can simply fill in relevant information without touching the template’s format.

With the new upgrade in V4.1.2, we’ve enabled font size adjustments for non-editable content. This update allows you to change the font size of text living in contenteditable=false elements while maintaining its uneditable nature.

Bug Fixes

We believe in continuous progress. Therefore, we’ve tracked down and remedied several bugs and issues that users reported. These include:

  • Fix the issue where the text color breaks when there is another attribute than style
  • Fix the issue where users cannot select text using the Left Arrow and Shift combination

We appreciate your continuous support and engagement with Froala.

How Can I Update?

We’ve streamlined the process to make it hassle-free. Just head over to our dedicated page for each framework SDK, where you’ll find detailed instructions on installing or updating to the latest version. Follow the links below to get started.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Technical Questions

Download Froala Editor

Effortlessly Migrate from TinyMCE to Froala in Your Vue App

Migration from TinyMCE to Froala in a Vue app

When we released Froala 4.1, which supports the LTS Vue version and many other popular JS frameworks, we anticipated significant migration from TinyMCE to Froala. Whether you are a fan of Froala or currently experiencing issues with TinyMCE and looking to switch to Froala for your Vue app, this article aims to provide you with a smooth and efficient transition process. We will guide you through every step, starting from removing TinyMCE to installing and configuring the Froala editor. By the end of this article, you should be able to switch your TinMCE editor to Froala with confidence and ease.

 Why do users migrate from TinyMCE to Froala?

There are several reasons for users to migrate from TinyMCE to Froala, such as:

  1. User Interface:
    Many users like the Froala UI. From the flat design to eye-catching SVG icons, Froala clearly stands out. The design of Froala Editor attracts many users who want a clean and modern interface.

    1. Smart Toolbar:
      The Froala Editor boasts an ingenious smart toolbar that organizes its myriad of features into four conveniently grouped context categories: text, block, media, and more. This simple yet intuitive toolbar ensures effortless navigation, as every feature is effortlessly locatable.
    2. Responsive:
      The Froala Toolbar offers a seamless and user-friendly experience by automatically adapting to the user’s screen width. It intelligently displays only the most commonly used buttons, while hundreds of other features are one click away. This is particularly useful for users working on tablets or phones, as it ensures optimal navigation and editing regardless of the screen size of the device.
      In contrast, TinyMCE maintains the toolbar buttons but adjusts the toolbar width based on the screen size, often resulting in the need for a horizontal scrollbar. This can make it challenging for users to locate specific buttons among the clutter, ultimately slowing down the content editing process.
  2. Used Technology:
    Both editors are Javascript editors but handle content differently. This results in a different HTML output for each editor. Moreover, these editors possess different API structures, which affects how developers can work with them. Many developers prefer easy use of the Froala API. This allows for easy customization of the editor’s function and the creation of custom elements or plugins.
  3. Transparent Pricing:
    Froala plans have a clear pricing model. There are no hidden costs, all Froala’s plugins are included, and there is no limitation on the editor’s usage. In contrast, TinyMCE plans are limited to a certain number of page loads. For example, their “Free“ plan is restricted to 1000 page loads.
    If a small-scale company with 10 users and each user loads a page containing the TinyMCE editor 10 times per day, they will reach the maximum editor-load limit in just 10 days. To continue using TinyMCE, they would need to pay $40 for another 1000 loads, resulting in a monthly cost of $80 or an annual cost of $960. This is actually higher than the cost of the Froala Professional plan.
    In addition, the free TinyMCE plan is limited to one domain, lacks access to all plugins, and does not include professional support.
    (Note: The mentioned prices are due date:8th of September 2023. prices could change later.)
  4. Feature quality:
    It is important to note that even if both editors share a feature with the same or similar name, their behaviors may vary. This highlights the significance of testing each feature in both editors, rather than assuming that they will deliver the same level of quality. For instance, we conducted a thorough examination of how each editor pastes content from third-party tools. However, TinyMCE named its feature “PowerPaste“ and made it a premium feature (Included on their Perfossional plan), yet it failed to maintain the pasted content styles as effectively as Froala did. To view the detailed results of our comparison, click here.
  5. Multiple Vue components:
    Unlike TinyMCE, which only has a single Vue component for rendering the editor, Froala SDK offers multiple Vue components. In addition to the component for rendering the editor itself, Froala provides a component for rendering editor content outside the editor to make it easy to display the editor content for viewers. Furthermore, the Froala component enables a special rendering mode for the editor on the img, button, input, and <a> tags.
  6. Other reasons
    There are many reasons that we will not cover here because we want to focus on learning how to migrate from TinyMCE to Froala. Share your thoughts in the comments section and let us know why you are migrating from TinMCE to Froala.

Migration from TinyMCE to Froala

How to migrate from TinyMCE to Froala in a Vue app?

The migration from TinyMCE to Froala is easy and straightforward. Follow these steps for a hassle-free process:

Uninstall TinyMCE Vue NPM Package

The first step in migrating from TinyMCE to Froala in your Vue application involves uninstalling TinyMCE. Uninstalling TinyMCE involves removing it from the application’s list of dependencies as well as deleting any references to it in your project.

Use your package manager to uninstall TinyMCE. If you are using npm, you can run the following command in your local project directory to uninstall TinyMCE:

npm uninstall -g @tinymce

Inside your npm_modules folder, you should find the “@tinymce“ folder is removed or empty.

Install Froala Vue NPM Package

The next step in transitioning from TinyMCE to Froala is to install the Froala Vue NPM package in the application. To install Froala, use the following command:

npm install vue-froala-wysiwyg

After the installation process completes, you can find the “vue-froala-wysiwyg” folder inside your npm_modules folder.

Replace TinyMCE with Froala in your components

The final step involves replacing any references to TinyMCE in your components with Froala.

Begin by deleting the import component statements associated with Tinymce and importing the Froala component instead. It is important to note that there is a distinction in how each editor’s component is imported. Usually, the Tinymce component is imported within a <script use> tag in the specific component where Tinymce will be utilized. On the other hand, it is preferable to import the Froala Vue component in the main.js file, where we use app.use() to globally install and load all Froala components throughout the entire Vue application.

Remove TinyMCE component

Search for the line

import Editor from '@tinymce/tinymce-vue';

and remove all the instances from your Vue applications.

Import Froala in your Vue App

In order to use Froala in your Vue application, it must be properly integrated. This involves importing the Froala WYSIWYG editor styles files into your application.

Open the main.js file and Import the Froala component, plugin files, and its styles using these lines of code:

//Import Froala Editor plugins

import 'froala-editor/js/plugins.pkgd.min.js';

// Import Froala Editor css files.

import 'froala-editor/css/froala_editor.pkgd.min.css';

import 'froala-editor/css/froala_style.min.css';

// Import Froala Editor component

import VueFroala from 'vue-froala-wysiwyg';

Once imported, make sure to pass it in the app.use() method.

app.use() is used to install the Froala components to the entire Vue application, not to a single component

const app = createApp(App);

app.use(VueFroala);

app.mount('#app');

Substitute all instances of TinyMCE with Froala in your template files.

Search for <Editor which defines the TinyMCE component inside the template files and replace it with the <froala. The two components have different tags. Therefore, it is important to replace these types of tags. Here is a list of TinyMCE tags and how we should handle them when migrating to Froala.

Before we start, let us consider an example of the TinyMCE Editor component:

<Editor

api-key="your-api-key"

cloud-channel="6"

:disabled=false

id="uuid"

:init="{

selector: 'textarea',

plugins: 'lists link image paste help wordcount',

toolbar: 'undo redo | blocks | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | help'

}"

initial-value="Once upon a time..."

:inline=true

@click="handlerFunction"

/>

Some of the tags will no longer be needed when migrating to Froala. Go ahead and remove them directly. they are:

      • api-key
      • cloud-channel
      • disabled
      • output-format
      • tinymce-script-src
      • model-events
id

This tag is used in both components; therefore, we keep it as it is.

tag-name

Is used to define the HTML element for the editor in the inline mode. Replace it with :tag. If it is not defined use :tag=textarea

init

This is the object sent to the tinymce.init method to initialize the editor. It contains the editor options. for example

<editor

:init="{

selector: '#myTextarea',

width: 600,

height: 300,

plugins: [

'advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak',

'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime',

'media', 'table', 'emoticons', 'template', 'help'

],

toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | ' +

'bullist numlist outdent indent | link image | print preview media fullscreen | ' +

'forecolor backcolor emoticons | help',

menu: {

favs: { title: 'My Favorites', items: 'code visualaid | searchreplace | emoticons' }

},

menubar: 'favs file edit view insert format tools table help',

content_css: 'css/content.css'

}"

/>

The most commonly used options are selector, plugins, toolbar, menu, and menubar. We will cover the equivalent for plugins and toolbar options in Froala below.

Because Froala displays only a toolbar, menu and menubar options will be removed.

For the selector option, add its value to the :tag attribute.

For other options like height, find the equivalent Froala API option and use it instead. In this case, Froala also uses the height option to set the editor height.

initial-value

The initial content of the editor when the editor is initialized. Put the initial value inside the component tag.

Example: using initial-value
<editor

initial-value="Once upon a time..."

/>

This will be converted to

<froala>Once upon a time...</froala>
v-model

Replace it with v-model:value

inline

Used to set the editor to inline mode. In Froala, set the toolbarInline: true inside the :config tag options object.

Example:
<editor

:inline=true

/>

This will converted to

<froala

:config="{toolbarInline: true}"

></froala>
plugins

Used to include plugins for the editor. In Froala, set the pluginsEnabled API option to the equivalent Froala plugins and add it to the :config tag options object.

It is important to note that certain core functionalities of TinyMCE are implemented through plugins in Froala; while some functionalities provided by Froala plugins are already available by default in TinyMCE.

For Example, TinyMCE has font size as a core function, whereas a Froala plugin is required to add this option.

Example:
<editor

plugins="emoticons wordcount help code lists"

/>

It will be converted to

<froala   :config="{ pluginsEnabled: ['emoticons', 'charCounter', 'help', 'codeView', 'lists'] }" > </froala>
toolbar

Used to set the toolbar for the editor. In Froala, set the toolbarButtons API option with the equivalent Froala toolbar buttons and add it to the :config tag options object.

In Froala, you can also set the toolbarButtonsMD, toolbarButtonsSM, and toolbarButtonsXS API options to customize the toolbar buttons based on the screen size.

While the toolbar attribute in the <editor> component accepts a string, the Froala toolbarButtons options accept arrays.

Example:
<editor

toolbar="bold italic underline code"

/>

Will converted to

<froala :config="{ toolbarButtons: ['bold', 'italic', 'underline', 'html'] }" > </froala>
Events

In the TinyMCE <editor> component, you will find event names declared after the @ symbol, such as:

<editor @click="handlerFunction" />

However, in Froala, Events are declared in the event objects inside the option object that is passed to the tag attribute.

So to migrate events, you will need to check which events are used and find the equivalent event name from the Froala API events list. It may also be necessary to alter the function assigned to the event. In this case, some Froala API methods can be used to achieve the desired functionality.

Example: migrating events

In TinyMCE:

<editor    @click="handlerFunction" />

In Froala:

<froala :config="{ events: { 'click':handlerFunction } }"  ></froala>
Full Example

Considering all these changes, now let’s see an example of how the <Editor> tag in TinyMCE will look after modification to <froala> in our Vue template.

Considering the following TinyMCE config

<Editor

cloud-channel=6

disabled =false

id="uuid"

:disabled=false

api-key="no-api-key"

:init="{

selector: 'textarea',

height: 300,

}"

plugins="emoticons wordcount help code lists"

toolbar="bold italic underline code"

initial-value="Once upon a time..."

:inline=true

@click="handlerFunction"

/>

The corresponding Froala config will be as follows:

<froala

tag='textarea'

:config="{

heightMax: 300,

pluginsEnabled: ['emoticons', 'charCounter', 'help', 'codeView', 'lists'],

toolbarButtons: [['bold', 'italic', 'underline'],['html']],

toolbarInline: true,

events: { 'click':handlerFunction }

}"

:id="uuid"

>Once upon a time...</froala>
Still Need Help?

Are you using custom plugins? This tutorial will help you to migrate them to Froala.

For more information, we check our migration from TinyMCE to the Froala feature matching guide.

With these implementations, your transition from TinyMCE to Froala should be complete!

Testing and Verifying Your Changes

After migrating from TinyMCE to Froala, ensure that all changes are working correctly. Test all editor features and verify whether the application behaves the same or better than before.

Conclusion

By switching from TinyMCE to Froala, you can now leverage the robust features that define Froala.

Integrating Froala into your Vue app is smooth, and straightforward, and actually enhances the productivity of your Vue app. Froala provides you with comprehensive tools to tackle rich text editing tasks efficiently. So make the switch and watch your Vue application thrive with Froala.

Inline React Editor: Using Froala’s Inline Mode Guide

Inline React Editor

In web development, creating a seamless editing experience is often a necessity.

Whether you’re building a content management system (CMS), a blog platform, or a collaborative document editor, providing a feature-rich and intuitive inline text editor can enhance the user experience.

One tool that stands out for this purpose is the Froala WYSIWYG Editor, which offers an Inline React Editor mode that allows you to embed rich text editing capabilities into your React applications.

In this article, we’ll delve into how to use Froala’s Inline Mode in a React App project.

Froala inline mode in React

What is the Froala WYSIWYG Editor?

Before diving into the intricacies of implementing Froala’s Inline Mode in a React-based application, it’s crucial to understand what the Froala WYSIWYG Editor brings to the table.

Froala is more than just another text editor; it’s a powerful JavaScript library designed to deliver a high-quality, user-friendly WYSIWYG (What You See Is What You Get) experience. Unlike traditional text editors, Froala allows for seamless text editing and formatting right within web applications, mimicking the features and capabilities of a full-fledged word processor.

One of the standout features of Froala is its flexibility.

Spotlight: Inline Mode

One feature that deserves special mention is Froala’s Inline Mode. This mode allows you to embed the editor directly within the text of your web page. Instead of switching to a separate editing interface, users can edit text on-the-fly, making the user experience more intuitive and less disruptive.

Setting Up Your React App

To get started with using Froala’s Inline Mode in a React application, you first need to set up your project.

If you haven’t already created a React app, you can do so using Create React App or your preferred method.

Once your project is ready, follow these steps to integrate Froala into your app:

Step 1: Installation

You can install the Froala WYSIWYG Editor for React by running the following command in your project directory:

npm install react-froala-wysiwyg --save

Step 2: Adding the Editor

In the component where you want to use the Froala Inline Editor, import Froala features and code the component:

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import FroalaEditorComponent from "react-froala-wysiwyg";

function App() {

  let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

  return (

    <div id="froala-editor">

          <h1>Froala WYSIWYG Editor </h1>

          <h2>Tutorial about Inline React Editor</h2>

      <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

        }}

      />

    </div>

  );

}

export default App;

In this code snippet, we code the necessary components and plugins for the Froala editor.

Froala React editor

The toolbarInline: true configuration option is what enables the Inline Mode.

    <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

          toolbarInline: true

        }}

  />

Inline React editor

Understanding the final component line-by-line

This code is a simple React application that uses the Froala WYSIWYG Editor to render a rich text editor on a web page. Let’s break down the code step by step:

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

These lines import the necessary CSS stylesheets for the Froala WYSIWYG Editor. These styles define the appearance and layout of the editor.

import FroalaEditorComponent from "react-froala-wysiwyg";

This line imports the FroalaEditorComponent from the “react-froala-wysiwyg” library.

This component is a React wrapper for the Froala WYSIWYG Editor, allowing you to integrate it into your React application.

Define the App component:

function App() {

This is a functional React component named App. It’s the entry point of your application.

let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

Here, a string variable named model is defined, which contains HTML content. This HTML content will be displayed in the Froala WYSIWYG Editor when the component is rendered.

Render the component:

return (

<div id="froala-editor">

<h1>Froala WYSIWYG Editor</h1>

<h2>Tutorial about Inline React Editor</h2>




<FroalaEditorComponent

tag="textarea"

model={model}

config={{

toolbarInline: true

}}

/>

</div>

);

The return statement contains JSX code that defines the structure of the rendered component.

Inside the div with the id “froala-editor,” there are two heading elements (h1 and h2) providing some context about the editor.

The FroalaEditorComponent is used to render the Froala WYSIWYG Editor itself. It is configured as follows:

  • tag="textarea": This specifies that the editor should be rendered as a textarea element.
  • model={model}: This sets the initial content of the editor to the HTML content stored in the model variable.
  • config: This is an object that specifies configuration options for the editor. In this case, it sets toolbarInline to true, indicating that the toolbar should be displayed inline with the editor.

Export the App component:

export default App;

This exports the App component so that it can be used in other parts of the application or imported into other files.

In summary, this code sets up a simple React application that displays a Froala WYSIWYG Editor with some initial HTML content.

Users can interact with the editor to edit and format text as needed. The editor’s appearance and behavior are controlled by the configuration options provided in the config object.

You can further customize the editor by adding or removing plugins and adjusting configuration settings to suit your project’s requirements.

Customizing the Inline React Editor

The power of the Froala Inline Mode lies in its customizability. You can tailor the editor’s behavior, appearance, and functionality to align perfectly with your project’s requirements. Let’s explore some common customizations you might want to consider:

1. Adding Custom Buttons

One of the most common customizations is adding custom buttons to the editor’s toolbar. This allows you to extend the editor’s functionality beyond the default options.

2. Customizing Styles and Formatting

Froala allows you to customize the available text formatting options, such as font size, font family, and text color. You can also define custom styles for your project.

3. Image and Media Handling

Integrating media handling capabilities into your inline editor can greatly enhance its usefulness. Froala supports image and media embedding, allowing users to add images, videos, and other multimedia content directly into the text.

Conclusion

Incorporating an Inline React Editor into your web application using Froala’s Inline Mode is a powerful way to enhance the user experience and provide rich text editing capabilities.

With its flexibility, customization options, and straightforward integration, Froala makes it relatively simple to create a feature-rich text editor that suits your project’s needs.

Throughout this article, we’ve covered the essential steps for setting up the Froala Inline Mode within a React application.

We’ve also explored various customization options, from adding custom buttons to handling media uploads, and discussed how to handle user-generated content.

By following these guidelines and experimenting with Froala’s extensive documentation and examples, you’ll be well on your way to implementing a seamless and user-friendly inline text editor in your React project.

Whether you’re building a CMS, a collaborative writing platform, or any application requiring rich text editing, Froala’s Inline Mode can be a valuable addition to your toolkit.

Why Froala 4.1.1 is Essential: A Quick Recap

graphical user interface, application

Hello developers! A while back, we unveiled Froala V4.1.1, an iteration that succeeded our much-acclaimed V4.1 release. In case you missed out, this update came with a host of improvements designed to give you an unparalleled coding experience. Today, we’re revisiting the groundbreaking features of this update, paying special attention to TypeScript and Angular. Let’s dive in!

A Quick Flashback to Froala 4.1 and TypeScript

Froala 4.1 made a big move by supporting TypeScript. Why is that cool? TypeScript makes coding easier and faster. Here’s how:

  1. Smart Tips: TypeScript is like a smart buddy who helps you code. It gives you hints that can help you avoid mistakes.
  2. Error-Checking: TypeScript checks your code while you’re writing it, helping you catch errors before they become big problems.
  3. Better Auto-complete: This isn’t just regular auto-complete. TypeScript’s suggestions are really on point, which makes finding code easier.

But wait, not everything was perfect. People who used Froala with Angular had some issues. That’s where the new update, Froala 4.1.1, comes in to fix those problems.

What’s New in Froala 4.1.1?

TypeScript is Now Even Cooler

First, let’s talk about TypeScript again. In this new 4.1.1 update, TypeScript support is upgraded, and it’s extra helpful if you’re using Angular. Ever run into issues like wrong definitions or missing bits in the index.d.ts file? The 4.1.1 update fixes those problems. That means Froala and Angular’s TypeScript get along really well now. It’s a smooth ride!

More Goodies for Angular Coders

Moving on, if you’re an Angular developer, you’re in for a treat. The 4.1.1 update makes dealing with toolbar buttons a breeze. To get this new feature, all you need to do is add Froala’s plugin scripts to your app.module.ts file. So, it’s gotten a lot easier and more flexible to use.

 

import 'froala-editor/js/plugins/align.min.js';

You can activate additional buttons like align right, align left, center, and justify. If you want the full package, use this import statement:

import 'froala-editor/js/plugins.pkgd.min.js';

With 4.1.1, you now have the power to tweak the editor’s toolbar using the toolbarButtons API option. By setting this option, you can specify which toolbar buttons appear and where. Here’s an example:

<div [froalaEditor]="options" [(froalaModel)]="content"></div>

 

Fixing TypeScript Definitions

One of the most underappreciated but vital updates in 4.1.1 was the refinement of TypeScript definitions. For example, numerous properties were added or edited:

FE.DEFAULTS

FE.DefineIcon

FE.DefineIconTemplate

FE.END_MARKER

FE.KEYCODE

FE.MARKERS

FE.PLUGINS

FE.POPUP_TEMPLATES

FE.RegisterCommand

FE.RegisterQuickInsertButton

FE.RegisterShortcut

FE.START_MARKER

If you were experiencing errors while creating custom buttons or plugins, 4.1.1 is your go-to solution.

Extra Content: Why this is a big deal

Easy-to-Add Features with Modular Design

First off, Froala 4.1.1 has a modular design. What’s that mean? It means you can pick and choose just the features you need. This is great for working with modern JavaScript frameworks like Angular, which also love modularity. For example, you can add just the pieces you need for your Froala editor, making your app quicker to load. Plus, TypeScript makes this process safer and more predictable.

Handle Tasks that Take Time Smoothly with Asynchronous Support

Next up, Froala 4.1.1 is ready for tasks that take some time to complete, like pulling in data from a website. It uses something called JavaScript Promises to make these tasks go smoothly. TypeScript adds another layer of safety here, helping you avoid mistakes when you’re handling these tasks. For example, you can set up rules for what kind of data you’re expecting, making it less likely you’ll run into errors later on.

Keep Up with Real-Time Changes Using Observables

Lastly, if you’re an Angular developer, you’ll be happy to hear about the Observables feature. Observables help you manage changes in your app in real-time. Froala 4.1.1 works really well with Angular’s Observables. You can tie them into Froala’s events, making your app more interactive and dynamic. Picture this: you can auto-save content or update your app’s look in real-time. And again, TypeScript makes this all easier and safer to manage.

Why You Should Update Now

First things first, updating to Froala Editor 4.1.1 is super important. It’s not just another regular update. Think of it as adding a turbo boost to your coding tools, especially if you’re using TypeScript or Angular. We’ve even got a step-by-step guide at the end of our original post to help you with the update.

Time to Wrap It Up

In conclusion, the 4.1.1 version isn’t just a small tweak. It’s like redoing the whole thing to make your coding life better. So if you haven’t updated yet, you really should. You’ll get to see all the cool stuff Froala Editor has to offer.

Happy coding!

Download Froala Editor

Document Ready Mode on a Froala Component in Your React App

Document Ready React editor

Rich text editors are indispensable tools for creating, editing, and formatting content.

These editors empower users to craft appealing and structured text without needing in-depth knowledge of HTML and CSS.

Froala is a tool that provides a powerful and customizable rich text editing experience, and it integrates with React applications.

One of its features is the Document Ready mode, which simplifies document view.

In this article, we’ll explore how to use the Document Ready mode of Froala in your React project app.

What is Document Ready Mode?

Document Ready React editor

Froala’s Document Ready mode is a feature that simplifies the initialization of the editor and allows you to focus on creating content rather than wrestling with configuration settings.

It streamlines the setup process, making it more straightforward and user-friendly.

Prerequisites

Before we dive into using Document Ready mode, let’s ensure you have everything in place:

React Project: You should have a React project set up. If not, you can create one using create-react-app or your preferred method.

Installation: Install Froala Editor in your React project using npm or yarn:

npm install react-froala-wysiwyg --save

Import Styles: Import Froala’s CSS styles in your project. You can do this by adding the following line no App.js file:

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

Initializing Froala Editor Component

Now that we’ve got the prerequisites out of the way, let’s initialize Froala Editor in Document Ready mode within your React project. Follow these steps:

1. Import Froala Editor

In your React component where you want to use Froala Editor, start by importing the necessary dependencies:

import FroalaEditorComponent from "react-froala-wysiwyg";

2. Create the Component

Next, create your React component with this code:

function App() {

  let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

  return (

    <div id="froala-editor">

          <h1>Froala WYSIWYG Editor </h1>

          <h2>Tutorial about Document Ready</h2>

      <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

          quickInsertTags: [""],

        }}

      />

    </div>
  );
}

export default App;

In the above code, we’ve created a simple React component.

Froala rich text editor

3. Configure Froala Editor

To make the most of Froala Editor, you can configure it according to your needs.

Inside the initialization code block, you can pass configuration options as an object. Here’s an example of some common options you might want to use:

toolbarButtons: ['bold', 'italic', 'underline'],

Customized WYSIWYG Editor

In this example, we’ve customized the toolbar buttons. You can explore more configuration options in Froala’s official documentation.

Include Document Ready mode

Use this line to change your component for the Document Ready mode.

 documentReady: true

The “document ready mode” feature in the Froala WYSIWYG HTML Editor is designed to enhance the editing experience when creating online documents, making it more akin to using traditional word processors like Microsoft Word or Google Docs.

Document Ready Editor

Enabling Document Ready Mode: When you enable the document mode in the Froala editor, it automatically configures the editor with optimized settings for creating documents.

These settings are tailored to make the editor behave more like a traditional word processor, making it easier to work with documents.

In summary, the Froala WYSIWYG HTML Editor’s “document ready mode” feature simplifies creating online documents by providing a set of optimized settings and essential tools for document editing.

It bridges the gap between traditional word processors and web-based editing, ensuring that your documents can be printed or exported as PDFs with ease, just like you would in a typical word processing software.

This feature can be particularly advantageous for web applications or websites that require users to generate and manage documents online.

The component will have this code:

import "froala-editor/css/froala_style.min.css";

import "froala-editor/css/froala_editor.pkgd.min.css";

import FroalaEditorComponent from "react-froala-wysiwyg";

function App() {

  let model = '<p><a href="https://froala.com">Froala WYSIWYG Editor</a></p>';

  return (

    <div id="froala-editor">

          <h1>Froala WYSIWYG Editor </h1>

          <h2>Tutorial about Document Ready</h2>

      <FroalaEditorComponent

        tag="textarea"

        model={model}

        config={{

          documentReady: true

        }}
      />

    </div>
  );
}
export default App;

Conclusion

By following the steps outlined in this article, you can easily integrate Froala Editor into your React project app using Document Ready mode.

This approach simplifies the setup process, allowing you to focus on creating and editing rich content while taking advantage of Froala’s extensive customization options.

Remember to refer to Froala’s official documentation for a comprehensive list of configuration options, events, and advanced features.

With Froala Editor and React, you can provide your users with a seamless and intuitive rich text editing experience in your web applications. Happy editing!

Froala with Grammarly Text Editor SDK Alternative

Integrating Froala with Grammarly Text Editor SDK Alternative

Grammarly announced that it would be discontinuing the Text Editor SDK, the developer tool that puts the company’s automated editing functionality into any app. The tool will be shut down on January 10th, 2024, after which the functionality will cease to work in any applications where it’s in use.

If you use Grammarly Text Editor SDK and your business will be affected by this change. You don’t need to worry. We’ve got you covered.

A WYSIWYG Editor that can integrate with Different JavaScript tools

Froala is a powerful WYSIWYG editor that can be easily integrated with different JavaScript tools on the web. Fortunately, there are a lot of JavaScript tools that provide similar Grammarly features. Incorporating a Grammarly alternative with Froala will maintain the same user experience in your application.

For instance, if you are looking for a grammar check and spelling correction suite, you can use WProofreader, the AI-powered component of WebSpellChecker. WProofreader works with the Froala editor seamlessly, providing real-time grammar, spelling, and punctuation checks. Check out how this integration works and see a working demo on our WProofreader integration page.

Another good Grammarly alternative is Sapling. In addition to grammar checking, Sapling also offers deep learning-powered autocomplete suggestions across all messaging platforms.

How to Integrate Sapling with Froala

Integrating Froala with Sapling

Integrating Sapling with Froala is a straightforward process that requires minimal coding. Sapling offers an extensive API as well as SDKs that assist in grammar-checking text for Python and JavaScript, and an HTTP API that is language-agnostic. In this post, we will use the grammar-checking SDK for quick integration with Froala. Here are the steps required.

Prerequisites:

  • Registering for an API key:

    Sapling offers a free plan with limited capabilities but it comes with a free 30-day trial of Sapling Pro. To allow you to try Sapling capabilities. Sign up for Sapling, and get your API key, to get started.

  • Prepare your environment:

    Sapling and Froala are versatile tools that support popular JavaScript frameworks like React, Angular, and Vue. Both offer guidance on how to integrate within these frameworks. However, for the sake of clarity, this article will focus on a straightforward integration using basic HTML and JavaScript. You can then adapt these principles to your favorite framework.

Get started

At the beginning, create an HTML document with a single element where the editor will be initialized.

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Froala & Sapling</title>

</head>

<body>

    <div id="editor-element">Lets get started!</div>

</body>

</html>

Start with initializing Froala:

  • Include Froala Stylesheet on the page header
    <!-- include the latest Froala version stylesheet -->
    <link href='https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css' rel='stylesheet' type='text/css' />
  • Include the Froala script before the closing </body> tag
    <!-- include the latest Froala version script -->
    <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>
  • Initialize the Froala editor by calling the Forala constructor function and passing the element selector as the first parameter
    <script> 

        new FroalaEditor('#editor-element');

    </script>

Now, if you open your HTML page on your browser, you should see the Froala editor opened

Froala editor initialized

Initializing Sapling:

  • Include the Sapling JavaScript file:
<script src="https://sapling.ai/static/js/sapling-sdk-v1.0.5.min.js"></script>
  •  We need to initialize Sapling after the editor loads. In this case, we can initialize it inside the Froala initialized event or in the callback function which is passed as the third parameter to the Froala constructor function. Basically, it is the same as doing it like this
    <script> 

        let editor = new FroalaEditor('#editor-element',{},function(){

            Sapling.init({

              key: '***',

              mode: 'dev',

            });          

        });

    </script>
  • Or doing it like this
    <script> 

        new FroalaEditor('#editor-element',{

            events: {

                'initialized': function () {                   

                Sapling.init({

                        key: '***',

                        mode: 'dev',

                        });

                }
            }

        });

   </script>

The Sapling init method takes an object that includes the following properties:

  • `key`: This is the API key you received when you signed up for Sapling.
  • `mode`: This can be either `’dev’ for development mode, or ‘prod’ for production mode. It determines what API endpoints Sapling will use.

Note:

  • During development, you can pass in the API key and use Sapling’s endpoints by setting mode: ‘dev’ in the init function.
  • For production, do not pass the API key in JavaScript. Instead, include the API key in your backend and call Sapling’s endpoints from the backend. This is the default setting with mode: ‘prod’.
  • Remember to replace ‘***’ with your Sapling API Key.

Once Sapling is initialized, we can call any of the methods mentioned in the Sapling docs.

We will use Sapling.observe to observe the editor for changes and provide grammar corrections and suggestions every time we add content.

  <script> 

    new FroalaEditor('#editor-element',{},function(){

        Sapling.init({
            key: '***',
            mode: 'dev',
        });

        // `this` is the editor instance

        const contentEditable = this.$el[0];

        Sapling.observe(contentEditable);
    });

 </script>

 The observe method’s first parameter should be the contenteditable or textarea element that needs to be observed. In our example we used the this keyword, which contains the editor instance, to get the editing area element.

Open the HTML file in your browser to test integration. Grammar checks should automatically be applied as you type in the editor. After clicking on the incorrect text, a popup displays suggested corrections. Select the desired correction to apply it to the text.

Grammar checking and correction with Froala and Sapling

The full example code is

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Froala & Sapling</title>
    <!-- include the latest Froala version stylesheet -->
    <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="editor-element" sapling-ignore="true">Lets get started!</div>

    <!-- include the latest Froala version script -->
    <script type='text/javascript' src='https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js'></script>
       
    <!-- include the Sapling SDK script -->
    <script src="https://sapling.ai/static/js/sapling-sdk-v1.0.5.min.js"></script>

    <script> 
    new FroalaEditor('#editor-element',{},function(){
       
        Sapling.init({
            key: '***',
            mode: 'dev',
        });

        // `this` is the editor instance
        const contentEditable = this.$el[0];
        Sapling.observe(contentEditable);
        
    });
    </script>
</body>
</html>

The example provided showcases only a glimpse of Sapling and Froala’s potential. We employed Sapling for live grammar and spelling checks within the editor. This can be further enhanced by tailoring Sapling to various editor events, leveraging different Sapling API methods, and even creating a custom Froala  plugin for implementing more Sapling features. 

Conclusion

The rolldown of Grammarly Text Editor SDK does not mark the end of automated writing assistant tools in your app. Explore the other options and choose the one that best fits your application’s needs.

Sapling offers a range of features such as grammar checking, writing suggestions, autocompletion, and more. You can easily integrate Sapling with the Froala WYSIWYG editor and provide users with a seamless writing experience. Using Sapling with Froala supports multiple languages, including, but not limited to English, German, and Spanish. 

Let’s start integrating Froala with Sapling and enjoy cleaner and free from grammatical errors writing experience. It is an essential add-on for writers, bloggers, marketers, or any users who frequently engage in content creation.

Leave a comment if you need help with the integration process or if you run into any issues.

Froala V4.1.1 release: Enhancing Typescript Support

Typescript Support

Today, we are delighted to introduce Froala V4.1.1, an update that builds upon the successes of our best release ever with Froala v4.1 which introduced updated LTS support for React, Vue, and Angular among other important improvements.

In response to our users’ feedback, We have introduced, in V4.1.1, significant changes to ensure a smoother and more compatible experience with TypeScript in Froala.

Froala 4.1 & TypeScript

Froala 4.1 has introduced TypeScript definitions support. This addition is a game-changer for developers as it offers a range of benefits that enhance productivity and code reliability. It provides developers with helpful hints, type-checking at compile-time, and more robust auto-completion.

  1. Better Intelligence:
    Software development teams can now enjoy contextual granularity while coding, thus reducing the chances of making errors..
  2. Compile-time Type Checking:
    Allowing developers to catch potential bugs in their code that may have been missed. This significantly enhances build-time code reliability.
  3. Definitive Auto-completion:
    This feature is a boon for quick coding. Suggestions based on TypeScript definitions provide accurate find-and-replace functionality, making coding a breeze. With accurate types, your editor gains a clear insight into the values and functionalities available, eliminating the need to search through the entire code base.

However, there were some incorrect definitions and missing properties in the index.d.ts file. As a result, using these properties could lead to TypeScript errors. Especially, when using the Angular SDK. Release 4.1.1 came to resolve these issues.

What’s new in Froala 4.1.1?

Enhanced TypeScript Support
Froala 4.1.1 boasts enhanced typescript definition support, successfully addressing any issues encountered in 4.1, and guaranteeing seamless compatibility with Angular TypeScript.
To fully benefit from these enhancements and avoid coding complications, we encourage all users to promptly update to the latest release. For instructions on how to update, please refer to our handy “how-to-update” section located at the bottom of this post.

let’s dig deeper into the 4.1.1 release

Displaying toolbar buttons correctly on Angular

Now that Froala supports the latest Angular release, you can enhance your users editing capabilities with the Froala editor. Follow this comprehensive step-by-step tutorial to integrate Froala into your Angular app.

The basic integration process will only display the editor’s default toolbar buttons. However, by importing Froala’s plugin scripts into the app.module.ts file, users can now have access to additional buttons related to those plugins.

For instance, by importing the align plugin

import 'froala-editor/js/plugins/align.min.js';

The editor toolbar will display the following buttons:

  • Align right
  • Align left
  • Center
  • Justify

To enjoy the full range of features, you can import all the editor plugins with a single statement thereby displaying all plugin toolbar buttons

import 'froala-editor/js/plugins.pkgd.min.js';

Furthermore, You have the flexibility to customize the editor toolbar to your liking by utilizing the toolbarButtons API option. Simply set this option with the desired toolbar buttons and pass it within the Froala Angular component options tag.

<div [froalaEditor]="options" [(froalaModel)]="content" ></div>

Fix TypeScript Definitions

As we mentioned above, in V4.1.1, we added properties that were missed in v4.1, we’ve also fine-tuned some definitions to ensure everything works smoothly.

Many properties have been added or edited. Such as:

  • FE.DEFAULTS
  • FE.DefineIcon
  • FE.DefineIconTemplate
  • FE.END_MARKER
  • FE.KEYCODE
  • FE.MARKERS
  • FE.PLUGINS
  • FE.POPUP_TEMPLATES
  • FE.RegisterCommand
  • FE.RegisterQuickInsertButton
  • FE.RegisterShortcut
  • FE.START_MARKER

If you’ve been encountering errors while creating custom buttons, plugins, or icons, don’t worry! Simply update your editor and it will now work without these errors.

How Can I Update?

We’ve streamlined the process to make it hassle-free. Just head over to our dedicated page for each framework SDK, where you’ll find detailed instructions on installing or updating to the latest version. Follow the links below to get started.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Support and Feedback

We are dedicated to always offering the best possible experience for all our users. We believe this release, meant to enhance Typescript support, is a stepping stone towards that commitment. We encourage you to try this improved Typescript support and give us your valuable feedback. Your input is crucial for delivering continuous enhancement in meeting your evolving needs. Thank you for being a valuable part of our vibrant and growing community.
We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Technical Questions

Get Froala Editor Now

 

Custom Buttons with Froala in an Angular Application

Froala Angular CUstom Buttons

In web development, Froala and Angular are well-known for being efficient and flexible. Froala is a WYSIWYG Editor with lots of features. Angular is a popular tool for building apps and works well with Froala. Together, they help developers save time and make better apps. For example, you can create custom buttons in the Froala editor, making apps more interactive.

 

In this guide, we’ll dig into custom buttons: why they’re awesome, how they simplify app building, and real-world uses.

The Power of Froala and Angular

But first, let’s chat about why mixing Froala with Angular makes such a big difference in web development.

Why Froala and Angular?

Froala’s Strengths:

Simple Setup: You can easily add Froala to different settings, including Angular.

Make It Yours: With Froala, you can customize a lot, like making your own buttons.

Lots to Offer: Froala lets you format text, add media, and more.

Angular’s Strengths:

Neat & Tidy: Angular is built in parts, so it’s easier to work with and keep clean.

Instant Updates: Changes you make in Angular show up in real-time.

More to Add: With tools like angular-froala-wysiwyg, Angular lets you do even more.

Tutorial: Creating Custom Buttons with Froala in Angular

Step 1: Installation

This step includes installing the necessary packages and including the required styles.

Install angular-froala-wysiwyg:

npm install angular-froala-wysiwyg

Add CSS styles to your index. file:

<link href="node_modules/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet">

Optionally, install font-awesome for additional icons (either via npm or using the CDN in index.):

npm install font-awesome

Or

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-

Step 2: Integration with Angular

This step integrates the Froala WYSIWYG editor with your Angular application.

Generate a New Angular Application (skip if you already have one):

npm install -g @angular/cli
ng new my-app
cd my-app

Install angular-froala-wysiwyg:

npm install angular-froala-wysiwyg --save

Modify src/app/app.module.ts by Importing Froala Modules and Adding Them to the Imports Array:

 

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
@NgModule({

   ...

   imports: [FroalaEditorModule.forRoot(), FroalaViewModule.forRoot(), ... ],

   ...

})

Insert the Necessary Styles in angular.json within the styles array:

"styles": [
  "styles.css",
  "./node_modules/froala-editor/css/froala_editor.pkgd.min.css",
  "./node_modules/froala-editor/css/froala_style.min.css",
]

Update src/app/app.component. to Include the Froala Editor Directive:

<div [froalaEditor]>Hello, Froala!</div>

Run Your Angular Application:

ng serve

Setting Up Froala Editor in Your Angular App

  1. Install Froala: This step is all about getting Froala into your app.
  2. Integrate with Angular: Once installed, make sure Froala works well with your Angular project.
  3. Ready for Customization: With Froala now part of your Angular app, you can start adding special features. For example, you can create your own buttons like we mentioned.

By completing these steps, your Froala editor will be all set and ready for any custom touches you want to add.

Step 3: Adding Custom Buttons

Go to Your Component File

  • Find the Angular component where you want to add the new button in Froala.
  • This could be in a special editor component or somewhere broader like a form page.

Make Your Custom Button

  • Within the component, find the FroalaEditor object.
  • Use it to create and list your custom button.
  • Put this step in the ngOnInit section. This makes sure your button is ready when the page starts up.

Here’s the updated code snippet:

 

import { Component, OnInit } from '@angular/core';
import FroalaEditor from 'froala-editor';

@Component({
  selector: 'app-demo',
  template: `
    <div class="sample">
      <h2>Sample 11: Add Custom Button</h2>
      <div [froalaEditor]="options" [(froalaModel)]="content"></div>
    </div>
  `,
})
export class AppComponent implements OnInit {
  public content: string = '<p>Your initial content here...</p>';
  ngOnInit() {
    FroalaEditor.DefineIcon('alert', { NAME: 'info' });
    FroalaEditor.RegisterCommand('alert', {
      title: 'Hello',
      callback: () => {
        alert('Hello!', this);
      },
    });
  }

  public options: Object = {
    toolbarButtons: ['bold', 'italic', 'underline', 'paragraphFormat', 'alert'],
    // ...
  };
}

 

Setting Up Custom Buttons in Froala with Angular

  1. Add to Toolbar: Put your custom button, like ‘alert’, on the Froala editor’s toolbar list. This makes it show up there.
  2. Include in Template: Add the component with your custom button to the right Angular templates, so the Froala editor pops up where you want.

By setting it up this way inside the Angular component from the start, your custom button fits right into your app’s flow and looks like a built-in part of your design.

Now, run the application:

ng serve

You can view the whole demo here:

How Custom Buttons in Froala Impact the Real World

With custom buttons in Froala, you can do so much more than just regular tasks. They boost user experience and bring fresh features to life. Check out these practical uses:

Easy Content Checks: In systems that manage content, a button can send work straight to a boss for a quick check.

Quick Email Templates: For email marketing, a button can add ready-to-use templates instantly.

Help for Special Needs: You can make buttons that read out text, helping users who need it.

Work with Other Tools: Add buttons that link to calendars, calculators, or other tools to make the editor even better.

Share on Social Media: A button can post content directly to sites like Facebook or Twitter, perfect for bloggers.

Unpacking the Power of Custom Buttons in Development

Better User Experience: With buttons made just for them, users will find your apps more enjoyable.

Faster App Building: With tools like Froala and Angular, developers can make detailed features faster.

Easy Updates: Custom buttons mean you can add new things to your app without redoing everything.”

Conclusion

Froala and Angular help make app-building simpler and better. One fun feature is adding custom buttons, as shown in our guide. These buttons can speed up tasks and make apps user-friendly. They let developers add creative touches. New or seasoned at building apps? Using these buttons in Froala and Angular offers cool features to try out.

 

Get Froala Editor Now

Crafting a Custom Button for the Froala Editor in Vue.js

vue js custom button

Creating a custom button for the Froala Editor within a Vue.js application allows developers to extend the editor’s capabilities to match their project’s specific needs. This comprehensive guide will walk you through the process step by step.

vue js custom button main image

Prerequisites:

Basic understanding of and Vue.js.

Node.js and NPM are installed on your machine.

A fresh Vue.js project. If you don’t have one, set it up using the Vue CLI.

Step-by-Step Integration:

1. Setting up a New Vue Project (if needed):

If you don’t already have a Vue project,

npm install -g @vue/cli

vue create froala-vue-project

cd froala-vue-project

2. Install the vue-froala-wysiwyg package:

npm install vue-froala-wysiwyg --save

3. Setting up Froala in the project

Open the src/main.js file:

import 'froala-editor/js/plugins.pkgd.min.js';

import 'froala-editor/css/froala_editor.pkgd.min.css';

import { createApp } from 'vue';
import App from './App.vue';
import VueFroala from 'vue-froala-wysiwyg';

const app = createApp(App);
app.use(VueFroala);
app.mount('#app');

4. Set up the Froala component in your Vue template:

In src/App.vue:

 

<template>
  <div id="app">
    <froala :tag="'textarea'" :config="config" v-model:value="content"></froala>
  </div>
</template>

<script>
import FroalaEditor from 'froala-editor';

export default {
  name: 'App',
  data() {
    return {
      content: 'Your initial content here!',
      config: {}
    };
  }
};
</script>

5. Creating Your Custom Button:

  1. Define the Icon: Choose an SVG icon or use a predefined one. Here, we’ll use the ‘star’ icon:
  2. Register the Custom Button: Define your button’s functionality. In this example, the button will insert custom text:
    1. FroalaEditor.DefineIcon('myButton', {NAME: 'star', SVG_KEY: 'star'});
  3. Integrate the Button into the Froala Toolbar: Update the config object in your App.vue:
    1. config: {
        toolbarButtons: [['bold', 'italic', 'underline', 'myButton']]
        // ... any other configurations
      }
      

Here’s the final look of your App.Vue file

<template>
  <div id="app">
    <froala :tag="'textarea'" :config="config" v-model:value="content"></froala>
  </div>
</template>

<script>
import FroalaEditor from 'froala-editor';

export default {
  name: 'App',
  data() {
    return {
      content: 'Your initial content here!',
      config: {
        //... (you can add your initial configuration here)
        toolbarButtons: [['bold', 'italic', 'underline', 'myButton']]
      }
    };
  },
  created() {
    // Define the Icon for the Custom Button
    FroalaEditor.DefineIcon('myButton', {NAME: 'star', SVG_KEY: 'star'});

    // Register the Custom Button's action
    FroalaEditor.RegisterCommand('myButton', {
      title: 'Insert Custom Text',
      focus: true,
      undo: true,
      refreshAfterCallback: true,
      callback: function() {
        this.html.insert('Watch the magic happen🌠');
      }
    });
  }
};
</script>

6. Run and Test:

Launch your Vue.js application:

 

npm run serve

Open your browser to view the application. You should spot the Froala Editor with your custom button integrated. Clicking it will insert the pre-set text.

 

Here’s a demo of the working code:

 

Extra Content: The Seamless Integration of Froala with Vue.js 3 LTS Version

With the long-term support (LTS) version of Vue.js 3 now available, the benefits of using Froala with Vue.js have become even more pronounced. Here’s why:

1. Flexibility Meets Stability

The LTS version of Vue.js 3 offers a stable platform that receives regular maintenance and security updates. When you combine this stability with Froala’s adaptability, developers get a blend of reliability and flexibility that few combinations can offer.

2. Enhanced Performance:

Vue.js 3 has brought numerous performance improvements. One notable change is the async setup, which allows you to handle asynchronous operations directly within the setup function. Combined with Froala’s efficient rendering, this results in a smoother user experience.

 

<template>
  <froala :tag="'textarea'" :config="config" v-model:value="content"></froala>
</template>

<script>
import { ref } from 'vue';
import FroalaEditor from 'froala-editor';

export default {
  async setup() {
    const content = ref('Your initial content here!');
    const config = ref({
      //... (your initial configuration here)
    });

    // Let's say you fetch some content asynchronously for the editor.
    const fetchedContent = await fetchContentFromServer();
    content.value = fetchedContent;

    return {
      content,
      config
    };
  }
};
</script>

3. Better Composition API:

Vue.js 3 introduces the Composition API, which allows a more flexible code organization. Combined with Froala’s modular design, this results in cleaner and more maintainable code.

 

import { ref, computed } from 'vue';
import FroalaEditor from 'froala-editor';

export default {
  setup() {
    const content = ref('Your initial content here!');
    
    // Using the Composition API to create a computed property
    const wordCount = computed(() => {
      return content.value.split(' ').length;
    });

    // Define and register a custom button using Froala's methods within the Composition API
    FroalaEditor.DefineIcon('wordCountButton', {NAME: 'counter', SVG_KEY: 'counter'});
    FroalaEditor.RegisterCommand('wordCountButton', {
      title: 'Word Count',
      focus: false,
      undo: false,
      refreshAfterCallback: false,
      callback: function() {
        alert(`Current word count: ${wordCount.value}`);
      }
    });

    return {
      content,
      wordCount
    };
  }
};

4. Improved Customizability:

Vue.js 3 LTS comes with enhanced support for TypeScript. This means developers can now easily define types for their custom buttons or other editor extensions.

 

import { Ref, ref } from 'vue';
import FroalaEditor from 'froala-editor';

interface EditorConfig {
  toolbarButtons?: string[][];
  //... other configuration options
}

export default {
  setup(): { content: Ref<string>; config: Ref<EditorConfig> } {
    const content: Ref<string> = ref('Your initial content here!');
    const config: Ref<EditorConfig> = ref({
      toolbarButtons: [['bold', 'italic', 'underline', 'wordCountButton']]
      // ... other configurations
    });

    return {
      content,
      config
    };
  }
};

The code snippets provided demonstrate how effortlessly Vue.js 3 LTS and Froala Editor can integrate. Together, they offer a robust platform for developers aiming to create top-notch digital solutions.

 

Conclusion

Successfully adding a custom button for the Froala Editor within a Vue.js app enhances the user experience and demonstrates the flexibility of both Vue.js and Froala. This tutorial aimed to deliver a clear roadmap from the beginning to the end of the process, and we urge readers to explore further customizations to meet their unique demands. With tools like Vue.js and Froala, the possibilities are vast. Happy coding!

Do checkout our Vue.js documentation to learn more.

 

Download Froala Editor

Creating Custom Buttons with React and Froala Editor

React editor custom buttons

The Froala Editor is a powerful WYSIWYG (What You See Is What You Get) HTML editor that offers a wide range of features for creating and editing content. One of its standout features is the ability to enhance its functionality by creating custom buttons. In this article, we will explore how to create custom toolbar buttons using React and Froala Editor to enhance your experience in creating content. React editor custom buttons

Understanding the Integration of Froala Editor and React

Before delving into the creation of custom buttons, let’s briefly examine the integration of Froala Editor with React. Froala Editor is a text editor that offers a seamless and user-friendly interface for editing content. Integrating Froala with React involves wrapping the editor inside a React component, thereby combining the capabilities of both technologies. You can learn more about the integration between React and Froala in the documentation on our website. To get started, you need to install the necessary dependencies for your React project.

npm install react-froala-wysiwyg --save

Once installed, you can import the Froala Editor styles and the React component:

import React from 'react'; import FroalaEditorComponent from 'react-froala-wysiwyg'; import 'froala-editor/css/froala_style.min.css'; import 'froala-editor/css/froala_editor.pkgd.min.css';

Now, you can use the FroalaEditorComponent in your React component’s method:

const App = () => {   return (     <div >       <FroalaEditorComponent         tag="textarea"       />     </div>   ); }; export default App;

With this integration, you can have a basic Froala Editor running in your React application. However, the true power lies in creating customized buttons to enhance the capabilities of the editor.

Extending the Froala Editor with Custom Buttons

The toolbar of the Froala Editor is where users can find options for formatting text, adding images, links, and other elements. Creating custom toolbar buttons using React allows you to enhance this functionality and offer users additional features that are specifically designed for your application’s requirements. Froala Editor allows you to seamlessly integrate custom buttons into its toolbar, providing users with additional functionality tailored to their specific needs. To accomplish this, we will utilize the combination of React and the Froala Editor’s API. On the component file, import Froalaeditor component so we can use it to create the custom buttons

import Froalaeditor from 'froala-editor';

Then add the following code to create ‘Alert’, ‘Clear’, and ‘Insert’ buttons.

Froalaeditor.DefineIcon('alert', {NAME: 'info', SVG_KEY: 'help'});   Froalaeditor.RegisterCommand('alert', {     title: 'Hello',     focus: false,     undo: false,     refreshAfterCallback: false,     callback: function () {       alert('Hello!');     }   });   Froalaeditor.DefineIcon('clear', {NAME: 'remove', SVG_KEY: 'remove'});   Froalaeditor.RegisterCommand('clear', {     title: 'Clear HTML',     focus: false,     undo: true,     refreshAfterCallback: true,     callback: function () {       this.html.set('');       this.events.focus();     }   });   Froalaeditor.DefineIcon('insert', {NAME: 'plus', SVG_KEY: 'add'});   Froalaeditor.RegisterCommand('insert', {     title: 'Insert HTML',     focus: true,     undo: true,     refreshAfterCallback: true,     callback: function () {       this.html.insert('My New HTML');     }   });

Witnessing the Magic of Custom Buttons

With these custom buttons seamlessly integrated into the Froala Editor, users are empowered to utilize their extended functionalities. Each custom button reveals a unique aspect of improvement. Alert Button: The ‘alert’ button transforms into a messenger, delivering a JavaScript alert that displays the message “Hello!” when summoned with a click. Clear Button: The ‘clear’ button assumes the role of a content guardian, allowing users to remove the editor’s content while maintaining its focus, providing a blank canvas for new creations. Insert Button: The ‘Insert’ button emerges as a vessel of ingenuity, allowing users to infuse the editor’s canvas with the inscription “My New HTML,” enabling rapid creation. These custom buttons embody the essence of a personalized experience, guiding users towards a world of streamlined actions, driven by these customized functionalities.

The Flourish: Integrating Custom Buttons

The culmination of this customization journey occurs when these custom buttons are seamlessly integrated into the Froala Editor’s toolbar, enhancing the process of creating content. React takes center stage here, serving as the conduit for this integration.

import React from 'react'; import FroalaEditorComponent from 'react-froala-wysiwyg'; import 'froala-editor/css/froala_style.min.css'; import 'froala-editor/css/froala_editor.pkgd.min.css'; const App = () => {   return (     <div >       <FroalaEditorComponent         tag="textarea"         config={{           toolbarButtons: [['undo', 'redo' , 'bold'], ['alert', 'clear', 'insert']],         }}       />     </div>   ); }; export default App;

In the React component snippet above, the FroalaEditor component is imported and configured with the toolbarButtons prop. The toolbar is meticulously organized into two rows. The first row comprises standard buttons such as ‘undo,’ ‘redo,’ and ‘bold.’ The second row showcases the culmination of our endeavor – the custom buttons: ‘alert,’ ‘clear,’ and ‘insert.’ Below we can see images of the result of the component with the buttons that we saw in the React application. React editor custom buttons Froala editor React editor custom buttons editor custom buttons custom buttons By following these steps, you can seamlessly integrate custom toolbar buttons into the Froala Editor using React. This approach empowers you to enhance the editor’s capabilities beyond its default features and create a more customized editing experience for your users.

Conclusion

Customizing rich text editors such as Froala using React opens up a world of possibilities for creating dynamic and feature-rich content creation experiences. By integrating custom toolbar buttons, you can provide users with specialized functionality that aligns with your application’s requirements. This not only enhances user satisfaction but also showcases your development skills in delivering a seamless and intuitive editing environment. So, go ahead and explore the combination of React and Froala Editor to create the ideal content creation tool for your web application. We have included a working example below that shows the complete code we have discussed.

 

Building Interactive Web Apps with React and Froala Editor

React rich text editor

Web applications have become a part of our lives by facilitating seamless communication and collaboration.

Rich text-editing capabilities are a crucial aspect of web app development. Users expect a user-friendly and easy-to-use interface to compose and present text.

Froala Editor is a feature-rich and customizable WYSIWYG (What You See Is What You Get) editor that enables users to easily create and format content. It supports various text styles, images, videos, and tables. This article explains how to use Froala Editor in a React app for better text editing.

Building Interactive Web Apps with React and Froala Editor

Why Choose The Froala Editor

Before diving into the integration process, let’s briefly discuss why the Froala Editor stands out among other text editors. Froala Editor offers a comprehensive set of features that make it an excellent choice for developers and content creators.

  • Rich Text Editing Capabilities: The Froala Editor provides a user-friendly interface that allows users to format and style text similar to a word processor.
  • Responsive Design: The editor is designed to work seamlessly across different devices, ensuring a consistent experience for all users.
  • Cross-browser Compatibility: Froala Editor supports all major web browsers, including Chrome, Firefox, Safari, and Edge.
  • Customizable: Developers can customize the editor’s appearance and behavior to match the application’s theme and requirements.
  • Media Support: The editor supports various media types, such as images and videos, making content creation more engaging.
  • Undo/Redo Functionality: Users can easily undo or redo their actions. This provides a safety net for accidental changes.
  • Easy Integration: The Froala Editor offers straightforward integration with popular frameworks, such as React, making it an ideal choice for developers.

With these features in mind, let’s move on to the steps required to integrate Froala Editor into a React application.

Installation and Setup

Prerequisites

Before integrating Froala Editor into your React application, make sure you have Node.js and npm (Node Package Manager) installed on your system. This allows one to create a new React project and effectively manage its dependencies.

Creating a React Application

To start, open your terminal and use the following command to create a new React application:

npx create-react-app froala-editor-demo

cd froala-editor-demo

This will set up a new React project in a directory called froala-editor-demo. Next, navigate to the project directory and install Froala Editor SDK:

npm install react-froala-wysiwyg --save

Importing and Initializing Froala Editor

After installing Froala Editor SDK, you need to import it and initialize it within your React application. To do this, follow these steps:

Open App.js, and import the necessary modules:

Import the Froala Editor CSS

Import the Froala Editor CSS to ensure that the editor’s styles are applied correctly.

import 'froala-editor/css/froala_editor.pkgd.min.css';

import 'froala-editor/css/froala_style.min.css';

Import the Froala Editor Component

import FroalaEditorComponent from 'react-froala-wysiwyg';

Usage Examples

Now that we have the basic integration set up, let’s explore some usage examples of the Froala Editor within our React application.

Example 1: Basic Usage

Using the FroalaEditorComponent is as simple as rendering it in your desired location within your React application.

Inside the App Function remove everything and add the following return statement

  return (
    <div>

      <h1>Froala Editor App</h1>
      <FroalaEditorComponent tag='textarea'/>
    </div>
  );

The App.js code now looks like

// Require Editor CSS files.
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';

import FroalaEditorComponent from 'react-froala-wysiwyg';

function App() {

  return (
    <div>

      <h1>Froala Editor App</h1>
      <FroalaEditorComponent tag='textarea'/>
    </div>
  );
  
}

export default App;

Run the application and you will see the Froala editor rendered on the screen

React rich text editor

Example 2: Customizing the Editor

Froala Editor allows you to customize various aspects of the editor. You can add custom configurations by passing an options object during initialization.

<FroalaEditorComponent tag='textarea' config={{

        toolbarButtons: ['bold', 'italic', 'underline'],

        quickInsertTags: [''],

}}/>

In this example, we modified the toolbar buttons to include only basic formatting options.

Customized rich text editor

Conclusion

Rich text editing functionality can be easily added by creating interactive web applications with React and Froala Editor. In this article, we covered the installation, configuration, and fundamental usage examples for integrating Froala Editor into a React application. 

You can quickly enable Froala Editor’s extensive capabilities in your web application by following the installation and configuration instructions provided in this article.

Additionally, you can customize the editor to meet your individual needs thanks to its flexibility and customization options, which makes it a valuable tool for content creation, blog platforms, online editors, and many other web applications.

As you delve deeper into both technologies, you’ll discover a myriad of possibilities for building sophisticated web applications that cater to diverse user needs. So, go ahead, experiment, and create amazing interactive web apps with React and Froala Editor.

For more information, explore our React SDK documentation.

How to integrate Froala With Vue 3

Froala-Vue integration

We are pleased to announce that Froala version 4.1 has been released. This new version of Froala also provides users with an improved experience, better performance and accessibility. It also includes new features such as support for Vue.js 3.x.

Vue.js 3.0 is a popular JavaScript framework for developing highly reactive user interfaces. Froala improves application user interfaces by offering an intuitive, feature-rich WYSIWYG editor that comes with numerous styling options, image management features, in-built support for rich text editing, video embedding, SEO-friendly, and many other features. That’s why I’m excited to show you how easy it is to integrate the Froala WYSIWYG editor with a Vue 3 application.

Vue WYSIWYG Editor

Before diving in, we assume you have a working knowledge of:

  • JavaScript (including some of the newer, es2015 features)
  • Vue 3
  • How to use the terminal/command line
  • Node and npm

We will create a simple application and guide you step-by-step through this tutorial. There will be a working demo at the end of the article.

Step 1: Create a simple Vue project

Skip this step if you already have a Vue 3 project setup. If not, head over to your terminal/console.

Using your terminal, you can create a new Vue.js project with vue-create:

1.1 Install the Vue CLI

npm install -g @vue/cli

1.2 Inside the folder where you want to create your new Vue project run the Vue create command for a basic Vue project

vue create my-froala-vue-app

1.3 The terminal will prompt some configuration questions. Carefully answer them with your preferred set-up settings. I selected `Default ([Vue 3] babel, eslint)` for a simple Vue 3 project. I also picked ‘NPM‘ as the package manager to use when installing dependencies.

Create Vue APP.

Step 2: Install Vue WYSIWYG editor (the Froala Editor Package)

Step inside the project directory:

cd my-froala-vue-app

Once inside, install Froala’s Vue WYSIWYG editor by running the following command:

npm install vue-froala-wysiwyg --save
Note: 
This installs the latest Froala Vue SDK which supports Vue 3. If you are using an earlier Vue version, use the following command instead

npm install vue-froala-wysiwyg@4.0.19 --save

Unfortunately, this command will not install the latest version of Froala. Therefore, we recommend updating Vue and installing Froala using the first command.

Congratulations, you have successfully installed Froala in your Vue application. This means you can now use the VueFroala component in your project. To use the editor component in your application, you need to import it into main.js. Let’s see how to do that!

Step 3: Integration

3.1 Import Froala Editor in main.js

Open your main.js file and import the imperative bits for Froala Editor. Here’s what your file should include:

import { createApp } from 'vue'
import App from './App.vue'

//Import Froala Editor plugins
import 'froala-editor/js/plugins.pkgd.min.js';


// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';


// Import Froala Editor component
import VueFroala from 'vue-froala-wysiwyg';

const app = createApp(App);          

app.use(VueFroala);
app.mount('#app');

3.2 Initializing the Editor

From within your project directory, open the src/App.vue file. By default, it makes use of a HelloWorld component:

<template>

  <img alt="Vue logo" src="./assets/logo.png">

  <HelloWorld msg="Welcome to Your Vue.js App"/>

</template>




<script>

import HelloWorld from './components/HelloWorld.vue'




export default {

  name: 'App',

  components: {

    HelloWorld

  }

}

</script>




<style>

#app {

  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;

}

</style>

Remove the importing and declaring the HelloWorld component within the <script> tags since we will use the Froala editor component instead.

In the App component definition, add the data function that defines the component’s data properties. Inside the data function, add the following properties:

  • config: is an object that contains the editor API options
  • model: a string containing the editor’s default HTML content displayed by the editor.
<script>

export default {

  name: 'App',

  data () {

    return {

      config: {

        //documentReady: true,

        //direction: 'rtl',

        heightMin: 300,

        events: {

          initialized: function () {

            console.log('initialized')

          }

        }

      },

      model: '<i>Edit Your Content Here!</i>'

    }

  }

}

</script>

Finally, replace the HelloWorld component within the <template> tags with the editor component :

<template>

  <img alt="Vue logo" src="./assets/logo.png">

  <froala id="edit" :tag="'textarea'" :config="config" v-model:value="model"></froala>

</template>
  • :tag attribute is used to tell on which tag the editor is initialized.
  • :config attribute is used to configure the editor options
  • v-model:value Used to load editor content. This value is affected by editor HTML changes.

:config and v-model:value are using the config and model data properties we defined previously.
Note: There will be changes to the model value if you want to initialize the editor based on a, button, img, or input tags. We will cover these special tags in detail in another article since they change the editor’s interface.

Step 4: Run the project

After the integration is complete, it’s time to run your project to see the editor in action.

To start your local development server and see your application, run the following command in your terminal:

npm run serve

This command will start the development server and mounts your application at `http://localhost:8080`

You can always stop the server by using the `CTRl + C` command.

That should reveal your new Froala editor within your Vue 3 Project.

Step 5 Displaying HTML

To display content created with the Froala editor use the froalaView component.

<froalaView v-model:value="content"></froalaView>

Step 6: Customizing Your Froala’s Vue WYSIWYG editor

Customizing the Froala editor is distinctively easy. The powerful Froala Editor API allows customizations by adjusting our config object. Refer to the API options, events, and methods docs to see what it offers. For instance, you can edit toolbar buttons using the toolbarButtons API option. Here is an example

<template>

  <img alt="Vue logo" src="./assets/logo.png">

  <froala id="edit" :tag="'textarea'" :config="config" v-model:value="model"></froala>

</template>

<script>

export default {

  name: 'App',

  data () {

    return {

      config: {

          toolbarButtons: {

            'moreText': {

              'buttons': [ 'italic', 'underline', 'bold', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting']

            },

            'moreParagraph': {

              'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple']

            },

            '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
            }

          },

        events: {

          initialized: function () {

            console.log('initialized')

          }

        }

      },

      model: '<i>Edit Your Content Here!</i>'

    }

  }

}

</script>

<style>

#app {

  font-family: Avenir, Helvetica, Arial, sans-serif;

  -webkit-font-smoothing: antialiased;

  -moz-osx-font-smoothing: grayscale;

  text-align: center;

  color: #2c3e50;

  margin-top: 60px;

}

</style>

Options

You can pass any existing Froala option within the config attribute. Vue SDK users will also be able to utilize a specific Froala option:

  • immediateVueModelUpdate: (default: false) This option updates the Vue model as soon as a key is released in the editor. Note that it may affect performance.

Events

As you can see in the previous example, API Events can be passed in with the options. Events are passed as an object named “events” in which you can define all the different events you want to use. Each defined event is an object where the key is the event name and the value is the callback function.

Methods

Using the editor instance from the arguments of the event callback you can call any method described in the method docs.

Custom Buttons

Furthermore, you can extend editor functionality by defining custom buttons. Froala allows us to define and add new buttons to the toolbar very conveniently and we will describe how to do this in a separate article.

Ready to build more with Froala and its Vue WYSIWYG Editor?

Froala doesn’t just provide a WYSIWYG editor but a powerful tool that enhances the user experience and makes content creation a breeze. With support for Vue, you can integrate Froala into various Vue projects ensuring a consistent user experience.

From the way you configure it, to the way you handle events or even create custom functionality, Froala’s Vue WYSIWYG Editor is remarkably simple and efficient.

Remember that an effective user interface yields better user engagement. Use Froala’s Vue WYSIWYG Editor for your content creation and enjoy the difference it makes.

Test Froala’s Vue Wysiwyg Editor

We built a Vue demo application showcasing the editor’s capabilities. You can use this as a starting point to test and understand how it works and fits your project requirements. Play with our demo and share your feedback in the comments.

 

TypeScript and Froala: The Basics

Typescript featured image

Froala Editor, renowned for its user-friendly interface and powerful features, just upped its game by introducing TypeScript support. If you’re a developer, TypeScript integration makes your life easier when working with Froala. How? Read on.

The Power of TypeScript

TypeScript, a statically typed superset of JavaScript, offers robust type-checking during development. This means errors are caught at compile-time rather than at runtime, resulting in fewer bugs and a more predictable development process. With the Froala Editor integrating TypeScript support, developers can harness these benefits when crafting rich text editing experiences.

typescript blog main image

An Illustrative Example with Froala’s tableEditButtons Option

Consider you want to initiate the Froala Editor with the tableEditButtons option. Using the newly provided TypeScript definitions, we can define our options like this:

 

export class AppComponent {
  title = 'my-app';
  public options: Partial<FroalaEditor.FroalaOptions> = {
    tableEditButtons: ['tableRows', 'tableColumns', 'tableCells', 'tableCellVerticalAlign', 'tableRemove']
  };
}

This simple code showcases two of TypeScript’s powerful features:

Autocomplete: As you start typing “tableEdit…“, your IDE will suggest available options from FroalaOptions, ensuring you pick the correct option without constantly referring to the documentation.

tableedit autocomplete

Type Checking: If you accidentally set tableEditButtons to a non-array or a boolean, TypeScript will raise a compile-time error. This immediate feedback loop is invaluable, ensuring you’re always working with valid configurations.

TypeScript error

Here’s the exact same configuration via JavaScript:

Javascript/TypeScript example

You’ll see that there’s no runtime error whatsoever. This is just a surface level explanation of the power of TypeScript with Froala.

Correct type:

TypeScript correct example

 

Going Technical: Understanding the Partial Utility Type

The use of Partial<FroalaEditor.FroalaOptions> might raise eyebrows if you’re new to TypeScript. Let’s dissect it:

Partial: A built-in TypeScript utility type, it creates a type where all properties are optional. This is immensely helpful when working with large option objects like FroalaOptions, where you might only want to specify a few settings.

FroalaEditor.FroalaOptions: This refers to the type definition provided by Froala for all available editor options. By combining it with Partial, we’re signaling that our options object will only use a subset of all available Froala options.

 

TypeScript vs JavaScript

TypeScript vs. JavaScript: Advancing with Froala

When you choose to implement a rich-text editor like Froala in your application, every decision you make can impact development velocity, bug frequency, and maintainability. One such pivotal decision is whether to use TypeScript or stick with plain JavaScript. Here’s a detailed comparison:

1. Type Safety

JavaScript: 

Being a dynamically typed language, JavaScript doesn’t allow you to define the type of a variable, leading to potential runtime errors. When working with a comprehensive library like Froala, this can cause unexpected behavior if you mistakenly assign incorrect types to editor options or misinterpret returned types.

TypeScript:

Statically Typed: At its core, TypeScript is a statically typed superset of JavaScript. This means you declare the type of variables, function parameters, and return types.

let myOption: boolean = true;

With Froala, this ensures that you’re assigning the correct types to each editor option and correctly interpreting returned values.

Compile-Time Checks: Before the code even runs, TypeScript will identify and flag type-related errors. This means if you’ve wrongly assigned a string to an option that expects a boolean, the error is caught during development rather than at runtime.

2. Autocomplete and Intellisense

JavaScript: While modern IDEs provide some level of autocomplete for JavaScript, the lack of type information can make suggestions less accurate, especially for large libraries like Froala.

TypeScript:

The enhanced type system in TypeScript allows IDEs to offer precise and context-aware autocomplete suggestions. When you’re working with Froala, as you start typing an option, the IDE will display a list of valid properties, complete with type information and even brief documentation.

This leads to faster development, less reliance on constantly referencing the official docs, and fewer mistakes.

For example, if you want to use Codox.io options you can just type “codox…” and it will show the relevant options.

codox options

3. Interface Implementation

JavaScript: Without formal interfaces, ensuring an object conforms to a specific shape or requirement in JavaScript requires manual checks and can be error-prone.

TypeScript:

Interfaces: TypeScript allows you to define interfaces, ensuring an object matches a specific structure.

 

interface FroalaCustomOption {

  theme: string;

  plugins: string[];

}

 

When using Froala, if the library offers a predefined interface for its configuration options, you can guarantee that your configuration object adheres to this structure, preventing potential errors. To learn more about TypeScript interfaces, you can check out their official guide.

4. Scalability and Maintenance

JavaScript: Larger projects can become hard to manage and maintain due to JavaScript’s dynamic nature.

TypeScript:

Offers enhanced readability and self-documenting features via its type system. In the context of Froala, as your application grows and you incorporate more features of the editor, TypeScript ensures that older integrations remain consistent and bug-free.

Refactoring becomes safer, as changes can be made with the confidence that any breaking alterations will be flagged by the compiler.

Froala, TypeScript, and Angular: Your Superpower

Angular, one of the most widely-used frameworks for building web applications, has championed TypeScript since its second version. When we intertwine the benefits of TypeScript with Froala within an Angular environment, the synergies elevate web development to new heights. Here’s why:

Native Support for TypeScript

Angular’s Foundation: Angular is built with TypeScript. This means that all of its core libraries, modules, and tooling are optimized for TypeScript. When you use Froala with TypeScript in an Angular project, you’re aligning with the natural rhythm of the framework.

Consistency: Incorporating Froala’s TypeScript features within an Angular application ensures a seamless development experience. Your Froala configurations and interactions will follow the same type patterns as the rest of your Angular components and services.

Enhanced Dependency Injection

Angular’s robust dependency injection system, combined with TypeScript’s type system, allows for more precise token retrieval. When integrating services or utilities related to Froala, TypeScript ensures you’re injecting the right dependencies.

Support for LTS version of Angular

Froala supports the latest version of Angular’s SDK. You can read more about it here.

Conclusion

TypeScript’s integration into the Froala Editor ecosystem isn’t just a flashy addition; it’s a game-changer. With powerful features like autocomplete and compile-time type checking, developers can work faster, smarter, and with greater confidence.

Are you ready to supercharge your Froala Editor experience with TypeScript? Dive in today and experience the difference!

Download Froala Editor

 

 

 

 

A look inside the core editor improvements in Froala 4.1

Core Editor Improvments

Most JavaScript developers prefer modern libraries and frameworks for coding due to their ability to create web applications that are not only fast and scalable but also easy to maintain. These frameworks provide a set of features and conventions that simplify the development process and reduce the amount of boilerplate code. They also offer security, performance optimization, testing, and deployment benefits. All of these features make it the best choice for developers.

We understand your needs and requirements for having an editor that supports Modern JavaScript Frameworks and we released our 4.1 version for you. A release that supports the popular React and Vue JavaScript libraries’ latest versions. As well as the Angular framework’s latest version.

Moreover, the 4.1 release contains enhancements and bug fixes to the core editor functionality as part of periodic updates to our rich text editor.

The release contains too many improvements. We couldn’t cover all of them in one blog post. We focused on framework improvements in our first post. Today, we will recap quickly the Frameworks improvements and then discuss the core editor improvements in more detail.

React, Angular, and Vue Support

Froala 4.1 supports React 18, Angular 15, and Vue 3. Please refer to the documentation page of your preferred framework and follow it for easy integration. If you want more details, you can read our blog posts about integration with React and Angular. The Vue integration post will be published soon.

Supporting the latest version of these frameworks was very imperative for several reasons:

  1. Maximized Compatibility: Frameworks are frequently updated to deal with emerging issues, optimize performance, and add new features. These updates can sometimes interfere with older code. Froala 4.1 ensures compatibility with other software that’s built using the same version of the used framework- this means fewer breakdowns and better performance overall.
  2. Improved Performance: The most recent versions of a framework aim to provide optimal performance. They might contain code optimizations that make the applications built with them run faster and smoother. In other words, up-to-date SDKs can make better use of system resources.
  3. Access to Latest Features: By supporting the latest version of these frameworks, developers get access to new and enhanced features that weren’t available in previous versions. These features can significantly streamline the development process and allow for more sophisticated applications.
  4. Security Measures: As with most software updates, new versions of a framework often come with patches for known security vulnerabilities. By supporting the latest version in the SDK, It helps protect applications from potential attacks or hacking attempts linked to outdated versions.

Now you can enjoy all of these benefits with Froala 4.1, ensuring your web application development is up-to-date, efficient, and secure.

TypeScript Definition Support

Froala 4.1 comes with a TypeScript definition. This is another big feature added to this version. Having a proper TypeScript definition helps developers by providing helpful hints, type-checking at compile-time, and more robust auto-completion.

  1. Better Intelligence
    The tooling can provide software development teams with more context-rich granularity when coding — leading to fewer errors.
  2. Compile-time Type Checking: Allow for catching possible bugs in your code that you may miss without TypeScript’s type-checking benefit. It greatly enhances build-time code reliability.
  3. Definitive Auto-completion: Better auto-completion aids in quick coding, with suggestions based on TypeScript definitions giving developers an accurate find-and-replace functionality. By having accurate types, your editor gets a clear insight into the value or the functionalities that are available without searching the entire code base.

What else

Read our release blog post to learn more about:

  • Display The Editor Toolbar At The Bottom On Mobile Devices
  • Improved Accessibility
  • Enhanced Pasting of content from 3rd party tools
  • Change Default Settings for Images Inside Iframe
  • Consistent API for image, video, and file uploading
  • Improved adding table rows functionality

Core Editor Improvements

Feedback from our user community continues to drive the development and refinement of Froala’s core editor. Improvements include expanding functionality, enhancing user experience, and fixing bugs.

Improvements to the Editor API

Say hello to the toolbarResponsiveToEditor API option for improved editor toolbar responsiveness. 

Froala is known for its responsive toolbar. It was the first editor to introduce API options to handle toolbar button visibility based on screen size. It provides developers with four API options: toolbarButtons, toolbarButtonsMD, toolbarButtonsSM, and toolbarButtonsXS. These options accept objects or arrays to give the developer flexibility when writing code. 

  • toolbarButtons: used to set the list of buttons that appear in the rich text editor’s toolbar on large devices (≥ 1200px).
  • toolbarButtonsMD: used to set the list of buttons that appear in the rich text editor’s toolbar on medium devices (≥ 992px). If you don’t set it, the toolbarButtons value will be used.
  • toolbarButtonsSM: used to set the list of buttons that appear in the rich text editor’s toolbar on small devices (≥ 768px). If you don’t set it, the toolbarButtonsMD value will be used.
  • toolbarButtonsXS: used to set the list of buttons that appear in the rich text editor’s toolbar on extra small devices (< 768px). If you don’t set it, the toolbarButtonsSM value will be used.

As you can see, these options are set based on window width. But in real applications, there are many cases where the developers limit the width of the editor to a reasonable width, for example, setting the editor max-width to 800px. In such cases, if you resize your browser, you may observe the toolbar buttons adjust before the editor size itself changes. It was the developer’s responsibility to use the provided options to adjust the toolbar display as needed. However, there were many requests to change this toolbar behavior to make it responsive to the editor size, not the screen size. 

In this release, we introduce another option to control editor toolbar behavior. The toolbarResponsiveToEditor API option accepts a Boolean with a default value set to false. This means the toolbar responds to the browser window size. If you prefer to make the editor toolbar responsive based on editor size, set the toolbarResponsiveToEditor option to true. This option enhances the editor’s UI by making toolbars more responsive. To enjoy this new option, update your editor now.

The updated API method html.wrap generates cleaner HTML output

The editor html.wrap API Method helps developers customize the HTML output by wrapping the text using a div with the class fr-temp.

  • The first parameter determines if the editor text should be wrapped or not.
  • The second parameter determines if the <td> and <tr> text should be wrapped or not.
  • The third parameter determines if the text inside the<blockquote> tag should be wrapped or not.

Merging cells in a table wrapped using html.wrap creates empty paragraphs inside the merged cell.

var editor = new FroalaEditor('.selector', {}, function () {

// Call the method inside the initialized event.

editor.html.unwrap(false, true, false);

})

With the new updated html.wrap API Method, developers will now experience cleaner editor content when using this method. We encourage you to explore this improved feature and harness its potential in your web application development projects.

Get rid of console error when inserting content using the editor html.insert API method

The html.insert API method allows developers to insert content inside the editor programmatically. You may want to insert content inside the editor in different cases. For example, when a specific event occurs or when you create a custom button that inserts specific content when clicked.

The method takes two parameters:

  1. The first parameter is the HTML to be inserted.
  2. A Boolean parameter. Set it to True if you want the editor to clean HTML content upon insertion, or False to insert content without any cleaning.

Occasionally, a “TypeError: Cannot read properties of undefined (reading 'which')“ error message shows up in the console when calling this method. This no longer happens.

var editor = new FroalaEditor('.selector', {}, function () {
  // Call the method inside the initialized event.
  editor.html.insert('foo bar', true);
})

Improved drag and drop experience

The Froala Draggable plugin allows you to move elements using your computer mouse. In the latest update, we have improved the overall drag and drop experience. User interactions are now more fluid and accurately represented on screen, providing a smooth, responsive experience while moving elements.

The plugin comes with thedragInline API option which specifies how the dragged elements should be placed in the new position. When this option is set to false, dragged elements are placed between block tags and not inside them.
Try to drag the section with red border in the below example:

Improved Safari Support

As part of Froala’s ongoing effort for cross-browser usability, continued improvements have been made to ensure better support for Safari. Now pasting links and images from third-party tools inside the Safari editor has been improved. We have also resolved issues related to incorrect behavior on Ipad Safari when backspacing on Korean text.

As always, we highly encourage developers to update their Froala version to enjoy these improvements and keep their editor within specifications.

Maintaining Viewport Stability: Enhanced FullScreen Transitions and Resolving iFrame Scrolling while pressing backspace

In an effort to deliver a more fluid user experience, we have enhanced full-screen transitions, resulting in more intuitive and engaging displays that go easy on the eyes whenever the mode is toggled. As a result of these UI enhancements, you can expect seamless switches between full-screen and standard modes, ensuring viewport stability for user convenience.

We have also addressed an issue regarding iFrame scrolling while pressing backspace. This unusual activity created difficulty navigating backward through the text. The loss of place posed a significant inconvenience, particularly in lengthy texts. This issue is now resolved. Pressing the backspace key no longer triggers unexpected and intrusive scrolling behavior, enabling greater ease and focus when editing and revising your content. 

Many bug fixes

Every new release of Froala features bug fixes to improve its software stability and quality.

Table row with display: none style no longer causes issues

Consider the following scenario

  • You have a table inside the editor
  • One of the table rows has a display: none style
  • You delete a row after the row with the display: none style

Previously, the editor was deleting the incorrect row, but this issue has now been resolved, and the correct row will now be deleted.

Check the release notes for the complete list of updates and improvements

How do I upgrade to V4.1?

Downloading and updating the Froala Editor is extremely straightforward. We have a dedicated page for each Framework SDK that explains in detail how to install or update your SDK to the latest version. Follow the links below to get started.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Technical Questions

Download Froala Editor

How to Integrate Froala with Angular

How to Integrate angular

Before diving in, it’s crucial to understand why you might want to use Froala. Apart from its rich set of features, it’s customizable, intuitive, and plays well with frameworks like Angular. The Froala community is active, ensuring that the editor keeps improving and that you receive support when needed with angular wysiwyg editors.

 How to integrate Froala with Angular

1. Create a New Angular Project (If you haven’t already):

For those who are starting fresh:

npm install -g @angular/cli

ng new your-project-name

cd your-project-name

2. Installation

Begin by integrating the angular-froala-wysiwyg package:

npm install angular-froala-wysiwyg

3. Styling the Froala Editor

Ensure that Froala’s style resources are linked. In your project’s index.html, paste:

<link href="node_modules/froala-editor/css/froala_editor.pkgd.min.css" rel="stylesheet">

Icon styling boosts the editor’s appeal. Use Font Awesome:

 npm install font-awesome

4. Setting Up in Angular

Head to app.module.ts and import necessary modules:

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';

Update your @NgModule:

@NgModule({
   ...
   imports: [
     ...,
     FroalaEditorModule.forRoot(),

     FroalaViewModule.forRoot()
   ],
   ...
})

5. Ensure All Styles are Loaded:

In angular.json, add:

"styles": [

  "styles.css",
   "node_modules/froala-editor/css/froala_editor.pkgd.min.css",
   "node_modules/froala-editor/css/froala_style.min.css"
]

6. Using Froala in a Component

Let’s see this in action. Navigate to your component, like app.component.html:

<div [froalaEditor]>Hello, Froala!</div>

For two-way data binding:

public editorContent: string = 'My initial content';

<div [froalaEditor] [(froalaModel)]="editorContent"></div>

7. Test it out by running:

ng serve

If you have default settings, it will be running on localhost:4200/ and you should see this:

Angular localhost

8. Adding a Custom Button

Here’s where the fun begins! We can expand Froala’s capabilities by adding our own custom buttons. Let’s dive into a real-world example:

Firstly, import Froala and define the component structure:

import FroalaEditor from 'froala-editor';
import { Component, OnInit  } from '@angular/core';
@Component({
  selector: 'app-demo',
  template: `<div class="sample">
               <h2>Sample: Add Custom Button</h2>
               <div [froalaEditor]="options" [(froalaModel)]="content" ></div>
             </div>`,
  ...
})

Within the component, implement the OnInit method:

export class AppComponent implements OnInit{
  ngOnInit () {
    FroalaEditor.DefineIcon('alert', {NAME: 'info'});
    FroalaEditor.RegisterCommand('alert', {
      title: 'Hello',
      ...
      callback: () => {

        alert('Hello!');
      }
    });
  }
  public options: Object = {
    ...
    toolbarButtons: ['bold', 'italic', ...,'alert'],
    ...
  };
}

9. Events and Methods

Froala events allow you to run specific actions in response to editor activities. For instance, you can run a function when the editor’s content changes.

public options: Object = {
  events : {
    'froalaEditor.contentChanged' : function(){
      console.log('Content updated!');
    }
  }
};

Methods provide control over the editor’s behavior. For instance:

// Initialize the editor first
editor = new FroalaEditor('div#editor');
// Use a method
editor.html.set('<p>New HTML content</p>');

With regards to Manual Initialization

Get the functionality to operate on the editor: create, destroy and get editor instance. Use it if you want to manually initialize the editor.

(froalaInit)="initialize($event)"
// Where initialize is the name of a function in your component that will receive an object with different methods to control the editor initialization process.
public initialize(initControls) {
  this.initControls = initControls;
  this.deleteAll = function() {
    this.initControls.getEditor()('html.set', '');
  };
}

The object received by the function will contain the following methods:

  • initialize: Call this method to initialize the Froala Editor
  • destroy: Call this method to destroy the Froala Editor
  • getEditor: Call this method to retrieve the editor that was created. This method will return null if the editor was not yet created

Displaying HTML

To display content created with the Froala editor use the froalaView directive.

[froalaView]="editorContent"
<div [froalaEditor] [(froalaModel)]="editorContent"></div>
<div [froalaView]="editorContent"></div>

Use Cases for Froala and Angular Integration

  1. Dynamic CMS: Make a content management system where users can edit and publish content in real time, while the backend (which is powered by Angular) handles and stores data efficiently.
  2. Educational Platforms: Froala can be used to create and edit rich-text course content, quizzes, and assignments on platforms that offer courses, while Angular can be used to manage user data, track progress, and do other things.
  3. E-Commerce Platforms: Froala can be used to change product descriptions, customer reviews, and any other text on e-commerce platforms. Angular, on the other hand, can handle the cart, user authentication, and managing products.
  4. Collaborative Tools: Tools like document editors or design platforms that let more than one person edit at the same time. Froala can handle the editing, and Angular can handle user sessions, updates in real time, and resolving conflicts.

Why choose Froala with Angular?

Angular is one of the most powerful front-end frameworks because it is scalable, modular, and has a responsive ecosystem. On the other hand, Froala has a rich-text editor that is sleek, easy to use, and powerful. When put together, the two can make applications that are very interactive and dynamic.

1. Reactive Forms with Froala

Reactive forms in Angular are a powerful way to react to form inputs. When developers combine Froala with Angular’s reactive forms, they can easily link the editor’s content to the form controls. This makes sure that when users change content in Froala, the form control underneath is updated automatically, and vice versa.

To integrate Froala with Angular’s reactive forms, you’ll first set up your form and then bind the Froala editor content to a form control:

// In your component.ts

import { Component } from '@angular/core';

import { FormBuilder, FormGroup } from '@angular/forms';

@Component({
  selector: 'app-editor',
  templateUrl: './editor.component.html'
})
export class EditorComponent {
  editorForm: FormGroup;
  constructor(private fb: FormBuilder) {
    this.editorForm = this.fb.group({
      content: ['Initial content']
    });
  }

In your HTML:

<form [formGroup]="editorForm">
  <textarea [froalaEditor] formControlName="content"></textarea>
</form>

2. Dynamic Content Loading

Similarly, you can easily get content from a backend service and bind it to the Froala editor using Angular’s dynamic content loading features. In other words, this means that for CMS-based applications, the content can be fetched, edited in Froala, and then saved back in a very responsive way.

3. Custom Directives with Froala

Above all, with Angular’s powerful directive system, developers can give DOM elements their own custom behaviors. With Froala, you can make your own directives to give the editor special features. For example, you could use a directive to automatically format content, add custom validations, or even work with plugins from other sites.

4. Component-Based Architecture

In addition, the modularity of Angular is ensured by its component-based architecture. You can make a Froala editor component that works on its own and can be used in other parts of your application. This makes sure all instances of the editor behave and look the same.

Example:

Create a standalone Froala editor component:

editor.component.ts:

import { Component, Input } from '@angular/core';

@Component({

  selector: 'app-froala-editor',

  templateUrl: './froala-editor.component.html'

})

export class FroalaEditorComponent {

  @Input() content: string;

}

In your froala-editor.component.html:

<textarea [froalaEditor] [(ngModel)]="content"></textarea>

Then, you can reuse this component throughout your application:

<app-froala-editor [content]="myContent"></app-froala-editor>

When you use this Angular wysiwyg editor, adding these features will help improve the dynamic capabilities of your Angular application, making it both efficient and easy to use.

5. AOT Compilation and Lazy Loading

Furthermore, by converting Angular components and templates into JavaScript code that the browser can immediately execute, Angular’s Ahead-of-Time (AOT) compilation optimizes the application. When you combine this with Froala, the editor is quick and the user experience is improved. With lazy loading, the editor and its assets can be loaded only when they are needed, making the first load time faster.

6. Event-Driven Architecture

Both Angular and Froala are heavily event-driven. In other words, this makes it easy to set up event listeners that respond to certain actions. For example, you could set up an event that happens when the content in Froala reaches a certain number of words or when a certain style is used. Use the best angular wysiwyg editor to do all of these things.

Ready to build more with Froala and its Angular Wysiwyg Editor?

Because of this, the integration of Froala with Angular isn’t just about embedding a text editor within an Angular application. It’s about harnessing the combined power of a world-class text editor and a leading front-end framework. Whether you’re building a small blog or a full-fledged web application, this combination ensures scalability, reactivity, and a top-notch user experience with an angular wysiwyg editor.

 

Get Froala Editor Now

Integrate Froala with React

integrate Froala with React

Earlier this week, Froala announced its most impressive editor release ever 4.1. This release was eagerly anticipated by React developers since it supports React 18. This means you can now easily include a React WYSIWYG editor component in your React application made using Froala, the top WYSIWYG editor.

Froala provides a modern user interface React WYSIWYG editor equipped with hundreds of features including a powerful API, basic and advanced rich text editing functions, SEO-friendly content, accessibility support, security, and compatibility with MS Word, Excel, and Google documents.

In this article, we will demonstrate how to initialize Froala’s editor in a React application using Froala’s React SDK.

We assume you have a working knowledge of:

  • JavaScript (including some of the newer, es2015 features)
  • React
  • How to use the terminal/command line
  • Node and npm

We will create a simple application and guide you step-by-step through this tutorial. There will be a working demo at the end of the article.

React WYSIWYG editor

Step 1: Creating A React App.

Skip this step if you will install the editor in an existing React app.

  1. Open the Node.js command prompt
  2. Navigate to the location where you want to install the React app.
  3. Since we don’t have a running React app. we will create a new React application using a package called create-react-app. To install the package run
    npm install -g create-react-app
    Note:
    If you’ve previously installed create-react-app it globally via npm install -g create-react-app, we recommend uninstalling the package using npm uninstall -g create-react-app or yarn global remove create-react-app. Then install it again to ensure that npx always uses the latest version.
  4. Run:
    npx create-react-app my-froala-editor-app

    A command which creates a React app. Create React app

    After running this command, if you go to the specific location you will find a folder called my-froala-editor-app containing the React app files.

Step2: Installing Froala

Navigate to the my-froala-editor-app folder via your terminal/command line window.

cd my-froala-editor-app

Once inside, install Froala’s React SDK by running the following command:

npm install react-froala-wysiwyg --save

Don’t forget, the --save flag is important as it adds the installed NPM package to the dependencies in your package.json file. This ensures that the Froala editor is included in your deployed application.

install Froala react SDK

Check your application’s node_modules directory or the package.json file for a successful installation of the Froala library. The react-froala-wysiwyg should now be present

Step3: Displaying the Froala Editor

Once you have installed the Froala React SDK, you can display the editor in any existing component by nesting <FroalaEditorComponent tag='textarea'/> into it.

As a test, open the app.js file in the src folder and edit it as follows:

    1. First, import the editor CSS stylesheet so the editor UI appears correctly
      // Require Editor CSS files.
      import 'froala-editor/css/froala_style.min.css';
      import 'froala-editor/css/froala_editor.pkgd.min.css';

      Note:
      froala_style.min.css: Only needed if you display the editor content outside the rich text editor to preserve the look of the edited HTML.
      froala_editor.pkgd.min.css: Contains the editor UI styles, such as the toolbar, buttons, popups, etc.

    2. Import FroalaEditorComponent so you can use the component inside the app function
      import FroalaEditorComponent from 'react-froala-wysiwyg';
    3. Place a <FroalaEditorComponent tag='textarea'/> where you want the editor to appear. I will add it under the <header> element. The app.js should now look like this
      import logo from './logo.svg';
      
      import './App.css';
      
      import 'froala-editor/css/froala_style.min.css';
      
      import 'froala-editor/css/froala_editor.pkgd.min.css';
      
      import FroalaEditorComponent from 'react-froala-wysiwyg';
      
      function App() {
      
      return (
      
      <div className="App">
      
      <header className="App-header">
      
      <img src={logo} className="App-logo" alt="logo" />
      
      <p>
      
      Edit <code>src/App.js</code> and save to reload.
      
      </p>
      
      <a
      
      className="App-link"
      
      href="https://reactjs.org"
      
      target="_blank"
      
      rel="noopener noreferrer"
      
      >
      
      Learn React
      
      </a>
      
      </header>
      
      <FroalaEditorComponent tag='textarea'/>
      
      </div>
      
      );
      
      }
      
      export default App;
    4. That’s it, run the app using the command npm start
    5. The http://localhost:3000 should be open automatically on your browser and that app now is running. Scroll down and you will find the Froala editor displayed with its basic configuration under the default React header

Step4: Create a custom Froala Editor component

As you can see it is very simple to install and use the Froala editor inside your application. However, since most developers will need to customize the editor function and style to their needs before displaying it, let’s see how we can do this.

Ideally, you will need to create a custom React component. Component files are where you define the structure, the UI logic, and the component’s specific behaviors, including state handling and methods that get executed in response to user actions.

React supports two types of components:

  1. Class component
  2. Functional component

There are a few fundamental differences between the class and functional components:

  1. Syntax: Class components are written as ES6 classes, while functional components are simple JavaScript functions.
  2. Lifecycle Methods: Class components allow you to use lifecycle methods (like componentDidMount, componentDidUpdate, and componentWillUnmount). Prior to React 16.8, functional components did not have this ability. However, with the introduction of Hooks in React 16.8, you can now use features like state and lifecycle methods in functional components using useEffect.
  3. State Management: Before React 16.8, state could only be used in class components. Now, however, with the introduction of the useState and useReducer hooks, you can use state in functional components too.
  4. This Keyword: In class components, the this keyword is used to access props, state, and methods. In functional components, there’s no this keyword, and props are passed in as a function argument.
  5. Boilerplate & Readability: Class components often require more code than functional components. And due to the simplicity of functional components, especially with hooks, they can lead to more readable code for some developers.

Froala SDK can be used in both types as declared in the SDK documentation. In this article, we will use the functional component.

Create a new directory in the src directory called components and create a file called FroalaBasicEditorComponent.jsx in that directory. Feel free to use a different name but remember to write it correctly in the code.

folder stracture

Similar to what we did in the App.js we will import the editor styles, and the editor component and call it inside whatever HTML markup we want. The EditorComponent.jsx now should be like

import React from 'react';

// Require Editor CSS files.

import 'froala-editor/css/froala_style.min.css';

import 'froala-editor/css/froala_editor.pkgd.min.css';

import FroalaEditorComponent from 'react-froala-wysiwyg';

// Render Froala Editor component.

function EditorComponent (){

return (

<div class="editor">

<h3> Froala's React WYSIWYG Editor</h3>

<FroalaEditorComponent tag='textarea'/>

</div>

);

}

export default EditorComponent;

As you can see, we simply return a header and put FroalaEditorComponent inside a div with class editor. Finally, we export the new component so we can import it into other components.

Now we can remove the lines we added previously to the App.js file and add the following:

import EditorComponent from './components/EditorComponent';

and <EditorComponent /> replaces <FroalaEditorComponent tag='textarea'/> so App.js should look like this:

import logo from './logo.svg';

import './App.css';

import EditorComponent from './components/EditorComponent';

function App() {

return (

<div className="App">

<header className="App-header">

<img src={logo} className="App-logo" alt="logo" />

<p>

Edit <code>src/App.js</code> and save to reload.

</p>

<a

className="App-link"

href="https://reactjs.org"

target="_blank"

rel="noopener noreferrer"

>

Learn React

</a>

</header>

<EditorComponent />

</div>

);

}

export default App;

and if you open http://localhost:3000 you will see it display the same page layout as it is. Now we will customize the EditorComponent.jsx to customize the editor.

Let’s create a custom stylesheet file called EditorComponent.css where we can style the HTML elements related to the component. For example, centering the “.editor” div

.editor{

width: 60%;

margin: 60px auto;

}

We should then import that CSS file inside the EditorComponent.jsx like this

import './EditorComponent.css';

Basic Froala React editor

Now let’s customize the editor to load all plugins:

To load the full-featured editor, simply import the plugins JS file

// Import all Froala Editor plugins;
import 'froala-editor/js/plugins.pkgd.min.js';

Now the editor turns out to be like this

full-featured React editor

More customizations

The Froala editor has a powerful API with more than a hundred options, events, and methods. For example, you can use the API options to turn the editor into a document editor. Easily pass the desired options in the config object while calling the FroalaEditorComponent in your component.

function EditorComponent (){

    let config = {
      documentReady: true,
      heightMin: 300,
      events : {
        'contentChanged' : function(e, editor) {
          console.log('test');
        }
      }
    };

  return (
    
      <div class="editor">
        <h2> Froala's React WYSIWYG Editor</h2>
       <FroalaEditorComponent tag='textarea' config={config} />
      </div>
  );

}

export default EditorComponent;

Similarly, the events are also passed through the config object. For example:

function EditorComponent (){

    let config = {
      documentReady: true,
      heightMin: 300,
      events : {
        'contentChanged' : function(e, editor) {
          console.log('test');
        }
      }
    };

  return (
    
      <div class="editor">
        <h2> Froala's React WYSIWYG Editor</h2>
       <FroalaEditorComponent tag='textarea' config={config} />
      </div>
  );

}

export default EditorComponent;

There is a lot you can do with Froala, such as changing the default language, changing the editor theme, adding a custom button, and loading a special component. Later, we will have dedicated articles about this.

For now, have fun with Froala’s React WYSIWYG editor demo.

Froala Blog Call To Action

Introducing Froala Editor v4.1: The Long-Awaited Update Packed with Modern Framework Compatibility!

Core editor improvments

We are thrilled to announce the latest release of Froala, the WYSIWYG rich text editor, that everyone eagerly awaits. This new release comes with game-changing features that enhance compatibility with modern frameworks, making integration an absolute breeze. In this blog post, we’ll dig into the newly added Froala’s powerful feature set that makes content creation a pleasure rather than a chore.

Embracing Modern Frameworks: Angular, React, and Vue Compatibility!

One of the major reasons to get excited about this release is that Froala now supports the latest Angular, React, and Vue frameworks. This means you can enjoy Froala’s advanced feature set while quickly integrating and using the editor in a wide range of projects. Say goodbye to compatibility headaches and hello to smooth project workflows!
Froala 4.1 release
Customers will benefit from the support of these popular JavaScript frameworks, reducing development time and improving user experience. This release ensures that the editor performs efficiently when working with these modern frameworks, minimizing the chances of performance bottlenecks or slowdowns. It was designed to work harmoniously with your chosen framework for a smoother user experience.

React SupportReact framework logo

The editor now supports React V18. Providing support for the latest React version helps React developers reduce their development time and avoid errors. React is a popular framework with 17M+ NPM weekly downloads. This upgrade demonstrates our commitment to keep pace with technological innovation and modern design trends. It presents our users with a more sophisticated cutting-edge tool to maximize their productivity.

We have updated the React SDK documentation to show you how to use it with Class or Functional components. Additionally, it provides an example of how to create a custom button. This is one of the most valuable things you can do if you want to learn how to customize the Froala editor for enhanced functionality.

Angular Support

Angular framework logoFroala Editor 4.1 now fully supports Angular, providing seamless integration with the framework. Developers can benefit from improved compatibility and create engaging content using Froala and Angular.

The editor now provides two Angular SDKs:

The updated Angular SDK documentation is more organized than ever before. It is now easier to explore different integration guides. It explains how to use the editor API and its options, events, and methods more clearly. Moreover, you will find an explanation of how to extend the editor’s functionality and more.

Vue Support

Vue framework logo

The Vue.js community can also breathe a sigh of relief! Froala embraces Vue.js 3, a progressive JavaScript framework. This makes it easier than ever to benefit from the rich text editor’s advanced features while simplifying the integration processes.

The editor now provides two Vue SDKs:

The Vue SDK documentation includes instructions on how to integrate the SDK, how to use the editor API, how to add a custom button, how to display the editor, and more.

How Supporting Modern Frameworks Gives Developers a Better User Experience

As part of Froala now supports the React, Angular, and Vue frameworks, the editor now provides

  • Typescript definition support
  • Display the Froala editor’s toolbar at the bottom on mobile devices
  • Improved accessibility
  • Enhanced pasting of content from 3rd party tools
  • Change default settings for Images Inside Iframe
  • Consistent API for image, video, and file uploading
  • Improved adding table rows functionality
  • And much more!

Typescript Definition Support

In addition to its compatibility with key JavaScript frameworks, Froala 4.1 takes a forward-looking leap in the right direction by incorporating support for Typescript definitions. This inclusion enhances certainty and reduces the possibility of errors during code compilation. Why does this matter? Typescript, a statically-typed superset of JavaScript, essentially aids developers in writing error-free code, verifying it at the development stage rather than during execution.

By integrating Typescript definitions, users can now benefit from auto suggestions offered by the software while coding. Auto suggestions prompt users in real-time with suitable code autocompletion as they type, creating a more seamless and agile development process. This great feature added to Froala 4.1 reduces Typescript integration complexity. By making sense of user needs, targeted coding becomes a smoother, more focused process, thereby minimizing the scope of errors.

For example, the API iframe option is defined as “Boolean” in Typescript definitions. If a developer, by mistake, configures it this way:
Iframe: "True"
This will highlight an error because “True” (inside double quotes) becomes a string, not a boolean. This will help users integrate the Froala editor using Typescript easily and avoid errors.

Display The Editor Toolbar At The Bottom On Mobile Devices

Forala lets you customize how the editor toolbar looks and where it is displayed. By default, the Froala Toolbar appears at the top. This can be changed and the toolbar displayed at the bottom by setting the toolbarBottom API option to true. This is suitable for chatting and messaging applications. This was only occurring on large screens.

new FroalaEditor('.selector', {

toolbarBottom: true

});

Starting with version 4.1, Froala also displays a toolbar at the bottom of mobile and small screens when this option is enabled. Open the Toolbar Bottom example on your mobile to play with it.

Froala bottom toolbar

Improved Accessibility

In the context of HTML content, accessibility refers to the design and creation of web content that is easily understandable and usable by disabled people. This ensures that everyone, including individuals with disabilities, can interact with the web content effectively.

The Froala WYSIWYG Editor is compliant with ARIA (Accessible Rich Internet Applications). The ARIA markup adds specific attributes to HTML elements, making them more accessible.

It’s important to make emoticons and special characters accessible by providing a description text in addition to their visual representation for screen readers.

To add ARIA markup for emoticons or special characters, use the aria-label attribute along with the role attribute (with a value “img”). The aria-label should contain a description of the emoticon or special character. Here is an example:

<span role="img" aria-label="Smiling face emoji">😀</span>

Screen readers will read the “aria-label” value, “Smiling face emoji”, making it accessible to users who rely on assistive technologies.

Inserting emoticons or special characters using Froala automatically adds an ARIA markup.

Froala is also Web Content Accessibility Guidelines (WCAG)-compliant, which includes implementing keyboard navigation to enable users with mobility impairments to interact with the website. By upgrading to Froala 4.1, you can navigate inside the emoticons and special characters popups using the arrow keys, the Tab and Enter keyboards.

Using the Froala editor, HTML content will be accessible to a broader range of users, promoting inclusivity.

It’s even possible to customize the emoticons you want to display to your users with Froala. Check the below example.

Enhanced Pasting of content from 3rd party tools 

Froala is known for its ability to paste content from 3rd party tools without losing the pasted format. Compared to other WYSIWYG html editors, Froala was superior. Due to the complex operations, Froala performed on the content through the pasting process, it hung if the content was extremely large. Froala 4.1 can process and load large pasted content without crashing or freezing.

Change Default Settings for Images Inside Iframe 

In the Froala editor’s normal mode, the editor content can be affected by the CSS code of the pages where the editor is loaded.  In certain cases, this could apply unwanted styles to the editor’s content. For example,

If you have the following CSS code on your page

h1{

color: red;

}

Then, after you add H1 heading inside your editor, it will be red. To avoid this, load the editor inside Iframe. In this case, the editor will not be affected by page style.

To enable Iframe mode, easily set the Iframe API option to true.

new FroalaEditor('div#froala-editor',  {

iframe: true

});

When Iframe mode was enabled, the uploaded images were

  • Aligned to left
  • Inserted at the top of the content
  • The user cannot use the Align button

Once you update your editor to version 4.1, the uploaded images inside the iframe mode will behave as in the normal mode and be

  • Center aligned
  • Inserted at the cursor position
  • The user will be able to change the image alignment using the Align button.

You are still able to change the default alignment by setting the imageDefaultAlign API option to ‘left’ or ‘right‘ as you like.

new FroalaEditor('.selector', {

imageDefaultAlign: 'left'

});

In the below example, the Froala editor is loaded inside iframe

Consistent API for image, video, and file uploading 

We believe that maintaining consistent coding functions is crucial for several reasons.

  1. Readability: When a code has a consistent style, it becomes easier for you and others to read and understand. Consistency enables developers to focus on the logic of the code rather than spending time discerning arbitrary differences in style or formatting.
  2. Maintainability: A consistent code allows developers to predictably make changes and updates, reducing the chance of introducing errors or creating conflicts with other parts of the code base. This predictability makes it easier for team members to navigate and work in different sections of the code.
  3. Collaboration: Consistency helps improve collaboration between developers. By following shared coding standards and conventions, developers can quickly understand each other’s work and reduce the risk of miscommunication or confusion when working on the same project.
  4. Onboarding: In large development teams or when onboarding new team members, a consistent coding style allows newcomers to understand the code, its structure, and patterns more quickly. This aids in increasing productivity and contributes to a smoother transition for new developers in the team.
  5. Quality: When a code is consistently written and organized, it explains the logical flow and simplifies the debugging and error identification. With a consistent style, finding potential flaws and issues becomes more efficient, helping to maintain the overall software quality.

Therefore, we rewrote the Video, File, and File Manager plugins API to flow with the image plugins API.

Improved adding table rows functionality

Froala makes the insertion and editing of tables easy. The edit table toolbar provides all the necessary functions. With a single click, you can add a table header or footer. You can also:

  • Add/remove a row
  • Add/remove a column
  • Remove table
  • Style table
  • Style table cell.
  • Merge cells vertically or horizontally
  • Split cells vertically or horizontally
  • Align cell content horizontally
  • Align cell content vertically

In the previous releases, when an additional table row is added, it creates a normal table row <td> regardless of the cell or row type, that is, header or normal.

Starting from the Froala 4.1 release, when you are on a table header cell <th> and insert an additional row or column, it will add another header row or column. Otherwise, a normal row or column is added.

As a side note, you can customize the editing table popup using the tableEditButtons API option.

new FroalaEditor('.selector', {

tableEditButtons: ['tableRows', 'tableColumns', 'tableCells', 'tableCellVerticalAlign', 'tableRemove']

});

Many bug fixes

Issues like:

  • Markdown UI breaks when enabling the iframe option
  • Hovering over the toolbar buttons generates a lot of errors in the console

are no longer happening

Core Editor Improvements

As a company that innovates web editing, we are constantly improving our core editor’s functionality. As part of this release, many improvements were made to the core editor. Check the changelog for the complete list of improvements and fixes.

 

How this release benefits key Enterprise account customers

While Froala is a powerful tool for all customers, it’s our Enterprise customers who get to enjoy the exclusive benefit of incorporating the editor within their SaaS offerings.

The beauty of the Froala editor lies not just in its core capabilities, but in its robust compatibility with leading-edge modern frameworks like React, Angular, and Vue. This means you can rebuild your apps with these frameworks, confident that you won’t face a barrage of integration errors.

Consider the impact this seamless user experience could have. By integrating the editor, you’re offering an upgraded interface to your customers, one that could broaden your customer base and escalate your sales.

So, why not let the enhanced functionality of Froala’s editor play a pivotal role in your success story? Boost your SaaS product, improve your profits, and let the journey of your customer be as smooth and appealing as it can possibly be!

 

In Conclusion: Embrace the Future with Froala Editor

Froala’s latest release enables a seamless editing experience with the latest React, Angular, and Vue frameworks. It delivers an unmatched content creation experience, backed by an impressive feature list and powerful compatibility with modern frameworks, such as React, Angular, and Vue. With effortless integration and customization capabilities, Froala Editor is quickly becoming the go-to choice for developers and content creators alike. Give it a try today and elevate your projects to new heights!

Why Froala?

Froala Editor v4.1 is a WYSIWYG-rich text editor compatible with modern frameworks and provides a powerful feature set, powerful API, detailed documentation, easy customization, and easy theming. Froala Editor features include Font Awesome icon support, document mode and PDF export, responsive videos, advanced Image Manager, advanced list item types, and enhanced text formatting with inline classes & line height

Froala is rated as one of the top WYSIWYG text editors on the market. This is due to its ease of use, setup, and clean design.

How Can I Update?

Downloading and updating the Froala Editor is extremely straightforward. We have a dedicated page for each Framework SDK that explains in detail how to install or update your SDK to the latest version. Follow the links below to get started.

If you are using a plain JavaScript library or other framework, check the get started page to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

If you are using a plain JavaScript library or other framework, follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.1/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.1/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that demonstrate the functionality of the Froala HTML Editor.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We would like to hear what you think of the latest release! Join us on our GitHub Community to chat with our product manager, developers, and other members of the Froala team.

Technical Questions

Download Froala Editor

 

 

Enhance Your React Forms With a Rich Text Editor

react rich text editor

React, a popular JavaScript library for building user interfaces, offers a seamless development experience. 

The 2023 StackOverFlow survey with 60,000 developers highlights that React remains one of the most popular frameworks and web technologies used by professionals. However, when it comes to forms, React’s native input components cannot handle rich text formatting. 

In content creation, blog posts, or email composition scenarios, users need formatting options like bold, italic, bullet points, and hyperlinks. 

Improving the experience

Integrating a rich text editor is essential to overcome this limitation and provide a robust form experience. 

By incorporating a rich text editor, developers can empower users to express themselves more effectively and enhance their experience.

This article will explore how to enhance React forms using Froala Editor, a customizable rich text editor solution. 

Creating a Project

If you haven’t already, set up a new React project by running a Create App React:

npx create-react-app my-app

Before installing the Froala package, enter the newly created app directory with the command.

cd my-app

Install the Froala Editor package in your React project. 

This package provides components and stylesheets required for integrating Froala Editor seamlessly into the application.

You can do this by running the following command in your project directory. 

npm install react-froala-wysiwyg 

Starting the code

Import Froala Editor: In the component where you want to use the rich text editor, import the elements from the Froala Editor package.

import ‘froala-editor/css/froala_editor.pkgd.min.css’;

import ‘froala-editor/css/froala_style.min.css’;

import FroalaEditor from ‘react-froala-wysiwyg’;

import React from ‘react’;

Implement the Editor: In your component’s render method, add the FroalaEditor component, passing the necessary props. 

  class ReactForm extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        editorContent: ,
      };
    }

The code is defining a class called ReactForm which extends React.Component class. This indicates that ReactForm is a component in a React application.

The constructor method is used to initialize the state of the component. In React, a state is an object that holds the data that can change over time and affect the component’s rendering. The constructor takes in a props parameter, representing the properties passed to the component.

Inside the constructor, the super(props) statement is called, which is necessary when defining a constructor in a subclass of React.Component. It calls the constructor of the parent class (React.Component), passing in the props parameter. This ensures that the component is initialized correctly according to the React.Component implementation.

The state property of the component is set using this.state = { editorContent: ” }. Here, editorContent is the key in the state object, and its initial value is an empty string (”). The state object is used to store and manage the data specific to the component.

    handleEditorChange = (content) => {
      this.setState({ editorContent: content });
    }

This code defines an arrow function called handleEditorChange within the class ReactForm. This function takes a parameter called content.

The function is used as an event handler for updating the state of the component. In particular, it is designed to handle changes in an editor, where the content parameter represents the updated content of the editor.

Inside the function body, this.setState({ editorContent: content }) is called. setState is a method provided by the React.Component class that allows you to update the state of a component.

In this case, setState is called with an object { editorContent: content }. This object specifies the new state values to be updated.

Using setState, React knows that the state has changed, and it triggers a re-render of the component, causing any parts of the UI that depend on the state to update accordingly.

    render() {
return (
<div>
<h2>React Form</h2>
<FroalaEditor
tag=’textarea’
onModelChange={this.handleEditorChange}
config={{
toolbarButtons: [‘bold’, ‘italic’, ‘underline’],
}}
/>
</div>
);
}
}
export default ReactForm;

The code shows the render method of the ReactForm component. In React, the render method is responsible for generating the JSX (JavaScript XML) that represents the component’s UI.

Inside the render method, there is a return statement that wraps the JSX within parentheses. The returned JSX represents the structure and content of the component’s UI.

In this case, the returned JSX consists of a <div> element as the root container. Within the <div>, there is an <h2> element with the text “React Form” as the heading.

Below the <h2> element, there is a FroalaEditor component. It is assumed that the FroalaEditor component is imported from an external library or component module. The FroalaEditor component represents an editor component for handling text input.

The FroalaEditor component has several props passed to it:

tag=’textarea’: This prop sets the underlying HTML tag of the editor component to be a <textarea>. It indicates that the editor should behave as a textarea input field.

onModelChange={this.handleEditorChange}: This prop sets the event handler function handleEditorChange to be called whenever the content of the editor changes. It means that whenever the user makes changes to the editor’s content, the handleEditorChange function will be invoked.

config: This prop is an object that contains configuration options for the editor component. In this case, the toolbarButtons option is set to an array [‘bold’, ‘italic’, ‘underline’]. This configures the toolbar buttons of the editor to only display the buttons for bold, italic, and underline formatting options.

Overall, the render method generates the JSX that represents the UI of the ReactForm component. It includes a heading, a FroalaEditor component for text input, and sets the event handler and configuration options for the editor.

The complete component will be this:

import ‘froala-editor/css/froala_editor.pkgd.min.css’;

import ‘froala-editor/css/froala_style.min.css’;

import FroalaEditor from ‘react-froala-wysiwyg’;

import React from ‘react’;

class ReactForm extends React.Component {

    constructor(props) {

      super(props);

      this.state = {

        editorContent: ,

      };

    }

  

    handleEditorChange = (content) => {

      this.setState({ editorContent: content });

    }

  

    render() {

      return (

        <div>

          <h2>React Form</h2>

          <FroalaEditor

            tag=‘textarea’

            onModelChange={this.handleEditorChange}

            config={{

              toolbarButtons: [‘bold’, ‘italic’, ‘underline’],

            }}

          />

        </div>

      );

    }

  }

  export default ReactForm;

 

In this example, we limit the toolbar buttons to include bold, italic, and underlined options. You can explore the Froala Editor documentation to discover the available toolbar buttons and their corresponding names.

That’s it! You now have a rich text editor integrated into your React form using Froala. 

Formatting options

Users can input and format text content with formatting options provided by the editor.

Integrating a rich text editor into React forms empowers developers to offer users a powerful and intuitive content creation experience. 

By providing a range of formatting features, Froala Editor enhances the functionality of React forms, enabling users to create visually appealing and well-structured content effortlessly. 

Integrating a rich text editor into React forms is a game-changer for capturing and manipulating rich text content. 

React forms become more versatile and user-friendly, allowing users to format text, insert media, and customize their content. 

Froala Editor provides a solution for seamlessly integrating a feature-rich text editor into React applications. 

Its extensive customization options and plugin support allow developers to create highly tailored and engaging editing experiences.

Download Froala Editor

Rank Higher on Google in 2024 with the SEO-friendly editor

SEO optimized content

With thousands of websites in your niche, how can you be the first result on Google for a certain keyword? If you don’t plan to spend a lot of money on paid ads, you have to optimize your web pages for search engines. Search engine optimization (SEO) is very important as it has many benefits from increasing organic traffic to boosting your site’s credibility.

SEO tips

SEO rules are updated quickly and you should learn the latest techniques to stay ahead of your competitors. However, there are some rules that are mandatory to be applied on every page and post you publish.

In this article, you will learn six essential on-page SEO tips to help your website rank higher on Google and other search engines. We will also explain how to incorporate these tips into your content using the SEO-friendly WYSIWYG editor Froala, which is much more convenient than manually modifying your HTML code, especially if you have no HTML programming skills.

 

How Froala can help you create a SEO-friendly content

Froala is easy to integrate with any web application using a few lines of code. It supports many web development frameworks. If you are using WordPress, download the WP plugin to get started. Alternatively, download the editor files to get started using it in any HTML/Javascript environment.

You can also use it online on this free online HTML editor tool, by copying your HTML into the editor, editing it, and copying it again into your application.

The advantage of using Froala to edit your content instead of editing the HTML content manually is the ability to see exactly how the content will look to the end users. Moreover, you can edit the HTML tags through Froala intuitive popups without the need to know these tags. This enables fast editing of the page content and accurately generated output without the need to learn HTML.

Now, let us start with the six powerful on-page SEO tips that will help you rank higher and boost your website’s organic traffic.

How to Optimize Your Content with Froala

1. Optimize Your Meta-Tags

Meta-tags play a crucial role in influencing click-through rates and rankings.

  • Title Tags: Keep them under 60 characters, incorporate primary keywords, and reflect the content’s topic
  • Meta Descriptions: Limit to 155 characters, include relevant keywords and create a compelling description of the page’s content
Editor configuration

Meta title and meta tags go under the <head> tag of your HTML. Most of the WYSIWYG editors strip out the <head> tag and its content, allowing you to only edit the page content. Froala also does this by default but you can change this behavior easily by setting the fullPage API option to true

new FroalaEditor('.selector', {

  fullPage: true

});

Then, you will be able to edit your whole HTML document, including the head section, where you can add and update your meta-tags effectively.

How to optimize Meta-tags using Froala:

Click on “More Misc” toolbar button then click on “Code View” button then start editing the meta tags. after finish editing click on the “Code View” button again to switch back to rich text editing mode.

2. Optimize Headings

Ensure that your headings accurately reflect the content to provide a better user experience. Use header tags (H1, H2, and H3) for a well-organized and structured page that search engines can easily crawl.

  • Utilize H1 tags for the main heading of the page, typically the title. Ensure only one h1 on a page.
  • Use H2 and H3 tags for subheadings, ensuring good organization and logical flow
  • Include targeted keywords in your headings, but don’t overdo it
Editor configuration

In Froala, you can quickly format headings using the toolbar options or keyboard shortcuts. By default, the paragraph format dropdown allows you to format the selected text in one of the below formats:

  • Heading 1: will wrap the selected text in <h1> tag.
  • Heading 2: will wrap the selected text in <h2> tag.
  • Heading 3: will wrap the selected text in <h3> tag.
  • Heading 4: will wrap the selected text in <h4> tag.
  • Code: will wrap the selected text in <pre> tag.
  • Normal: will warp text in <p> or <div> based on the value of the enter API option

The enter API option allows you to determine which tag <p>, <div>, or <br> to be inserted when the ENTER key is hit. Making the “Normal” paragraph option dependent on the “enter“ API option value is a great way to provide consistency in the produced HTML code which is also great for SEO.

If you want to add another paragraph format to the editor dropdown, you can easily edit the available options through the `paragraphFormat` API option. it is an object whose key is the HTML tag and its value is the text that will be displayed on the dropdown menu. For example, if you added into it the following code

paragraphFormat: {

SECTION: 'Block'

}

then in the dropdown menu, you will find the text “Block“, that when you select it, the paragraph code will turn into

<section>paragraph </section>

Use paragraph format options to ensure a clean and consistent HTML structure that is SEO-friendly.

new FroalaEditor('.selector', {
  paragraphFormat: {
    N: 'Normal',
    H1: 'Heading 1',
    H2: 'Heading 2'
  }
});

How to optimize headings using Froala:
  • Select the text
  • Click on “More Paragraph” button
  • Click on “Paragraph Format” button
  • Select the desired format

3. Add Alt Text to Images

Optimize the images by adding descriptive image alternative text (ALT), and captions to make them crawlable and accessible to visually impaired users.

The Froala image editing popup is giving you the ability to optimize your visuals for SEO without any hassle. Moreover, You can change the displayed image size, insert a link, and many more. you can control which options are displayed on this popup by editing the imageEditButtons API option. Furthermore, if you need to add custom functionality, you can create a Froala custom button and add it to the image editing popup through that option.

  • Alt text

Search engines cannot interpret images, so adding image alternative text (ALT) is essential for indexing and ranking.

  • Describe the image accurately while keeping the description concise
  • Include relevant keywords to improve the picture’s ranking
How to edit Alt text using Froala:
  • Click on the image
  • Click on the “alternative text” button from the popup that appears
  • Enter your alt text
  • click “Update“
  • Caption

Adding captions to your images can provide additional context and improve user engagement. Captions should be brief and informative.

  • Use concise and relevant descriptions for your captions
  • Include targeted keywords whenever appropriate, without overusing them
How to add image captions using Froala:
  • Click on the image
  • Click on “Image Caption” button from the popup that appears
  • Type in your desired caption and it will appear below the image.

SEO friendly editor

 

4. Utilize Internal and External Links

Linking to other relevant pages within your website (internal links) and to authoritative sources (external links) can improve SEO and user experience. This practice creates a better user experience, defines your website’s structure, and provides reference sources for your content. To optimize your links

  • Use descriptive anchor text for internal and external links that accurately describe the linked content.
  • Link to reputable and authoritative external sources to provide additional value and credibility to your content.
  • Regularly check and update the links to ensure they are not broken or outdated.
How to add/edit links using Froala:

In the Froala Editor, adding internal and external links is very intuitive. Simply highlight the desired text, click on the “Insert Link” option in the toolbar, enter the URL, and set the target attributes (e.g., open in a new tab).

Editing links is very easy too, just click on the link and select the edit button from the popup, then update the URL and target attributes as needed.

Editor configuration for editing link attributes

However Froala doesn’t provide editing links attributes by default, but you can customize this using the linkAttributes Froala API option.

Link ‘title’

One of the most important link attributes in SEO is link titles as they provide additional context for search engines to understand the linked content. Adding relevant and descriptive titles can improve your search engine ranking. Keep your title links short and concise but also keep them descriptive and keyword-rich.

By adding thetitle: 'Enter Title'to the linkAttributes object, a field for entering the link title will appear when adding or editing a link, allowing you to seamlessly incorporate optimized link titles into your content.

You can add more attributes to this object. The object key is the attribute name and its value is the placeholder for the created field.

Link ‘rel’

Another important attribute is the ‘rel’ attribute as it enables you to define the relationship between the linked page and your current page. For example, using rel="nofollow" can advise search engines not to follow certain links for ranking purposes. Froala linkAlwaysNoFollow option Specifies if the rel="nofollow" attribute should be added to all links.

Adding, editing, and optimizing links in Froala Editor is simple and efficient. With the right techniques, you can improve your website’s SEO, user experience, and overall performance.

5. Optimize Your Videos

Videos are engaging and can keep users on your site for a longer duration, but they also need to be optimized for SEO. Make sure your embedded videos have an SEO-friendly format, accurate title, and descriptive text.

  • Choose a suitable video hosting platform like YouTube or Vimeo for better load times and easier embedding.
  • Create accurate and engaging titles and descriptions for your videos, incorporating relevant keywords.
  • Add transcripts or captions to make the videos accessible to a wider audience and search engines.
  • Use a video schema markup to provide additional information about the video and improve search visibility.

The Froala rich text editor automatically parses YouTube, Vimeo, Yahoo, and Dailymotion video links. For videos from other sources, you can insert them by pasting the embedded code. With Froala you can also customize the video size and alignment without touching the code.

6. Quality Content is King

Creating informative, engaging, and original content is key to ranking high in search engines. The readability of your content plays a significant role in user engagement and search engine rankings. Properly formatting your text ensures it is easy to read and understand, ultimately improving the user experience and SEO performance. Ensure your content is:

  • Well-structured with headings, lists, and short paragraphs
  • Tailored to your target audience’s preferences and pain points
  • Updated regularly to maintain relevancy and add fresh insights – Free of spelling and grammatical errors for an improved user experience and better SEO results
  • Enhanced with relevant images, videos, and multimedia to engage users and support your content

The Froala Editor offers all the essential tools and formatting options for creating high-quality content, including various header styles, list types, text alignments, and media options. Remember to always proofread and revise your work to optimize your content for both users and search engines. You can integrate Froala with WProofreader spelling and grammar checker to automatically proofread the content for you.

Using On-Page SEO to Boost Page Rankings and Drive Traffic

on-page SEO plays a significant role in helping your website rank higher on search engines like Google. By implementing these six powerful SEO tips – optimizing meta-tags, headings, images, links, videos, and creating quality content – you can greatly improve your site’s visibility and organic traffic. To make this process even easier, use Froala WYSIWYG editor for an SEO-friendly editing experience. Experience Froala for free now.

Download Froala Editor

 

Froala V4.0.19 released

Froala Editor 4.0.19
We are delighted to announce the new release of Froala Editor, the next-generation WYSIWYG HTML editor that’s easy to integrate with any web application, and your users will fall in love with its clean design. This new release introduces improvements that will enhance your users’ editing experience and productivity. The most notable feature is the enhanced pasting of content into the editor process. In addition to that, Froala Editor now enhances table editing, link insertion, and Firefox and Safari (MAC OS) support. Froala WYSIWYG editor

Let’s have a deeper look at what’s new in Froala Editor V4.0.19:

Enhanced Pasting:

Froala already offers a superior paste experience compared to WYSIWYG editors but our technical team is constantly striving to make it even better. Pasting content into the editor is now more seamless, maintaining formatting and reducing the need for manual adjustments post-paste. For example:
  • Pasting pre-written text will no longer insert a <span> tag with a lot of inline styles.
  • Copying text from one table column and pasting it into another will not create a new table.
  • Copying text from a <div> element and pasting it will no longer insert a new line.

… and much more!

In this release, several bugs were fixed as part of an ongoing effort to make the user experience better.
  • Initializing Froala on an element containing a table will no longer reverse the table rows’ order.
  • “fr-” prefix has been added to the File Manager plugin CSS classes.
  • Inserting a link in the middle of a sentence with highlighting a text will no longer insert the new link at the beginning of the text.
  • Fixed the issue where inserting a special character in a link removes the whole content formatting and structure.
  • The scrollbar automatically shifts downward when a new line is added.
  • Fixed the issue that caused word styles to be removed when replacing the first word in a sentence on Firefox.
  • Navigating through the toolbar buttons on Safari (Mac) now works fine.
All these improvements come together to make an already powerful WYSIWYG editor even better. Please find the complete changelog list here. If you want to learn more about the Froala Editor and how it can help you create stunning web content, check its features list or download our free trial today. You will be amazed by what you can do with Froala Editor!

Get Froala V4.0.19

Since version 3.0.1, we’ve made a lot of improvements. We’ve added new features and enhanced the security of the Froala editor without making any breaking changes. This means that if you haven’t updated Froala in a while, you are missing out on a lot. If you update your editor today, which will take less than 5 minutes, you will enjoy a better editing experience that we think you’ll adore. Updating your editor could also resolve some issues that you or your users might have had before. Don’t hesitate to update your editor today.

How do I upgrade to V4.0.19?

Super easy. Follow the steps below to update to the latest version.

For Froala Editor Version 3 and Version 4 Users

Follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.
Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.0.19/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.19/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks like React, Angular, and Vue.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that show you the functionality of Froala HTML Editor.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We’d love to hear what you think of the latest release! Join us on GitHub Community to chat with product managers, developers, and other members of the Froala team.

Technical Questions

What’s coming up

Supporting the latest version of React, Angular, and Vue

We understand your demand for Froala to support the latest versions of React, Angular, and Vue, and we’ve heard your requests. Our team is making this a reality in our next V4.1 release, slated for June. Stay tuned!

A Pro’s Guide to Froala’s Word and Excel Pasting

Froala Pasting plugin

Need an easy way to send Word and Excel content in your forms or messaging apps? Want to create an app compatible with Word and Excel?

Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.

 

 

Froala Pasting pluginWhy should you consider Froala for online document editor applications?

Froala will save your time and effort by providing an easy and intuitive way to implement your online document application. To make the Froala WYSIWYG editor user interface look like an online documents editor, you simply need to set the documentReady Froala API option to true. By doing this:

  • Froala will display only the most frequently used toolbar buttons for editing documents.
  • Froala reorder toolbar buttons to provide the best document editing experience.
  • The editing area’s default height will be increased to resemble a typical A4 document.

If you don’t like the defaults, With Froala editor, you can change the theme, add more toolbar buttons, customize the buttons’ order, and extend functionality with custom plugins.

Is Froala editor compatible with Word and Excel?

Froala editor is compatible with Microsoft Word documents and Excel sheets. This enables the smooth transfer of content, retaining the same format, between these applications. This is made possible by Froala’s enhanced Microsoft Word and Excel Pasting Plugin, also called the Word Paste plugin.

Word content contained an excessive amount of unnecessary markup, making implementation of this feature challenging. Moreover, important information that doesn’t come as HTML has to be parsed and converted appropriately for the browser to render it.

As a leading WYSIWYG editor, the Froala team accepted this challenge and worked hard to support Word markup. Furthermore, when Word images are pasted into the editor, we process them and upload them to your server in the same way as regular images.

In our comparisons with other WYSIWYG editors such as TinyMCE and CKEditor, we found that Froala preserved the original formatting of the content pasted from Microsoft Word and Excel better than any other editor.

Configuring Froala’s Enhanced Microsoft Word and Excel Pasting Plugin

With Froala’s Enhanced Microsoft Word and Excel Pasting Plugin, copying and pasting content from Microsoft Word or Excel into a WYSIWYG editor is easy and streamlined. It includes several options and events for customizing it to best suit your application. Let’s explore its configurations further.

Options

wordPasteModal

Set whether you want to display a modal to choose if you want to keep the pasted style or not.

wordPasteKeepFormatting

If you choose to not display the modal, you can specify here whether the editor will keep the pasted styles or not. By default, the editor will keep the styles.

wordDeniedTags

An array of HTML tags that will be removed altogether with their content when pasting content into the rich text editor from Word. For example, to remove links from the pasted content set this option to

new FroalaEditor('.selector', {

wordDeniedTags: ['a']

});

wordDeniedAttrs

An array of HTML attributes to be removed altogether with their content when pasting content into the rich text editor from Word. For example, to remove the id of the pasted elements set this option as

new FroalaEditor('.selector', {

wordDeniedAttrs: ['id']

});

wordAllowedStyleProps:

An array contains the allowed CSS properties to be used for tags when pasting from Word. by default it is set to allow the following properties

['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-.*']

Note: The Froala API offers additional options related to pasting content. These can impact how content is pasted from Word documents too. For instance, if you set the pastePlain API option to true, all pasted content is cleaned, regardless of the value of wordPasteKeepFormatting.

Let’s look at the other pasting options that affect pasting content whether it is from Word or other sources.

pastePlain

Indicates whether the rich text editor should strip formatting when pasting content or not. In both cases, the content structure is preserved. It is set to ‘false‘ by default. This keeps the text formatting.

new FroalaEditor('.selector', {

  pastePlain: true

});

Other options

The other options pasteDeniedTags, pasteDeniedAttrs, and pasteAllowedStyleProps are similar to wordDeniedTags, wordDeniedAttrs, and wordAllowedStyleProps respectively but they affect the content copied from any sources. 

 

Events

Events are callback functions that are triggered during the paste process. You can customize the editor’s behavior by handling these events in your application’s logic.  In this section, we will explore all the events related to pasting content as each one is critical for customizing the process.

paste.before

This event occurs before the paste action is performed. This lets you modify pasted content before it’s inserted into the editor or add custom logic.

 new FroalaEditor('.selector', {
   events: {

    'paste.before': function (original_event) {

      // Do something here.

      // this is the editor instance.

      console.log(this);

    }

  }

});

You will receive the jQuery event object for the paste event (original_event) as the first parameter. 

For example, if we paste this “Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.“ into the editor, the first argument will be 

{

paste: { target: p, clipboardData: DataTransfer }

bubbles: true

cancelBubble: false

cancelable: true

clipboardData: DataTransfer { dropEffect: "none", effectAllowed: "uninitialized", mozCursor: "auto", … }

composed: true

currentTarget: null

defaultPrevented: true

​eventPhase: 0

explicitOriginalTarget: <div class="fr-element fr-view" dir="auto" aria-disabled="false" spellcheck="true" contenteditable="true">

isTrusted: true

originalTarget: <p>

returnValue: false

srcElement: <p>

target: <p>

timeStamp: 114314

type: "paste"

<get isTrusted()>: function isTrusted()

<prototype>: ClipboardEventPrototype { clipboardData: Getter, … }

}

paste.beforeCleanup (clipboard_html)

The event is triggered after the content has been pasted into the Froala Rich Text Editor but before any clean action is performed.

new FroalaEditor('.selector', {

  events: {

    'paste.beforeCleanup': function (clipboard_html) {

      // Do something here.

      // this is the editor instance.

      console.log(this);

    }

  }

});

In this event, you will receive the clipboard-pasted HTML (clipboard_html) string as the first parameter.

For example, if we paste this “Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.“ into the editor, the first argument will be:

  • In case you copied it from not Word document
<html><body>

<!--StartFragment-->Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.<!--EndFragment-->
</body>
</html>
  • In case you copy it from a Word document
<html xmlns:o="urn:schemas-microsoft-com:office:office"

xmlns:w="urn:schemas-microsoft-com:office:word"

xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"

xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta http-equiv=Content-Type content="text/html; charset=utf-8">

<meta name=ProgId content=Word.Document>

<meta name=Generator content="Microsoft Word 15">

<meta name=Originator content="Microsoft Word 15">

<link rel=File-List

href="file:///C:/Users/mostafa/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml">

<!--[if gte mso 9]><xml>

 <o:OfficeDocumentSettings>

  <o:AllowPNG/>

 </o:OfficeDocumentSettings>

</xml><![endif]-->

<link rel=themeData

href="file:///C:/Users/mostafa/AppData/Local/Temp/msohtmlclip1/01/clip_themedata.thmx">

<link rel=colorSchemeMapping

href="file:///C:/Users/mostafa/AppData/Local/Temp/msohtmlclip1/01/clip_colorschememapping.xml">

<!--[if gte mso 9]><xml>

 <w:WordDocument>

  <w:View>Normal</w:View>

  <w:Zoom>0</w:Zoom>

  <w:TrackMoves/>

  <w:TrackForma…

Note: you can modify the pasted content by returning a new string.

paste.afterCleanup (clipboard_html)

The event is triggered after the content has been pasted into the Froala Rich Text Editor and cleaned up. The pasted content will be replaced with the returned string if one is returned. This allows users to manipulate the pasted content before it becomes a part of the editor’s content.

new FroalaEditor('.selector', {

  events: {

    'paste.afterCleanup': function (clipboard_html) {

      // Do something here.

      // this is the editor instance.

      console.log(this);

     // Return modified clipboard_html if needed.

      return clipboard_html;

    }

  }

});

You will receive the cleaned HTML as the first parameter.

For example, if we paste this “Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.“ into the editor, the first argument will be:

  • In case you choose to clean the content
<p>Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.</p>
  • In case you choose to not clean the content
<p style="margin-top:0in;margin-right:0in;margin-bottom:8.0pt;margin-left:0in;line-height:107%;font-size:15px;font-family:&quot;Calibri&quot;,sans-serif;">Froala WYSIWYG editor is an easy yet powerful solution for reaching your goals.</p>

paste.after

This event is triggered after the paste action has been processed and the content has been inserted into the editor. It allows you to perform additional actions once the paste is complete. It doesn’t have any parameters.

new FroalaEditor('.selector', {

  events: {

    'paste.after': function () {

      // Do something here.

      // this is the editor instance.

      console.log(this);

    }

  }

});

Paste Images from Word

Froala uploads images pasted from Word just like regular images. Since there are no specific API options or events for this, the pasting image process can be customized using general API options and events.

Image paste Options

pasteAllowLocalImages

Removes images that have a local path (file://) on paste. Enabling this option might result in having mixed content on HTTPS websites.

new FroalaEditor('.selector', {

  pasteAllowLocalImages: true

});

 imagePaste

Allows pasting images from clipboard.

new FroalaEditor('.selector', {

  imagePaste: false

});

imagePasteProcess

Use default image settings for pasted images.

new FroalaEditor('.selector', {

  imagePasteProcess: true

});

Image paste Events

image.beforePasteUpload (img)

Triggered before uploading a pasted image from clipboard to the server. The first parameter is the DOM element representing the image to be uploaded.

Note: Returning false in the handler assigned to the event will cancel the current action.

new FroalaEditor('.selector', {

  events: {

    'image.beforePasteUpload': function (img) {

      // Do something here.

      // this is the editor instance.

      console.log(this);

    }

  }

});

Demo

Take a look at the browser console to see the event results after pasting some content in the demo below

Conclusion

Implementing an online documents editor, such as Froala Editor is a powerful, time-saving solution. By properly configuring the editor, and adding the enhanced Microsoft Word and Excel Pasting Plugin, you can make it easier for users to compose and edit content in familiar formats, No more hassle of having to reformat text, lists, tables, and images copied from Word or Excel files. If you find anything that you believe should work differently, just reach our engineering team and we’ll get it solved.

Overall, Froala is an excellent solution for building online documents, creating messaging applications, or any form that requires rich text editing capabilities with a modern and intuitive user interface. Give the Froala Editor a try today and elevate your document editor game!

Froala V4.0.18: Copy and Paste Images Made Better

Froala editor v4.0.18

The Froala Editor team is excited to announce the release of Froala Editor 4.0.18. This new version has a lot of improvements to quality and stability, as well as fixes for problems that customers told us about.

The 4.0.18 release provides a number of benefits for users of the editor. With the bug fixes and improvements, users will be able to edit tables, images, and other content in the editor more easily. This release also contains enhancements that aim to increase users’ productivity.

What’s New in Froala Editor V4.0.18


Refined Process of Copying and Pasting Images Inside the Froala Editor:

When you discover an image you’d like to insert in the editor, you can swiftly paste images into the editor without having to manually upload the file. Simply follow these steps:

  1. Find the desired image.
  2. Copy the image (right-click and select ‘Copy image’ or use keyboard shortcuts like `Ctrl+C`).
  3. Navigate to the editor.
  4. Paste the image directly into the editor.

This improvement streamlines the process of adding images to your content, saving you time and effort. To ensure successful uploads to your server, configure the API settings correctly:

  1. Set the imageUpload API option to true, to enable the uploading functionality.
  2. Set the HTTP image upload request type at the imageUploadMethod API option, by default, it is ‘PUT’.
  3. When an image is inserted into the WYSIWYG HTML editor, AJAX requests from the editor to the server. The request is sent to the URL you defined in the imageUploadURL API option. Make sure to set this option correctly.
  4. To store the uploaded image on your server, follow the instructions related to your server on the Froala server integration page. The Froala team also developed several SDKs to get you started on server integration faster.
  5. After the server completes the image processing, it sends a response to the editor via the API image events, such as:
    image.uploaded event is triggered after a successful image upload request, but before inserting the image in the editor.
    image.inserted event is triggered after inserting the image into the editor.
    image.replaced event is triggered after replacing the image in the editor.
    image.error event is triggered if any errors occur during the upload process.

For more detailed information about image uploading, visit our comprehensive image upload guide.

Front-end Code Example:

<script>

  new FroalaEditor('.selector', {

    // Set the image upload parameter.
    imageUploadParam: 'image_param',

    // Set the image upload URL.
    imageUploadURL: '/upload_image',

    // Additional upload params.
    imageUploadParams: {id: 'my_editor'},

    // Set request type.
    imageUploadMethod: 'POST',

    // Set max image size to 5MB.
    imageMaxSize: 5 * 1024 * 1024,
    // Allow to upload PNG and JPG.
    imageAllowedTypes: ['jpeg', 'jpg', 'png'],

    events: {

      'image.beforeUpload': function (images) {

        // Return false if you want to stop the image upload.

      },

      'image.uploaded': function (response) {

        // Image was uploaded to the server.

      },

      'image.inserted': function ($img, response) {

        // Image was inserted in the editor.

      },

      'image.replaced': function ($img, response) {

        // Image was replaced in the editor.

      },

      'image.error': function (error, response) {

        // Bad link.
        if (error.code == 1) { ... }

        // No link in upload response.
        else if (error.code == 2) { ... }

        // Error during image upload.
        else if (error.code == 3) { ... }

        // Parsing response failed.
        else if (error.code == 4) { ... }
        // Image too text-large.
        else if (error.code == 5) { ... }

        // Invalid image type.
        else if (error.code == 6) { ... }

        // Image can be uploaded only to same domain in IE 8 and IE 9.
        else if (error.code == 7) { ... }

        // Response contains the original server response to the request if available.

      }

    }

  })

</script>

Refinement Table Editing

One of Froala editor’s key features is the ability to easily create and edit tables in a user-friendly manner. Through an innovative table editing popup, Froala gives you the ability to:

  • Add/Remove table header
  • Add/Remove table footer
  • Merge/Split cells
  • Add/Delete table rows
  • Add/Delete table columns
  • Apply a custom style

What’s new in this release:

  • In the past releases, if you inserted a column when a row contained both th and td cells, the new cell would be a th cell. Now the editor defaults to inserting td cells, as this is usually the user’s preferred option.
  • In the past releases, If the htmlUntouched API option is disabled, merging cells of a table with a header row will distort the cell order. This will no longer happen when you update to the latest release.
  • Froala Editor is known for its ability to keep the pasted content format from third-party tools such as Microsoft Word or Excel. When you paste the content into the editor, the editor asks you if you want to keep the pasted content format or not, if you select to keep the pasted content format, the pasted content styles will be preserved. Previously, adding a row or column to a pasted table could remove the table border properties. This will no longer happen when you update to the latest release.

What’s more

By upgrading to the 4.0.18 release, you will be able to:

  1. Easily indent and outdent paragraphs using the “Tab” and “Shift + Tab“ keys respectively.
  2. Stick the editor toolbar in the Bootstrap modal. Set the toolbarSticky API option to true to fix the editor toolbar to the top of the viewport while you scroll down.

All these improvements and more come together to make an already powerful WYSIWYG editor even better. Please find the complete changelog list here.

Get Froala V4.0.18

Since version 3.0.1, we’ve made a lot of improvements. We’ve added new features and enhanced the security of the Froala editor without making any breaking changes. This means that if you haven’t updated Froala in a while, you are missing out on a lot. If you update your editor today, which will take less than 5 minutes, you will enjoy a better editing experience that we think you’ll adore.

Updating your editor could also resolve some issues that you or your users might have had before. Don’t hesitate to update your editor today.

How Do I Upgrade to V4.0.17?

Super easy! Follow the steps below to update to the latest version.

For Froala Editor Version 3 and Version 4 Users

Follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.0.18/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.18/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks like React, Angular, and Vue.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that show you the functionality in Froala HTML Editor.

If you like to see the HTML output while trying Froala, use Froala Online HTML Editor.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We’d love to hear what you think of the latest release! Join us on GitHub Community to chat with product managers, developers, and other members of the Froala team.

Technical Questions

You’re helping us build a better editor

Thank you for using Froala. With your support, we’re working to make WYSIWYG editing more enjoyable, accessible, and beneficial for everyone.

 

 

Creating a Page Builder Using the Froala WYSIWYG Editor

Creating An Amazing Page Builder Using The Froala WYSIWYG Editor

In today’s digital era, every business needs to have its own website, blog, etc. In fact, people may doubt your legitimacy as a business if you don’t have a website. However, getting a professionally designed website can be costly, due to which many businesses opt to build a website by themselves. You can use a WYSIWYG HTML editor to ease web content creation. A WYSIWYG editor essentially allows you to easily create and manage HTML content without writing any code. However, people usually use a rich text editor or WYSIWYG editor for composing documents or creating simple, one-block content. For more complex websites, most developers today use a web page builder. A website page builder allows you to create beautiful and well-formatted websites quickly without the need to write a single line of code.

In this article, we’ll show you how you can convert the Froala WYSIWYG editor into an easy-to-use, drag-and-drop page builder.

What Is A Web Page Builder?

 

A page builder built using the Froala WYSIWYG editor

If you don’t know how to code and want to create a website for your business, you want something that doesn’t involve learning and writing code. If you spend a lot of time learning programming languages to create websites, you wouldn’t be able to focus on growing your business and meeting customer demands. This is where you need a page builder or drag-and-drop website builder. A website page builder comes with built-in templates, layouts/themes, and other elements you need to create a professional web page. It is essentially a tool that even nontechnical people can use to create websites without writing any code and reduce development time.

Should You Use WYSIWYG HTML Editors Or Page Builders?

A WYSIWYG Editor shows you how your content would look on a web browser. It allows you to create and edit web content quickly without writing any code. For example, you can use WYSIWYG editors to format text, add links, create tables, insert images and videos, add links, and more. However, most users prefer a WYSIWYG HTML editor for creating simple web pages and composing documents.

For creating professional, complex layouts and websites, drag-and-drop website builders are mostly used. You can use a page builder in your content management system, email marketing software, or any other application. Because of their ease of use, drag-and-drop page builders have become so popular, especially among small businesses.

Why Should You Use Froala WYSIWYG Editor To Create A Page Builder?

 

An efficient page builder built using Froala WYSIWYG editor

Froala is considered one of the best WYSIWYG HTML editors that offers great features and a clean UI (user interface). You can even use plug-ins to add new features to the editor. However, you can also convert it into an easy-to-use, drag-and-drop page builder thanks to its initialization modes features. By using Froala editor to create a page builder, you can combine the benefits of creating a website page builder from scratch and using an existing page builder. For example, when you create a page builder from scratch, you can customize it as per your requirements. However, using an existing page builder eliminates the need to write lengthy code from scratch.

Here are some key reasons to use Froala editor to create your page builder:

  • Froala offers a simple API with detailed documentation and flexible features to develop an efficient page builder that meets your requirements. When you use Froala to create your page builder, you can save a lot of time and effort as you don’t have to build every single component of your page builder from scratch.
  • It generates high-quality HTML code to minimize the issues associated with existing page builders.
  • Froala pricing plans are very budget-friendly. Additionally, it offers discounts for startups, which makes it a perfect option for creating your page builder.
  • Froala is also a perfect choice for those who wish to have both a WYSIWYG editor and a drag-and-drop page builder. As a result, you can get both editors using the same code.

How To Build A Page Builder Using Froala WYSIWYG Editor?

When you’re building a page builder, you need to create two sections: a toolbar and an editing area. To create these sections, open your HTML file and add the following code:

<div class="row"> 
  <div class="col col-1"> 
	<!-- Toolbar contains different block-types will go here --> 
</div> <div class="col col-2"> <!-- Editing Area --> <div id=“editing-area"></div> </div> </div>

Creating The Toolbar

The toolbar of a page builder consists of several block types, such as:

  • Title Block
  • Text Block
  • Button
  • Image Block
  • Code Block
  • Link
  • CTA Block
  • Markdown Block

Using these blocks, you can quickly add a title, text, images, CTA, buttons (such as submit buttons), etc., to the editing area to create your website or web page.

Here is an example code for adding the title block to the toolbar of the page builder:

<li data-type="title" class="block-source float-left">
  <div class="text-center">
      <div>
          <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 120.26" style="enable-background:new 0 0 122.88 120.26" xml:space="preserve"><g><polygon points="0,14.54 0,0 49.81,0 49.81,14.54 36.93,17.03 36.93,51.7 85.98,51.7 85.98,17.03 73.1,14.54 73.1,0 85.98,0 110,0 122.88,0 122.88,14.54 110,17.03 110,103.31 122.88,105.79 122.88,120.26 73.1,120.26 73.1,105.79 85.98,103.31 85.98,70.3 36.93,70.3 36.93,103.31 49.81,105.79 49.81,120.26 0,120.26 0,105.79 12.8,103.31 12.8,17.03 0,14.54"/></g></svg>
       </div>
        <span class="text-center">Title</span>
   </div>
</li>

You can then use the following CSS code to modify the block style and format:

<style> 

html,body, .row{ 
  margin: 0; 
  padding: 0; 
  height: 100%; } 
.col{ float: left; 
}

.col-1{ 
  width: 22%; 
  height: 100%; 
  margin-right: 5%; 
  background-color: #eee; 
  border-right: 1px solid #c4c1c1; 
} 

.col-2{ width: 72%; 
  padding: 10px auto; 
} 

@media screen and (max-width: 676px) { 
  .col{ float: none 
  } 
  .col-1, .col-2{ 
    width: 100%; 
    height: auto; 
    border: none; 
    margin: 0; 
  } 
  .col-1{ 
    height:250px; 
  } 
} 

.text-center { 
  text-align:center 
} 

.block-source { 
  margin:0 0 18px 18px; 
  width:7rem; 
  height:7rem; 
  white-space:nowrap; 
  text-overflow:ellipsis; 
  background-color:#fff; 
  border:1px solid #bfc7d6; 
  -webkit-box-sizing:border-box; 
  box-sizing:border-box; 
  border-radius:6px; 
  display:-webkit-inline-box; 
  display:-ms-inline-flexbox; 
  display:inline-flex; 
  -webkit-box-pack:center; 
  -ms-flex-pack:center; 
  justify-content:center; 
  -webkit-box-align:center; 
  -ms-flex-align:center; 
  align-items:center; 
  color:#6c757d 
} 

.block-source:hover { 
  cursor:pointer; 
  border:1px solid #c6bbef; 
  -webkit-transform:translate(0); 
  transform:translate(0) 
} 

.block-source svg { 
  height:3.65rem; 
  width:3.65rem; 
  color:#bfc7d6; 
  fill:#bfc7d6 
} 

.block{ 
  margin: 20px 0; 
} 

</style>

When you add all the blocks and format them, your toolbar will look as follows:

 

Page builder UI

Adding Blocks To The Editing Area

The editing area will consist of all the blocks that the user chooses to add to the page. Hence, when a user clicks on a block in the toolbar, we need to:

  • Add an HTML element that corresponds to the selected block type in the editing area
  • Initialize the Froala editor on that element with the required options

To initialize the Froala editor, add the latest version of the Froala stylesheet inside the head:

 

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

Now, add the Froala latest version script before closing the body tag:

 
<script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js" ></script>
 

Next, we have to add a click event listener to the Block Types. You can find the detailed tutorial on customizing each block type, adding the drag-and-drop editor functionality, and creating an amazing page builder with Froala here.

Do You Need To Test Your Web Page Builder?

Software testing

QA testing is an extremely important aspect of any software development project, including web apps and websites. With QA testing, we can ensure that we release high-quality software without any bugs or errors. In other words, software testing helps save time and costs and enhances the quality of software. For software testing, we need to write test cases related to functionality, performance, usability, and more. However, conducting and managing several different test cases manually can be time-consuming. As a result, most developers today use test management tools to organize, track, and manage test cases.

Which Is The Best Tool For Managing Test Cases For Your Page Builder?

 

TestRail Test Management Tool

If you’re looking for a robust test management tool, TestRail is the right option. TestRail is a powerful web-based test management tool that helps users to plan, organize, run, track, and manage test cases efficiently. TestRail also allows you to create agile test plans and streamline your testing processes to create high-quality software.

Here are the popular features of TestRail:

  • With TestRail, planning and running test cases is quick and easy. You can quickly start test runs and choose test cases based on powerful filters. Additionally, TestRail’s advanced interface makes it easy to execute your tests and record results. You can also group, filter, and organize your results efficiently.
  • With TestRail, you can even link tests to defects and requirements in GitLab, Atlassian Jira, GitHub Issues, and more.
  • TestRail provides a single collaborative platform to track and monitor all of your test activities and quality metrics. It allows you to track tests for browsers, mobile devices, and more.
  • TestRail enables users to quickly generate traceability reports. For example, you can generate detailed reports for projects, plans, milestones, and runs. You can also compare the results of different test runs and milestones.
  • With TestRail, you can track the status and progress of testing in real-time.
  • TestRail can easily be integrated with many project management tools and automation testing tools, such as JIRA, Jenkins, and Selenium.
  • TestRail enables developers to efficiently organize reusable test cases in folders.

Frequently Asked Questions (FAQs)

 

What is the best free WYSIWYG editor?

Froala is a leading WYSIWYG HTML editor that offers impressive rich text editing features. For example, you can format text, insert rich media, add custom themes, and much more using the Froala editor.

What are the key features of the best WYSIWYG editors?

A good WYSIWYG HTML editor like Froala has a modern design and offers a wide range of impressive features, such as text formatting, inserting rich media, media management, auto-formatting, etc. A powerful WYSIWYG editor also seamlessly integrates with CMS and other apps and offers live preview options.

Can you convert a WYSIWYG HTML editor into a page builder?

Not all WYSIWYG editors can be converted into a page builder. However, you can convert Froala editor into an impressive page builder, thanks to its initialization modes features.

Learn more about TestRail and its features here.

Building a solid drag-and-drop web page builder using Froala

Froala Page builder
A developer building an amazing page builder using Froala WYSIWYG Editor Modern page builders have revolutionized the way we develop website pages. They enable non-technical users to quickly and easily create complex website pages that are responsive and scalable. Clients love page builders because they can create stunning web pages without requiring expensive development resources and lengthy development cycles. They provide the ability to quickly design and maintain pages without needing extensive coding experience or deep technical knowledge. Page builders are used in content management systems (CMS) like WordPress, and it is one of the reasons that makes WordPress so popular. That’s because page builders make it easy for absolute beginners to build and maintain their website pages and blog posts. Page builders are also used on email management platforms like Mailchimp to enable users to easily create email templates without the need for HTML coding skills. Page builders are used in many cases under different names like “theme builders”, “template builders”, “website builders”, or “email builders”. If you are creating an application where users will need to write HTML code, then using a page builder will be the best solution. Page builders can help you retain your users while attracting new ones because of their top-notch user experience.

The difference between a classic editor (WYSIWYG editor) and a modern drag-and-drop editor

Usually, platforms implement two types of editors to eliminate the need for users to write any HTML or CSS code:
  1.  A classic editor or standard WYSIWYG editor
  2.  A drag-and-drop editor which divides the web page into rows, columns, and blocks, allowing users to easily create and maintain templates, edit each block’s content separately, and assemble template elements by dragging and dropping them into a new position.
Users tend to prefer classic editors for composing documents, messaging, or simple, one-block content; however, for constructing more complex, structured layouts like a web page, a drag-and-drop editor is typically used.

Should You Build a Custom Page Builder or Use an Existing One?

Before integrating a page builder into your product, it is important to consider whether you should create one from the ground up or utilize a readily available page builder. Doing thorough research into both options will help you make an informed decision. Utilizing an existing page builder is likely the best way to begin. There is no need to start from scratch when there are other tools available. However, it might be surprising to know that in some cases, creating a custom page builder is the right choice. While using an existing page builder eliminates the hassle and time associated with coding from scratch as the underlying code is already developed, creating a page builder from scratch can be beneficial in a number of ways. Firstly, it allows businesses to customize the page builder to exactly meet their requirements, which can be important in terms of making sure the page builder works with their existing website and other applications. Additionally, it provides businesses with full control over the design and functionality of their page builder, allowing them to tweak and adjust the interface and features as they see fit. It also avoids having to present users with an abundance of components and options that will not be used. Furthermore, creating a page builder from scratch can mitigate some of the issues associated with existing page builders. One of the most problematic issues is the creation of bloated HTML code that contains a large number of DOM nodes. This causes the issue of having an excessive DOM size that slows down your page performance. This issue can drive away website visitors. The generated HTML code could also be in a non-semantic format that can badly affect the SEO ranking of the page. In this article, we will demonstrate an intuitive solution to construct a page builder that combines the advantages of creating one from scratch and using an existing page builder while minimizing the drawbacks. A solution that uses Froala to build your page builder.  

Why should I use Froala to build a page builder?

By using Froala to create your page builder, you will be able to save a lot of time and effort that would otherwise be spent building every single component of your page builder from scratch. Additionally, Froala’s API offers powerful and flexible features that help develop a page builder that meets your exact specifications. Froala Editor also produces efficient and high-quality HTML code, allowing you to avoid the issues associated with existing page builders. Froala pricing plans are very cheap. Unlike other WYSIWYG editors, Froala doesn’t charge extra for premium features, number of users, or editor loads. Froala also offers discounts for startups. Moreover, Froala has a perpetual plan, allowing customers to purchase a release once and receive updates for one year after the purchase date. And they can use the last release they received forever. These reasons make Froala affordable despite its status as a premier and powerful editor, and this makes Froala a good starting point for building your page builder. Moreover, Froala is an ideal choice for those who want to have both a classic editor and a drag-and-drop page builder. With this solution, you can get the best of both editors using the same code, making your product codes more consistent and optimized. You may also be able to reduce the third-party libraries you are using, which in turn can result in your product running faster.

Can You Use a WYSIWYG Editor to Develop a Page Builder?

With the Froala WYSIWYG editor, you can develop a robust, fast, and elegant page builder that has various components. This is due to its unique initialization modes feature, which makes the editor behave differently depending on the element that it is initialized with.
Email created using Froala's page builder
A demonstration of using a custom page builder created using Froala editor for creating a professional email – no coding required!

How to build a page builder using Froala

We have a detailed guide that explains how to create a page builder using Froala. In that guide, you can see how easy it is to do so in a few steps. The guide will show you that you can build different types of blocks by simply changing the editor initialization options. In the guide, we explained how to create eight different blocks types using Froala: 1- Title Block 2- Text Block 3- Image Block 4- Button 5- Link 6- CTA Block 7- Code Block 8- Markdown Block You can look at Froala’s API options, methods, and events and start thinking about other blocks that Froala can create. Also, if you would like to add an option to one of the blocks, you can simply create a custom Froala button and assign the desired function to it. Furthermore, you can create a whole custom functionality by writing your own plugin to customize a block depending on your project details and requirements.

Conclusion

With its cost-effective, flexible, and customizable features, combined with its already existing powerful API, Froala provides a solution for developers looking to create a page builder from scratch with minimal effort. Froala is the only WYSIWYG editor that you can use to build both classic and modern page builders. Give it a try by starting your free trial today.
Let your community know if you enjoyed this post.

What Are The Best Test Cases To Test An Online Text Editor?

a person is working with an online text editor tested using the best test cases

Being software developers, we must realize the importance of QA testing for any software project. Multiple benefits make QA testing an essential aspect of software development. However, the most common ones are to save costs and time and enhance the quality of software. For this purpose, we write performance test cases to ensure the quality of our software. But how to write an effective test case? We will explore it in this article.

We will particularly focus on online text editors in this article. Therefore, we will learn how to write a test case for our online text editor to enhance its quality. Before proceeding further, it is important to note that we must hire an expert QA testing team for faster results. It can also enhance the reliability of the software testing environment. Let’s continue reading till the end.

test cases for test data test scenario or test scenarios in software testing

What is the Importance of Online Text Editors?

We must know the fact that text editors are the most important part of software development. The reason behind this importance is that they help to enhance the user experience.

Moreover, we can take an idea of their higher importance from the fact that text editors are found in many applications these days.

The key benefit of a text editor is that users can create content without any knowledge of coding. The non-technical users can also integrate online text editors into their applications without programming knowledge.

Moreover, if a platform lets users express themselves, the chances of its popularity increase automatically.

test case management tools for test steps manual testing or regression testing

How to Build an Online Text Editor with Froala?

Multiple ways can help us build an online text editor. However, Froala is the most popular platform to help us get our high-quality online text editor. The reason is that Froala offers many amazing text editing features. Some of the benefits of using Froala are:

It lets us add emoticons to our documents.

Froala can convert our text into superscripts and subscripts when required.

We can also apply formatting to the text blocks altogether.

Apart from that, it has various other features. So, let’s begin the process of building an online text editor with Froala.

Froala test suite test case template test plan

Getting Started

First of all, we have to download the Froala text editor and install it using npm.

npm install froala-editor 

The next step is to embed the following code into our 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>
 We can also use the CDN given below:
<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 next step is to create an empty div element that will convert into a rich text editor.

<div id=”example”></div>

Now, we have to initialize the Froala into our empty div element.

var editor = newFroalaEditor ('#example')

To keep the same appearance of edited HTML elements, we have to include the CSS files below:

<link href="../css/froala_style.min.css" rel="stylesheet" type="text/css"/>

The next step is to put the edited content inside our element.

 

<div class="fr-view"> Here comes the HTML edited with the Froala rich text editor. </div>

What are Test Cases?

A test case refers to a set of actions for a system that helps to determine if the system functions correctly or not. It is interesting to note that the test cases are written while keeping the end user in mind. Moreover, it s recommended not to repeat any test cases.

How to Write Test Cases for an Online Text Editor?

Test cases are referred to as blueprints that a tester follows. Therefore, test cases need to be clear and accurate. Here are 10 steps that can guide us in writing effective tests for an online text editor.

  1. Define your targeted area.
  2. Ensuring that the test cases are executable and understandable.
  3. Applying and understanding the relevant test designs.
  4. Trying a unique test case ID.
  5. Creation of traceability matrix for requirements
  6. Writing test cases with a clear description.
  7. Addition of proper postconditions and preconditions
  8. Specification of expected results
  9. Using the right testing techniques
  10. Getting peer review of test cases before their implementation.

creating test cases for test execution and test script user acceptance test cases

Can You Manage Test Cases for Froala Through TestRail?

TestRail is designed for the management of database test cases to ensure the quality of software. Moreover, it can also teach us how to write effective tests for Froala.

However, you need a structure and a framework to proceed with the whole process. We organize test cases into test suites. It helps us to break down larger projects into smaller milestones.

Another reason to manage test cases through TestRail is that we can manage them within the same web-based interface. Moreover, it also gives proper reports to track our test case.

TestRail test coverage test management tools user acceptance tests ui tests

Final Thoughts

The best test cases to test an online editor that satisfies the quality and save time. We can follow the steps described above to ensure high-quality testing for our online text editor.

Moreover, a reliable testing tool allows us to create the best test cases. In this case, we can always rely on TestRail to give us the best test cases.

FAQs

What Is a Test Case With an Example?

Test case gives us a set of rules to ensure the quality of our application. For example, checking the results after entering a valid username and password.

How Do You Write a Test Case?

We keep in mind the requirements of our end user to write a test case.

What Is the Best Online Text Editor?

Froala is the best online text editor.

How Can I Edit Text Files Online?

Froala can help us to edit text files online.

Sign up for free now to create the best test cases for your online text editor.

WYSIWYG – Best Free HTML Editor: Expectations vs. Reality

a person using a laptop

Are you at a crossroads, trying to decide which HTML WYSIWYG editor to use for your next web project? Whether you are an individual developer, web designer, or project manager, you deserve the best rich text editing experience and the best HTML editor. Of course, you also want to make smart choices that help you save money, help accelerate development, and meet deadlines. Hence, you might want to look for a free WYSIWYG editor. The best free WYSIWYG HTML editors are essential tools for web development that allow users to easily create and manage HTML content without having to write code. They are userfriendly, intuitive, and powerful tools that enable users to quickly and easily create webpages, websites, and mobile applications. WYSIWYG HTML editors are popular among web designers due to their ability to quickly and easily create and manage webpages, websites, and applications.

If you explore the HTML WYSIWYG editor marketplace when looking for the best free HTML editors, you’ll come across many good candidates. And there are plenty of things to love about them (click here to see a list). But don’t fall into the trap of believing that free subscriptions will save you money; sure, it’s free, but its features might not meet your needs, or you’ll most likely pay a high price for a lack of functionality, intuitiveness, speed, or portability. To assist you in making informed decisions about HTML editors, we have compiled a list of issues that you may encounter when using a free WYSIWYG Editor. Continue reading to learn about a great online free WYSIWYG Editor, and how it offers an even better editing experience when purchased.

Is it Really ‘What You See Is What You Get’?

Many open-source and free HTML editors claim to be WYSIWYG. They advertise that they render and display content exactly as it will appear in a web browser. Unfortunately, the truth is far from reality. A free editor’s rendered content may appear very different from what you expect. Especially for large and complex HTML documents, these editors could mess with your character formatting and paragraph styles. They simply don’t show results in some browsers properly. So, if these statements hold true for a free editor, then it’s most likely not WYSIWYG. And if it is, can you expect it to work across every browser? 

Do Free WYSIWYG Editors Work on All Browsers?

A free WYSIWYG editor that works well in one browser may not work the same way on the others. Simply put, the open-source community developing the editor might be focused on perfecting it for one particular browser. This means that your HTML document might render incorrectly on others. To be sure, you’d have to double check whether a free WYSIWYG editor works across all browsers or not. On the other hand, premium editors work on all browsers right away. It is recommended that you check an editor’s compatibility with your browser before downloading it, even though the finest free HTML editors should normally function on most browsers. But browsers are one thing. What about platforms and OS?

Does your Free WYSIWYG Editor Run Smoothly on All Platforms?

Developers and web designers expect their HTML documents to render consistently on all platforms, including desktop and mobile devices. When you use open-source editors to develop your HTML page, your content may not display properly on all platforms. This is particularly true on mobile devices. For example, your free editor might not resize your images or other media content appropriate to screen size. They may also wrap tables and other layouts incorrectly. Nowadays, it’s essential that we make our applications usable and elegant regardless of screen size. We can’t have content that looks good on regular desktop screens but horrible or cropped on smaller ones. And what about users who prefer writing their content on the go using their phones? They also need an editor that displays all content, buttons, and toolbars properly no matter the resolution. Responsiveness is one of the defining traits of modern websites and applications. If your free WYSIWYG editor isn’t responsive enough, then perhaps looking for a premium editor is the wiser course of action.

Can You Extend Your Free WYSIWYG Editor With Plugins?

Probably not. While many free WYSIWYG HTML editors have basic text and paragraph formatting options, which are good for personal projects, you can’t extend many of them to include additional functionality. Modern applications have more complex requirements. Nowadays, content editors usually need advanced features, such as real-time editing, image handling, file uploads, table support, smart content pasting, autosaving, and so on. Therefore, you’ll need a WYSIWYG editor that’s rich in features. However, you need to be careful since more features usually lead to a bigger editor size, longer initialization time, and a more cluttered toolbar. It is then advisable to look for an editor that’s feature-rich, fast and lightweight, organized, and intuitive for the best user experience. You usually won’t find all these in a free WYSIWYG editor, though.

Do Free WYSIWYG Editors Provide Tech Support?

Again, likely not. With even the best free WYSIWYG HTML editors, you’ll have to resort to forums set up by the developers in the open-source community. Almost all free editors have little or no dedicated tech support. While this is not bad at all, this means that whenever you have questions about the editor, you’ll have to wait for the community’s response. And the community consists of people who have their own jobs and busy schedules. This could result in inconvenience at the very least, possibly leading to delays in development. It’s a lot better and faster when you have people who dedicate their time to helping you with your concerns and questions.

Why Subscribe to Froala When there are Free HTML Editors Out There?

 

Froala is a beautiful, fast, and feature-rich WYSIWYG HTML editor. With Froala, you don’t have to worry about any of the issues that you encounter with open source and freely available HTML editors. Our dedicated team of developers has ensured Froala runs smoothly on all browsers on all platforms. You can successfully use it on all types of devices including mobiles and tablets. We also optimized Froala to run on iOS and Android.

If you are a developer looking to give your users rich text capabilities you can do it easily with Froala’s Javascript APIs. You can integrate Froala with software developed in your choice of programming language and framework. Froala supports Django, ExtJS, Angular, CakePHP, and more. It also has extensive documentation, online tutorials, demos, and examples to help you get started. More importantly, our dedicated tech support is always available and ready to help. Technical versatility and support reliability are key differentiators that we analyze in our side-by-side WYSIWYG editor comparisons to show how premium tools outperform basic free versions.

Which HTML WYSIWYG Editor is the Leader on G2.com?

Froala is the top-rated HTML editor. It has ranked consistently as the most popular HTML editor on G2.com. It is feature-rich yet blazingly fast. Froala lets you develop complex web pages in the shortest possible time. It has the most votes for market presence and customer satisfaction.

How Do I Sign Up For Froala?

Froala is the highest quality HTML editor. It has over 100 features and runs optimally on desktop and mobile devices.  It is the editor of choice for small businesses, large corporations, and even individual developers. Froala clients include Amazon, eBay, Intel, IBM, Samsung, and more.

Don’t delay! Try out our free online HTML editor powered by Froala. Explore all Froala features and sign up for a free trial today.

WYSIWYG Editor FAQs

  1. Why is WYSIWYG better than HTML?

    Okay, first of all, neither is better than the other. Instead, both WYSIWYG and HTML development have areas in which they excel more than the other, but there is no one clear winner for all use cases. For instance, making a website using a WYSIWYG editor is better for developers who want to save plenty of time. On the other hand, doing the same using a standard HTML editor is better for experienced developers who have the time. You can even use both.

  2. Is Notepad++ a WYSIWYG HTML editor?

    No, Notepad++, Sublime text, Visual Studio Code, and similar software are not WYSIWYG HTML editors. They are what we call HTML text editors, which are powerful tools with features like syntax highlighting, project structure navigation, testing, and so on. Finding the best text editor for HTML coding is outside the scope of this post, though.

  3. Which HTML editor is easier to use?

    Froala is one of the easiest editors to use (user side) and integrate or configure (developer side). Despite having over 100 features, its organized and categorized toolbar makes it really easy for users to use. Froala also has clear documentation, tutorials, and examples that make building applications easy for developers.

  4. What is the best program for HTML?

A code editor, such as Sublime Text, Atom, Visual Studio Code, or Notepad++, is the best program for HTML. These code editors include features that make HTML coding easier, such as                  syntax highlighting, code completion, and debugging tools.

 

The Best Kept Secrets About A TinyMCE Alternative

The Best Kept Secrets About TinyMCE Alternative

Are you a developer and stuck while building or making changes to a site? Are you fed up and looking for a TinyMCE alternative free WYSIWYG HTML editor? There are plenty of similar editors available on the market. But what is the best-kept secret when it comes to WYSIWYG HTML editors? Which HTML editor has the best tools?

In this post, you will find why is Froala the best TinyMCE alternative and learn its best-kept secrets?

Why TinyMCE Alternative?

Once, TinyMCE HTML editor [1] was considered an excellent tool that provided value for money. Lately, however, TinyMCE has lost its glamour. Somewhere along the way, it became difficult to deal with. In many ways it ticks all the right boxes — it is open-source, supports several platforms, and allows customization. On the other hand, however, it is expensive, and its operating costs are not transparent. It is also crash-prone and unstable in certain conditions. As a result, it is no longer as light and smooth as before.

Developers need a flexible, smooth, and lightweight solution. In short, they want a dependable editor. They want an editor that supports many platforms and contains useful tools while providing a productive user experience. While TinyMCE can’t check all these boxes, Froala can. Froala lacks TinyMCE’s flaws and brings even more to the table.

Why Froala as TinyMCE Alternative?

According to G2 [2], Froala is the best lightweight WYSIWYG HTML editor. It is JavaScript-based with built-in rich text capabilities and extensions via Froala’s API and server-side SDKs. It is also modern and makes it appealing to users who want to complete their projects quickly. Froala is one of the best WYSIWYG HTML editors because of its unique, real-time collaborative editing feature. Thanks to its detailed documentation and robust framework plugins with many practical examples, Froala seamlessly integrates with existing technological infrastructure. This makes it perfect as a TinyMCE alternative jQuery (among other libraries and frameworks) editor. The same architectural versatility required to replace TinyMCE makes Froala a CKEditor alternative worth considering for teams needing robust, real-time collaborative tools.

What are the Best Kept Secrets about Froala as a TinyMCE Alternative?

 

# 1. Do You Know about the Sticky Toolbar for Convenient Editing?

By default, the Froala editor’s Toolbar remains at the top of the screen while you scroll down the page. This gives you quick access to necessary tools and makes the editing process easier. Here is the editing toolbar in Froala:

How can I Enable the Sticky Toolbar in Froala?

Enabling the Froala sticky toolbar is simple. First, go to your HTML file and create a container for the Froala editor, then add this code:

<div id="froala-editor">
  <p>In this example, when you scroll down, the rich text editor's toolbar will scroll along with the page and it will no longer be visible at the top of the page.</p>
  <p><strong>Dummy text to enable scroll.</strong></p>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.</p>
</div>

Second, go to your JavaScript file and add the lines:

<script>
  new FroalaEditor('div#froala-editor', {
    toolbarSticky: false
  })
</script>

Make sure to set the toolbarSticky field to true.

Done!

# 2. Do You Know to Use Froala’s Document Ready Mode to Turn It into an Online Document Editor?

When you enable document ready mode, the Froala WYSIWYG HTML Editor sets the best options for creating online documents by default. This is what it looks like in Froala:

How can I Enable Document Ready Mode in Froala?

First off, go to your HTML file and add a container for the Froala editor:

<p>By enablind the document mode, the Froala WYSIWYG HTML Editor sets by default the best options for creating online documents. After editing the content, the print and export as PDF buttons are perfect so you to take the content and use it further just as you'd do with any Word processor such as Microsoft Word or Google Docs.</p>
<div id="froala-editor"></div>

Then, go to your CSS file and add these lines:

<!-- Include all Editor plugins CSS style. -->
<link rel="stylesheet" href="../css/froala_editor.pkgd.min.css">

After that, go to your JavaScript file, then insert these lines:

<!-- Include all Editor plugins JS files. -->
<script type="text/javascript" src="../js/froala_editor.pkgd.min.js"></script>

<!-- Include PDF export JS lib. -->
<script type="text/javascript" src="https://raw.githack.com/eKoopmans/html2pdf/master/dist/html2pdf.bundle.js"></script>

<script>
  new FroalaEditor('div#froala-editor', {
    documentReady: true
  })
</script>

Make sure to set the documentReady field to true.

Done!

# 3. Do You Know that Froala Enables Markdown Support and Makes WYSIWYG HTML Editing Awesome?

If you want markdown support, just enable the markdown plugin in the Froala editor. You will immediately see the changes. Markdown support gives developers flexible, rich text and markdown content creation options. It also offers robust, reliable markdown output for your projects.

How can I enable Markdown mode in Froala?

To enable markdown mode in Froala, first go to your HTML file and create a container for the Froala editor, then add this code:

<div id="froala-editor">
  <h3>Markdown support makes WYSIWYG HTML editing awesome.</h3>
  <p>Markdown plugin in Froala editor provides flexible rich text and markdown content creation options for authors, and also provides robust, reliable markdown output for developer projects.
</div>

Second, Go to your JavaScript file and add these lines:

<script>
  new FroalaEditor('div#froala-editor', {
    toolbarButtons: ['bold', 'italic', 'underline', 'paragraphFormat', 'align', 'markdown', 'undo', 'redo']
  })
</script>

Done!

# 4. Do You Know How to Edit Effortlessly with the Inline Selection Toolbar?

You turn the line Selection Toolbar on by Enabling the toolbarVisibleWithoutSelection option. The best alternative to the TinyMCE inline editor now appears as soon as you click in an editable area. You don’t even need to select specific text.  It looks like this:

How can I Enable Inline Toolbar Selection in Froala?

To enable inline toolbar selection, begin as usual. First, go to your HTML file and add a container for the Froala editor:

<div id=“froala-editor”> <h3>Click here to edit the content</h3> <p>Enabling the <strong>toolbarVisibleWithoutSelection</strong> option makes the inline WYSIWYG HTML editor to appear as soon as you click in the editable area and not only when you select text.</p> </div>

Now, go to your JavaScript file and add these lines:

<script>
  new FroalaEditor('div#froala-editor', {
    toolbarInline: true,
    charCounterCount: false
  })
</script>

Done!

# 5. Have You Known that You can Use Multiple Editors on a Page?

Froala is a fantastic editor that allows you to use multiple editors on the same page. It will not affect your editing experience. You can even drag and drop an image from one editor to another.

How can I Use Two Editor Instances on the Same Page with Froala?

Go to your HTML file and create two different containers.

<div id="froala-editor1">
  <p>This is the first editor instance</p>
  <img src="https://raw.githubusercontent.com/froala/wysiwyg-editor/master/editor.jpg" class="fr-fil" alt="book" width="150"/>
</div>
<br/>
<div id="froala-editor2">
  <p>This is the second editor instance</p>
  <img src="https://raw.githubusercontent.com/froala/wysiwyg-editor/master/editor.jpg" class="fr-fil" alt="book" width="150"/>
</div>

Go to your JavaScript file and add these lines:

<script>
  new FroalaEditor('div#froala-editor1, div#froala-editor2', {
    toolbarInline: true,
    charCounterCount: false
  })
</script>

Done! you will see two editor instances on the same page.

# 6. Can I Insert Math Equations and Chemistry Formulas Effortlessly?

Do you want to use math equations and chemistry formulas in your editor? Froala enables you to insert them easily. It also supports a wide range of symbols and mathematical expressions.

To add a mathematical equation all you need to do is click on the square root icon. This opens a list of all the symbols required. Similarly, just click the C icon to add open a list of all chemistry formulas. 

How can I Use MathType with Froala?

To use MathType with Froala, you first need to install the MathType for Froala npm module. Use this command in the terminal to get started:

npm install @wiris/mathtype-froala3

Now, you need to load the module into your project using this line:

<script src = "node_modules/@wiris/mathtype-froala3/wiris.js"></script>

Finally, you have to update your Froala configuration options.

// From FroaLa 'Get started' section https://froala.com/wysiwyg-editor/docs/overview/ 
new FroalaEditor('.selector', { 
// Add MathType and ChemType buttons to the toolbar and the image menu: 
toolbar: ['wirisEditor', 'wirisChemistry'],
imageEditButtons: ['wirisEditor','wirisChemistry'], 
// Allow aLL tags, in order to allow MathML: 
htmlAllowedTags: [' .* '],
htmlAllowedAttrs: [' .* '], 
 // ALLow empty tags on these next elements for proper formula rendering: 
htmlAllowedEmptyTags: ['mprescripts', 'none'],
// In case you are using a different FroaLa editor Language than defauLt,
// Language: 'es',
// You can choose the Language for the MathType editor, too:
// @see: https://docs.wiris.com/en/mathtype/mathtype_web/sdk-api/parametersPregionaL_properties
// mathTypeParameters: { 
// editorParameters: { Language: 'es' },
//},
}

Done!

# 7. Does Froala Support Other Languages Like Arabic or Farsi with RTL?

Unlike English, languages like Arabic, Hebrew, and Farsi are read from right to left (RTL) [4]. Of course, if your web application supports any of these languages, you need a WYSIWYG editor that supports RTL functionality. Don’t worry! Your Froala editor offers full RTL support. When you select languages like Arabic or Farsi in Froala, the toolbar shifts and adjusts itself automatically. It will undoubtedly enhance your RTL text editing experience. Look at the form below showing the Froala language interface: While TinyMCE users often prioritize these localization features, the same technical scrutiny is essential in our Froala vs CKEditor comparison when evaluating global language support.

How do I Enable RTL Typing in Froala?

You can enable RTL text editing in Froala in one simple step. Go to your HTML file. Create a container for Froala.

<div id="froala-editor">
  <p>The rich text editor has full RTL support. Set the <a href="../docs/options#direction" title="direction option" target="_blank">direction</a> option to rtl and writing in Arabic or Farsi will feel naturally.</p>
</div>

Then go to your JavaScript file and add this code:

<script>
  new FroalaEditor('div#froala-editor', {
    direction: 'rtl'
  })
</script>

As you can see, the direction is set to ‘rtl.’ You enabled RTL typing.

# 8. Do You Know to Use Froala Responsive Video Options to Automatically Adapt to Different Screen Sizes?

This feature enables you to insert videos from different sources like Youtube or Vimeo and then change them based on your device screen. It shows like this:

How do I Enable Responsive Video in Froala?

To enable responsive video, go to your HTML file. Create a container for Froala.

<div id="froala-editor">
  <h3>Embed videos from your favorite service and have them adapt based on the screen size.</h3>
  <p>The responsive video features enables you to insert videos from Youtube or Vimeo and have them change based on your device screen.</p>
</div>

Go to your JavaScript file and add this code:

<script>
  new FroalaEditor('div#froala-editor', {
    videoResponsive: true,
    toolbarButtons: ['insertVideo']
  })
</script>

Done!

# 9. Do You Know How to Use Font Family to Add Your Fonts to the Froala WYSIWYG HTML Editor?

 By using the font_family.min.js plugin, it is possible to add your fonts to the WYSIWYG HTML editor.

First, Include the font on your webpage. In this example, we use four Google fonts: Roboto, Oswald, Montserrat, and Open Sans Condensed.

Next, define the fonts you want to add in the Font Family dropdown using the fontFamily option.

How do I Enable Font Family in Froala?

To enable FontFamily, go to your HTML file. Create a container for Froala.

<div id="froala-editor">
  <p>By default the font family icon is visible in the editor's toolbar. If you want to be able to see the actual font family for the selected text you can use the <a href='../docs/options#fontFamilySelection' title='fontFamilySelection' target='_blank'>fontFamilySelection</a> option.</p>
</div>

Then go to your CSS file and add the lines:

<!-- Include the fonts. -->
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,700,700italic&subset=latin,vietnamese,latin-ext,cyrillic,cyrillic-ext,greek-ext,greek' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Oswald:400,300,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,greek,greek-ext,vietnamese,cyrillic-ext,cyrillic,latin-ext' rel='stylesheet' type='text/css'>

Go to your JavaScript file and add this code:

<!-- Include the plugin file. -->
<script src="../js/plugins/font_family.min.js"></script>

<script>
  new FroalaEditor('div#froala-editor', {
    fontFamily: {
      "Roboto,sans-serif": 'Roboto',
      "Oswald,sans-serif": 'Oswald',
      "Montserrat,sans-serif": 'Montserrat',
      "'Open Sans Condensed',sans-serif": 'Open Sans Condensed'
    },
    fontFamilySelection: true
  })
</script>

Done!

# 10. Can I Use Third-Party Integrations for Spelling and Grammar Checking in Froala?

Froala editor supports third-party integration. WProofreader [3], enables advanced spelling, grammar, and text style checking. It allows the user to see and correct typos and grammar problems while typing. It detected misspellings and automatically underlines grammar errors. All you need to do is hover over a marked word and select a suggestion for a replacement. Here is an example:

Follow these steps to integrate and activate the WProofreader spelling and grammar checking functionality on your website:

  1. First, go to the WebSpellChecker website and subscribe to the WProofreader Cloud service.
  2. When you subscribe, you get an activation key that you need to specify in the WProofreader configuration.
  3. Finally, pass your activation key as a value for the serviceId option in the configuration script. It should be an identifier like this” gXuG4NUNri45q9A52Pf

How do I Integrate and Activate WProofreader Spelling and Grammar Checking Functionality in Froala?

To get your spell checker and Wproffreader working, there are several steps you need to follow:

Go to your HTML file. Create a container for Froala.

<div id="froala-editor">
  <p>This is an exampl of a sentence with two mispelled words. Just type text with misspelling to see how it works.</p>
</div>

Go to your JavaScript file and add this code:

// From FroaLa 'Get started' section https://froala.com/wysiwyg-editor/docs/overview/ 
new FroalaEditor('.selector', { 
// Add MathType and ChemType buttons to the toolbar and the image menu: 
toolbar: ['wirisEditor', 'wirisChemistry'],
imageEditButtons: ['wirisEditor','wirisChemistry'], 
// Allow aLL tags, in order to allow MathML: 
htmlAllowedTags: [' .* '],
htmlAllowedAttrs: [' .* '], 
 // ALLow empty tags on these next elements for proper formula rendering: 
htmlAllowedEmptyTags: ['mprescripts', 'none'],
// In case you are using a different FroaLa editor Language than defauLt,
// Language: 'es',
// You can choose the Language for the MathType editor, too:
// @see: https://docs.wiris.com/en/mathtype/mathtype_web/sdk-api/parametersPregionaL_properties
// mathTypeParameters: { 
// editorParameters: { Language: 'es' },
//},
}

Done!

Are You Ready to Enjoy Froala as a TinyMCE Alternative for Seamless HTML Editor Experience?

TinyMCE HTML editor that offers a wide range of features to users. It enables the easy creation and editing of HTML code, as well as the ability to customize the editor’s look and feel. Froala provides a similar HTML editor at a much lower cost. It has a simple and user-friendly interface, as well as features such as drag-and-drop content blocks, rich text editing, and custom integration with other tools. Both editors offer an excellent user experience and can assist you in creating high-quality HTML code.Don’t waste time! Head over to Froala and sign up to start enjoying the seamless, powerful features of the Froala WYSIWYG editor. This balance of high-end functionality and cost-efficiency is why our 7 WYSIWYG editor comparisons rank Froala as the premier choice for teams seeking professional-grade tools.

TinyMCE Alternative FAQs

Does WordPress still use TinyMCE?

Yes, WordPress still uses TinyMCE’s lighter version. To get the best editing experience in WordPress, you can choose a TinyMCE alternative WordPress editor.

Is TinyMCE free for commercial use?

Yes, TinyMCE is open-source and free for commercial use. However, it’s very limited as an open-source editor, and its paid plans are pricier compared to other premium editors such as Froala.

[1] https://www.tiny.cloud/

[2] https://www.g2.com/categories/wysiwyg-editors/free

[3] https://webspellchecker.com/

[4] https://froala.com/wysiwyg-editor/examples/rtl-ltr-custom-button/

 

Froala Blog Call To Action

 

 

 

Froala Editor 4.0.17 Released: Improving Convenience and User Experience

Froala 4.0.17

Froala always brings more stability and quality improvements with each new release. Our goal is to keep delivering the best WYSIWYG editing experience at affordable prices to our customers. Our success formula is:

Top quality editor + transparent pricing plans without hidden costs + all features included = the best value for the cost WYSIWYG editor (Froala)  

The Froala team is excited to announce the release of Froala Editor 4.0.17. It is another release built around you that comes with many fixes for customer-reported issues.

Froala WYSIWYG editor new release

 

What’s New in Froala Editor V4.0.17

The Froala v4.0.17 release includes improvements and fixes to content pasting and formatting, iOS device support, images, and a lot more!

Typing a comma after pasting a link now breaks the link editing

When pasting a URL into the Froala WYSIWYG editor, typing directly after it without adding a space will cause the user’s text to be part of the link. This enhances productivity as it allows users to quickly edit the URL without having to open the edit link popup. As URLs typically do not include commas, Froala will henceforth break the link if a comma is typed immediately after it.

The “Clear Formatting” tool now removes inline styles from pasted content

One of the features that Froala provides is the ability to clear the formatting that you applied to a text with a single button click. Before this release, the “Clear Formatting” tool didn’t remove the inline styles of the content pasted on the editor, especially when pasting in content from Microsoft Word. Now, this tool can get rid of any unwanted inline styles of the pasted content, too.

PRO TIP:

If you want Froala to automatically remove text formatting but keep content structure when pasting content into the editor, turn on the paste plain feature.

new FroalaEditor('.selector', {

pastePlain: true

});

Improved “keep format on delete” feature 

Whenever you type inside the Froala WYSIWYG editor, the last text format you applied remains in effect for any new text you type. For example, if you start typing in normal font weight and then apply bold formatting to one of the words, all words after that will automatically be in bold. However, if you delete the bolded text and continue typing in the non-bolded format, your text will remain in the non-bolded format unless you have the “keep format on delete” feature enabled.

new FroalaEditor('.selector', {

keepFormatOnDelete: true

});

This feature preserves the formatting of deleted text and applies it to the replacement text. It is useful for keeping the correct format of text when replacing content.

The buttons for inserting lists are now disabled when an image is selected

When you click on an image inside the Froala editor, the image edit popup appears, and the toolbar buttons are disabled to prevent users from executing a command before closing the image edit popup. Before the latest release, the ordered and unordered list buttons on the main toolbar were not disabled whenever an image was selected. This is now fixed, and the OL/UL button will be grayed out when an image is focused.

Although not recommended, you can enable the editor toolbar buttons while an image is selected by calling the “toolbar.enable” Froala API method. To ensure the toolbar buttons are enabled each time the image edit popup is shown, assign an event handler for the “popups.show.image.edit” event to call the “toolbar.enable” method.

 

var editor = new FroalaEditor('#editor', {
  events: {
    popups.show.image.edit' : function(){
      // this is the editor instance.
      this.toolbar.enable();
    }
  }
});

… and much more!

In this release, several bugs were fixed as part of an ongoing effort to make the user experience better.

  • Ensure that the image resize feature functions properly when the editor is initialized with its CSS position property set to “absolute”.
  • Froala no longer has any problems concerning the addition or removal of HTML <br> tags in empty paragraphs.
  • Resolved the problem of backspace not functioning on iOS devices.
  • Fixed the issue where the cursor moves when toggling between formatting.

All these improvements come together to make an already powerful WYSIWYG editor even better. Please find the complete changelog list here.

Get Froala V4.0.17

Since version 3.0.1, we’ve made a lot of improvements, added new features, and enhanced the security of the Froala editor without making any breaking changes. This means that if you haven’t updated Froala in a while, you are missing out on a lot. Plus, like in every Froala release, you don’t have to worry about your product breaking after updating the editor. If you update your editor today, which will take less than 5 minutes, you will enjoy a better editing experience that we think you’ll adore. In the unlikely event that something unexpected occurs, you can easily undo changes in under 5 minutes.

Updating your editor could also resolve some issues that you or your users might have had before. Don’t hesitate to update your editor today.

How Do I Upgrade to V4.0.17?

Super easy! Follow the steps below to update to the latest version.

For Froala Editor Version 3 and Version 4 Users

Follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.0.17/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.17/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks like React, Angular, and Vue.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that show you the functionality in Froala HTML Editor.

If you like to see the HTML output while trying Froala, use Froala Online HTML Editor.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We’d love to hear what you think of the latest release! Join us on GitHub Community to chat with product managers, developers, and other members of the Froala team.

Technical Questions

You’re helping us build a better editor

Thank you for using Froala. With your support, we’re working to make WYSIWYG editing more enjoyable, accessible, and beneficial for everyone.

Froala Editor V4.0.16: Quality and Stability Improvements

Froala editor v4.0.16

Today, we are excited to introduce Froala’s 4.0.16 release. It is another release built around you with a focus on quality enhancements, stability improvements, and fixes for customer-reported issues. Because you keep in touch with our team, we can quickly put out quality releases that focus on your needs.

Since version 3.0.1, there have been a lot of improvements, new features, and security enhancements added to the Froala editor without any breaking changes. This means that if you haven’t updated Froala in a while, you are missing out on a lot. Plus, like in every Froala release, you don’t have to worry about your product breaking after updating the editor. If you update your editor today, which will take less than 5 minutes, you will enjoy a better editing experience that we think you’ll adore. In the unlikely event that something unexpected occurs, you can easily undo changes in under 5 minutes.

Updating your editor could also resolve some issues that you or your users might have had before. Don’t hesitate to update your editor today. To help you update your editor as smoothly as possible, we’ve added a detailed section at the end of the post.

Froala WYSIWYG editor

A Deep Dive into the New Froala Editor V4.0.16

The Froala v4.0.16 release includes improvements and fixes to the styling and formatting of list items, the placement of popups, problems with scrolling in the editor viewport, and a lot more!

Improved pasting content feature 

We know how disappointing it is when you try to paste some content into your WYSIWYG editor, only for the content to look different. We know some of you experience a few issues when pasting hyperlinks and images into Safari. So, we’ve improved this feature in our latest release. You can solve pasting issues by updating your editor to the latest version. Additionally, there are no longer any extra leading or trailing spaces when you paste text from a clipboard.

Improved List feature 

Adding ordered and unordered lists is a basic feature for any WYSIWYG editor. Froala’s List plugins allow users to not just insert basic lists like numbers and bullets but also advanced types such as lower greek or upper roman. You can enable or disable inserting advanced list types through the listAdvancedTypes API option.

There were several issues with lists that have been resolved in this release:

  • Inserting an image inside a list then setting it to display inline and aligning it to the left results in overlapping the list with the image.
  • Toggling the list button on an empty field creates extra list items.
  • The images or URLs which are inserted are not in line with the number formatting. They move upwards out of the format.

Improved Language support 

The Froala WYSIWYG editor supports 38 languages. By default, it uses the English (United States) language, but you can easily change this using the language API option. Make sure you have the language file in the /langs folder. For example, if you want to set your editor language to Estonian, your script should be like

<!-- Include the language file. -->

<script src='../langs/es.js'></script>

<script>

  $(function() {

    $('div#froala-editor').froalaEditor({

      // Set the language code.

      language: 'es'

    })

  });

</script>

In the latest release, we added some missing translations for Dutch(nl), Japanese (ja), and some other languages.

Fixed the issue where the zIndex option is ignored for popups after exiting fullscreen mode

One of the powerful options of the Froala editor is the ability to customize the z-index value for the popups and toolbars. This is helpful when the editor and your application’s parts do the same in fullscreen mode. Update now to solve this issue.

Editor viewport jumps when pressing the ENTER key after enabling iframe and heightMax options

The Froala editor provides you with amazing features. For instance, you can load your editor in Iframe. This isolates your editor’s contents from the rest of the page. For example, elements inside the editor will not be affected by other styles you are using on your webpage. To enable this feature, set the iframe API option to “true”

new FroalaEditor('.selector', {

  iframe: true

});

Another option that the Froala editor provides is the heightMax API option, which allows you to set a maximum height for the rich text editor’s editing box. We noticed that using those two features together leads to an issue when you try to add a new line using the ENTER key. This issue has been resolved, and you can now use these options together safely.

… and much more!

Several bugs were fixed with this release in a constant effort to make the user experience even better.

  • Fixed the issue where embedded Google Documents are deleted when deleting text in the next row.
  • Fixed the issue where a pop-up drop-down menu becomes hidden when trying to scroll over its contents using the mouse.

Please find the complete changelog list here.

Get Froala V4.0.16

How Do I Upgrade to V4.0.16?

Super easy! Follow the steps below to update to the latest version.

For Froala Editor Version 3 and Version 4 Users

Follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.0.16/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.16/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks like React, Angular, and Vue.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step instructions on how to upgrade from version 2.

Try The Latest Froala Editor

Explore a variety of examples that show you the functionality in Froala HTML Editor.

If you like to see the HTML output while trying Froala, use Froala Online HTML Editor.

Are you ready to use Froala in production?

Level up your rich text editing capabilities today with the plan that best suits your needs.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We’d love to hear what you think of the latest release! Join us on GitHub Community to chat with product managers, developers, and other members of the Froala team.

Technical Questions

You’re helping us build a better editor

Thank you for using Froala. With your support, we’re working to make WYSIWYG editing more enjoyable, accessible, and better for everyone.

Froala Editor 4.0.15 Released: XSS vulnerability resolved

Froala v4.0.15

Froala is continuously updating its editor to make it more secure and intuitive so that everyone can enjoy a great content editing experience.

4.0.15 Release

The long-awaited 4.0.15 release of Froala is now available! This release contains a number of quality enhancements, usability improvements, and fixes for customer-reported issues. This includes:

  • Resolving XSS vulnerability in the Markdown feature.
  • Improvements for content pasting from different sources.
  • Improvements for resizing images that have a caption.
  • And more!

Froala WYSIWYG Editor New Release

Resolving XSS vulnerability within the Markdown plugin

When developing applications, web developers must be cognizant of security issues. Cross-site scripting (XSS) is one particular issue that can occur when user input is not properly sanitized before being shown on a page.

XSS is a major security flaw. Additionally, if you are using an earlier version of the Markdown plugin, you should be aware of a potential XSS vulnerability. This can be exploited if an attacker injects malicious code into the markdown content that the plugin subsequently processes. The good news is that the Froala team is always trying to improve the editor’s security, and they’ve introduced certain capabilities to the Markdown plugin that help to mitigate XSS attacks. They’ve introduced an escaping mechanism, for example, that automatically escapes specific code parts that could be utilized in an attack.

To mitigate this issue, ensure that you are using the latest version of the Markdown plugin. You can do this by updating your editor using the instructions in the “Updating your editor” section below.

If you are loading the editor plugins separately, not using the editor pkgd script, make sure to replace the Froala editor version on the Markdown plugin script link with 4.0.15. For example,

https://cdn.jsdelivr.net/npm/froala-editor@4.0.15/js/plugins/markdown.min.js

If you’re not aware of the Froala markdown feature, It’s a highly requested feature that was introduced in version 4. It allows users to format words and text using code shortcuts through predefined, easy-to-remember markdown syntax. Get a deeper look at the Markdown plugin here.

Improvements in content pasting from different sources

If you’ve ever tried copying and pasting content from a Word document or another website into your Froala editor, you know how well it works. Sometimes, though, the result wouldn’t be exactly what you want it to be. So we’ve made some improvements:

  • Convert the font size unit of the pasted content.

When you paste the content into Froala, it will now automatically convert the font size unit to the unit you set using the fontSizeUnit option, making it easier to keep your text style looking consistent. For example, If you paste content from MS Excel that has a 12px font size and the fontSizeUnit of your Froala is set to ‘pt‘, the content will have a 9pt font size after being pasted to the editor.

The fontSizeUnit is one of the many options that Froala provides to control the editor’s font style. You can use it to set the unit to be used for the font size. By default, it is set to ‘px’.

  • Keep complex table structure after pasting from MS Excel.

We’ve also made improvements to pasting complex tables inside the editor – so now you can do it without worrying about losing any formatting or breaking the table structure after pasting it from MS Excel or any other source. We understand that tables are crucial for representing data, and we don’t want you to waste any more time fixing the table structure after you paste it into the editor. So update your editor now and enjoy pasting content into the editor without any hassle!

 

Improvements for resizing images that have a caption.

Images are extremely important to include when creating content  – especially if you want people to remember it! In fact, studies have shown that we’re more likely to recall information and engage with content when there are images involved. That’s why Froala makes it easy to add and edit images. It has been proven that Froala is one of the best WYSIWYG editors that handle images. With Froala, you get a lot of options for editing and enhancing your images, including the ability to resize, add an ALT attribute, set the display property, change the alignment, add a caption, and much more.

With Froala, you can resize images either by clicking on the “Change Size” button and entering a custom value into the width and height inputs that appear or by clicking on the image and dragging the blue border that appears around it. Resizing images by dragging allows you to see the new image size while editing, which makes it easy to adjust the image size to best fit your content. In the latest release, images with captions can also be resized by dragging correctly, just as it works for images without captions.

 

… and much more!

Several bugs were fixed with this release in a constant effort to make the user experience even better.

  • Fixed deleting the last character on a line makes the cursor jump to the previous line with ENTER_BR config.
  • Fixed the issue wherein the Font Family gets reset when pressing enter even after enabling the keepFormatOnDelete option
  • Fixed crash when editing content: Uncaught TypeError: Cannot read property ‘classList’ of null.

Please find the complete changelog list here.

Get Froala V4.0.15

How Do I Upgrade to V4.0.15?

Super easy! Follow the steps below to update to the latest version.

For Froala Editor Version 3 and Version 4 Users

Follow the table below to know the proper way of downloading the latest Froala Editor release and how to include it in your project based on your preferred method.

Method How to download Include in your project
CDN
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@4.0.15/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Include Editor JavaScript file-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@4.0.15/js/froala_editor.pkgd.min.js"></script>
CDN (Always the latest version)
<!-- Include Editor stylesheet-->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

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

Replace the {download-folder-path} in the following example with the path to the folder containing the stylesheet file e.g.

../css/froala_editor.pkgd.min.js

-->

<link href="{download-folder-path}/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!--

Replace the {download-folder-path} with the path to the folder containing the JS file e.g.

../js/froala_editor.pkgd.min.js

-->

<script type="text/javascript" src="{download-folder-path}/froala_editor.pkgd.min.js"></script>
bower
bower install froala-wysiwyg-editor
NO Package Manager Download Froala WYSIWYG Editor files using the download form here.
Integrated with a Framework Select your preferred framework from 17 different popular frameworks like React, Angular, and Vue.
Other options Check here for other options to use Froala WYSIWYG Editor in your project.

For Froala Editor Version 2 Users:

Follow this migration guide to get step-by-step upgrade instructions.

Try The Latest Froala Editor

Explore a variety of examples that show you the functionality in Froala HTML Editor.

If you like to see the HTML output while trying Froala, use Froala Online HTML Editor.

Are you ready to use Froala in production?

Level up your rich text editing capabilities today with the plan that best suits your needs.

Change Log

Get Started

  • You can download and start using Froala in less than five minutes following our get started guide.

Support and Feedback

  • We’d love to hear what you think of the latest release! Join us on GitHub Community to chat with product managers, developers, and other members of the Froala team.

Technical Questions

What’s next?

Development continues to make Froala a safe, secure, and feature-rich WYSIWYG editor. More changes and improvements are coming up in the next release! Stay tuned and subscribe to our newsletter to be the first to know about the updates!

7 Best Online Text Editors To Boost Up in 2022

online text editors

Over time, the manual writing process on paper has given way to the use of word processing software. People are involved in writing tasks in various fields and must prepare and edit files using software such as MS Word, WordPad, and others. However, people’s issue with these programs is that they are not free. Unlike WordPress text editors, they must be installed on your device, and the device must be sufficiently compatible to run them smoothly. Thus, people are now starting to prefer online text editors.

People are migrating to the online world as a result of technological advancement. The online text editor is part of a modern invention that allows people to edit their text files easily. This post will go over the top 7 online text editors of 2022 that will help you be more productive.

What are the Best Online Text Editors?

Why Should I Use Froala WYSIWYG Online HTML Editor?

online text editors

An HTML WYSIWYG editor is made for developers by developers. You can start using it immediately if you have robust API and documentation access. Froala Editor is a lightweight JavaScript WYSIWYG HTML Editor that allows your applications to edit rich text.

Let’s discuss some benefits you’ll get from using Froala WYSIWYG Editor Trial. Firstly, you can start using this tool immediately if you have access to a robust API and documentation, making it developer friendly. 

Secondly, the Froala Editor is simple to expand, as it allows you to do anything. Proper written, organized, and documented code is simple to comprehend and expand upon.

This editor has standard plugins, so inventing the wheel is unnecessary. For your project, you can choose from more than 30 pre-installed plugins in our rich text editor. Selecting the right set of built-in plugins is much easier when you weigh these features against our selection of the best WYSIWYG editors for web developers in 2026.

Furthermore, it is blazing fast. Our rich text editor will initialize in less than 40ms, which is ten times faster than the blink of an eye. Froala’s WYSIWYG is lightweight. You can improve the editing experience in your application without slowing down loading.

This is the best JavaScript-rich text editor, thanks to our engineers’ fantastic architecture, so it is also well organized. 

Lastly, this text editor is secure. We are confident it is impenetrable, but don’t take our word for it—try hacking it instead.

You can use it as an online notepad to save the text in a PDF or Word document, convert text to HTML, or run sanity checks on your HTML code.

With this text editor, you can write or copy the text on the left while viewing neat, easily usable HTML code in the right window.

If you enjoy writing code, copy and paste your HTML and use the left editor to view the text output.

Additionally, you can improve the text by using simple to complex editing tools, such as strike-through, subscript, superscript, italic, and bold.

Changes in fonts, text alignment, ordered lists, bullets, quotes, indentation, color schemes, inline classes, line heights, paragraph styles, drag-and-drop, shortcuts, and other features are all possible.

Another advantage is the ability to insert images, audio, and video into the editor. Add URLs, style images, personalize image editing, add custom color pickers, or use emoticons to express yourself.

What Makes Prepostseo.com a Good Online Editor?

With the aid of this straightforward text editor, users can quickly and stylishly submit content that is free of errors. In addition, this online text editor’s user interface is quite simple and offers several helpful features to enhance the effectiveness of content.

The editor offers the ability to insert emoticons and special characters into written text. Users can enhance the content by adding numbered or bulleted lists to make it look more appealing.

Moreover, the amazing option to include media files in the written document offered by the online WordPad is fantastic. The editor also offers a choice to alter the written text’s format.

Prepostseo enables users to add a link to a particular anchor text to send users to a particular webpage. The editor also has a great feature that lets you save the edited file as a PDF or DOC. Balancing these specific file export options against the advanced usability of high-end platforms is a key focus in our Froala vs TinyMCE in 2026 analysis.

How Can Editpad.org Boost Your Productivity?

Similar to MS Word, this online notepad offers extensive options for content modification. It enables students to turn in flawless homework and other research projects. Simply enter the text in the input field and begin editing to use this editor.

What is Textdoc.co?

Create, edit, share, and save text files to your device or Google Drive as editable Docs using this online text file editor. As a result, you don’t have to worry about unwanted auto-formatting when you keep notes throughout the day, make a list, or write or edit code. Building custom web interfaces often requires moving beyond simple text files to more robust solutions, as detailed in our guide to what’s The Best Django WYSIWYG Editor With Image Upload.

A user can also send a link to your text file via a special URL to a client, a coworker, or a friend using a straightforward URL that anyone can access. A password can also be used to lock the file.

You can save your text file as a Doc in Google Drive as an alternative to a TXT file. Instead of automatically saving every file, this enables you to save important editable files.

Text can be copied and pasted into and out of Textdocs without formatting or extra characters. Doing this allows you to edit the text before pasting it into an email or chat platform.

Does SmallSEOtools.com Have an Online Text Editor?

SmallSEOTools’ online text editing tool is a full-featured package with cutting-edge text editing capabilities. This will allow you to edit any text file in minutes. This website’s editor is a simple-to-use online text editing tool that doesn’t require users to go through or adhere to any complicated steps to edit their text files.

In addition, the editing features offered by this tool are similar to those you may already use on text editing programs like MS Word, so you don’t need to learn them. Transitioning from these familiar MS Word-style interfaces to a more specialized CKEditor alternative in 2026 allows for much greater control over web-specific formatting requirements.

Is Hemingwayapp.com a Useful Online Text Editor?

An excellent online plain text editor enables users to make their text understandable and fashionable. The editor has a distinctive user interface and quickly provides the word count of the written text.

Features of the Hemingway app include the ability to insert headings into the content, alter the text’s style, and much more. Refining these stylistic adjustments becomes even more critical when weighing such manual tools against the automated AI capabilities detailed in our Froala vs Tiptap comparison.

What Are Wordhtml.com’s Key Features?            

WORDHTML’s free online text editor lets users quickly edit the critical text in real-time. It functions similarly to Microsoft Word and offers a variety of tools for editing the provided text.

All you need to do is enter the necessary text or copy and paste it to begin editing with the online editor.

Can You Choose the Best Text Editor Now?

online text editors

An online text editor is an effective online tool for making your workflow portable and quick. You only need an internet connection to use these services, and you can access them from any PC, anywhere.