Footer
The page footer: a frame for its rows, in the order given. Compose FooterService,
FooterColumns, FooterTrust and FooterLegal, or rows of your own. Fetches
nothing; every text, link and number comes in through props and slots.
import { Footer } from "@evolve-storefront/layout/footer";Preview
Usage
A consumer store: service, columns with the newsletter, trust and legal.
<Footer> <FooterService> <FooterServiceChannel channel="chat" title={t("chat")} hours={t("chat-hours")}> <OpenChatButton /> </FooterServiceChannel> <FooterServiceChannel channel="phone" title={t("call")} link={footer.phone} hours={t("phone-hours")} /> <FooterServiceChannel channel="email" title={t("mail")} link={footer.email} responseTime={t("mail-response")} /> </FooterService> <FooterColumns columns={footer.columns} renderLink={renderLink} aside={<NewsletterForm />} /> <FooterTrust paymentMethods={paymentMethods} rating={footer.rating} socials={footer.socials} renderLink={renderLink} /> <FooterLegal copyright={footer.copyright} companyNumber={footer.kvk} vatNumber={footer.vatNumber} links={footer.legalLinks} renderLink={renderLink} cookiePreferences={<CookiePreferencesButton />} localePicker={<CountryLanguagePicker countries={countries} locale={locale} href={pathname} />} /></Footer>;Props
| Prop | Type | Description |
|---|---|---|
headingLevel? | HeadingLevel | The level of the footer's own heading, which only screen readers see. |
Any other props go to the root element, like on a plain HTML element.
Change the layout
Pass children to Footer to arrange its parts yourself. Every part is exported from @evolve-storefront/layout/footer.
<Footer> <FooterService> <FooterServiceChannel channel="chat" title={t("chat")} hours={t("chat-hours")}> <OpenChatButton /> </FooterServiceChannel> <FooterServiceChannel channel="phone" title={t("call")} link={footer.phone} hours={t("phone-hours")} /> <FooterServiceChannel channel="email" title={t("mail")} link={footer.email} responseTime={t("mail-response")} /> </FooterService> <FooterColumns columns={footer.columns} renderLink={renderLink} aside={<NewsletterForm />} /> <FooterTrust paymentMethods={paymentMethods} rating={footer.rating} socials={footer.socials} renderLink={renderLink} /> <FooterLegal copyright={footer.copyright} companyNumber={footer.kvk} vatNumber={footer.vatNumber} links={footer.legalLinks} renderLink={renderLink} cookiePreferences={<CookiePreferencesButton />} localePicker={<CountryLanguagePicker countries={countries} locale={locale} href={pathname} />} /></Footer>;Examples
Link TypesEach link follows the CMS: a page of the site through the router with its anchor, an external link or a file as a plain anchor, and a new tab announced as one.
// Map the CMS link onto a FooterLink: the site resolves the href, the footer the rest.const link = { label: cms.name, href: resolveHref(cms), type: cms.type, anchor: cms.anchor, newTab: cms.newTab };<FooterColumns columns={[{ id, title, links: [link] }]} renderLink={renderLink} />;Business BuyerA signed-in business buyer sees their own account manager in the service row.
<FooterService> {channels} <FooterAccountManager name={manager.name} avatar={manager.initials} phone={{ label: manager.phone, href: `tel:${manager.phone}` }} email={{ label: manager.email, href: `mailto:${manager.email}` }} /></FooterService>;Business VisitorA business visitor without an account is offered one in the service row.
<FooterBusinessAccount title={t("business-title")} description={t("business-description")} link={{ label: t("business-request"), href: "/business/register" }} renderLink={renderLink}/>;From SiteThe footer of the site query: siteFooterColumns makes each top-level entry of the footer menu a column of its linked children, and siteFooterTrust the payment brands, review rating and socials, named in the current locale.
const { site } = await fetcher(LayoutGetSite, { version });const columns = siteFooterColumns(site?.footerNavigation, (link) => siteLinkHref(link, ({ slug }) => productHref(slug)),);const t = await getTranslations("Layout.footer");const trust = siteFooterTrust(site, { t, paymentIcons, socialIcons });
<Footer> <FooterColumns columns={columns} renderLink={renderLink} /> <FooterTrust {...trust} renderLink={renderLink} /></Footer>;
