Marketing · Gutenberg

Notification Bar block for WordPress

Dismissible sticky announcement or promo bar — shown at the top or bottom of the page.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Dismissible sticky announcement or promo bar — shown at the top or bottom of the page.

Inspector panels on this block: Content, Behaviour. Those titles come from index.js, not from a shared template.

Behavior controls: “Link target” options: Same tab, New tab; “Content — Icon” options: None, Info, Warning, Star, Megaphone; “Position” options: Top of page, Bottom of page; “Animation” options: Slide, Fade, None.

Where to find it

Gutenberg inserter → Marketing → search “Notification Bar” (block name `blockenberg/notification-bar` in block.json). Style it in the sidebar after insert.

How to use Notification Bar block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Notification Bar”, insert it. Category: Marketing.
  3. Configure inspector controls that exist on this block. Open Content. Set “Link label”, “Link URL”, “Link target”, “Content — Icon”.
  4. Check the published page. The view script reads HTML data attributes: data-animation, data-cookie, data-position. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Link labelText field in the inspector. block.json default: Shop Now. Saved as `linkLabel`.
Link URLText field in the inspector. Saved as `linkUrl`.
Link targetSelect control; the chosen value is saved on the block. Options: Same tab; New tab. block.json default: _self. Saved as `linkTarget`.
Content — IconSelect control; the chosen value is saved on the block. Options: None; Info; Warning; Star; Megaphone; Bell. block.json default: none. Saved as `icon`.
PositionSelect control; the chosen value is saved on the block. Options: Top of page; Bottom of page. block.json default: top. Saved as `position`.
Sticky (fixed to viewport)On/off toggle in the inspector. On by default. Saved as `sticky`.
Show close buttonOn/off toggle in the inspector. On by default. Saved as `showClose`.
AnimationSelect control; the chosen value is saved on the block. Options: Slide; Fade; None. block.json default: slide. Saved as `animation`.
Show after delay (ms)Numeric range control in the inspector. Range 0–10000. block.json default: 0. Saved as `showAfterDelay`.
Cookie / storage keyText field in the inspector. block.json default: bkbg_nb_dismissed. Saved as `cookieName`.
Remember dismissal (days)Numeric range control in the inspector. Range 0–365. block.json default: 1. Saved as `cookieDays`.
Vertical padding (px)Numeric range control in the inspector. Range 4–32. block.json default: 12. Saved as `padding`.
Colors — BackgroundColor control in the inspector. block.json default: #2563eb. Saved as `bgColor`.
Colors — TextColor control in the inspector. block.json default: #ffffff. Saved as `textColor`.
LinkColor control in the inspector. block.json default: #bfdbfe. Saved as `linkColor`.
Close buttonColor control in the inspector. block.json default: #93c5fd. Saved as `closeBtnColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Notification Bar block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Notification Bar”. It sits under Marketing. After insert, open Content and set “Link label”, “Link URL”, “Link target”, “Content — Icon”.

Where does Notification Bar store visitor state?

In localStorage on that browser. Clearing site data resets it. It is not a WordPress user meta field unless render.php says so.

Is the Notification Bar Gutenberg block free?

Yes. Notification Bar ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Notification Bar to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Behaviour).

Related marketing blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Notification Bar from the Gutenberg inserter.

Get Blockenberg