Parts
The parts of @poltura/theme-sdk/navigation.
On this page
import { … } from '@poltura/theme-sdk/navigation';NavMenu
One menu item with a panel, where the theme draws the trigger and the panel and the part wires them.
NavMenu(props: NavMenuProps): ReactElementProps: NavMenuProps
Example
import { NavMenu, type MenuLink } from '@poltura/theme-sdk/navigation';
export function Dropdown({ link }: { link: MenuLink }) {
return (
<NavMenu
items={link.children}
renderTrigger={({ triggerProps }) => (
<button type='button' {...triggerProps}>{link.label}</button>
)}
renderPanel={({ items, panelProps }) => (
<div {...panelProps}>
{items.map((item) => (
<a key={item.href} href={item.href}>{item.label}</a>
))}
</div>
)}
/>
);
}See also: useMegaMenu
MenuColumns
Titled 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.
MenuColumns(props: MenuColumnsProps): ReactElement | nullProps: MenuColumnsProps
Example
import { MenuColumns, useMenu } from '@poltura/theme-sdk/navigation';
export function FooterLinks() {
const quick = useMenu('footerQuick');
const legal = useMenu('footerLegal');
return (
<MenuColumns
columns={[
{ title: 'Shop', links: quick },
{ title: 'Legal', links: legal },
]}
/>
);
}Breadcrumbs
A breadcrumb trail with the current page marked for assistive technology; nothing when it has no steps.
Breadcrumbs(props: BreadcrumbsProps): ReactElement | nullProps: BreadcrumbsProps
Example
import { Breadcrumbs } from '@poltura/theme-sdk/navigation';
export function Trail() {
return (
<Breadcrumbs
items={[
{ label: 'Home', href: '/' },
{ label: 'Mugs', href: null },
]}
/>
);
}NavProducts
A heading over product rows with a thumbnail and title each, for a menu panel; nothing while there is nothing to show.
NavProducts(props: NavProductsProps): ReactElement | nullProps: NavProductsProps
Example
import { NavProducts } from '@poltura/theme-sdk/navigation';
export function Featured() {
return <NavProducts heading='Popular' by={{ handles: ['mug', 'poster'] }} />;
}See also: useNavProducts