「プラン比較表」は Pro に含まれます。解除するとプレビューが表示されます。
使い方
import { LandingPricingCompare } from './LandingPricingCompare.jsx'
// Without onChoose a plan starts after a short wait. Wire it to your checkout:
<LandingPricingCompare
locale="en"
currency="USD"
plans={plans} // [{ id, name, tagline, monthly, yearly }]
groups={featureGroups} // [{ id, name, icon, rows: [{ name, hint?, values: [true | false | string per plan] }] }]
highlight="plus"
loading={!plans}
onChoose={async (planId, billing) => (await startTrial(planId, billing)).ok}
/>プロパティ
| プロパティ | 型 | 既定値 | 説明 |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | 組み込みの文言、サンプルのプランと価格の言語。 |
plans | Array<{ id, name, tagline, monthly, yearly }> | sample plans | 列として並ぶプラン。価格は月額で、yearly は年払いの月額換算です。 |
groups | Array<{ id, name, icon?, rows: Array<{ name, hint?, values }> }> | sample features | カテゴリごとの機能行。値は true、false、短い文字列のいずれか。hint は行の説明として表示されます。 |
highlight | string | 'plus' | アクセント色で目立たせるプランの id。スマホでも最初に表示されます。 |
currency | string | by locale | すべての価格に使う ISO 通貨コード。 |
billing | 'monthly' | 'yearly' | 'yearly' | 最初に表示する支払い方法。 |
loading | boolean | false | 価格の読み込み中はスケルトンを表示します。 |
onChoose / onBillingChange | (planId, billing) => Promise<boolean | void> / (billing) => void | — | プランを開始(false を返すとボタンのまま)/支払い方法の切り替え時に呼ばれます。 |
labels | object | — | 組み込みの文言を置き換えます(キーは copy.js と同じ)。 |
className | string | — | ルートの section に追加されます。 |
プロジェクトに追加
Pro にはこのブロックのソース一式が含まれます。指示をコピーしてエージェントに導入を依頼できます。
LandingPricingCompare.jsxlanding-pricing-compare.csscopy.jskit.jsxkit.cssui/base-button/ui/rolling-number/ui/success-check/ui/skeleton-shimmer/ui/sliding-tabs/ui/tooltip/tokens.cssREADME.md
ブロック本体、スタイルと文言、共通の kit、使っているコンポーネント、tokens.css が 1 つのフォルダにまとめて入ります。
