本文へ移動
日本語
「プラン比較表」は 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'組み込みの文言、サンプルのプランと価格の言語。
plansArray<{ id, name, tagline, monthly, yearly }>sample plans列として並ぶプラン。価格は月額で、yearly は年払いの月額換算です。
groupsArray<{ id, name, icon?, rows: Array<{ name, hint?, values }> }>sample featuresカテゴリごとの機能行。値は true、false、短い文字列のいずれか。hint は行の説明として表示されます。
highlightstring'plus'アクセント色で目立たせるプランの id。スマホでも最初に表示されます。
currencystringby localeすべての価格に使う ISO 通貨コード。
billing'monthly' | 'yearly''yearly'最初に表示する支払い方法。
loadingbooleanfalse価格の読み込み中はスケルトンを表示します。
onChoose / onBillingChange(planId, billing) => Promise<boolean | void> / (billing) => void—プランを開始(false を返すとボタンのまま)/支払い方法の切り替え時に呼ばれます。
labelsobject—組み込みの文言を置き換えます(キーは copy.js と同じ)。
classNamestring—ルートの 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 つのフォルダにまとめて入ります。