• Jodit
  • PRO
  • Builder
  • Getting Started
  • Playground
  • Examples
  • Documentation
  • Download
  • Overview
  • Issue tracker
  • Docs
  • Plugins
  • Demo
  • Pricing
  • File Browser Pro
  • Sign in
Get connected wth us on social networks!

Footer

Jodit Core

  • Jodit Home page
  • Documentation
  • Playground
  • Examples
  • Github
  • Issues

Integration

  • Jodit React
  • Jodit Angular
  • Jodit Vue
  • Jodit Yii2
  • Jodit Joomla

PRO/OEM plugins

  • AutoComplete
  • Backup Plugin
  • Button Generator
  • Change case
  • Custom Color Picker
  • Emoji
  • Finder
  • Google Search
  • Paste code
  • Show Blocks
  • Virtual Keyboard
  • Tune block
  • Highlight signature
  • Google Maps Editor
  • Export in PDF
  • Page Break
  • Iframe Editor
  • Paste from Word PRO
  • Mobile View
  • ToDo List
  • Translate

Links

  • Demo PRO/OEM
  • Demo FileBrowser PRO
  • Price
  • License
  • Support
  • For resellers

Versions

  • site v.0.1.810
  • Jodit PRO v.4.6.4
  • Jodit v.4.6.2
  • All versions
2025 © Copyright: XDSoft.net <support@xdsoft.net>
  • Getting started

    • Installation
    • Usage
    • Support
    • FAQs
    • Cloud
    • Examples
  • How to

    • Create plugin
    • Add custom button
    • Add custom font in the font list
    • How to create module
    • How to generate license key
    • How to make a backend finder
    • How to set up document view
  • Modes

    • Source mode
  • Customisation

    • Theme
    • Keyboard
  • API

    • License Rest API
    • JS API
  • Changelog

  • Plugins

    • AutoComplete
    • Backup Plugin
    • Button Generator
    • Change case
    • Custom Color Picker
    • Emoji
    • Finder
    • Google Search
    • Paste code
    • Show Blocks
    • Virtual Keyboard
    • Tune block
    • Highlight signature
    • Google Maps Editor
    • Export in PDF
    • Page Break
    • Iframe Editor
    • Paste from Word PRO
    • Mobile View
    • ToDo List
    • Translate

How to create your own Jodit plugin

Jodit plugins are designed to extend the basic functionality of the editor. There are built-in plugins, without which the editor will not work correctly. There are plugins that add completely new functionality. You can write your own plugin that will either change the current behavior of the editor or add a new function.

Plugins can be both simple functions and complex classes.

In the simplest case, it's just a function that receives a Jodit instance as input.

Jodit.plugins.add('alertMyId', function (jodit) { alert(jodit.id); });
Copy

The moment you create an instance of Jodit, all plugins are initialized.

const editor = Jodit.make('#editorId'); // alert('editorId')
Copy

This is usually not what you expect. You probably want the plugin to take action on certain events. The EventEmiter editor will help you with this.

Jodit.plugins.add('keyLogger', function (jodit) { jodit.events.on('keydown', (e) => { sendAnalytics('keydown', e.key); }); });
Copy

As mentioned above, plugins can be more complex than just a function. A plugin can be a class:

class resizeEditor { hasStyle = true; buttons = [ { name: 'custom', group: 'other' } ]; requires = ['enter', 'drag-and-drop']; init(jodit: IJodit): void { jodit.events.on('afterInit', () => { Jodit.ns.Helpers.css(jodit.editor, { width: 400 }); }); } destruct() { Jodit.ns.Helpers.css(this.jodit.editor, { width: null }); } } Jodit.plugins.add('resizeEditor', resizeEditor);
Copy

hasStyle

  • Type: boolean
  • Default: false

Jodit will try to load the styles along the same path as the plugin is loaded.

buttons

  • Type: Array<IPluginButton>
  • Default: []
export interface IPluginButton { name: string; group?: ButtonGroup; position?: number; options?: IControlType; } export type ButtonGroup = | string | 'source' | 'font-style' | 'script' | 'list' | 'indent' | 'font' | 'color' | 'media' | 'state' | 'clipboard' | 'insert' | 'history' | 'search' | 'other' | 'info';
Copy

Buttons to be automatically added to the editor's button groups. Those. if the plugin is connected, the button will appear in the list, if not connected, it will disappear.

Jodit.defaultOptions.controls.insertTime = { icon: require('./icon.svg'), tooltip: 'Insert Time', exec: (editor: IJodit) => { editor.s.insertHTML(new Date().toTimeString()); } }; class insertTimePlugin { buttons = [ { name: 'insertTime', group: 'insert' } ]; } Jodit.plugins.add('insertTimePlugin', insertTimePlugin);
Copy

requires

  • Type: Array<string>
  • Default: []

If your plugin depends on other plugins, then it must be initialized after them.