Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Better plan selection UI

Blue Mousea9e9bac6c2e5
diff --git a/web/app/components/pricing/BillingPricing.tsx b/web/app/components/pricing/BillingPricing.tsx
index e424bec76..63cdd35d0 100644
--- a/web/app/components/pricing/BillingPricing.tsx
+++ b/web/app/components/pricing/BillingPricing.tsx
@@ -7,7 +7,8 @@ import { Trans, useTranslation } from 'react-i18next'
import { useFetcher } from 'react-router'
import { toast } from 'sonner'
-import MarketingPricing, {
+import {
+ PricingInternal,
type MarketingPricingSelection,
} from '~/components/pricing/MarketingPricing'
import {
@@ -80,6 +81,7 @@ const BillingPricing = ({
const currentEventTier =
getEventTierByPlanCode(user?.planCode)?.code || '100k'
const currentPlanLimit = user?.planCode ? PLAN_LIMITS[user.planCode] : null
+ const hasPaidPlan = !['none', 'trial', 'free'].includes(user?.planCode || '')
const [activeSelection, setActiveSelection] =
useState<PendingSelection | null>(null)
@@ -217,13 +219,18 @@ const BillingPricing = ({
const isTrialingPaidPlan =
!!user?.trialEndDate &&
- !['none', 'trial', 'free'].includes(user?.planCode || '') &&
+ hasPaidPlan &&
dayjs(user.trialEndDate).isAfter(dayjs())
const hasActiveSubscription =
- !!user?.subID &&
- !user.cancellationEffectiveDate &&
- !['none', 'trial', 'free'].includes(user.planCode || '')
+ !!user?.subID && !user.cancellationEffectiveDate && hasPaidPlan
+
+ const choosePlanDescription = hasPaidPlan
+ ? t('billing.choosePlanCurrentPlanDesc', {
+ plan: getPlanName(currentPlanType, t),
+ events: formatEventsLong(currentPlanLimit?.monthlyUsageLimit || 0),
+ })
+ : t('billing.choosePlanPageDesc')
const getSelectionMeta = (selection: PendingSelection) => {
const selectedPrice = getPlanPrice(
@@ -337,13 +344,12 @@ const BillingPricing = ({
const { cannotSelfServe, isDowngrade, sameSelection, selectedRank } =
getSelectionMeta(selection)
const currentRank = getSelectionRank(currentPlanType, currentEventTier)
- const isUnpaid = ['free', 'trial', 'none'].includes(user?.planCode || '')
if (cannotSelfServe) {
return t('pricing.contactUs')
}
- if (user?.cancellationEffectiveDate || isUnpaid) {
+ if (user?.cancellationEffectiveDate || !hasPaidPlan) {
return t('pricing.subscribe')
}
@@ -386,32 +392,43 @@ const BillingPricing = ({
<>
<main className='min-h-min-footer bg-gray-50 pb-16 dark:bg-slate-950'>
<div className='mx-auto w-full max-w-7xl px-4 pt-6 sm:px-6 lg:px-8'>
- <Button
- to={`${routes.user_settings}?tab=billing`}
- variant='ghost'
- size='sm'
- className='mb-4 gap-1'
- >
- <ArrowLeftIcon className='size-4' />
- {t('billing.backToBilling')}
- </Button>
- <div className='max-w-3xl'>
- <Text as='h1' size='3xl' weight='bold'>
- {t('billing.choosePlanTitle')}
- </Text>
- <Text as='p' size='base' colour='secondary' className='mt-2'>
- {t('billing.choosePlanPageDesc', {
- plan: getPlanName(currentPlanType, t),
- events: formatEventsLong(
- currentPlanLimit?.monthlyUsageLimit || 0,
- ),
- })}
- </Text>
+ <div className='grid gap-6 lg:grid-cols-[1fr_minmax(0,40rem)_1fr] lg:items-start'>
+ <Button
+ to={`${routes.user_settings}?tab=billing`}
+ variant='ghost'
+ size='sm'
+ className='w-fit gap-1 justify-self-start lg:mt-1'
+ >
+ <ArrowLeftIcon className='size-4' />
+ {t('billing.backToBilling')}
+ </Button>
+
+ <div className='mx-auto max-w-3xl text-center'>
+ <Text
+ as='h1'
+ size='3xl'
+ weight='bold'
+ colour='primary'
+ className='text-balance sm:text-4xl'
+ >
+ {t('billing.choosePlanTitle')}
+ </Text>
+ <Text
+ as='p'
+ size='base'
+ colour='secondary'
+ className='mt-4 text-pretty'
+ >
+ {choosePlanDescription}
+ </Text>
+ </div>
+
+ <div aria-hidden='true' />
</div>
</div>
- <div className='mt-6'>
- <MarketingPricing
+ <div className='mt-2'>
+ <PricingInternal
metainfo={metainfo}
onSelectPlan={handlePlanSelection}
getActionLabel={getActionLabel}
diff --git a/web/app/components/pricing/MarketingPricing.tsx b/web/app/components/pricing/MarketingPricing.tsx
index 487980c49..8474df412 100644
--- a/web/app/components/pricing/MarketingPricing.tsx
+++ b/web/app/components/pricing/MarketingPricing.tsx
@@ -275,7 +275,7 @@ const BillingFrequencySwitch = ({ checked }: { checked: boolean }) => (
</span>
)
-const MarketingPricing = ({
+export const PricingInternal = ({
metainfo = DEFAULT_METAINFO,
onSelectPlan,
getActionLabel,
@@ -316,262 +316,158 @@ const MarketingPricing = ({
}
return (
- <section id='pricing' className='relative bg-gray-50 p-2 dark:bg-slate-950'>
- <div className='overflow-hidden rounded-2xl bg-gray-100 py-16 ring-1 ring-gray-200/70 sm:py-20 dark:bg-slate-900/50 dark:ring-white/10'>
- <div className='mx-auto max-w-7xl'>
- <div className='mx-auto max-w-3xl px-4 text-center sm:px-6 lg:px-8'>
+ <>
+ <div className='mx-auto mt-10 max-w-xl px-4 sm:px-6 lg:px-8'>
+ <div className='mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between'>
+ <div>
+ <div className='flex items-center gap-1.5'>
+ <Text as='h3' size='lg' colour='secondary'>
+ {t('pricing.monthlyEvents')}
+ </Text>
+ <Tooltip
+ ariaLabel={`${t('common.learnMore')}: ${t(
+ 'pricing.monthlyEvents',
+ )}`}
+ text={t('pricing.monthlyEventsTooltip')}
+ />
+ </div>
<Text
- as='h2'
+ as='p'
size='3xl'
weight='bold'
colour='primary'
- className='sm:text-4xl'
+ className='mt-1'
>
- {t('pricing.title')}
+ {selectedMonthlyEventsLabel}
</Text>
- <Text
- as='p'
- size='base'
- colour='primary'
- className='mt-6 whitespace-pre-line'
+ </div>
+
+ <div className='flex justify-start sm:justify-end'>
+ <button
+ type='button'
+ aria-pressed={isYearly}
+ onClick={toggleBillingFrequency}
+ className='flex cursor-pointer items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2 transition-colors hover:bg-gray-50 dark:border-white/10 dark:bg-slate-900 dark:hover:bg-slate-800'
>
- {t('pricing.adv', { amount: TRIAL_DAYS })}
- </Text>
+ <Text as='span' size='sm' weight='medium' colour='primary'>
+ {t('pricing.billedYearly')}
+ </Text>
+ <Text
+ as='span'
+ size='xs'
+ weight='semibold'
+ colour='success'
+ className='rounded-md bg-emerald-500/20 px-1.5 py-0.5'
+ >
+ -17 %
+ </Text>
+ <BillingFrequencySwitch checked={isYearly} />
+ </button>
</div>
+ </div>
- <div className='mx-auto mt-10 max-w-xl px-4 sm:px-6 lg:px-8'>
- <div className='mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between'>
- <div>
- <div className='flex items-center gap-1.5'>
- <Text as='h3' size='lg' colour='secondary'>
- {t('pricing.monthlyEvents')}
- </Text>
- <Tooltip
- ariaLabel={`${t('common.learnMore')}: ${t(
- 'pricing.monthlyEvents',
- )}`}
- text={t('pricing.monthlyEventsTooltip')}
- />
- </div>
- <Text
- as='p'
- size='3xl'
- weight='bold'
- colour='primary'
- className='mt-1'
- >
- {selectedMonthlyEventsLabel}
- </Text>
- </div>
+ <input
+ aria-label={t('pricing.monthlyEventVolume')}
+ type='range'
+ min={0}
+ max={eventTierOptionLabels.length - 1}
+ step={1}
+ value={selectedTierIndex}
+ onChange={(event) => setSelectedTierIndex(Number(event.target.value))}
+ className='h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 accent-blue-600 [&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-blue-600 [&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:shadow-sm active:[&::-moz-range-thumb]:cursor-grabbing [&::-webkit-slider-thumb]:size-5 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-blue-600 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-sm active:[&::-webkit-slider-thumb]:cursor-grabbing'
+ style={{
+ background: `linear-gradient(to right, rgb(37 99 235) 0%, rgb(37 99 235) ${sliderPercent}%, rgb(209 213 219) ${sliderPercent}%, rgb(209 213 219) 100%)`,
+ }}
+ />
+
+ <div
+ className='mt-3 grid gap-1'
+ style={{
+ gridTemplateColumns: `repeat(${eventTierOptionLabels.length}, minmax(0, 1fr))`,
+ }}
+ >
+ {eventTierOptionLabels.map((label, index) => (
+ <Text
+ key={label}
+ as='button'
+ type='button'
+ size='xs'
+ weight={index === selectedTierIndex ? 'bold' : 'medium'}
+ colour={index === selectedTierIndex ? 'primary' : 'secondary'}
+ className='text-center'
+ onClick={() => setSelectedTierIndex(index)}
+ >
+ {label}
+ </Text>
+ ))}
+ </div>
+ </div>
- <div className='flex justify-start sm:justify-end'>
- <button
- type='button'
- aria-pressed={isYearly}
- onClick={toggleBillingFrequency}
- className='flex cursor-pointer items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2 transition-colors hover:bg-gray-50 dark:border-white/10 dark:bg-slate-900 dark:hover:bg-slate-800'
- >
- <Text as='span' size='sm' weight='medium' colour='primary'>
- {t('pricing.billedYearly')}
- </Text>
+ <NumberFlowGroup>
+ <div className='mx-auto mt-6 grid max-w-7xl gap-4 px-4 sm:px-6 lg:grid-cols-3 lg:px-8'>
+ {planCards.map((planType) => {
+ const isEnterprise = planType === 'enterprise'
+ const benefits = getBenefits(planType, t)
+ const visibleBenefits = showAllBenefits
+ ? benefits
+ : benefits.slice(0, visibleBenefitsCount)
+ const hiddenBenefitsCount = Math.max(
+ 0,
+ benefits.length - visibleBenefits.length,
+ )
+ const monthlyPlan = isCustomEventTier
+ ? null
+ : getPlanPrice(planType, selectedTier, 'monthly', currencyCode)
+ const yearlyPlan = isCustomEventTier
+ ? null
+ : getPlanPrice(planType, selectedTier, 'yearly', currencyCode)
+ const monthlyPrice = monthlyPlan?.amount
+ const yearlyPrice = yearlyPlan?.amount
+ const yearlyMonthlyPrice = yearlyPrice
+ ? Math.round((yearlyPrice / 12) * 100) / 100
+ : null
+ const hasPublishedPrice = Boolean(monthlyPrice && yearlyPrice)
+ const canSelfServe = Boolean(
+ (isYearly ? yearlyPlan : monthlyPlan)?.paddlePlanId,
+ )
+ const selection: MarketingPricingSelection = {
+ planType,
+ eventTier: selectedTier,
+ billingFrequency,
+ currency: currencyCode,
+ }
+ const actionLabel =
+ getActionLabel?.(selection) ||
+ (canSelfServe
+ ? t('pricing.startFreeTrial')
+ : t('pricing.contactUs'))
+
+ return (
+ <div
+ key={planType}
+ className={cn(
+ 'flex min-h-[520px] flex-col rounded-2xl p-5 shadow-sm ring-1 dark:ring-white/10',
+ isEnterprise
+ ? 'bg-slate-900 ring-slate-700'
+ : 'bg-white ring-gray-200 dark:bg-slate-900',
+ )}
+ >
+ <div className='flex items-start justify-between gap-3'>
<Text
- as='span'
- size='xs'
- weight='semibold'
- colour='success'
- className='rounded-md bg-emerald-500/20 px-1.5 py-0.5'
+ as='h3'
+ size='lg'
+ weight='bold'
+ colour='primary'
+ className={isEnterprise ? 'dark' : ''}
>
- {/* 2 months free */}
- -17 %
+ {getPlanName(planType, t)}
</Text>
- <BillingFrequencySwitch checked={isYearly} />
- </button>
- </div>
- </div>
-
- <input
- aria-label={t('pricing.monthlyEventVolume')}
- type='range'
- min={0}
- max={eventTierOptionLabels.length - 1}
- step={1}
- value={selectedTierIndex}
- onChange={(event) =>
- setSelectedTierIndex(Number(event.target.value))
- }
- className='h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 accent-blue-600 [&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-blue-600 [&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:shadow-sm active:[&::-moz-range-thumb]:cursor-grabbing [&::-webkit-slider-thumb]:size-5 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-blue-600 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-sm active:[&::-webkit-slider-thumb]:cursor-grabbing'
- style={{
- background: `linear-gradient(to right, rgb(37 99 235) 0%, rgb(37 99 235) ${sliderPercent}%, rgb(209 213 219) ${sliderPercent}%, rgb(209 213 219) 100%)`,
- }}
- />
-
- <div
- className='mt-3 grid gap-1'
- style={{
- gridTemplateColumns: `repeat(${eventTierOptionLabels.length}, minmax(0, 1fr))`,
- }}
- >
- {eventTierOptionLabels.map((label, index) => (
- <Text
- key={label}
- as='button'
- type='button'
- size='xs'
- weight={index === selectedTierIndex ? 'bold' : 'medium'}
- colour={index === selectedTierIndex ? 'primary' : 'secondary'}
- className='text-center'
- onClick={() => setSelectedTierIndex(index)}
- >
- {label}
- </Text>
- ))}
- </div>
- </div>
+ </div>
- <NumberFlowGroup>
- <div className='mx-auto mt-6 grid max-w-7xl gap-4 px-4 sm:px-6 lg:grid-cols-3 lg:px-8'>
- {planCards.map((planType) => {
- const isEnterprise = planType === 'enterprise'
- const benefits = getBenefits(planType, t)
- const visibleBenefits = showAllBenefits
- ? benefits
- : benefits.slice(0, visibleBenefitsCount)
- const hiddenBenefitsCount = Math.max(
- 0,
- benefits.length - visibleBenefits.length,
- )
- const monthlyPlan = isCustomEventTier
- ? null
- : getPlanPrice(
- planType,
- selectedTier,
- 'monthly',
- currencyCode,
- )
- const yearlyPlan = isCustomEventTier
- ? null
- : getPlanPrice(planType, selectedTier, 'yearly', currencyCode)
- const monthlyPrice = monthlyPlan?.amount
- const yearlyPrice = yearlyPlan?.amount
- const yearlyMonthlyPrice = yearlyPrice
- ? Math.round((yearlyPrice / 12) * 100) / 100
- : null
- const hasPublishedPrice = Boolean(monthlyPrice && yearlyPrice)
- const canSelfServe = Boolean(
- (isYearly ? yearlyPlan : monthlyPlan)?.paddlePlanId,
- )
- const selection: MarketingPricingSelection = {
- planType,
- eventTier: selectedTier,
- billingFrequency,
- currency: currencyCode,
- }
- const actionLabel =
- getActionLabel?.(selection) ||
- (canSelfServe
- ? t('pricing.startFreeTrial')
- : t('pricing.contactUs'))
-
- return (
- <div
- key={planType}
- className={cn(
- 'flex min-h-[520px] flex-col rounded-2xl p-5 shadow-sm ring-1 dark:ring-white/10',
- isEnterprise
- ? 'bg-slate-900 ring-slate-700'
- : 'bg-white ring-gray-200 dark:bg-slate-900',
- )}
- >
- <div className='flex items-start justify-between gap-3'>
- <Text
- as='h3'
- size='lg'
- weight='bold'
- colour='primary'
- className={isEnterprise ? 'dark' : ''}
- >
- {getPlanName(planType, t)}
- </Text>
- </div>
-
- <div className='mt-2 min-h-[78px]'>
- {hasPublishedPrice ? (
- <>
- <div className='flex min-h-10 flex-wrap items-end gap-2'>
- <Text
- as='p'
- size='3xl'
- weight='bold'
- colour='primary'
- className={isEnterprise ? 'dark' : ''}
- >
- <PriceAmount
- value={
- isYearly
- ? (yearlyPrice ?? null)
- : (monthlyPrice ?? null)
- }
- currencySymbol={currency.symbol}
- />
- </Text>
- <Text
- as='p'
- size='base'
- weight='medium'
- colour='secondary'
- className={cn('pb-1', isEnterprise ? 'dark' : '')}
- >
- {`/${t(
- isYearly
- ? 'pricing.intervals.year'
- : 'pricing.intervals.month',
- )}`}
- </Text>
- </div>
- {isYearly ? (
- <div className='mt-1 flex h-6 flex-wrap items-baseline gap-1'>
- <Text
- as='span'
- size='sm'
- weight='medium'
- colour='secondary'
- className={cn(
- 'line-through',
- isEnterprise ? 'dark' : '',
- )}
- >
- {formatPrice(
- monthlyPrice ?? null,
- currency.symbol,
- )}
- </Text>
- <Text
- as='span'
- size='sm'
- weight='bold'
- colour='primary'
- className={isEnterprise ? 'dark' : ''}
- >
- {formatPrice(
- yearlyMonthlyPrice,
- currency.symbol,
- )}
- </Text>
- <Text
- as='span'
- size='sm'
- weight='medium'
- colour='secondary'
- className={isEnterprise ? 'dark' : ''}
- >
- /{t('pricing.intervals.month')}
- </Text>
- </div>
- ) : (
- <div className='mt-2 h-6' aria-hidden='true' />
- )}
- </>
- ) : (
+ <div className='mt-2 min-h-[78px]'>
+ {hasPublishedPrice ? (
+ <>
+ <div className='flex min-h-10 flex-wrap items-end gap-2'>
<Text
as='p'
size='3xl'
@@ -579,102 +475,204 @@ const MarketingPricing = ({
colour='primary'
className={isEnterprise ? 'dark' : ''}
>
- {t('pricing.custom')}
+ <PriceAmount
+ value={
+ isYearly
+ ? (yearlyPrice ?? null)
+ : (monthlyPrice ?? null)
+ }
+ currencySymbol={currency.symbol}
+ />
</Text>
- )}
- </div>
-
- <Button
- to={
- onSelectPlan && canSelfServe
- ? undefined
- : canSelfServe
- ? isAuthenticated
- ? routes.billing_choose_plan
- : routes.signup
- : routes.contact
- }
- onClick={
- onSelectPlan && canSelfServe
- ? () => onSelectPlan(selection)
- : undefined
- }
- variant='primary'
- size='lg'
- loading={loadingPlanType === planType}
- disabled={disabled}
- className={cn(
- 'mt-4 justify-center gap-2',
- isEnterprise ? 'dark' : '',
- )}
- >
- <Text
- as='span'
- size='sm'
- weight='semibold'
- colour='inherit'
- >
- {actionLabel}
- </Text>
- <ArrowRightIcon className='size-4' />
- </Button>
-
- <div className='mt-5 space-y-3'>
- {visibleBenefits.map((benefit) => (
- <BenefitRow
- key={benefit.label}
- benefit={benefit}
- isEnterprise={isEnterprise}
- />
- ))}
- {hiddenBenefitsCount > 0 || showAllBenefits ? (
- <button
- type='button'
- onClick={() => setShowAllBenefits((value) => !value)}
- className='underline-animate flex items-center gap-2.5'
+ <Text
+ as='p'
+ size='base'
+ weight='medium'
+ colour='secondary'
+ className={cn('pb-1', isEnterprise ? 'dark' : '')}
>
- {showAllBenefits ? (
- <CaretUpIcon
- className={cn(
- 'size-4',
- isEnterprise
- ? 'text-gray-200'
- : 'text-gray-700',
- )}
- weight='bold'
- />
- ) : (
- <CaretDownIcon
- className={cn(
- 'size-4',
- isEnterprise
- ? 'text-gray-200'
- : 'text-gray-700',
- )}
- weight='bold'
- />
- )}
+ {`/${t(
+ isYearly
+ ? 'pricing.intervals.year'
+ : 'pricing.intervals.month',
+ )}`}
+ </Text>
+ </div>
+ {isYearly ? (
+ <div className='mt-1 flex h-6 flex-wrap items-baseline gap-1'>
<Text
as='span'
size='sm'
weight='medium'
+ colour='secondary'
+ className={cn(
+ 'line-through',
+ isEnterprise ? 'dark' : '',
+ )}
+ >
+ {formatPrice(monthlyPrice ?? null, currency.symbol)}
+ </Text>
+ <Text
+ as='span'
+ size='sm'
+ weight='bold'
colour='primary'
className={isEnterprise ? 'dark' : ''}
>
- {showAllBenefits
- ? t('common.showLess')
- : t('common.showMore', {
- count: hiddenBenefitsCount,
- })}
+ {formatPrice(yearlyMonthlyPrice, currency.symbol)}
</Text>
- </button>
- ) : null}
- </div>
- </div>
- )
- })}
- </div>
- </NumberFlowGroup>
+ <Text
+ as='span'
+ size='sm'
+ weight='medium'
+ colour='secondary'
+ className={isEnterprise ? 'dark' : ''}
+ >
+ /{t('pricing.intervals.month')}
+ </Text>
+ </div>
+ ) : (
+ <div className='mt-2 h-6' aria-hidden='true' />
+ )}
+ </>
+ ) : (
+ <Text
+ as='p'
+ size='3xl'
+ weight='bold'
+ colour='primary'
+ className={isEnterprise ? 'dark' : ''}
+ >
+ {t('pricing.custom')}
+ </Text>
+ )}
+ </div>
+
+ <Button
+ to={
+ onSelectPlan && canSelfServe
+ ? undefined
+ : canSelfServe
+ ? isAuthenticated
+ ? routes.billing_choose_plan
+ : routes.signup
+ : routes.contact
+ }
+ onClick={
+ onSelectPlan && canSelfServe
+ ? () => onSelectPlan(selection)
+ : undefined
+ }
+ variant='primary'
+ size='lg'
+ loading={loadingPlanType === planType}
+ disabled={disabled}
+ className={cn(
+ 'mt-4 justify-center gap-2',
+ isEnterprise ? 'dark' : '',
+ )}
+ >
+ <Text as='span' size='sm' weight='semibold' colour='inherit'>
+ {actionLabel}
+ </Text>
+ <ArrowRightIcon className='size-4' />
+ </Button>
+
+ <div className='mt-5 space-y-3'>
+ {visibleBenefits.map((benefit) => (
+ <BenefitRow
+ key={benefit.label}
+ benefit={benefit}
+ isEnterprise={isEnterprise}
+ />
+ ))}
+ {hiddenBenefitsCount > 0 || showAllBenefits ? (
+ <button
+ type='button'
+ onClick={() => setShowAllBenefits((value) => !value)}
+ className='underline-animate flex items-center gap-2.5'
+ >
+ {showAllBenefits ? (
+ <CaretUpIcon
+ className={cn(
+ 'size-4',
+ isEnterprise ? 'text-gray-200' : 'text-gray-700',
+ )}
+ weight='bold'
+ />
+ ) : (
+ <CaretDownIcon
+ className={cn(
+ 'size-4',
+ isEnterprise ? 'text-gray-200' : 'text-gray-700',
+ )}
+ weight='bold'
+ />
+ )}
+ <Text
+ as='span'
+ size='sm'
+ weight='medium'
+ colour='primary'
+ className={isEnterprise ? 'dark' : ''}
+ >
+ {showAllBenefits
+ ? t('common.showLess')
+ : t('common.showMore', {
+ count: hiddenBenefitsCount,
+ })}
+ </Text>
+ </button>
+ ) : null}
+ </div>
+ </div>
+ )
+ })}
+ </div>
+ </NumberFlowGroup>
+ </>
+ )
+}
+
+const MarketingPricing = ({
+ metainfo = DEFAULT_METAINFO,
+ onSelectPlan,
+ getActionLabel,
+ loadingPlanType,
+ disabled,
+}: MarketingPricingProps) => {
+ const { t } = useTranslation('common')
+ return (
+ <section id='pricing' className='relative bg-gray-50 p-2 dark:bg-slate-950'>
+ <div className='overflow-hidden rounded-2xl bg-gray-100 py-16 ring-1 ring-gray-200/70 sm:py-20 dark:bg-slate-900/50 dark:ring-white/10'>
+ <div className='mx-auto max-w-7xl'>
+ <div className='mx-auto max-w-3xl px-4 text-center sm:px-6 lg:px-8'>
+ <Text
+ as='h2'
+ size='3xl'
+ weight='bold'
+ colour='primary'
+ className='sm:text-4xl'
+ >
+ {t('pricing.title')}
+ </Text>
+ <Text
+ as='p'
+ size='base'
+ colour='primary'
+ className='mt-6 whitespace-pre-line'
+ >
+ {t('pricing.adv', { amount: TRIAL_DAYS })}
+ </Text>
+ </div>
+
+ <PricingInternal
+ metainfo={metainfo}
+ onSelectPlan={onSelectPlan}
+ getActionLabel={getActionLabel}
+ loadingPlanType={loadingPlanType}
+ disabled={disabled}
+ />
</div>
</div>
</section>
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 0c0337358..9d0fb8109 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -2858,8 +2858,9 @@
"noPlanSelected": "No plan selected",
"noPlanDescription": "Choose a plan to keep Swetrix active for your projects.",
"backToBilling": "Back to billing",
- "choosePlanTitle": "Choose your plan",
- "choosePlanPageDesc": "Pick the plan type, monthly event volume, and billing period that fits your account. Your current plan is {{plan}} with {{events}} events per month.",
+ "choosePlanTitle": "Choose a plan that fits your traffic",
+ "choosePlanPageDesc": "Pick your monthly event volume, plan type, and billing period. You'll see the exact price before checkout.",
+ "choosePlanCurrentPlanDesc": "Pick your monthly event volume, plan type, and billing period. Your current plan is {{plan}} with {{events}} events per month, and changes are prorated automatically.",
"planFaqTitle": "Plan questions",
"membersNotification": "Pageviews, custom events, CAPTCHA events, and error events count toward the account owner's plan limit. Invited project members do not need their own subscription.",
"trialDescription": "Your free trial includes all features and unlimited data collection. When it ends, choose a paid plan that matches your usage to keep using Swetrix.",