NEWCKEditor AI is here! Learn how to supercharge your editor with AI on our webinar.
Sign up (with export icon)

CKEditor 5 widget API

This package implements the widget API for CKEditor 5.

The API consists of a few primitives and helpers that make it easy to implement rich content units such as images with captions.

Documentation

Copy link

Browse the API documentation of this package by using the module tree on the left.

The widget API consists of two layers:

  • The Widget plugin that enables base support for this feature. Usually, your plugin which implements a specific widget will define its reliance on the Widget plugin via its Plugin.requires property.
  • The toWidget() and toWidgetEditable() functions. You need to use them during the conversion to make a specific element either a widget or its nested editable. See their documentation for more details.

Besides these mentioned core functionalities, this package implements the following utilities:

Note

The widget API is proposed in a different way than it was in CKEditor 4. It is just a set of utilities that allow you to implement typical object-like entities. Most of the work actually happens in the engine and this API’s only role is to control it.

Installation

Copy link

This package is part of our open-source aggregate package.

npm install ckeditor5
Copy code

Contribute

Copy link

The source code of this package is available on GitHub in https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-widget.

Copy link