Types: BreadcrumbItem to NavMenuProps
The types of @poltura/theme-sdk/navigation, BreadcrumbItem to NavMenuProps.
On this page
import { … } from '@poltura/theme-sdk/navigation';BreadcrumbItem
One step of a breadcrumb trail.
labelrequiredstringThe step's text in the page language.
hrefrequiredstring | nullWhere the step links, or null for the current page.
MegaMenuPanelProps
Props a mega menu spreads on its panel.
refrequired(node: HTMLElement | null) => voidAttaches the panel.
idrequiredstringThe panel's element id.
rolerequired'group'The panel is a group of links.
aria-labelledbyrequiredstringThe trigger's element id.
hiddenrequiredbooleanHides the panel while it is closed.
onClickrequired(event: MouseEvent<HTMLElement>) => voidCloses the panel when a link in it is followed.
onKeyDownrequired(event: KeyboardEvent<HTMLElement>) => voidArrow keys, Home and End walk the panel's links; Escape closes it and returns to the trigger.
onBlurrequired(event: FocusEvent<HTMLElement>) => voidCloses the panel when the focus leaves the menu.
MegaMenuRootProps
Props a mega menu spreads on its root element.
refrequired(node: HTMLElement | null) => voidAttaches the root element.
onMouseEnterrequired(() => void) | undefinedOpens the panel on hover, when the menu opens on hover.
onMouseLeaverequired(() => void) | undefinedCloses the panel a moment after the pointer leaves, when the menu opens on hover.
MegaMenuState
One mega menu item's panel: whether it is open, the actions and the props that wire its keyboard model.
openrequiredbooleanWhether the panel is open.
openPanelrequired() => voidOpens the panel and closes every other panel of the same menu.
closerequired() => voidCloses the panel.
rootPropsrequiredMegaMenuRootPropsProps for the item's root element.
triggerPropsrequiredMegaMenuTriggerPropsProps for the link or button that opens the panel.
panelPropsrequiredMegaMenuPanelPropsProps for the panel.
MegaMenuTriggerProps
Props a mega menu spreads on the link or button that opens its panel.
refrequired(node: HTMLElement | null) => voidAttaches the trigger.
idrequiredstringThe trigger's element id, which labels the panel.
aria-expandedrequiredbooleanWhether the panel is open.
aria-controlsrequiredstringThe panel's element id.
onClickrequired(event: MouseEvent<HTMLElement>) => voidToggles the panel when the menu opens on click.
onKeyDownrequired(event: KeyboardEvent<HTMLElement>) => voidArrow keys open the panel and walk into it; Space toggles it; Escape closes it.
onBlurrequired(event: FocusEvent<HTMLElement>) => voidCloses the panel when the focus leaves the menu.
MenuColumn
A titled column of links, such as one column of the footer.
titlerequiredstringThe column's heading in the page language.
linksrequiredreadonly MenuLink[]The column's links; their children are listed under them.
MenuHandle
A store menu: the main menu, the quick links or the legal links of the footer.
type MenuHandle = 'primary' | 'footerQuick' | 'footerLegal'MenuLink
One link of a store menu, with the links under it.
idrequiredstring | nullStable across reorders, so a panel can be bound to the link; null for links filled in from a category or page.
labelrequiredstringThe link's text in the page language.
hrefrequiredstringWhere the link goes.
opensrequired'hover' | 'click' | nullHow the link's submenu opens, or null to follow the menu's own setting.
iconIconValue | nullThe icon of the category the link was filled in from, drawn with `Icon`; null or absent otherwise.
childrenrequiredreadonly MenuLink[]The links under this one; categories and pages arrive with theirs filled in.
NavCategory
A category in the navigation tree, with its subcategories.
idrequiredstringThe category's id.
namerequiredstringThe category's name in the page language.
hrefrequiredstringThe category's page.
iconrequiredIconValue | nullThe icon the merchant chose for the category, drawn with `Icon`; null when it has none.
parentIdrequiredstring | nullThe id of the category it sits under, or null for a top-level category.
childrenrequiredreadonly NavCategory[]Its subcategories, in the merchant's order.
NavData
Everything navigation draws from: the category tree and the site's pages.
categoriesrequiredreadonly NavCategory[]The top-level categories, each with its subcategories.
pagesrequiredreadonly NavPage[]The store's site pages.
NavPage
A page of the store's site, such as About us, that menus can link to.
hrefrequiredstringThe page's address.
titlerequiredstringThe page's title in the page language.
SubmenuStyle
How a menu link's children open: a dropdown list under it, or a wide panel across the header.
type SubmenuStyle = 'dropdown' | 'panel'MegaMenuOptions
Options of useMegaMenu.
openOn'hover' | 'click'Whether the panel opens on hover or on click; defaults to hover.
forceOpenbooleanHolds the panel open, such as while the merchant edits it in the customizer.
MainNavProps
Props of MainNav.
linksreadonly MenuLink[]The links to draw; defaults to the store's main menu.
submenuSubmenuStyleHow a link's children open; defaults to a dropdown.
openOn'hover' | 'click'Whether submenus open on hover or on click; defaults to hover.
flatbooleanDraws the top level only, with no submenus.
classNamestringClasses added to the menu bar.
linkClassNamestringClasses added to each top-level link.
MobileNavProps
Props of MobileNav.
linksreadonly MenuLink[]The links to draw; defaults to the store's main menu.
classNamestringClasses added to the list.
NavMenuTrigger
What NavMenu hands to its trigger renderer.
openrequiredbooleanWhether the panel is open.
triggerPropsrequiredMegaMenuTriggerPropsProps to spread on the link or button that opens the panel.
NavMenuPanel
What NavMenu hands to its panel renderer.
openrequiredbooleanWhether the panel is open.
closerequired() => voidCloses the panel.
itemsrequiredreadonly MenuLink[]The links the panel shows.
panelPropsrequiredMegaMenuPanelPropsProps to spread on the panel.
NavMenuProps
Props of NavMenu.
itemsrequiredreadonly MenuLink[]The links the panel shows.
openOn'hover' | 'click'Whether the panel opens on hover or on click; defaults to hover.
forceOpenbooleanHolds the panel open, such as while the merchant edits it.
renderTriggerrequired(trigger: NavMenuTrigger) => ReactNodeDraws the link or button that opens the panel.
renderPanelrequired(panel: NavMenuPanel) => ReactNodeDraws the panel.