PaymentMethods
The PaymentMethods component displays the logos of the available payment options in a store.
Import
Import the component from @faststore/ui
import { PaymentMethods } from '@faststore/ui'
Import Styles
import '@faststore/ui/src/components/organisms/PaymentMethods/styles.scss'
Usage
Props
Name | Type | Description | Default |
---|---|---|---|
testId | string | ID to find this component in testing tools (e.g.: cypress, testing-library, and jest). | fs-payment-methods |
title | string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | Title of the payment methods section (e.g.: "Payment methods", "Accepted Cards"). | |
aria-label | string | Defines a string value that labels the current element when title is not used. | |
flagList* | Flag[] | List of flags to be displayed in the payment methods section (e.g.:, visa, mastercard, etc). |
Flag
Name | Type | Description | Default |
---|---|---|---|
icon | { icon: string } | An object with the icon name to display the flag image. | |
alt | string | Description of the flag image to be also used for accessibility purposes. |
Design Tokens
Nested Elements
Title
Local token | Default value/Global token linked |
---|---|
--fs-payment-methods-title-size | var(--fs-text-size-body) |
--fs-payment-methods-title-weight | var(--fs-text-weight-bold) |
--fs-payment-methods-title-line-height | 1.25 |
Flags
Local token | Default value/Global token linked |
---|---|
--fs-payment-methods-flags-row-gap | var(--fs-spacing-1) |
--fs-payment-methods-flags-margin-top | var(--fs-spacing-3) |
Flag
Local token | Default value/Global token linked |
---|---|
--fs-payment-methods-flag-width | var(--fs-spacing-5) |
--fs-payment-methods-flag-height | var(--fs-spacing-4) |
--fs-payment-methods-flag-border-width | var(--fs-border-width) |
--fs-payment-methods-flag-border-color | var(--fs-color-neutral-3) |
--fs-payment-methods-flag-border-radius | var(--fs-border-radius-small) |
Customization
data-fs-payment-methods
data-fs-payment-methods-title
data-fs-payment-methods-flags
data-fs-payment-methods-flag