One menu
menu is the normalized Shopify menu (raw tags, resource ids). nodes is
the UI-ready tree (NavigationNode[]). Mapping happens on render, so it costs
no extra request.
Several menus in one request
The Storefront API has a singlemenu(handle:) root and no menus(...)
batch field. useMenus still makes one round trip by generating GraphQL
aliases for the requested handles.
Prefetch before navigating
useMenu('main-menu') then renders from the same cache with no spinner.
Navigation node
Routes, not deep links
route is always a plain path (/products/<handle>,
/collections/<handle>, /collections/all, /pages/<handle>,
/blogs/<blog>/<article>, /policies/<handle>, /search, /account) or
the original URL for external/unknown links. Map it onto your own navigator —
the SDK never hard-codes a myapp:// scheme.
Shopify returns absolute storefront URLs
(https://shop.myshopify.com/products/tee). Those are recognized as internal
resources, not external links; isExternal is reserved for off-store URLs
whose path the SDK cannot route.
Mega menus
A node is a mega menu whenchildren.length >= 6, or when you opt in with an
override. columns is then provided:
- if any child has its own children, each child becomes a column header followed by its descendants;
- otherwise children are chunked into columns of 4.
title, icon,
badge, image, theme, isMegaMenu.
Tree helpers
buildNavigationTree, normalizeMenu,
parseMenuUrl as well), so tests and custom navigators can reuse them.
Service API
null; an empty handle makes no request.
