DesignOverviewDesign SystemMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingAgentsCortexMemoryActiveProvenanceActiveContextActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
MegamenuView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorA section of a navigation with a trigger that opens a panel of links.Also called Mega menu, Flyout, and Nav panel.StableSince 0.1.0NavigationImportimport'@fusion.dev/helix/megamenu'import'@fusion.dev/helix-headless/megamenu'Preview
GuidelinesWhen to use
A section of a site's main navigation that opens a panel of links.MegamenuThis page
Write the panel's links and headings yourself, in its default slot.A router renders its own anchors and cannot render them inside the megamenu's shadow root.
Mark the panel's columns, headings, and links with their data-megamenu attributes.helix.css lays out the panel through them, and without them the panel holds your markup as you styled it.<helix-navigationlabel="Main"><ahref="#overview">Overview</a><helix-megamenulabel="Products"><divdata-megamenu-group><helix-textas="h3"data-megamenu-headingscale="title">Work</helix-text><adata-megamenu-itemhref="#helix"><helix-iconname="cube"></helix-icon><strong>Projects</strong><span>Plan and track work across teams.</span></a><adata-megamenu-itemhref="#icons"><helix-iconname="palette"></helix-icon><strong>Documents</strong><span>Write, edit, and share files.</span></a></div><divdata-megamenu-group><helix-textas="h3"data-megamenu-headingscale="title">Insights</helix-text><adata-megamenu-itemhref="#cortex"><helix-iconname="pulse"></helix-icon><strong>Reports</strong><span>See how your projects are doing.</span></a><adata-megamenu-itemhref="#trace"><helix-iconname="strategy"></helix-icon><strong>Dashboards</strong><span>Track the numbers you care about.</span></a></div></helix-megamenu><ahref="#pricing">Pricing</a></helix-navigation><linkhref="styles.css"rel="stylesheet"/><helix-headless-navigationlabel="Main"><ahref="#overview">Overview</a><helix-headless-megamenulabel="Products"><divdata-megamenu-group><h3data-megamenu-heading>Work</h3><adata-megamenu-itemhref="#helix"><helix-headless-iconname="cube"></helix-headless-icon><strong>Projects</strong><span>Plan and track work across teams.</span></a><adata-megamenu-itemhref="#icons"><helix-headless-iconname="palette"></helix-headless-icon><strong>Documents</strong><span>Write, edit, and share files.</span></a></div><divdata-megamenu-group><h3data-megamenu-heading>Insights</h3><adata-megamenu-itemhref="#cortex"><helix-headless-iconname="pulse"></helix-headless-icon><strong>Reports</strong><span>See how your projects are doing.</span></a><adata-megamenu-itemhref="#trace"><helix-headless-iconname="strategy"></helix-headless-icon><strong>Dashboards</strong><span>Track the numbers you care about.</span></a></div></helix-headless-megamenu><ahref="#pricing">Pricing</a></helix-headless-navigation>
Anatomy
1::part(trigger)The default trigger button, shown when the trigger slot is empty.
2::part(surface)The floating panel that opens.
API referenceRoothelix-megamenuA section of a navigation with a trigger that opens a panel of links.
PropTypeDescriptionbandBelownumberDefault640The page width, in pixels, below which a card panel is shown as a band. At
zero, it never is.closeDelaynumberDefault220How long a pointer leaving the trigger and the panel waits before the panel
closes, in milliseconds. The pointer needs the time to cross from the
trigger to the panel. The attribute also takes a CSS time, such as 0.2s.defaultOpenbooleanDefaultfalseWhether the element starts open. Ignored once open is written.labelstringDefault""The section's name, used for the default trigger and the panel.layout"band"Whether the panel is a card under the trigger or a band across the page.openbooleanWhether the element is open.openDelaynumberDefault120How long a pointer rests on the trigger before the panel opens, in
milliseconds, under open-on="hover". A pointer crossing the bar on its
way somewhere else opens nothing. The attribute also takes a CSS time, such
as 0.1s.openOn"click"|"hover"Default"hover"Whether hovering over the trigger opens the panel (hover), or only a press
does (click).placement"bottom"|"bottom-end"|"bottom-start"|"left"|"left-end"|"left-start"|"right"|"right-end"|"right-start"|"top"|"top-end"|"top-start"Default"bottom-start"The side of the trigger a card panel opens on, when there is room. It
moves if that side does not fit. A band ignores it, since a band spans the
page under its bar.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The panel's contents, such as your own lists of links and their headings.indicatorA mark for the open trigger, shown while the panel is open, such as a bar or an arrow pointing at the panel.triggerThe control that opens the panel. When it is empty, a button named by label is shown.
EventTypeDescriptionhelix-before-closeHelixBeforeCloseEventThe panel is about to close. Cancelable.helix-before-openHelixBeforeOpenEventThe panel is about to open. Cancelable.toggleToggleEventThe panel opened or closed. Carries newState and oldState.
MethodTypeDescriptionrequestOpen(next: boolean) => booleanRequests that the element open or close, and returns whether the change
was applied.toggleOpen() => booleanRequests the opposite of the current state.
PartDescriptioncolumnsThe panel's default slot. It draws no box until a sheet gives it a display.indicatorThe indicator slot, rendered while the panel is open.surfaceThe floating panel that opens.triggerThe default trigger button, shown when the trigger slot is empty.trigger-indicatorThe caret on the default trigger, turned while the panel is open.
CSS PropertyDescription--megamenu-backdropThe filter behind the panel. Inside an App Header it is the bar's own filter, so a glass bar's panel is glass too, and elsewhere none. This family has no material property, so this and --megamenu-background-color set the panel's material.--megamenu-background-colorThe panel's fill. Inside an App Header it is the bar's fill, the page's ground under an opaque bar and the bar's glass under a glass one, and elsewhere the page's ground.--megamenu-border-widthThe width of the panel's edge. Follows --helix-border-floating, a hairline, which is drawn in dark mode only. Set it to 0 for the shadow alone.--megamenu-column-sizeThe minimum width of a column before the grid wraps.--megamenu-durationHow long the panel takes to open and close.--megamenu-edgeHow far the card keeps from the window's edge, which is as far as the row it sits in starts from it, between 8 and 32 pixels. Written on the card while it is placed, and read there.--megamenu-from-block-sizeThe height of the panel this one took over from, written on the surface while it is open.--megamenu-from-inline-sizeThe width of the panel this one took over from, written on the surface while it is open.--megamenu-full-sizeThe maximum width of the band's contents, which are centered in it.--megamenu-gapThe space between the panel's columns.--megamenu-paddingThe space inside the card's edge.--megamenu-shadowThe shadow under the panel. Follows --helix-shadow-floating, so the panel has a shadow by default, because it sits over content you cannot predict.--megamenu-sizeThe maximum width of the panel.--megamenu-surface-block-sizeThe panel's own height, written on the surface while it is open.--megamenu-surface-inline-sizeThe panel's own width, written on the surface while it is open.--megamenu-topWhere the panel starts, measured from the bar above it.--megamenu-trigger-colorThe trigger's text color at rest.--megamenu-trigger-font-sizeThe size of the trigger's text.--megamenu-trigger-font-weightThe weight of the trigger's text.--megamenu-trigger-hover-colorThe trigger's text color under the pointer.--megamenu-trigger-open-background-colorThe trigger's fill while its panel is open.--megamenu-trigger-open-colorThe trigger's text color while its panel is open.--megamenu-trigger-padding-inlineThe space either side of the trigger's text.--megamenu-trigger-radiusThe trigger's corners.
Custom stateDescriptioncurrentA link in the panel carries aria-current="page", so the trigger can show the section you are in.from-endThe panel opened in place of one earlier in the bar, so it can enter from the end side.from-startThe panel opened in place of one later in the bar, so it can enter from the start side.narrowThe page is narrower than band-below, so the panel is shown as a band whatever its layout.openThe panel is open, and the trigger is shown as current.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.to-endThe panel closed because one earlier in the bar opened, so it can leave toward the end.to-startThe panel closed because one later in the bar opened, so it can leave toward the start.
Roothelix-headless-megamenuA section of a navigation with a trigger that opens a panel of links.
PropTypeDescriptionbandBelownumberDefault640The page width, in pixels, below which a card panel is shown as a band. At
zero, it never is.closeDelaynumberDefault220How long a pointer leaving the trigger and the panel waits before the panel
closes, in milliseconds. The pointer needs the time to cross from the
trigger to the panel. The attribute also takes a CSS time, such as 0.2s.defaultOpenbooleanDefaultfalseWhether the element starts open. Ignored once open is written.labelstringDefault""The section's name, used for the default trigger and the panel.layout"band"Whether the panel is a card under the trigger or a band across the page.openbooleanWhether the element is open.openDelaynumberDefault120How long a pointer rests on the trigger before the panel opens, in
milliseconds, under open-on="hover". A pointer crossing the bar on its
way somewhere else opens nothing. The attribute also takes a CSS time, such
as 0.1s.openOn"click"|"hover"Default"hover"Whether hovering over the trigger opens the panel (hover), or only a press
does (click).placement"bottom"|"bottom-end"|"bottom-start"|"left"|"left-end"|"left-start"|"right"|"right-end"|"right-start"|"top"|"top-end"|"top-start"Default"bottom-start"The side of the trigger a card panel opens on, when there is room. It
moves if that side does not fit. A band ignores it, since a band spans the
page under its bar.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The panel's contents, such as your own lists of links and their headings.indicatorA mark for the open trigger, shown while the panel is open, such as a bar or an arrow pointing at the panel.triggerThe control that opens the panel. When it is empty, a button named by label is shown.
EventTypeDescriptionhelix-before-closeHelixBeforeCloseEventThe panel is about to close. Cancelable.helix-before-openHelixBeforeOpenEventThe panel is about to open. Cancelable.toggleToggleEventThe panel opened or closed. Carries newState and oldState.
MethodTypeDescriptionrequestOpen(next: boolean) => booleanRequests that the element open or close, and returns whether the change
was applied.toggleOpen() => booleanRequests the opposite of the current state.
PartDescriptioncolumnsThe panel's default slot. It draws no box until a sheet gives it a display.indicatorThe indicator slot, rendered while the panel is open.surfaceThe floating panel that opens.triggerThe default trigger button, shown when the trigger slot is empty.trigger-indicatorThe caret on the default trigger, turned while the panel is open.
CSS PropertyDescription--megamenu-edgeHow far the card keeps from the window's edge, which is as far as the row it sits in starts from it, between 8 and 32 pixels. Written on the card while it is placed, and read there.--megamenu-from-block-sizeThe height of the panel this one took over from, written on the surface while it is open.--megamenu-from-inline-sizeThe width of the panel this one took over from, written on the surface while it is open.--megamenu-surface-block-sizeThe panel's own height, written on the surface while it is open.--megamenu-surface-inline-sizeThe panel's own width, written on the surface while it is open.--megamenu-topWhere the panel starts, measured from the bar above it.
Custom stateDescriptioncurrentA link in the panel carries aria-current="page", so the trigger can show the section you are in.from-endThe panel opened in place of one earlier in the bar, so it can enter from the end side.from-startThe panel opened in place of one later in the bar, so it can enter from the start side.narrowThe page is narrower than band-below, so the panel is shown as a band whatever its layout.openThe panel is open, and the trigger is shown as current.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.to-endThe panel closed because one earlier in the bar opened, so it can leave toward the end.to-startThe panel closed because one later in the bar opened, so it can leave toward the start.
Examples
NameDescriptionBandA panel that spans the page from edge to edge, for links too wide to fit under one trigger.EventsThe events a megamenu sends before and after its panel opens or closes.Open on clickA megamenu that opens only on a press, with open-on set to click.PreviewA navigation item that opens a panel of links in columns.PreviewA navigation item that opens a panel of links in columns.SeveralThree megamenus in one navigation. Opening one closes the panel that was open.