Layout · Gutenberg

Sticky Header block for WordPress

A fully-styled site header with logo (image or text), navigation links, and an optional CTA button. Sticks to the top on scroll with a shrink animation. Supports light, dark, glass, and gradient style variants.

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

A fully-styled site header with logo (image or text), navigation links, and an optional CTA button. Sticks to the top on scroll with a shrink animation. Supports light, dark, glass, and gradient style variants.

Inspector panels on this block: Logo, Navigation Links, CTA Button, Style & Behavior. Those titles come from index.js, not from a shared template.

Behavior controls: “Style & Behavior — Style” options: Light, Dark, Glass, Gradient.

Where to find it

Gutenberg inserter → Layout → search “Sticky Header” (block name `blockenberg/sticky-header` in block.json). Style it in the sidebar after insert.

How to use Sticky Header block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Sticky Header”, insert it. Category: Layout.
  3. Configure inspector controls that exist on this block. Open Logo. Set “Show Logo”, “Logo Text (fallback)”, “Logo Image Width (px)”, “Site URL”.
  4. Check the published page. The view script reads HTML data attributes: data-shrink, data-sticky. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Show LogoOn/off toggle in the inspector. On by default. Saved as `showLogo`.
Logo Text (fallback)Text field in the inspector. block.json default: MySite. Saved as `logoText`.
Logo Image Width (px)Numeric range control in the inspector. Range 40–300. block.json default: 140. Saved as `logoWidth`.
Site URLText field in the inspector. block.json default: #. Saved as `siteUrl`.
LabelText field in the inspector.
URLText field in the inspector.
Open in New TabOn/off toggle in the inspector.
Show CTA ButtonOn/off toggle in the inspector. On by default. Saved as `showCta`.
Button TextText field in the inspector. block.json default: Get Started. Saved as `ctaText`.
Button URLText field in the inspector. block.json default: #. Saved as `ctaUrl`.
Open in New Tab (Cta Open New)On/off toggle in the inspector. Off by default. Saved as `ctaOpenNew`.
Style & Behavior — StyleSelect control; the chosen value is saved on the block. Options: Light; Dark; Glass; Gradient. block.json default: light. Saved as `style`.
Sticky on ScrollOn/off toggle in the inspector. On by default. Saved as `sticky`.
Shrink on ScrollOn/off toggle in the inspector. On by default. Saved as `scrollShrink`.
Show Mobile Menu ToggleOn/off toggle in the inspector. On by default. Saved as `showMobileMenu`.
Border BottomOn/off toggle in the inspector. On by default. Saved as `borderBottom`.
Drop Shadow (when scrolled)On/off toggle in the inspector. Off by default. Saved as `shadow`.
Header Height (px)Numeric range control in the inspector. Range 40–120. block.json default: 70. Saved as `height`.
Shrunk Height (px)Numeric range control in the inspector. Range 36–100. block.json default: 56. Saved as `heightShrunk`.
Max Width (px)Numeric range control in the inspector. Range 760–1600. block.json default: 1200. Saved as `maxWidth`.
z-indexNumeric range control in the inspector. Range 1–9999. block.json default: 1000. Saved as `zIndex`.
Nav Gap (px)Numeric range control in the inspector. Range 8–64. block.json default: 32. Saved as `linkGap`.
CTA Radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 8. Saved as `ctaRadius`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Text / LogoColor control in the inspector. block.json default: #0f172a. Saved as `textColor`.
Nav LinksColor control in the inspector. block.json default: #374151. Saved as `linkColor`.
Link HoverColor control in the inspector. block.json default: #6c3fb5. Saved as `linkHoverColor`.
AccentColor control in the inspector. block.json default: #6c3fb5. Saved as `accentColor`.
CTA BGColor control in the inspector. block.json default: #6c3fb5. Saved as `ctaBg`.
CTA TextColor control in the inspector. block.json default: #ffffff. Saved as `ctaTextColor`.
Colors — BorderColor control in the inspector. block.json default: #e2e8f0. Saved as `borderColor`.

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 Sticky Header block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Sticky Header”. It sits under Layout. After insert, open Logo and set “Show Logo”, “Logo Text (fallback)”, “Logo Image Width (px)”, “Site URL”.

What makes Sticky Header different from other Blockenberg blocks?

A fully-styled site header with logo (image or text), navigation links, and an optional CTA button. Sticks to the top on scroll with a shrink animation. Supports light, dark, glass, and gradient style variants. Inspector labels on this block include “Show Logo”, “Logo Text (fallback)”, “Logo Image Width (px)”, “Site URL”.

Is the Sticky Header Gutenberg block free?

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

Can I style Sticky Header 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: Logo, Navigation Links, CTA Button, Style & Behavior).

Related layout blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Sticky Header from the Gutenberg inserter.

Get Blockenberg