Skip to main content

Notification

A notice with an icon, an optional label and a message — inline in the content, pinned as an announcement bar, or floating as a toast. Core has an equivalent only in the sense that a coloured paragraph is an equivalent.

The block renders through the notification element — the same PHP that runs in the page builder, so the front end is identical either way.

What the sidebar exposes

OptionWhat it does
messageThe notice text
label_textA short label before the message, e.g. “Heads up”
typeSemantic colour — info, success, warning, danger and the rest
border_styleFilled or outline
iconThe icon shown beside the message
layoutIcon and text inline, or stacked
dismissibleGive the notice a close button
auto_dismissClose it automatically after this many seconds
display_modeInline, a bar pinned to the top or bottom, or a floating toast
persist_dismissRemember a dismissal so it does not come back on the next page
text_colorOverall text colour
bg_colorBackground
label_colorLabel colour
message_colorMessage colour
icon_colorIcon colour
font_size_presetText size preset

Anything not listed stays available in the page builder, and round-trips untouched — the block only writes the values you change, so an element styled in the builder keeps every setting this sidebar does not show.

The preview does not dismiss itself

The canvas preview is inert, and here that is doing real work: live, the close button would let you dismiss the block you are editing, and auto_dismiss would make it disappear a few seconds after every render. Neither is a preview of anything.

Pinned modes stay inside the canvas

display_mode of bar-top, bar-bottom or floating pins the notice to the viewport. In the editor that viewport is the canvas iframe, so a pinned notice sits inside the canvas rather than over the editor chrome — the layout is honest and the editor stays usable.

caution
persist_dismiss needs a dismissible notice

Remembering a dismissal only means something if a visitor can dismiss it. With dismissible off, this setting has nothing to remember.

Margin and padding come from Gutenberg

The block declares core spacing support, so the element's own spacing option is not exposed here — use the Dimensions panel at the top of the sidebar.