Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/promo-pages`: Improve Company License pricing section (#7062)

Dixbc050176f3e4
diff --git a/packages/design/src/Switch.tsx b/packages/design/src/Switch.tsx
index 4cb02776fa..97215cf426 100644
--- a/packages/design/src/Switch.tsx
+++ b/packages/design/src/Switch.tsx
@@ -3,9 +3,14 @@ import React from 'react';
export const Switch: React.FC<{
readonly active: boolean;
readonly onToggle: () => void;
-}> = ({active, onToggle}) => {
+ readonly 'aria-label'?: string;
+}> = ({active, onToggle, 'aria-label': ariaLabel}) => {
return (
- <div
+ <button
+ type="button"
+ role="switch"
+ aria-checked={active}
+ aria-label={ariaLabel}
data-active={active}
className="h-[34px] transition-all rounded-full w-[56px] border-2 border-b-4 bg-gray-200 p-[2px] cursor-pointer data-[active=true]:bg-brand border-black relative shrink-0"
onClick={onToggle}
@@ -14,6 +19,6 @@ export const Switch: React.FC<{
data-active={active}
className="h-[20px] w-[20px] left-[4px] top-[4px] transition-all rounded-full bg-white border-2 border-black absolute data-[active=true]:left-[calc(100%-24px)]"
/>
- </div>
+ </button>
);
};
diff --git a/packages/promo-pages/src/components/homepage/FreePricing.tsx b/packages/promo-pages/src/components/homepage/FreePricing.tsx
index 5331922d19..d63e33579a 100644
--- a/packages/promo-pages/src/components/homepage/FreePricing.tsx
+++ b/packages/promo-pages/src/components/homepage/FreePricing.tsx
@@ -1,7 +1,6 @@
import {Switch} from '@remotion/design';
import React, {useCallback, useMemo} from 'react';
import {cn} from '../../cn';
-import {InfoTooltip} from './InfoTooltip';
import {PricingBulletPoint} from './PricingBulletPoint';
const Container: React.FC<{readonly children: React.ReactNode}> = ({
@@ -70,7 +69,8 @@ const PricingSlider: React.FC<{
readonly min: number;
readonly max: number;
readonly step?: number;
-}> = ({value, onChange, min, max, step = 1}) => {
+ readonly 'aria-label'?: string;
+}> = ({value, onChange, min, max, step = 1, 'aria-label': ariaLabel}) => {
const percentage = ((value - min) / (max - min)) * 100;
return (
@@ -116,6 +116,7 @@ const PricingSlider: React.FC<{
step={step}
value={value}
onChange={(e) => onChange(Number(e.target.value))}
+ aria-label={ariaLabel}
className="pricing-slider w-full"
style={{
background: `linear-gradient(to right, var(--color-brand) 0%, var(--color-brand) ${percentage}%, var(--background) ${percentage}%, var(--background) 100%)`,
@@ -236,8 +237,15 @@ const SectionCheckbox: React.FC<{
readonly children?: React.ReactNode;
}> = ({checked, onChange, title, subtitle, children}) => {
return (
- <div className="flex flex-row gap-3 cursor-pointer select-none items-center">
- <Switch active={checked} onToggle={() => onChange(!checked)} />
+ <div
+ className="flex flex-row gap-3 cursor-pointer select-none items-center"
+ onClick={() => onChange(!checked)}
+ >
+ <Switch
+ active={checked}
+ onToggle={() => onChange(!checked)}
+ aria-label={title}
+ />
<div className="flex flex-col">
<div className="fontbrand font-bold text-lg flex flex-row items-center gap-1">
{title}
@@ -305,12 +313,10 @@ export const CompanyPricing: React.FC = () => {
<PricingBulletPoint text="Commercial use allowed" checked />
<PricingBulletPoint text="Pay according to usage" checked />
<PricingBulletPoint text="Prioritized Support" checked />
- <PricingBulletPoint text="$250 Mux credits" checked>
- <InfoTooltip>
- Credits for Mux.com.
- <br /> Applies only to new Mux customers.
- </InfoTooltip>
- </PricingBulletPoint>
+ <PricingBulletPoint
+ text="$250 Mux credits (applies only to new Mux customers)"
+ checked
+ />
<div style={{height: 30}} />
{/* Remotion for Creators Section */}
@@ -319,15 +325,7 @@ export const CompanyPricing: React.FC = () => {
onChange={setCreatorsSelected}
title="Remotion for Creators"
subtitle="Create videos for yourself - $25/mo per seat"
- >
- <InfoTooltip>
- Intended for low volume video creations through coding and prompting,
- and building motion design systems in a local environment.
- <br />
- <br />
- Get 1 Seat per user.
- </InfoTooltip>
- </SectionCheckbox>
+ />
<div
className={cn(
'grid ease-out',
@@ -340,23 +338,30 @@ export const CompanyPricing: React.FC = () => {
? 'grid-template-rows 150ms ease-out, opacity 150ms ease-out 75ms'
: 'opacity 150ms ease-out, grid-template-rows 150ms ease-out 75ms',
}}
+ inert={!creatorsSelected}
>
<div className="overflow-hidden">
- <div className="flex flex-row items-center gap-3 sm:gap-4 w-full py-3">
+ <p className="text-sm text-muted fontbrand pt-3 pb-1">
+ Intended for low volume video creations through coding and
+ prompting, and building motion design systems in a local
+ environment. Get 1 Seat per user.
+ </p>
+ <div className="flex flex-row items-center gap-3 sm:gap-4 w-full pt-3 pb-1">
<div className="flex-1 min-w-0">
<PricingSlider
value={devSeatCount}
onChange={setDevSeatCount}
min={1}
max={50}
+ aria-label="Number of seats"
/>
</div>
- <div className="fontbrand shrink-0 whitespace-nowrap w-[135px] sm:w-[150px] text-center">
+ <div className="fontbrand shrink-0 whitespace-nowrap w-[135px] sm:w-[150px] text-center tabular-nums">
{devSeatCount} {devSeatCount === 1 ? 'Seat' : 'Seats'}
</div>
- <div className="fontbrand font-bold min-w-[60px] text-right shrink-0 whitespace-nowrap">
+ <div className="fontbrand font-bold min-w-[60px] text-right shrink-0 whitespace-nowrap tabular-nums">
$
{new Intl.NumberFormat('en-US', {
maximumFractionDigits: 0,
@@ -374,18 +379,7 @@ export const CompanyPricing: React.FC = () => {
onChange={setAutomatorsSelected}
title="Remotion for Automators"
subtitle="Build video creation tools - $0.01 per render, $100/mo minimum"
- >
- <InfoTooltip>
- Intended for companies launching <br />
- SaaS applications; such as video editors and prompt-to-video apps, and
- automated high-volume video creation.
- <br />
- <br />A $100/mo Minimum Spend applies.
- <br />
- <br />
- Developers working on automation projects do not require a Seat.
- </InfoTooltip>
- </SectionCheckbox>
+ />
<div
className={cn(
'grid ease-out',
@@ -398,9 +392,16 @@ export const CompanyPricing: React.FC = () => {
? 'grid-template-rows 150ms ease-out, opacity 150ms ease-out 75ms'
: 'opacity 150ms ease-out, grid-template-rows 150ms ease-out 75ms',
}}
+ inert={!automatorsSelected}
>
<div className="overflow-hidden">
- <div className="flex flex-row items-center gap-3 sm:gap-4 w-full py-3">
+ <p className="text-sm text-muted fontbrand pt-3 pb-1">
+ Intended for companies launching SaaS applications; such as video
+ editors and prompt-to-video apps, and automated high-volume video
+ creation. A $100/mo Minimum Spend applies. Developers working on
+ automation projects do not require a Seat.
+ </p>
+ <div className="flex flex-row items-center gap-3 sm:gap-4 w-full pt-3 pb-1">
<div className="flex-1 min-w-0">
<PricingSlider
value={cloudRenders}
@@ -408,14 +409,15 @@ export const CompanyPricing: React.FC = () => {
min={1000}
max={100000}
step={1000}
+ aria-label="Number of renders"
/>
</div>
- <div className="fontbrand shrink-0 whitespace-nowrap w-[135px] sm:w-[150px] text-right">
+ <div className="fontbrand shrink-0 whitespace-nowrap w-[135px] sm:w-[150px] text-right tabular-nums">
{new Intl.NumberFormat('en-US').format(cloudRenders)} Renders
</div>
- <div className="fontbrand font-bold min-w-[60px] text-right shrink-0 whitespace-nowrap">
+ <div className="fontbrand font-bold min-w-[60px] text-right shrink-0 whitespace-nowrap tabular-nums">
$
{new Intl.NumberFormat('en-US', {
maximumFractionDigits: 0,
@@ -426,31 +428,32 @@ export const CompanyPricing: React.FC = () => {
</div>
<div style={{height: 14}} />
- <div className={'flex flex-row justify-end'}>
- <div style={{...textUnitWrapper, alignItems: 'flex-end'}}>
- <PriceTag>{totalPriceString}/month</PriceTag>
- <BottomInfo
- data-visible={showMinimumMessage}
- className="opacity-0 data-[visible=true]:opacity-100 transition-opacity"
- >
- The minimum is $100 per month for Remotion for Automators
- </BottomInfo>
- <BottomInfo
- data-visible={showEnterpriseMessage}
- className="opacity-0 data-[visible=true]:opacity-100 transition-opacity"
+ <div className="flex flex-row items-baseline justify-end gap-2">
+ <div className="fontbrand text-muted text-sm">Total</div>
+ <PriceTag>{totalPriceString}/month</PriceTag>
+ </div>
+ <div className="flex flex-col items-end">
+ <BottomInfo
+ data-visible={showMinimumMessage}
+ className="opacity-0 data-[visible=true]:opacity-100 transition-opacity mt-1"
+ >
+ The minimum is $100 per month for Remotion for Automators
+ </BottomInfo>
+ <BottomInfo
+ data-visible={showEnterpriseMessage}
+ className="opacity-0 data-[visible=true]:opacity-100 transition-opacity mt-1"
+ >
+ At this spend, you are eligible for the Enterprise License.
+ <br /> You can select it when setting up your license, or{' '}
+ <a
+ className="bluelink"
+ target="_blank"
+ href="https://www.remotion.pro/contact"
>
- At this spend, you are eligible for the Enterprise License.
- <br /> You can select it when setting up your license, or{' '}
- <a
- className="bluelink"
- target="_blank"
- href="https://www.remotion.pro/contact"
- >
- contact us
- </a>
- .
- </BottomInfo>
- </div>
+ contact us
+ </a>
+ .
+ </BottomInfo>
</div>
<div className={'flex flex-row justify-end mt-4'}>
<div
diff --git a/packages/promo-pages/src/components/homepage/InfoTooltip.tsx b/packages/promo-pages/src/components/homepage/InfoTooltip.tsx
deleted file mode 100644
index 6cc382504a..0000000000
--- a/packages/promo-pages/src/components/homepage/InfoTooltip.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import React, {useState} from 'react';
-
-interface InfoTooltipProps {
- readonly children: React.ReactNode;
-}
-
-export const InfoTooltip: React.FC<InfoTooltipProps> = ({children}) => {
- const [isVisible, setIsVisible] = useState(false);
-
- return (
- <span
- className="relative inline-block ml-1 text-gray-600 cursor-default"
- onPointerEnter={() => setIsVisible(true)}
- onMouseLeave={() => setIsVisible(false)}
- >
- <span className="font-bold" style={{fontSize: '1rem'}}>
- β“˜
- </span>
- {isVisible && (
- <span className="absolute bottom-full left-1/2 transform -translate-x-1/2 bg-gray-500 text-white p-2 rounded text-sm z-10 cursor-default font-normal w-[300px] inline-block text-wrap">
- {children}
- <span className="absolute top-full left-1/2 transform -translate-x-1/2 border-5 border-solid border-gray-500 border-t-transparent border-r-transparent border-b-transparent border-l-transparent cursor-default" />
- </span>
- )}
- </span>
- );
-};