Skip to main content

DiscountBadge

A custom Badge that display product's discounts.

Overviewโ€‹

Loading...

Importโ€‹

Import the component from @faststore/ui

import { DiscountBadge } from '@faststore/ui'

Import Styles

import '@faststore/ui/src/components/molecules/DiscountBadge/styles.scss'

Usageโ€‹

Loading...

Propsโ€‹


Design Tokensโ€‹

This component inherits Badge design tokens.

Variantsโ€‹

Low Discountโ€‹

Loading...
Local tokenDefault value/Global token linked
--fs-discount-badge-low-bkg-color
var(--fs-badge-success-bkg-color)
--fs-discount-badge-low-text-color
var(--fs-badge-success-text-color)
--fs-discount-badge-low-border-color
var(--fs-badge-success-border-color)

Medium Discountโ€‹

Loading...
Local tokenDefault value/Global token linked
--fs-discount-badge-medium-bkg-color
var(--fs-badge-warning-bkg-color)
--fs-discount-badge-medium-text-color
var(--fs-badge-warning-text-color)
--fs-discount-badge-medium-border-color
var(--fs-badge-warning-border-color)

High Discountโ€‹

Loading...
Local tokenDefault value/Global token linked
--fs-discount-badge-high-bkg-color
var(--fs-badge-danger-bkg-color)
--fs-discount-badge-high-text-color
var(--fs-badge-danger-text-color)
--fs-discount-badge-high-border-color
var(--fs-badge-danger-border-color)

Customizationโ€‹

For further customization, you can use the following data attributes:

data-fs-discount-badge

data-fs-discount-badge-variant

This component inherits Badge css selectors and styles.