# 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.

<a id="documentation">

## Documentation

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

The widget API consists of two layers:

* The [`Widget`](module_widget_widget-Widget.md) 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`](module_core_plugin-PluginStaticMembers.md#member-requires) property.
* The [`toWidget()`](module_widget_utils.md#function-toWidget) and [`toWidgetEditable()`](module_widget_utils.md#function-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:

* The [`WidgetToolbarRepository`](module_widget_widgettoolbarrepository-WidgetToolbarRepository.md) plugin which exposes a nice API for registering widget toolbars.
* A few helper functions for managing widgets in the [`@ckeditor/ckeditor5-widget/utils`](module_widget_utils.md) module.

> **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](engine.md) and this API’s only role is to control it.

<a id="installation">

## Installation

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

```bash
npm install ckeditor5
```

<a id="contribute">

## Contribute

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

<a id="external-links">

## External links

* [`@ckeditor/ckeditor5-widget` on npm](https://www.npmjs.com/package/@ckeditor/ckeditor5-widget)
* [`ckeditor/ckeditor5-widget` on GitHub](https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-widget)
* [Issue tracker](https://github.com/ckeditor/ckeditor5/issues)
* [Changelog](https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md)

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
