UiConfig
Properties
overlayContainer?: ShadowRoot | HTMLElementmodule:core/editor/editorconfig~UiConfig#overlayContainerThe element or shadow root that hosts the editor's overlay layer.
The overlay layer (internally the body collection) hosts the editor's floating UI – balloons, dialogs, and tooltips. It is rendered outside the editor's own DOM structure so it stacks above the editor and is not clipped by scrollable or
overflow: hiddenancestors.When the editor runs inside a shadow root, provide this container as a separate shadow root attached to a host element placed at the end of
document.body, rather than to an element nested in the editor's own tree. As a direct child ofdocument.body, that host has no scrollable oroverflow: hiddenancestor to clip the overlay layer, and its own shadow root keeps it a self-contained styling boundary:
Copy codeconst overlayHost = document.body.appendChild( document.createElement( 'div' ) ); const overlayContainer = overlayHost.attachShadow( { mode: 'open' } ); // A shadow root does not inherit the page styles, so the editor stylesheets must be adopted into it // (for example through its `adoptedStyleSheets`) for the overlay layer to render styled. overlayContainer.adoptedStyleSheets = editorStyleSheets; ClassicEditor .create( { attachTo: document.querySelector( '#editor' ), ui: { overlayContainer } } );When it is not set, the editor falls back to auto-detecting the shadow root it lives in (open or closed). Treat this only as a fallback – that root may clip the overlay layer; the
document.bodydefault is meant just for editors embedded in the light DOM.module:core/editor/editorconfig~UiConfig#poweredByThe configuration of the “Powered by CKEditor” logo.
Read more in
PoweredByConfig.module:core/editor/editorconfig~UiConfig#viewportOffsetThe viewport offset used for positioning various absolutely positioned UI elements.
Read more in
ViewportOffsetConfig.