Badge Promotion
Overview
BadgePromotion is the promotional badge atom for product tiles and pricing. The discriminated variant prop picks the visual treatment:
variant | Use for |
|---|---|
'promo' | Generic promotional callouts (gift-with-purchase, bundle, free shipping). |
'sale' | Discount callouts, usually paired with savingPercentage. |
'new' | Fresh-stock or new-arrival callouts. |
'icon' | Icon-only badges driven by the icon prop. |
The BEM root class is .badge-promotion and the locale namespace is badgePromotion.*.
Key Business & UX Benefits
- One promotional badge covers gift-with-purchase, sale, new arrival, and icon callouts, so storefronts stay visually coherent across every campaign.
- A typed
variantprop forces merchandisers and engineers onto a fixed set of promo treatments, preventing rogue one-off styles from creeping into PDPs and PLPs. - Locale namespace
badgePromotion.*keeps copy translation-ready, so country sites can swap "Sale" for the local term without code changes. - Pairing
savingPercentagewithvariant="sale"puts the discount front and center, which lifts click-through on promo grids and supports markdown-driven AOV.
variant="sale" with a savingPercentage when you want the discount visible at a glance, and variant="new" (no percentage) for fresh-stock callouts.Usage
<LBadgePromotion variant="sale" :saving-percentage="10" />
Feature List
- Four discriminated `variant` values ('promo', 'sale', 'new', 'icon') keep merchandising on a fixed set of promo treatments
- `savingPercentage` pairs with `variant="sale"` to put the discount front and center on promo grids
- `variant="icon"` drives icon-only badges through the `icon` prop, so glyph-led promos share the same primitive
- Locale namespace `badgePromotion.*` keeps every variant's copy translation-ready out of the box
- BEM root class `.badge-promotion` anchors per-variant theme overrides without prop sprawl
API Reference
| Prop | Default | Type |
|---|---|---|
variant | promo | "icon" | "promo" | "sale" | "new"Visual variant. |
radius | equal | "equal" | "unequal"Corner radius preset. |
size | m | "s" | "m"Size preset. |
icon | stringIcon name (used when | |
text | stringText content. Ignored when | |
savingPercentage | numberConvenience: renders the localized "Save X%" string. Takes precedence over | |
withNotch | false | booleanRender a decorative notch behind the badge (for ribbon-adjacent use, e.g. next to a price). |
Stars Rating
Star graphic with optional text for displaying a numeric rating on products, reviews, or any rating context.
Hosting
Laioutr provides a flexible and integrated approach to hosting and deploying the frontends you create on the platform. Whether you want a fully managed default solution or need to connect your own infrastructure, Laioutr supports both paths from the start.