Skip to content

Block 89 of 297

Header — Utility Bar

A dark top strip for phone, language links, small links and site search above the main bar with logo, menu and button.

Puck key
HeaderUtilityBlock
Export
headerUtilityBlock
React component
<HeaderUtility />
Path
components/puck/header-utility-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A two-tier header: a dark strip with a contact link, languages, small links and search, above a main bar with logo, tagline, menu and button. On smaller screens, search, small links and the menu move into a "Menu" panel, while the button and languages stay visible.

  • Legal aid, health or social service sites with a prominent helpline
  • Multilingual nonprofit or agency sites
  • Sites where search is a main way people find help
Writing the content
  • Write each Languages label in its own language, like Español, and fill Language code (es, vi, zh-Hans) so it's pronounced correctly.
  • Keep Top strip links to 4 or fewer short items like News or Careers. Menu links allows up to 7.
  • Search page and Search parameter must match your real search URL, such as /search and q. Leave Search page blank to hide search everywhere.
  • Button text stays visible beside the menu toggle on phones, so keep it to a word or two like Donate.
Accessibility
  • Language links set both lang and hreflang, and they sit in a nav labelled "Language", separate from the main menu.
  • Search is a form with role="search" and a hidden label from Search label, so it doesn't depend on the placeholder.
  • Focus outlines are white on the dark strip and indigo on the main bar, so focus stays visible on both (WCAG 2.4.7). The current link has aria-current="page".
Customizing the code
  • The strip color is bg-neutral-950 with a neutral-800 search field; change these to tint the strip.
  • Desktop search is w-60; indigo- classes control the button, current link and focus outlines.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Contact texttext
  • Contact linktext
  • Languagesarray
  • Top strip linksarray
  • Search pagetext
  • Search parametertext
  • Search labeltext
  • Site nametext
  • Logo image URLtext
  • Logo alt texttext
  • Logo linktext
  • Taglinetext
  • Navigation nametext
  • Menu linksarray
  • Current sectiontext
  • Button texttext
  • Button linktext
  • Mobile menu labeltext