Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
RegionBar

This component is a custom button, designed primarily for mobile devices, that triggers the RegionModal.

The RegionBar is a custom button, usually used only on mobile devices. It should trigger the RegionModal.
The component is part of the Regionalization feature.
Example
Code

Usage

Import the component


_10
import { RegionBar } from '@faststore/ui'

Import styles

To apply styles, include the following in your stylesheet:

_10
@import '@faststore/ui/src/components/molecules/RegionBar/styles.scss';


Design tokens

Local tokenDefault value/Global token linked
--fs-region-bar-width100%
--fs-region-bar-paddingvar(--fs-spacing-0) 0 var(--fs-spacing-0) var(--fs-spacing-2)
--fs-region-bar-text-color
var(--fs-color-text-display)
--fs-region-bar-bkg-color
var(--fs-color-body-bkg)
--fs-region-bar-border-bottom-widthvar(--fs-border-width)
--fs-region-bar-border-bottom-colorvar(--fs-border-color-light)

Nested Elements

CTA (Call to Action)
{"base64":"  ","img":{"width":71,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","url":"https://img.shields.io/badge/deprecated-lightgrey"}}

Local tokenDefault value/Global token linked
--fs-region-bar-cta-margin-leftauto
--fs-region-bar-cta-text-decorationunderline

Message
{"base64":"  ","img":{"width":71,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","url":"https://img.shields.io/badge/deprecated-lightgrey"}}

Local tokenDefault value/Global token linked
--fs-region-bar-message-margin-rightauto

Postal Code
{"base64":"  ","img":{"width":71,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","url":"https://img.shields.io/badge/deprecated-lightgrey"}}

Local tokenDefault value/Global token linked
--fs-region-bar-postal-code-margin-rightauto

Icon

Local tokenDefault value/Global token linked
--fs-region-bar-icon-margin-rightvar(--fs-spacing-1)

Location

Local tokenDefault value/Global token linked
--fs-region-bar-location-heightvar(--fs-spacing-4)

Data attributes

You can target and override RegionBar styles using the following data attributes:
data-fs-region-bar
data-fs-region-bar-postal-code
data-fs-region-bar-cta
data-fs-region-bar-message
data-fs-region-bar-filter
data-fs-region-bar-filter-message
data-fs-region-bar-location
data-fs-region-bar-location-city
data-fs-region-bar-location-message
data-fs-region-bar-location-postal-code

Props

NameTypeDescriptionDefault
citystringCity to be displayed in the component.
postalCodestringPostal code string to be display in the component.
iconstring | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortalA React component that will be rendered as the location icon.
label*stringSpecifies a label for the location text.
editLabelstringSpecifies a label for the edit location text. @deprecated
buttonIconstring | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortalA React component that will be rendered as an icon.
onButtonClick() => voidFunction called when location button is clicked.
shouldDisplayPostalCodefalse | trueBoolean to control whether postal code should be visible or not.true
filterButton{ icon?: ReactNode; label?: string; selectedFilter?: string; shouldDisplayFilterButton?: boolean; onClick?: () => void; }Properties of the global filter button.
Contributors
4
Photo of the contributor
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
4
Photo of the contributor
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page