Named slots are an experimental feature that allows a single host node (an ElementNode or DecoratorNode) to contain several isolated editable regions addressed by name (e.g., a Card with a title slot).
Key characteristics include:
- Isolation: Each slot acts as a virtual shadow root. Carets and formatting do not merge across slot boundaries, and
Cmd+A is scoped to the slot, not the whole document. - Single Tree: Unlike nested editors, named slots exist within the same
EditorState, simplifying history and collaboration. - Structural Boundary:
getParent() stops at the slot boundary; to reach the host, you must use $getSlotHost(). - DOM Representation: Each slot renders into a hidden
<div data-lexical-slot="<name>"> container by default until the host explicitly attaches it during rendering.