Skip to content

Block 90 of 297

Header — Mega Menu

Top-level items open full-width panels of grouped link columns with an intro and featured promo; phones get an accordion menu.

Puck key
HeaderMegaMenuBlock
Export
headerMegaMenuBlock
React component
<HeaderMegaMenu />
Path
components/puck/header-mega-menu-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 header for large sites where top-level items open full-width panels with an intro, an overview link, up to three link columns and an optional promo card. One panel stays open at a time in supporting browsers. On phones and tablets the menu becomes an accordion.

  • University and college sites with many schools and offices
  • Large nonprofits with distinct audiences such as donors, volunteers and clients
  • Regional agencies whose services group naturally into a few columns
Writing the content
  • Top-level items takes 1 to 6 entries. Leave an item's Columns empty and it becomes a plain link with no panel.
  • Each panel allows up to 3 Columns with 1 to 8 links each. Give every column a short Column label such as Apply or Afford.
  • Panel intro is one or two factual sentences; blank hides it.
  • The promo card needs a Feature title, links to Feature link or the item's Link, and appears only in the desktop panel.
Accessibility
  • Panels and the mobile accordion are native details elements, so they open with Enter or Space without custom scripting.
  • Each link list is labelled by its column label through aria-labelledby, so screen readers hear the group name as they enter it.
  • Desktop and mobile menus are separate nav landmarks; links and toggles keep a 44px minimum height and a focus outline (WCAG 2.4.7).
Customizing the code
  • The promo card is bg-indigo-950 with a decorative ring SVG; change that class or remove the svg to simplify it.
  • The panel splits lg:col-span-3 for the intro and lg:col-span-6 (9 without a promo) for columns. There is no Current section field.

Editor fields

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

  • Site nametext
  • Logo image URLtext
  • Logo alt texttext
  • Logo linktext
  • Navigation nametext
  • Top-level itemsarray
  • Button texttext
  • Button linktext
  • Mobile menu labeltext