lomi.
lomi. UI

Sélecteur de prix

Sélecteur de cycle de facturation du panneau produit sombre du checkout hébergé.

Sélecteur de prix

Reprend price-selector.tsx sur le panneau produit sombre du checkout hébergé.

Aperçu

Installation

Install to your codebase

Copy the component source with shadcn.

npx shadcn@latest add https://docs.lomi.africa/r/price-selector.json

Utilisation

import { PriceSelector } from '@/components/lomi-ui/price-selector';

<PriceSelector
  currencyCode="XOF"
  selectedPriceId={selectedPriceId}
  onPriceSelect={setSelectedPriceId}
  prices={[
    {
      price_id: 'monthly',
      amount: 25000,
      billing_interval: 'monthly',
      is_default: true,
    },
    {
      price_id: 'yearly',
      amount: 250000,
      billing_interval: 'yearly',
    },
  ]}
/>;

Affichez-le dans un panneau #121317 pour correspondre au checkout hébergé.

Props

PropTypeDescription
pricesPriceOption[]Prix actifs à afficher. Masqué s’il y a un prix ou moins.
selectedPriceIdstring | nullIdentifiant du prix sélectionné.
onPriceSelect(priceId: string) => voidDéclenché quand un prix est choisi.
currencyCodestringCode devise ISO. Par défaut XOF.
labelstringLibellé de section. Par défaut Choose your billing cycle.

Sur cette page