A horizontal navigation menu with flyout panels — the pattern marketing sites use for "Products / Solutions / Resources" menus that hold more than a simple dropdown can.
Follows the W3C disclosure navigation pattern (recommended for site
navigation over ARIA menu roles): each trigger is a button with
aria-expanded/aria-controls and panels contain plain links.
By default panels open on hover (the top-nav convention), driven by the
PetalNavMenu JS hook: it holds the panel open across the trigger-to-panel
gap with a close grace period, opens on keyboard focus too, and closes on
Escape. Set trigger="click" for explicit tap-to-toggle (100% LiveView.JS,
no hook) on touch-first apps, where Escape and clicking away close the panel.
Panels are free-form: compose them from navigation_menu_link/1 rows
(icon + title + description), an optional navigation_menu_footer/1 CTA
strip, or any markup you like.
Staying on screen
In hover mode the hook nudges an open panel horizontally to stay inside the
viewport, so a wide panel near the right edge slides left to fit instead of
spilling off screen. You can still set align="end" on an item to anchor its
panel to the trigger's end edge (useful in click mode, which has no
repositioning). Panel widths are clamped to the viewport so a wide panel
shrinks to fit on a phone, and a panel taller than the screen scrolls rather
than being cut off at the bottom.
Full-width (mega menu) panels
Set full_width on an item and the panel spans the nearest positioned
ancestor — give your site header class="relative" and the panel becomes a
full-width mega menu below it.
Summary
Functions
Renders the navigation menu.
A full-bleed strip at the bottom of a flyout panel, usually holding one to
three navigation_menu_footer_link/1 CTAs.
A compact centered CTA for navigation_menu_footer/1.
A flyout panel row: icon in a tinted square, bold title, muted one-line description.