Contribute to this guide

guideImages in CKEditor 5 (overview)

CKEditor 5 comes with various tools to work with images. The editor allows inserting (uploading), resizing, styling, captioning and linking images. All these features work both with block, inline, and responsive images out-of-the-box.

To see the all image features in action, check out the demo below. To learn more about individual plugins (sub-features) in the image ecosystem, see the Image features section.

# Demo

This demo only presents a limited set of features. Visit the full-featured editor example to see more in action.

# Base image feature

The base image feature does not support any user interface for inserting or managing images. Its sole purpose is to lay ground for other plugins (listed below) to build the target user experience. This pattern (composition of atomic features) is common for CKEditor 5 and allows the developers to build their own customized experience by implementing specific subfeatures differently.

# Image features

The @ckeditor/ckeditor5-image package contains multiple plugins that implement various image-related features. The Image plugin is at the core of the ecosystem. Available in all ready-to-use editor builds, it provides the basic support for block and inline images. There are many other features that extend the editor capabilities:

The availability of these plugins varies in different predefined editor builds but the most important ones are present in all builds as presented in the table below:

Image feature (plugin) Predefined editor build
Classic Inline Balloon Balloon block Document Superbuild
Image ImageBlock
ImageInline
ImageToolbar
ImageCaption
ImageStyle
ImageTextAlternative
ImageUpload
PictureEditing
ImageResize
LinkImage
ImageInsert
AutoImage

You can add more image features to your editor using the online builder or manually by customizing your editor build.

# Image contextual toolbar

The ImageToolbar plugin available in all editor builds introduces a contextual toolbar for images. The toolbar appears when an image is selected and can be configured to contain any buttons you want. Usually, these will be image-related options such as the text alternative button, the image caption button, and image styles buttons. Shown below is an example contextual toolbar as observed in the demo above with a large set of buttons.

An extended contextual toolbar.

The image toolbar is configurable using the config.image.toolbar property. For instance, to display the caption toggle and text alternative buttons, use the following configuration:

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        image: {
            toolbar: [ 'toggleImageCaption', 'imageTextAlternative' ]
        }
    } )

Refer to the image installation guide for more details on configuring the features available in the toolbar and to the toolbar section of the Migration to v29.x guide, as important changes were introduced in that version. You can also check the editor toolbar guide.

See the common API of image-related features such as ImageStyle, ImageResize, and LinkImage to learn more about available image toolbar buttons.

# Responsive images

Support for responsive images in CKEditor 5 is brought by the CKBox management platform. The Easy Image feature can also be used without any additional configuration. Refer to the Easy Image integration guide to learn how to use the feature in your project.

# Typing around images

To type before or after an image easily, select the image, then press the Arrow key ( or ) once, depending on where you want to add content – before or after respectively. The image becomes no longer selected and whatever text you type will appear in the desired position.

You can also use the Insert paragraph handles on the bottom or top edge of the selected image to add a paragraph below or above the image, respectively.

Paragraph insertion handles.

# Contribute

The source code of the feature is available on GitHub in https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-image.