Skip to content

ckeditor5-elements / ElementBreadcrumbs

Class: ElementBreadcrumbs ​

Shows the data view structure at the current selection (the elements of the editor data, as in getData()), e.g. aside.note › p, ul › li or figure.table › table › tbody › tr › td.

Inline elements are items, as any element. CKEditor's text attributes, marks on the text such as its <strong>, are skipped. The selected element, e.g. an image, is the innermost item.

Place them in a toolbar as the breadcrumbs component, or anywhere else using a view from createView.

Clicking is configured only by the elementBreadcrumbs.menu editor config option (see ElementBreadcrumbsConfig): with it, the items are buttons that open the menu of their element, with ElementMenu, as the context menu does; without it, they are labels.

The data view is converted again only when elements change, not when typing or moving the cursor. For a large document, that happens at most every 250 ms.

Extends ​

Constructors ​

Constructor ​

ts
new ElementBreadcrumbs(editor): ElementBreadcrumbs;

Parameters ​

ParameterType
editorEditor

Returns ​

ElementBreadcrumbs

Overrides ​

Plugin.constructor

Properties ​

items ​

ts
items: readonly BreadcrumbItem[];

Observable

The elements at the current selection, from the outermost to the innermost one.

Accessors ​

pluginName ​

Get Signature ​

ts
get static pluginName(): "ElementBreadcrumbs";
Returns ​

"ElementBreadcrumbs"


requires ​

Get Signature ​

ts
get static requires(): readonly [typeof ElementMenu];
Returns ​

readonly [typeof ElementMenu]

Methods ​

createView() ​

ts
createView(locale?): BreadcrumbsView;

Creates a breadcrumbs view that follows items.

Parameters ​

ParameterType
locale?Locale

Returns ​

BreadcrumbsView


destroy() ​

ts
destroy(): void;

Returns ​

void

Inherit Doc ​

Overrides ​

Plugin.destroy


init() ​

ts
init(): void;

Returns ​

void


refresh() ​

ts
refresh(): void;

Updates items from the current selection, converting the data view first when elements changed.

Returns ​

void