Documentation
Feedback
Guides
Storefront Development

Storefront Development
FastStoreUI componentsOrganisms
RegionModal

This component is a modal with some region configurations.

The RegionModal is part of the Regionalization feature and provides a modal interface for selecting and configuring region-specific options. It extends the functionality of the Modal component, making it adaptable for region-related settings within your FastStore application.

Import

Import the component from @faststore/ui

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

Import styles into your FastStore project

To apply the styles of this component in your FastStore project, add the following line to your stylesheet:

_10
@import '@faststore/ui/src/components/organisms/RegionModal/styles.scss';

Follow the instructions in the Importing FastStore UI component styles guide.

Usage

Example
Code

Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing-library, and jest).fs-region-modal
titlestringThe region modal's title.Set your location
descriptionstringDescription for region modal.Prices, offers and availability may vary according to your location.
closeButtonAriaLabelstringClose button aria-label.Close Region Modal
idkPostalCodeLinkPropsPartial<LinkProps<LinkElementType>>Props for the link `I don't know my Postal Code`.
linkTextPartial<LinkProps<LinkElementType>>Props for the `I don't know my Postal Code` link on modal body content.
errorMessagestringMessage of error for input.
inputRefMutableRefObject<HTMLInputElement>Postal code input's ref.
inputValuestringPostal code input's value.
inputLabelstringPostal code input's label.Postal Code
fadeOutOnSubmitfalse | trueEnables fadeOut effect on modal after onSubmit function
overlayPropsPropsProps forwarded to the `Overlay` component.
onClose() => voidFunction called when Close button is clicked.
onInput(event: React.FormEvent<HTMLInputElement>) => voidCallback function when input is typed.
onSubmit() => voidCallback function when form is submitted.
onClear() => voidCallback function when the input clear button is clicked.
aria-labelledbystringIdentifies the element (or elements) that labels the current element. @see aria-labelledby https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby
isOpenfalse | trueA boolean value that represents the state of the Modal
onDismiss() => voidEvent emitted when the modal is closed

Design Tokens

Local tokenDefault value/Global token linked
--fs-region-modal-margin-bottomvar(--fs-spacing-6)
--fs-region-modal-link-padding0
--fs-region-modal-link-column-gapvar(--fs-spacing-0)
--fs-region-modal-link-color
var(--fs-color-link)

Customization

For further customization, you can use the following data attributes:
data-fs-region-modal
data-fs-region-modal-input
data-fs-region-modal-link
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page