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): a rail of bar items, Link vs Mega type cards, destinations through LINK_FIELD, a two-up column builder, and a sticky FloatingNavBlock preview. Advanced CSS column widths stay on the schema so existing rows do not migrate; the kit does not render them.

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 “Goes to”. 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[].customWidthtextA CSS width: 13rem, 1fr, minmax(0, 1fr)
panel.columns[].dividercheckboxLabelled “Draw a line on the left of this column”. Default false.
panel.columns[].sectionsarray
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 “Goes to”. 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 lumbar, si.
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 “Goes to”. 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 “Goes to”. 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.
panel.customWidthscheckboxLabelled “Type a CSS width for each column instead of choosing a percentage”. Default false.
panel.customMaxWidthtextPanel width in rem, e.g. 30. Leave empty to use the preset above.

* required.