Skip to content

Mega menu

Mega menu · sample rowOpen ↗

The panel alone, as MegaMenuBlockRenderer shows it during live preview. In a header it opens under its bar item; see Header blocks for the global and the one call that builds the bar.

An editor sees the kit on Header items (NAV_ITEMS_FIELD) inside the admin workspace: a rail of bar items, Link vs Mega type cards, destinations through LINK_FIELD, a two-up column builder, and a preview of the bar. When the Header has an admin.livePreview URL, that preview is the site’s real header in a frame (desktop width, scaled to the canvas), with menu=<item index> holding the mega being edited open; it reloads after each autosave, so it matches the Live Preview pane and the published header exactly. Without a live preview URL it falls back to a kit sketch of the bar, which cannot show the site’s looks or icons. Column widths are percent tokens that must total 100%. Each section has a name for the editor fold, independent of the optional public eyebrow. Adding a link leaves the display name empty, with placeholder “Link Display Name”.

The column widths, read as fractions, must add up to 100%. The rule is the array’s own validate, so the editor sees “The columns add up to 75%. They need to add up to 100%.” as they build, and the global’s publish refuses the same. Custom widths skip it.

Every destination (the trigger landing page, a section’s links, the overview link, the call to action) is picked from published pages or pasted as a URL, and resolves through the site’s resolveLink. A link whose page is missing or unpublished is dropped from the panel rather than rendered pointing nowhere. An unpublished trigger landing page omits the bar href and keeps the panel.

A row with no columns, or whose columns hold no complete links, renders nothing, and headerItemsFromBlocks drops it.

payload.config.ts / collections
import { megaMenuBlock } from "@bison-lab/payload-blocks";
// In the navigation global's `items` blocks array:
megaMenuBlock({ variants, icons })
blocks/registry.ts
import { MegaMenuBlockRenderer } from "@bison-lab/payload-blocks/react";
// In the site's registry:
megaMenu: MegaMenuBlockRenderer,

The table below is generated from megaMenuBlock(megaMenuSampleOptions), the options the sample was written against. A site’s own variants and icons replace the two selects’ options.

FieldTypeNotes
label *text
typeradioLabelled “Link”. One of page, external. Default "page".
pagerelationshipRelationship to pages.
hreftextLabelled “URL”. A full URL ("https://example.com"), "mailto:" or "tel:", or a site path ("/contact").
newTabcheckboxLabelled “Open in a new tab”. Default false.
panelgroup
panel.maxWidthselectOne of narrow, standard, wide. Default "standard".
panel.columns *array1 to 4 rows. Opens with 1 empty row; the admin field will not remove below that.
panel.columns[].widthselectOne of 25, 33, 50, 66, 75, 100. Default "100".
panel.columns[].dividercheckboxLabelled “Draw a line on the left of this column”. Default false.
panel.columns[].sectionsarray
panel.columns[].sections[].nametextLabelled “Section name”. Editor label for this fold. Independent of the optional eyebrow on the public panel.
panel.columns[].sections[].eyebrowtextSmall heading above this group; leave empty for none
panel.columns[].sections[].displayselectOne of featured, list. Default "list".
panel.columns[].sections[].hideDescriptionsOnMobilecheckboxLabelled “Hide descriptions on mobile”. Default true.
panel.columns[].sections[].linksarray
panel.columns[].sections[].links[].typeradioLabelled “Link”. One of page, external. Default "page".
panel.columns[].sections[].links[].page *relationshipRelationship to pages.
panel.columns[].sections[].links[].href *textLabelled “URL”. A full URL ("https://example.com"), "mailto:" or "tel:", or a site path ("/contact").
panel.columns[].sections[].links[].label *textLabelled “Label”.
panel.columns[].sections[].links[].newTabcheckboxLabelled “Open in a new tab”. Default false.
panel.columns[].sections[].links[].descriptiontextareaSupporting line under the label. Optional.
panel.columns[].sections[].links[].variantselectThe look of this featured link. One of primary, secondary.
panel.columns[].sections[].links[].iconselectGlyph shown before a list link. Optional. One of help, mail.
panel.footergroupThe strip under the columns. Leave both empty for no footer.
panel.footer.overviewgroupLabelled “Overview link”. The section's own landing page, so it stays reachable from the bar.
panel.footer.overview.typeradioLabelled “Link”. One of page, external. Default "page".
panel.footer.overview.pagerelationshipRelationship to pages.
panel.footer.overview.hreftextLabelled “URL”. A full URL ("https://example.com"), "mailto:" or "tel:", or a site path ("/contact").
panel.footer.overview.labeltextLabelled “Label”.
panel.footer.overview.newTabcheckboxLabelled “Open in a new tab”. Default false.
panel.footer.ctagroupLabelled “Call to action”.
panel.footer.cta.typeradioLabelled “Link”. One of page, external. Default "page".
panel.footer.cta.pagerelationshipRelationship to pages.
panel.footer.cta.hreftextLabelled “URL”. A full URL ("https://example.com"), "mailto:" or "tel:", or a site path ("/contact").
panel.footer.cta.labeltextLabelled “Label”.
panel.footer.cta.newTabcheckboxLabelled “Open in a new tab”. Default false.

* required.