ImageStyleDropdownDefinition (image/imagestyle)
@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui
The image style custom drop-down definition descriptor
This definition can be implemented in the image toolbar configuration to define a completely custom drop-down in the image toolbar.
ClassicEditor.create( editorElement, {
image: { toolbar: [
// One of the predefined drop-downs
'imageStyle:wrapText',
// Custom drop-down
{
name: 'imageStyle:customDropdown',
title: Custom drop-down title,
items: [ 'imageStyle:alignLeft', 'imageStyle:alignRight' ],
defaultItem: 'imageStyle:alignLeft'
}
] }
} );
Note: At the moment it is possible to populate the custom drop-down with only the buttons registered by the ImageStyle
plugin.
The defined drop-down will be registered
as the DropdownView
with the SplitButtonView
under the provided name in the
ComponentFactory
Filtering
Properties
-
defaultItem : String
module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition#defaultItem
The name of one of the buttons from the items list, which will be used as a default button for the drop-down's split button.
-
items : Array.<String>
module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition#items
The list of the names of the buttons that will be placed in the drop-down's toolbar. Each of the buttons has to be one of the default image style buttons or to be defined as the image styling option.
-
name : String
module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition#name
The unique name of the drop-down. It is recommended to precede it with the "imageStyle:" prefix to avoid collision with the components' names registered by other plugins.
-
title : String
module:image/imagestyle/imagestyleui~ImageStyleDropdownDefinition#title
The drop-down's title. It will be used as the split button label along with the title of the default item in the following manner: "Custom drop-down title: Default item title".
Setting
title
to one oflocalizedDefaultStylesTitles
will automatically translate it to the language of the editor.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.