Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/chrome

chrome

Ez az oldal még csak angolul érhető el.

The header, footer and promo bar and their pieces: brand, user menu, switchers, mobile menu and colour mode.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/chrome';

Hooks

NameWhat it is
useHeaderThe data a header draws from: categories, languages, the signed-in shopper and how the header scrolls.
useLocaleSwitcherThe language choice.
useCurrencySwitcherThe currency choice.
useStorefrontSwitcherThe storefront choice.
useMobileMenuThe mobile menu's state, shared by every component on the page: the button that opens it and the drawer that shows it.
useHeaderVisibilityThe header's scroll state.
usePromoBarThe announcement strip's text and link, live while the merchant edits it.

Parts

NameWhat it is
BrandThe store's logo linking home, with the dark-scheme logo under a dark colour scheme, or its initial and name when it has none.
LogoThe store's logo at a set width, with its dark-scheme variant, falling back to the store's name.
ColorModeToggleSwitches the storefront between light and dark, with the transition the theme sets.

Defaults

NameWhat it is
LocaleSwitcherThe complete language and currency switcher: each group shows only when it offers a choice, and with neither it draws nothing.
CurrencySwitcherThe currency switcher on its own, drawn only when the storefront offers more than one currency.
MobileMenuThe mobile menu drawer: open while useMobileMenu says so, closed when a link in it is followed or the page changes.
PromoBarThe announcement strip above the header, drawn only while it is on and has text.
UserMenuThe account button and its menu: sign in and register for guests; the account, the orders and sign out once signed in.
LocaleBannerSuggests a storefront or a language.
HeaderThe store's header: the promo bar and the header section group in the pinned box the header's scroll settings drive.
FooterThe store's footer: the footer section group as the merchant arranged it.

Types

NameWhat it is
HeaderStickyHow the header behaves as the page scrolls, as the merchant set it.
HeaderDataWhat a header draws from, so a theme's header takes no props.
LocaleSwitcherStateLanguage choice state.
LocaleSwitcherPropsProps of LocaleSwitcher.
CurrencySwitcherStateCurrency choice state.
CurrencySwitcherPropsProps of CurrencySwitcher.
StorefrontChoiceA market.
StorefrontSwitcherStateStorefront choice state.
MobileMenuStateThe mobile menu's state, shared by the button that opens it and the drawer that shows it.
MobileMenuPropsProps of MobileMenu.
HeaderVisibilityHeader scroll state.
PromoBarStateThe announcement strip above the header, as the merchant wrote it.
PromoBarPropsProps of PromoBar.
BrandClassesClass names for the pieces of Brand.
BrandPropsProps of Brand.
LogoPropsProps of Logo.
UserMenuPropsProps of UserMenu.
LocaleBannerPropsProps of LocaleBanner.
ColorModeTogglePropsProps of ColorModeToggle.
Utoljára frissítve