LumnPricing

Drop-in pricing table component. Auto-fetches products from your Lumn account and renders pricing cards with interval switching.

typescript
import { LumnProvider, LumnPricing } from '@lumnsh/react';
function App() {
return (
<LumnProvider apiKey={process.env.NEXT_PUBLIC_LUMN_API_KEY} baseUrl={process.env.NEXT_PUBLIC_LUMN_API_BASE_URL}>
<LumnPricing
customerId="cus_123"
/>
</LumnProvider>
);
}

LumnPricingProps

Parameter reference
ParameterTypeRequiredDescriptionExample
customerIdstringOptionalOptional customer ID to show personalized plan statuses.'cus_123'
productsProduct[]OptionalManual products list. Auto-fetches from Lumn API if omitted.-
intervalsPricingInterval[]OptionalAvailable intervals. Default: ['monthly', 'yearly']['monthly', 'yearly']
defaultIntervalPricingIntervalOptionalInitial selected interval. Default: 'monthly''monthly'
localestringOptionalBCP 47 locale for price formatting (e.g. 'zh-CN').'en-US'
onSelectPlanfunctionOptionalCallback when a user clicks a plan. Receives product, interval, and checkout helper.-
renderCardfunctionOptionalCustom render hook for the entire pricing card.-
formatPricefunctionOptionalCustom formatter for price display (e.g. "$10/mo").-
loadingComponentReactNodeOptionalCustom loader shown during API fetch.-
emptyComponentReactNodeOptionalCustom UI shown when no products are found.-
errorComponentfunctionOptionalCustom error UI if the fetch fails.-
classNamestringOptionalAdditional CSS classes for the container.-

Interactive UI & Output

Paste your API key above to try

Parameters