ValyroUI Русская версия

Loyalty Rewards

Loyalty program: points, tier, progress and a rewards catalog. Pro · Shop and payments › Payments and wallet

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add loyalty-rewards
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { LoyaltyRewards } from 'valyro-ui-pro';

Props

PropTypeDefault
points *numberPoints the member can spend now.
lifetimePointsnumberPoints earned all time (they decide the tier).
tier *LoyaltyTierThe member's current tier.
nextTierLoyaltyNextTierThe tier above, for the progress bar.
rewards *LoyaltyReward[]What points buy.
claimedstring[]Ids of claimed rewards (controlled).
defaultClaimedstring[]Initial claimed when uncontrolled.
onClaimedChange(claimed: string[]) => voidCalled with the new claimed when it changes.
onClaim(reward: LoyaltyReward) => voidCalled when a reward is claimed: deduct the points there. Until points changes, the balance shown already excludes it.
howToEarnReactNodeContent of the "How to earn" tab.
tabstringOpen tab (controlled): rewards, claimed or earn.
defaultTabstringInitial tab when uncontrolled.
onTabChange(tab: string) => voidCalled with the new tab when it changes.
localestringBCP 47 locale for the numbers.
labelsPartial<LoyaltyRewardsLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Purchase Card · Next: Subscription Manager · All Shop and payments