lomi.
lomi. UI

Price selector

Hosted checkout billing cycle selector for the dark product panel.

Price selector

Matches price-selector.tsx on the hosted checkout dark product panel.

Preview

Installation

Install to your codebase

Copy the component source with shadcn.

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

Usage

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',
    },
  ]}
/>;

Render it inside a #121317 panel to match hosted checkout.

Props

PropTypeDescription
pricesPriceOption[]Active prices to render. Hidden when one or fewer prices.
selectedPriceIdstring | nullCurrently selected price id.
onPriceSelect(priceId: string) => voidFired when a price is chosen.
currencyCodestringISO currency code. Defaults to XOF.
labelstringSection label. Defaults to Choose your billing cycle.

On this page