Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/design`: Make Button polymorphic β€” render as `<a>` when `href` is passed

Jonny Burger85a48fca93d6
diff --git a/packages/convert/app/components/AlternativePickFileOptions.tsx b/packages/convert/app/components/AlternativePickFileOptions.tsx
index cda9036b2c..cb94b5f8e6 100644
--- a/packages/convert/app/components/AlternativePickFileOptions.tsx
+++ b/packages/convert/app/components/AlternativePickFileOptions.tsx
@@ -7,12 +7,12 @@ export const AlternativePickFileOptions: React.FC<{
}> = ({onSampleFile}) => {
return (
<div className="flex flex-row items-center justify-center gap-3">
- <a
- className="font-brand text-brand cursor cursor-pointer"
+ <Button
+ className="font-brand text-brand rounded-full text-sm h-10"
onClick={onSampleFile}
>
- <Button className="rounded-full text-sm h-10">Use a sample file</Button>
- </a>
+ Use a sample file
+ </Button>
<LoadFromUrl />
</div>
);
diff --git a/packages/convert/app/components/LoadFromUrl.tsx b/packages/convert/app/components/LoadFromUrl.tsx
index 22729d97cc..d5cd83f711 100644
--- a/packages/convert/app/components/LoadFromUrl.tsx
+++ b/packages/convert/app/components/LoadFromUrl.tsx
@@ -56,14 +56,12 @@ export const LoadFromUrl: React.FC = () => {
return (
<>
- <a
- className="font-brand text-brand cursor cursor-pointer"
+ <RemotionButton
+ className="font-brand text-brand rounded-full text-sm h-10"
onClick={onOpenUrl}
>
- <RemotionButton className="rounded-full text-sm h-10">
- Load from URL
- </RemotionButton>
- </a>
+ Load from URL
+ </RemotionButton>
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent>
<DialogHeader>
diff --git a/packages/convert/app/components/NewBackButton.tsx b/packages/convert/app/components/NewBackButton.tsx
index ec2e2b24af..24ed5b6650 100644
--- a/packages/convert/app/components/NewBackButton.tsx
+++ b/packages/convert/app/components/NewBackButton.tsx
@@ -7,16 +7,15 @@ export const NewBackButton: React.FC<{
readonly link: string;
}> = ({color, text, link}) => {
return (
- <a
- href={link}
- className="justify-center items-center font-medium no-underline mb-4 block"
+ <div
+ className="justify-center items-center font-medium mb-4 block"
style={{
fontFamily: 'GTPlanar',
fontWeight: 500,
color,
}}
>
- <Button className="px-4 rounded-full text-sm h-10">
+ <Button href={link} className="px-4 rounded-full text-sm h-10">
<div className="flex row items-center justify-start font-normal">
<svg
className="h-4 mr-[8px] inline-block"
@@ -32,6 +31,6 @@ export const NewBackButton: React.FC<{
{text}
</div>
</Button>
- </a>
+ </div>
);
};
diff --git a/packages/design/src/Button.tsx b/packages/design/src/Button.tsx
index cbaae86ae1..02c69ea690 100644
--- a/packages/design/src/Button.tsx
+++ b/packages/design/src/Button.tsx
@@ -4,12 +4,32 @@ import {useHoverTransforms} from './helpers/hover-transforms';
import {Outer} from './helpers/Outer';
import {Spinner} from './Spinner';
-export const Button: React.FC<
- React.ButtonHTMLAttributes<HTMLButtonElement> & {
- readonly depth?: number;
- readonly loading?: boolean;
- }
-> = ({children, className, disabled, depth, loading, ...buttonProps}) => {
+type CommonProps = {
+ readonly depth?: number;
+ readonly loading?: boolean;
+ readonly disabled?: boolean;
+};
+
+type ButtonAsButton = CommonProps &
+ Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'href' | 'disabled'> & {
+ readonly href?: undefined;
+ };
+
+type ButtonAsAnchor = CommonProps &
+ Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'type'> & {
+ readonly href: string;
+ };
+
+export type ButtonProps = ButtonAsButton | ButtonAsAnchor;
+
+export const Button: React.FC<ButtonProps> = ({
+ children,
+ className,
+ disabled,
+ depth,
+ loading,
+ ...rest
+}) => {
const [dimensions, setDimensions] = useState<{
width: number;
height: number;
@@ -74,37 +94,35 @@ export const Button: React.FC<
[],
);
- const content = (
- <button
- type="button"
- disabled={disabled || loading}
- className={cn(
- 'text-text',
- 'flex',
- 'justify-center',
- 'bg-button-bg',
- 'items-center',
- 'font-brand',
- 'border-solid',
- 'text-[1em]',
- 'rounded-lg',
- 'border-black',
- 'border-2',
- 'border-b-4',
- 'cursor-pointer',
- 'px-4',
- 'h-12',
- 'flex',
- 'flex-row',
- 'items-center',
- 'disabled:cursor-default',
- 'disabled:opacity-50',
- 'relative',
- 'overflow-hidden',
- className,
- )}
- {...buttonProps}
- >
+ const isDisabled = disabled || loading;
+
+ const sharedClasses = cn(
+ 'text-text',
+ 'flex',
+ 'justify-center',
+ 'bg-button-bg',
+ 'items-center',
+ 'font-brand',
+ 'border-solid',
+ 'text-[1em]',
+ 'rounded-lg',
+ 'border-black',
+ 'border-2',
+ 'border-b-4',
+ 'cursor-pointer',
+ 'px-4',
+ 'h-12',
+ 'flex',
+ 'flex-row',
+ 'items-center',
+ 'relative',
+ 'overflow-hidden',
+ isDisabled && 'cursor-default opacity-50',
+ className,
+ );
+
+ const innerContent = (
+ <>
<div className={cn(loading && 'invisible', 'inline-flex')}>
{children}
</div>
@@ -117,6 +135,35 @@ export const Button: React.FC<
<Spinner size={20} duration={1} />
</div>
) : null}
+ </>
+ );
+
+ const isAnchor = 'href' in rest && rest.href !== undefined;
+
+ const content = isAnchor ? (
+ <a
+ {...(rest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}
+ className={cn('no-underline text-inherit', sharedClasses)}
+ aria-disabled={isDisabled || undefined}
+ tabIndex={isDisabled ? -1 : undefined}
+ onClick={
+ isDisabled
+ ? (e: React.MouseEvent<HTMLAnchorElement>) => {
+ e.preventDefault();
+ }
+ : (rest as React.AnchorHTMLAttributes<HTMLAnchorElement>).onClick
+ }
+ >
+ {innerContent}
+ </a>
+ ) : (
+ <button
+ type="button"
+ disabled={isDisabled}
+ className={sharedClasses}
+ {...(rest as React.ButtonHTMLAttributes<HTMLButtonElement>)}
+ >
+ {innerContent}
</button>
);
diff --git a/packages/promo-pages/src/components/BackButton.tsx b/packages/promo-pages/src/components/BackButton.tsx
index b1cd9b7a29..432994cebf 100644
--- a/packages/promo-pages/src/components/BackButton.tsx
+++ b/packages/promo-pages/src/components/BackButton.tsx
@@ -7,16 +7,15 @@ export const BackButton: React.FC<{
readonly link: string;
}> = ({color, text, link}) => {
return (
- <a
- href={link}
- className="justify-center items-center font-medium no-underline mb-4 block"
+ <div
+ className="justify-center items-center font-medium mb-4 block"
style={{
fontFamily: 'GTPlanar',
fontWeight: 500,
color,
}}
>
- <Button className="px-4 rounded-full text-sm h-10">
+ <Button href={link} className="px-4 rounded-full text-sm h-10">
<div className="flex row items-center justify-center px-4">
<svg
className="h-4 mr-[15px] inline-block"
@@ -32,6 +31,6 @@ export const BackButton: React.FC<{
{text}
</div>
</Button>
- </a>
+ </div>
);
};
diff --git a/packages/promo-pages/src/components/design.tsx b/packages/promo-pages/src/components/design.tsx
index c4fcdd3048..52197627d8 100644
--- a/packages/promo-pages/src/components/design.tsx
+++ b/packages/promo-pages/src/components/design.tsx
@@ -140,6 +140,21 @@ export const DesignPage: React.FC = () => {
</svg>
</Button>
<div className="h-8" />
+ <Explainer>Link button</Explainer>
+ <Button href="/design">Link button</Button>
+ <br />
+ <Explainer>
+ Link button with <code>&lt;span&gt;</code>
+ </Explainer>
+ <Button href="/design">
+ <span>Link button with span child</span>
+ </Button>
+ <br />
+ <Explainer>External link button</Explainer>
+ <Button href="https://github.com/remotion-dev/remotion" target="_blank">
+ GitHub
+ </Button>
+ <div className="h-8" />
<Explainer>Remove (small)</Explainer>
<Button
className="hover:text-white hover:bg-warn transition-colors w-6 h-6 p-0 rounded-full"
diff --git a/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx b/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx
index ecaed76164..3ab7827fc4 100644
--- a/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx
+++ b/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx
@@ -35,47 +35,49 @@ export const GetStarted: React.FC = () => {
</div>
</div>
<div style={{width: 10, height: 10}} />
- <a className={'no-underline w-full lg:w-auto'} href="/docs">
- <Button className="w-full">Docs</Button>
- </a>
+ <div className="w-full lg:w-auto">
+ <Button href="/docs" className="w-full">
+ Docs
+ </Button>
+ </div>
<div className="w-2 h-2" />
- <a
- className="no-underline w-full lg:w-auto"
- href="https://remotion.dev/discord"
- target="_blank"
- >
- <Button className="w-full">Discord</Button>
- </a>
+ <div className="w-full lg:w-auto">
+ <Button
+ href="https://remotion.dev/discord"
+ target="_blank"
+ className="w-full"
+ >
+ Discord
+ </Button>
+ </div>
<div className="w-2 h-2" />
- <a
- className="no-underline w-full lg:w-auto"
- href="https://github.com/remotion-dev/remotion"
- target="_blank"
- >
- <Button className="w-full">
+ <div className="w-full lg:w-auto">
+ <Button
+ href="https://github.com/remotion-dev/remotion"
+ target="_blank"
+ className="w-full"
+ >
<GithubButton />
</Button>
- </a>{' '}
+ </div>{' '}
<div className="w-2 h-2" />
<div className="w-full lg:w-auto">
- <a className={'no-underline w-full block'} href="/prompts">
- <Button className="w-full">
- <svg
- width="20"
- height="20"
- viewBox="0 0 149 149"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- style={{marginRight: 8}}
- >
- <path
- d="M29.05 98.54L58.19 82.19L58.68 80.77L58.19 79.98H56.77L51.9 79.68L35.25 79.23L20.81 78.63L6.82 77.88L3.3 77.13L0 72.78L0.340004 70.61L3.3 68.62L7.54 68.99L16.91 69.63L30.97 70.6L41.17 71.2L56.28 72.77H58.68L59.02 71.8L58.2 71.2L57.56 70.6L43.01 60.74L27.26 50.32L19.01 44.32L14.55 41.28L12.3 38.43L11.33 32.21L15.38 27.75L20.82 28.12L22.21 28.49L27.72 32.73L39.49 41.84L54.86 53.16L57.11 55.03L58.01 54.39L58.12 53.94L57.11 52.25L48.75 37.14L39.83 21.77L35.86 15.4L34.81 11.58C34.44 10.01 34.17 8.69 34.17 7.08L38.78 0.820007L41.33 0L47.48 0.820007L50.07 3.07001L53.89 11.81L60.08 25.57L69.68 44.28L72.49 49.83L73.99 54.97L74.55 56.54H75.52V55.64L76.31 45.1L77.77 32.16L79.19 15.51L79.68 10.82L82 5.2L86.61 2.16L90.21 3.88L93.17 8.12L92.76 10.86L91 22.3L87.55 40.22L85.3 52.22H86.61L88.11 50.72L94.18 42.66L104.38 29.91L108.88 24.85L114.13 19.26L117.5 16.6H123.87L128.56 23.57L126.46 30.77L119.9 39.09L114.46 46.14L106.66 56.64L101.79 65.04L102.24 65.71L103.4 65.6L121.02 61.85L130.54 60.13L141.9 58.18L147.04 60.58L147.6 63.02L145.58 68.01L133.43 71.01L119.18 73.86L97.96 78.88L97.7 79.07L98 79.44L107.56 80.34L111.65 80.56H121.66L140.3 81.95L145.17 85.17L148.09 89.11L147.6 92.11L140.1 95.93L129.98 93.53L106.36 87.91L98.26 85.89H97.14V86.56L103.89 93.16L116.26 104.33L131.75 118.73L132.54 122.29L130.55 125.1L128.45 124.8L114.84 114.56L109.59 109.95L97.7 99.94H96.91V100.99L99.65 105L114.12 126.75L114.87 133.42L113.82 135.59L110.07 136.9L105.95 136.15L97.48 124.26L88.74 110.87L81.69 98.87L80.83 99.36L76.67 144.17L74.72 146.46L70.22 148.18L66.47 145.33L64.48 140.72L66.47 131.61L68.87 119.72L70.82 110.27L72.58 98.53L73.63 94.63L73.56 94.37L72.7 94.48L63.85 106.63L50.39 124.82L39.74 136.22L37.19 137.23L32.77 134.94L33.18 130.85L35.65 127.21L50.39 108.46L59.28 96.84L65.02 90.13L64.98 89.16H64.64L25.49 114.58L18.52 115.48L15.52 112.67L15.89 108.06L17.31 106.56L29.08 98.46L29.04 98.5L29.05 98.54Z"
- fill="#D97757"
- />
- </svg>
- Prompt a video
- </Button>
- </a>
+ <Button href="/prompts" className="w-full">
+ <svg
+ width="20"
+ height="20"
+ viewBox="0 0 149 149"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ style={{marginRight: 8}}
+ >
+ <path
+ d="M29.05 98.54L58.19 82.19L58.68 80.77L58.19 79.98H56.77L51.9 79.68L35.25 79.23L20.81 78.63L6.82 77.88L3.3 77.13L0 72.78L0.340004 70.61L3.3 68.62L7.54 68.99L16.91 69.63L30.97 70.6L41.17 71.2L56.28 72.77H58.68L59.02 71.8L58.2 71.2L57.56 70.6L43.01 60.74L27.26 50.32L19.01 44.32L14.55 41.28L12.3 38.43L11.33 32.21L15.38 27.75L20.82 28.12L22.21 28.49L27.72 32.73L39.49 41.84L54.86 53.16L57.11 55.03L58.01 54.39L58.12 53.94L57.11 52.25L48.75 37.14L39.83 21.77L35.86 15.4L34.81 11.58C34.44 10.01 34.17 8.69 34.17 7.08L38.78 0.820007L41.33 0L47.48 0.820007L50.07 3.07001L53.89 11.81L60.08 25.57L69.68 44.28L72.49 49.83L73.99 54.97L74.55 56.54H75.52V55.64L76.31 45.1L77.77 32.16L79.19 15.51L79.68 10.82L82 5.2L86.61 2.16L90.21 3.88L93.17 8.12L92.76 10.86L91 22.3L87.55 40.22L85.3 52.22H86.61L88.11 50.72L94.18 42.66L104.38 29.91L108.88 24.85L114.13 19.26L117.5 16.6H123.87L128.56 23.57L126.46 30.77L119.9 39.09L114.46 46.14L106.66 56.64L101.79 65.04L102.24 65.71L103.4 65.6L121.02 61.85L130.54 60.13L141.9 58.18L147.04 60.58L147.6 63.02L145.58 68.01L133.43 71.01L119.18 73.86L97.96 78.88L97.7 79.07L98 79.44L107.56 80.34L111.65 80.56H121.66L140.3 81.95L145.17 85.17L148.09 89.11L147.6 92.11L140.1 95.93L129.98 93.53L106.36 87.91L98.26 85.89H97.14V86.56L103.89 93.16L116.26 104.33L131.75 118.73L132.54 122.29L130.55 125.1L128.45 124.8L114.84 114.56L109.59 109.95L97.7 99.94H96.91V100.99L99.65 105L114.12 126.75L114.87 133.42L113.82 135.59L110.07 136.9L105.95 136.15L97.48 124.26L88.74 110.87L81.69 98.87L80.83 99.36L76.67 144.17L74.72 146.46L70.22 148.18L66.47 145.33L64.48 140.72L66.47 131.61L68.87 119.72L70.82 110.27L72.58 98.53L73.63 94.63L73.56 94.37L72.7 94.48L63.85 106.63L50.39 124.82L39.74 136.22L37.19 137.23L32.77 134.94L33.18 130.85L35.65 127.21L50.39 108.46L59.28 96.84L65.02 90.13L64.98 89.16H64.64L25.49 114.58L18.52 115.48L15.52 112.67L15.89 108.06L17.31 106.56L29.08 98.46L29.04 98.5L29.05 98.54Z"
+ fill="#D97757"
+ />
+ </svg>
+ Prompt a video
+ </Button>
</div>
</div>
);
diff --git a/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsx b/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsx
index 997f691e9f..f1d771b4a6 100644
--- a/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsx
+++ b/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsx
@@ -11,20 +11,21 @@ export const MoreTemplatesButton: React.FC = () => {
const mobileLayout = useMobileLayout();
return (
- <a href="/templates" className="no-underline text-inherit">
- <Button className="right-0 border-2 rounded-full text-inherit px-4 py-2 fontbrand font-semibold text-sm flex flex-row items-center h-10">
- {mobileLayout ? 'Templates' : 'Find a template'}
- <svg
- style={icon}
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 448 512"
- >
- <path
- fill="currentColor"
- d="M438.6 278.6l-160 160C272.4 444.9 264.2 448 256 448s-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L338.8 288H32C14.33 288 .0016 273.7 .0016 256S14.33 224 32 224h306.8l-105.4-105.4c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160C451.1 245.9 451.1 266.1 438.6 278.6z"
- />
- </svg>
- </Button>
- </a>
+ <Button
+ href="/templates"
+ className="right-0 border-2 rounded-full text-inherit px-4 py-2 fontbrand font-semibold text-sm flex flex-row items-center h-10"
+ >
+ {mobileLayout ? 'Templates' : 'Find a template'}
+ <svg
+ style={icon}
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 448 512"
+ >
+ <path
+ fill="currentColor"
+ d="M438.6 278.6l-160 160C272.4 444.9 264.2 448 256 448s-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L338.8 288H32C14.33 288 .0016 273.7 .0016 256S14.33 224 32 224h306.8l-105.4-105.4c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160C451.1 245.9 451.1 266.1 438.6 278.6z"
+ />
+ </svg>
+ </Button>
);
};
diff --git a/packages/promo-pages/src/components/prompts/NewBackButton.tsx b/packages/promo-pages/src/components/prompts/NewBackButton.tsx
index 77881ddca3..405244df74 100644
--- a/packages/promo-pages/src/components/prompts/NewBackButton.tsx
+++ b/packages/promo-pages/src/components/prompts/NewBackButton.tsx
@@ -6,15 +6,14 @@ export const NewBackButton: React.FC<{
readonly link: string;
}> = ({text, link}) => {
return (
- <a
- href={link}
- className="justify-center items-center font-medium no-underline mb-4 block text-text"
+ <div
+ className="justify-center items-center font-medium mb-4 block text-text"
style={{
fontFamily: 'GTPlanar',
fontWeight: 500,
}}
>
- <Button className="px-8 rounded-full text-sm h-10">
+ <Button href={link} className="px-8 rounded-full text-sm h-10">
<div className="flex row items-center justify-start font-normal">
<svg
className="h-4 mr-[8px] inline-block text-text"
@@ -29,6 +28,6 @@ export const NewBackButton: React.FC<{
{text}
</div>
</Button>
- </a>
+ </div>
);
};
diff --git a/packages/promo-pages/src/components/prompts/PromptsGallery.tsx b/packages/promo-pages/src/components/prompts/PromptsGallery.tsx
index 5e81a9392d..19d7058fb9 100644
--- a/packages/promo-pages/src/components/prompts/PromptsGallery.tsx
+++ b/packages/promo-pages/src/components/prompts/PromptsGallery.tsx
@@ -199,32 +199,31 @@ export const PromptsGalleryPage: React.FC<{
</p>
</div>
<div className="flex items-center gap-2">
- <a
+ <Button
href="/docs/ai/claude-code"
- className="flex items-center no-underline hover:no-underline"
+ className="font-brand rounded-full bg-[#D97757] flex items-center text-white"
>
- <Button className="font-brand rounded-full bg-[#D97757] flex items-center text-white">
- <svg
- width="20"
- height="20"
- viewBox="0 0 149 149"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- style={{marginRight: 8}}
- >
- <path
- d="M29.05 98.54L58.19 82.19L58.68 80.77L58.19 79.98H56.77L51.9 79.68L35.25 79.23L20.81 78.63L6.82 77.88L3.3 77.13L0 72.78L0.340004 70.61L3.3 68.62L7.54 68.99L16.91 69.63L30.97 70.6L41.17 71.2L56.28 72.77H58.68L59.02 71.8L58.2 71.2L57.56 70.6L43.01 60.74L27.26 50.32L19.01 44.32L14.55 41.28L12.3 38.43L11.33 32.21L15.38 27.75L20.82 28.12L22.21 28.49L27.72 32.73L39.49 41.84L54.86 53.16L57.11 55.03L58.01 54.39L58.12 53.94L57.11 52.25L48.75 37.14L39.83 21.77L35.86 15.4L34.81 11.58C34.44 10.01 34.17 8.69 34.17 7.08L38.78 0.820007L41.33 0L47.48 0.820007L50.07 3.07001L53.89 11.81L60.08 25.57L69.68 44.28L72.49 49.83L73.99 54.97L74.55 56.54H75.52V55.64L76.31 45.1L77.77 32.16L79.19 15.51L79.68 10.82L82 5.2L86.61 2.16L90.21 3.88L93.17 8.12L92.76 10.86L91 22.3L87.55 40.22L85.3 52.22H86.61L88.11 50.72L94.18 42.66L104.38 29.91L108.88 24.85L114.13 19.26L117.5 16.6H123.87L128.56 23.57L126.46 30.77L119.9 39.09L114.46 46.14L106.66 56.64L101.79 65.04L102.24 65.71L103.4 65.6L121.02 61.85L130.54 60.13L141.9 58.18L147.04 60.58L147.6 63.02L145.58 68.01L133.43 71.01L119.18 73.86L97.96 78.88L97.7 79.07L98 79.44L107.56 80.34L111.65 80.56H121.66L140.3 81.95L145.17 85.17L148.09 89.11L147.6 92.11L140.1 95.93L129.98 93.53L106.36 87.91L98.26 85.89H97.14V86.56L103.89 93.16L116.26 104.33L131.75 118.73L132.54 122.29L130.55 125.1L128.45 124.8L114.84 114.56L109.59 109.95L97.7 99.94H96.91V100.99L99.65 105L114.12 126.75L114.87 133.42L113.82 135.59L110.07 136.9L105.95 136.15L97.48 124.26L88.74 110.87L81.69 98.87L80.83 99.36L76.67 144.17L74.72 146.46L70.22 148.18L66.47 145.33L64.48 140.72L66.47 131.61L68.87 119.72L70.82 110.27L72.58 98.53L73.63 94.63L73.56 94.37L72.7 94.48L63.85 106.63L50.39 124.82L39.74 136.22L37.19 137.23L32.77 134.94L33.18 130.85L35.65 127.21L50.39 108.46L59.28 96.84L65.02 90.13L64.98 89.16H64.64L25.49 114.58L18.52 115.48L15.52 112.67L15.89 108.06L17.31 106.56L29.08 98.46L29.04 98.5L29.05 98.54Z"
- fill="#fff"
- />
- </svg>
- <div className="text-sm">Create your own video</div>
- </Button>
- </a>
- <a href="/prompts/submit" className="no-underline hover:no-underline">
- <Button className="font-brand rounded-full text-sm">
- Submit a prompt
- </Button>
- </a>
+ <svg
+ width="20"
+ height="20"
+ viewBox="0 0 149 149"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ style={{marginRight: 8}}
+ >
+ <path
+ d="M29.05 98.54L58.19 82.19L58.68 80.77L58.19 79.98H56.77L51.9 79.68L35.25 79.23L20.81 78.63L6.82 77.88L3.3 77.13L0 72.78L0.340004 70.61L3.3 68.62L7.54 68.99L16.91 69.63L30.97 70.6L41.17 71.2L56.28 72.77H58.68L59.02 71.8L58.2 71.2L57.56 70.6L43.01 60.74L27.26 50.32L19.01 44.32L14.55 41.28L12.3 38.43L11.33 32.21L15.38 27.75L20.82 28.12L22.21 28.49L27.72 32.73L39.49 41.84L54.86 53.16L57.11 55.03L58.01 54.39L58.12 53.94L57.11 52.25L48.75 37.14L39.83 21.77L35.86 15.4L34.81 11.58C34.44 10.01 34.17 8.69 34.17 7.08L38.78 0.820007L41.33 0L47.48 0.820007L50.07 3.07001L53.89 11.81L60.08 25.57L69.68 44.28L72.49 49.83L73.99 54.97L74.55 56.54H75.52V55.64L76.31 45.1L77.77 32.16L79.19 15.51L79.68 10.82L82 5.2L86.61 2.16L90.21 3.88L93.17 8.12L92.76 10.86L91 22.3L87.55 40.22L85.3 52.22H86.61L88.11 50.72L94.18 42.66L104.38 29.91L108.88 24.85L114.13 19.26L117.5 16.6H123.87L128.56 23.57L126.46 30.77L119.9 39.09L114.46 46.14L106.66 56.64L101.79 65.04L102.24 65.71L103.4 65.6L121.02 61.85L130.54 60.13L141.9 58.18L147.04 60.58L147.6 63.02L145.58 68.01L133.43 71.01L119.18 73.86L97.96 78.88L97.7 79.07L98 79.44L107.56 80.34L111.65 80.56H121.66L140.3 81.95L145.17 85.17L148.09 89.11L147.6 92.11L140.1 95.93L129.98 93.53L106.36 87.91L98.26 85.89H97.14V86.56L103.89 93.16L116.26 104.33L131.75 118.73L132.54 122.29L130.55 125.1L128.45 124.8L114.84 114.56L109.59 109.95L97.7 99.94H96.91V100.99L99.65 105L114.12 126.75L114.87 133.42L113.82 135.59L110.07 136.9L105.95 136.15L97.48 124.26L88.74 110.87L81.69 98.87L80.83 99.36L76.67 144.17L74.72 146.46L70.22 148.18L66.47 145.33L64.48 140.72L66.47 131.61L68.87 119.72L70.82 110.27L72.58 98.53L73.63 94.63L73.56 94.37L72.7 94.48L63.85 106.63L50.39 124.82L39.74 136.22L37.19 137.23L32.77 134.94L33.18 130.85L35.65 127.21L50.39 108.46L59.28 96.84L65.02 90.13L64.98 89.16H64.64L25.49 114.58L18.52 115.48L15.52 112.67L15.89 108.06L17.31 106.56L29.08 98.46L29.04 98.5L29.05 98.54Z"
+ fill="#fff"
+ />
+ </svg>
+ <div className="text-sm">Create your own video</div>
+ </Button>
+ <Button
+ href="/prompts/submit"
+ className="font-brand rounded-full text-sm"
+ >
+ Submit a prompt
+ </Button>
</div>
<div className="h-12" />
diff --git a/packages/promo-pages/src/components/templates.tsx b/packages/promo-pages/src/components/templates.tsx
index 6449e614b2..1ab3559774 100644
--- a/packages/promo-pages/src/components/templates.tsx
+++ b/packages/promo-pages/src/components/templates.tsx
@@ -48,23 +48,19 @@ export const Templates: React.FC = () => {
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-[15px]">
{CreateVideoInternals.FEATURED_TEMPLATES.map((template) => {
return (
- <a
+ <Button
key={template.cliId}
href={`/templates/${template.cliId}`}
- className="no-underline"
+ depth={0.5}
+ className="justify-start text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] h-full w-full items-start"
>
- <Button
- depth={0.5}
- className="justify-start text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] no-underline h-full w-full items-start"
+ <Item
+ label={template.homePageLabel}
+ description={template.description}
>
- <Item
- label={template.homePageLabel}
- description={template.description}
- >
- <IconForTemplate scale={0.7} template={template} />
- </Item>
- </Button>
- </a>
+ <IconForTemplate scale={0.7} template={template} />
+ </Item>
+ </Button>
);
})}
</div>
@@ -72,74 +68,59 @@ export const Templates: React.FC = () => {
<br />
<h3>Paid templates</h3>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-[15px]">
- <a
- key={'editor-starter'}
- className="no-underline"
- href={`https://www.remotion.pro/editor-starter`}
+ <Button
+ href="https://www.remotion.pro/editor-starter"
+ depth={0.5}
+ className="text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] h-full w-full items-start"
>
- <Button
- depth={0.5}
- className="text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] no-underline h-full w-full items-start"
+ <Item
+ label={'Editor Starter'}
+ description={'A boilerplate for starting your own video editor'}
>
- <Item
- label={'Editor Starter'}
- description={'A boilerplate for starting your own video editor'}
- >
- <EditorIcon
- style={{
- height: 0.7 * 32,
- overflow: 'visible',
- }}
- />
- </Item>
- </Button>
- </a>
+ <EditorIcon
+ style={{
+ height: 0.7 * 32,
+ overflow: 'visible',
+ }}
+ />
+ </Item>
+ </Button>
- <a
- key={'watercolor-map'}
- className="no-underline"
- href={`https://www.remotion.pro/watercolor-map`}
+ <Button
+ href="https://www.remotion.pro/watercolor-map"
+ depth={0.5}
+ className="text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] h-full w-full items-start"
>
- <Button
- depth={0.5}
- className="text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] no-underline h-full w-full items-start"
+ <Item
+ label={'Watercolor Map'}
+ description={'A beautiful 2D map for travel videos'}
>
- <Item
- label={'Watercolor Map'}
- description={'A beautiful 2D map for travel videos'}
- >
- <SkiaIcon
- style={{
- height: 0.7 * 32,
- overflow: 'visible',
- }}
- />
- </Item>
- </Button>
- </a>
- <a
- key={'timeline'}
- className="no-underline"
- href={`https://www.remotion.pro/timeline`}
+ <SkiaIcon
+ style={{
+ height: 0.7 * 32,
+ overflow: 'visible',
+ }}
+ />
+ </Item>
+ </Button>
+ <Button
+ href="https://www.remotion.pro/timeline"
+ depth={0.5}
+ className="text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] h-full w-full items-start"
>
- <Button
- depth={0.5}
- className="text-left p-3.5 flex flex-col relative cursor-pointer text-[var(--text-color)] no-underline h-full w-full items-start"
+ <Item
+ label={'<Timeline />'}
+ description={
+ 'A copy pasteable component for timeline-based editing'
+ }
>
- <Item
- label={'<Timeline />'}
- description={
- 'A copy pasteable component for timeline-based editing'
- }
- >
- <TimelineIcon
- style={{
- height: 0.7 * 32,
- }}
- />
- </Item>
- </Button>
- </a>
+ <TimelineIcon
+ style={{
+ height: 0.7 * 32,
+ }}
+ />
+ </Item>
+ </Button>
</div>
<br />