← All @molecule/* packages · App templates
@molecule/app-pricing-table-reactFeature · pricing-table · App (browser) · v1.0.1 · Apache-2.0
Features × plans matrix for side-by-side plan comparison
npm install @molecule/app-pricing-table-react@molecule/app-pricing-table-react is a ready-made pricing-table feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.
import { PricingTable } from '@molecule/app-pricing-table-react'
const checkout = (planId: string): void => {
window.location.assign(`/checkout?plan=${planId}`)
}
;<PricingTable
plans={[
{
id: 'starter',
name: 'Starter',
price: '$9',
interval: '/mo',
cta: { label: 'Get started', onClick: () => checkout('starter') },
},
{
id: 'pro',
name: 'Pro',
price: '$29',
interval: '/mo',
recommended: true,
cta: { label: 'Get started', onClick: () => checkout('pro') },
},
]}
features={[
{ label: 'Projects', values: { starter: '3', pro: 'Unlimited' } },
{ label: 'Team members', values: { starter: false, pro: true } },
]}
/>Works with: @molecule/app-react, @molecule/app-ui, @molecule/app-ui-react
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Side-by-side pricing comparison table.
Exports <PricingTable> and PricingPlan / PricingFeature types.
import { PricingTable } from '@molecule/app-pricing-table-react'
const checkout = (planId: string): void => {
window.location.assign(`/checkout?plan=${planId}`)
}
;<PricingTable
plans={[
{
id: 'starter',
name: 'Starter',
price: '$9',
interval: '/mo',
cta: { label: 'Get started', onClick: () => checkout('starter') },
},
{
id: 'pro',
name: 'Pro',
price: '$29',
interval: '/mo',
recommended: true,
cta: { label: 'Get started', onClick: () => checkout('pro') },
},
]}
features={[
{ label: 'Projects', values: { starter: '3', pro: 'Unlimited' } },
{ label: 'Team members', values: { starter: false, pro: true } },
]}
/>
feature
npm install @molecule/app-pricing-table-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
npm install -D @types/react
PricingFeatureDescribes a single feature row and its per-plan values in the pricing table.
interface PricingFeature {
/** Row label. */
label: ReactNode
/** Per-plan-id values: `true` / `false` / a string / a node. */
values: Record<string, boolean | string | ReactNode>
/** Optional category / group heading rendered above this row. */
groupHeading?: ReactNode
}
PricingPlanDescribes a single plan column in the pricing table.
interface PricingPlan {
id: string
name: ReactNode
description?: ReactNode
price: ReactNode
interval?: ReactNode
/** CTA renders as primary button on this column. */
cta?: { label: ReactNode; onClick?: () => void; href?: string }
/** Visually emphasise as recommended / featured. */
recommended?: boolean
}
PricingTablePropsProps for {@link PricingTable}.
interface PricingTableProps {
plans: PricingPlan[]
features: PricingFeature[]
/** Extra classes. */
className?: string
}
PricingTable(props)Side-by-side pricing comparison — features × plans matrix. A header
row holds plan cards (name, price, CTA); body rows show per-feature
availability (true → ✓, false → —, strings/nodes pass through).
The wrapper scrolls horizontally when columns overflow.
function PricingTable({ plans, features, className }: PricingTableProps): ReactNode
props — Component props (see {@link PricingTableProps}).Peer dependencies:
@molecule/app-react ^1.0.1@molecule/app-ui ^1.0.1@molecule/app-ui-react ^1.0.1react ^18.0.0 || ^19.0.0@molecule/app-react@molecule/app-ui@molecule/app-ui-reactreactAll text arrives via props — pass pre-translated strings; requires a wired ClassMap bond.