SIGN IN SIGN UP

feat(react): configurable portal targets for floating UI (#2729)

* feat(react): configurable portal targets for floating UI

Adds a `portalElements` prop on `BlockNoteView` for configuring where
floating UI elements (slash menu, formatting toolbar, side menu, table
handles, etc) portal to, plus a per-Controller `portalElement` override.

Also changes `editor.mount()` to default to `element.parentElement`
(i.e. `bn-container`) instead of `document.body` so floating UI is
contained within the editor by default. Pass
`portalElements={{ default: document.body }}` to opt back into the
previous behaviour.

Resolves #2692.

* docs(react): document portalElements config

Adds a short "Configuring Portal Targets" section to the UI Components
overview page and updates the example README to match the side-by-side
demo.
N
Nick Perez committed
2e2d22523e3e188cd7dd1cde209e53b20bd70f96
Parent: 932e3ab
Committed by GitHub <noreply@github.com> on 5/13/2026, 8:58:47 AM