Skip to content
Corex

DrawerRenderer

Corex\Ui\Blocks\DrawerRenderer · class · Add-ons layer

Renders the corex/drawer block (spec 068, US9) — a slide-in panel: a trigger button + a native <dialog> (focus-trap + ESC + ::backdrop for free), sliding from the start or end edge (logical, RTL-correct), with a close button. Token-only (radius/shadow/z-index/focus), escaped, i18n. Empty title + empty content render nothing. The dialog always has a name. With a title it is labelled by its heading. With none it carries the label of its trigger, which is never empty: a dialog with no name is announced as “dialog” and nothing more (DECISIONS #316). Only the view script answers the trigger and the close button. With scripting off the stylesheet shows the dialog in the page, where the block is, and hides the two buttons (shared/_dialog-parts.scss), so what it holds is not lost. The close button comes before the body, in a header with the title. The order is not for looks: a browser opening a dialog puts focus on the first thing in it that takes focus, and scrolls to it. With the button last that was the first link of the content, wherever in the content it was.

render(array $attributes, string $content, object $block): string

Section titled “render(array $attributes, string $content, object $block): string”