Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
BannerText

Displays brands, products, and/or collections. They comprise an image, some text content, and a call-to-action button.

The BannerText is used for advertising brands, products, and/or collections. They comprise an image, some text content, and a call-to-action button.The final BannerText component is a compound of the following:
  • BannerText: wraps the BannerText component.
  • BannerTextContent: the content of the banner, including a title, caption, and Link.
Example
Code

Explore more about our amazing products

See more

Usage

Import the component


_10
import { BannerText, BannerTextContent } from "@faststore/ui";

Import styles

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/organisms/BannerText/styles.scss";


Examples

Variants

Primary

Example
Code

Explore more about our amazing products

See more

Secondary

Example
Code

Explore more about our amazing products

All the amazing products from the brands we partner with.

See more

Color variants

Main

Example
Code

Explore more about our amazing products

See more

Light

Example
Code

Explore more about our amazing products

See more

Accent

Example
Code

Explore more about our amazing products

See more

Design tokens

Local tokenDefault value/Global token linked
--fs-banner-text-padding-mobilevar(--fs-spacing-6) 5%
--fs-banner-text-padding-desktopvar(--fs-spacing-9) 15%

Nested Elements

Button Link

Local tokenDefault value/Global token linked
--fs-banner-text-button-link-min-width11.25rem
--fs-banner-text-button-link-margin-topvar(--fs-spacing-6)

Title

Local tokenDefault value/Global token linked
--fs-banner-text-title-sizevar(--fs-text-size-lead)
--fs-banner-text-title-weightvar(--fs-text-weight-bold)
--fs-banner-text-line-height1.2

Design tokens: Primary

Local tokenDefault value/Global token linked
--fs-hero-primary-title-sizevar(--fs-text-size-title-page)

Design tokens: Secondary

Local tokenDefault value/Global token linked
--fs-banner-text-secondary-title-sizevar(--fs-text-size-4)
--fs-banner-text-secondary-caption-sizevar(--fs-text-size-base)
--fs-banner-text-secondary-caption-weightvar(--fs-text-weight-regular)
--fs-banner-text-secondary-caption-line-height1.5

Design tokens: Main

Local tokenDefault value/Global token linked
--fs-banner-text-main-bkg-color
var(--fs-color-primary-bkg)
--fs-banner-text-main-text-color
var(--fs-color-primary-text)

Design tokens: Light

Local tokenDefault value/Global token linked
--fs-banner-text-light-bkg-color
var(--fs-color-secondary-bkg-light)
--fs-banner-text-light-text-color
var(--fs-color-text-display)

Design tokens: Accent

Local tokenDefault value/Global token linked
--fs-banner-text-accent-bkg-color
var(--fs-color-highlighted-bkg)
--fs-banner-text-accent-text-color
var(--fs-banner-text-light-text-color)

Data attributes

You can target and override BannerText styles using the following data attributes: data-fs-banner-text
data-fs-banner-text-variant="primary" | "secondary"
data-fs-banner-text-color-variant="main" | "light" | "accent"
data-fs-banner-text-content
data-fs-banner-text-heading
data-fs-banner-text-link

Props

All banner text related components support all attributes also supported by the <div> tag. Besides those attributes, the following props are also supported:

BannerText

NameTypeDescriptionDefault
variant"primary" | "secondary"Specifies the component direction variant.primary
colorVariant"main" | "light" | "accent"Specifies the component's color variant combination.main
testIdstringID to find this component in testing tools (e.g.: cypress, testing-library, and jest).fs-banner-text

BannerTextContent

NameTypeDescriptionDefault
title*stringThe content for the h2 tag.
caption*stringThe content for the p tag below the h2.
link*stringThe href used at the link.
linkText*stringThe label used at the link.
linkTargetBlankfalse | trueSpecify if the link opens in a new tab.
testIdstringID to find this component in testing tools (e.g.: cypress, testing library, and jest).fs-banner-text-content
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page