Developers
Start building
Themes/Theme SDK/Modules/navigation

navigation

Store menus, the category and page tree, mega menu panels and breadcrumb trails.

On this page
import { … } from '@poltura/theme-sdk/navigation';

Hooks

NameWhat it is
useMenuA store menu with the links its categories and pages stand for already filled in.
useNavDataThe store's category tree and site pages, for menus a theme builds itself.
useMegaMenuOne menu item's dropdown or mega panel: its open state and the props that give it the menu keyboard model.
useNavProductsThe products a navigation panel shows: a category's most popular ones or a hand-picked list.

Parts

NameWhat it is
NavMenuOne menu item with a panel, where the theme draws the trigger and the panel and the part wires them.
MenuColumnsTitled columns of links in a grid of up to three, such as the footer's; a link's children follow it in the same list.
BreadcrumbsA breadcrumb trail with the current page marked for assistive technology; nothing when it has no steps.
NavProductsA heading over product rows with a thumbnail and title each, for a menu panel; nothing while there is nothing to show.

Defaults

NameWhat it is
MainNavThe header's menu bar: the top-level links with their dropdowns or panels and the menu keyboard model.
MobileNavThe main menu as a stacked list whose items fold open to their children, for a mobile drawer.
MegaMenuThe all-categories button with a two-pane panel: the top-level categories, and the subcategories of the one pointed at.
CategoryNavA bar of the top-level categories, each with its subcategories in a dropdown and the current one marked.

Functions

NameWhat it is
findCategoryFinds a category of the navigation tree by its id or by the path of its handles.

Constants

NameWhat it is
MENU_MAX_CHILDRENThe most links a menu item holds under it.

Types

NameWhat it is
BreadcrumbItemOne step of a breadcrumb trail.
MegaMenuPanelPropsProps a mega menu spreads on its panel.
MegaMenuRootPropsProps a mega menu spreads on its root element.
MegaMenuStateOne mega menu item's panel: whether it is open, the actions and the props that wire its keyboard model.
MegaMenuTriggerPropsProps a mega menu spreads on the link or button that opens its panel.
MenuColumnA titled column of links, such as one column of the footer.
MenuHandleA store menu: the main menu, the quick links or the legal links of the footer.
MenuLinkOne link of a store menu, with the links under it.
NavCategoryA category in the navigation tree, with its subcategories.
NavDataEverything navigation draws from: the category tree and the site's pages.
NavPageA page of the store's site, such as About us, that menus can link to.
SubmenuStyleHow a menu link's children open: a dropdown list under it, or a wide panel across the header.
MegaMenuOptionsOptions of useMegaMenu.
MainNavPropsProps of MainNav.
MobileNavPropsProps of MobileNav.
NavMenuTriggerWhat NavMenu hands to its trigger renderer.
NavMenuPanelWhat NavMenu hands to its panel renderer.
NavMenuPropsProps of NavMenu.
MegaMenuPropsProps of MegaMenu.
CategoryNavPropsProps of CategoryNav.
MenuColumnsClassesClass names for the pieces of MenuColumns.
MenuColumnsPropsProps of MenuColumns.
BreadcrumbsPropsProps of Breadcrumbs.
NavProductsByWhich products a navigation panel shows.
NavProductsClassesClass names for the pieces of NavProducts.
NavProductsPropsProps of NavProducts.
Last updated