<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Remotion | Make videos programmatically Blog</title>
        <link>https://www.remotion.dev/learn</link>
        <description>Remotion | Make videos programmatically Blog</description>
        <lastBuildDate>Thu, 22 Dec 2022 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Recreating the Apple fireworks animation]]></title>
            <link>https://www.remotion.dev/learn/apple-wow</link>
            <guid>https://www.remotion.dev/learn/apple-wow</guid>
            <pubDate>Thu, 22 Dec 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[Learn how to create an animation that Apple has on its website during the holiday season with this beginner-friendly Remotion tutorial!]]></description>
            <content:encoded><![CDATA[<span data-raw-markdown="---%0Aslug%3A%20apple-wow%0Atitle%3A%20Recreating%20the%20Apple%20fireworks%20animation%0Aauthors%3A%0A%20%20-%20name%3A%20Mehmet%20Ademi%0A%20%20%20%20title%3A%20Business%20Developer%0A%20%20%20%20url%3A%20https%3A%2F%2Fgithub.com%2FMehmetAdemi%0A%20%20%20%20image_url%3A%20%2Fimg%2Fteam%2Fmehmet.png%0A%20%20-%20name%3A%20Jonny%20Burger%0A%20%20%20%20title%3A%20Chief%20Hacker%0A%20%20%20%20url%3A%20https%3A%2F%2Fgithub.com%2FJonnyBurger%0A%20%20%20%20image_url%3A%20%2Fimg%2Fteam%2Fjonny.png%0A---%0A%0Aimport%20Tabs%20from%20'%40theme%2FTabs'%3B%0Aimport%20TabItem%20from%20'%40theme%2FTabItem'%3B%0Aimport%20%7BAppleFireworksTutorial%7D%20from%20'..%2Fsrc%2Fcomponents%2Ftutorials'%3B%0A%0ALearn%20how%20to%20create%20an%20animation%20that%20Apple%20has%20on%20its%20website%20during%20the%20holiday%20season%20with%20this%20beginner-friendly%20Remotion%20tutorial!%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FFinal.gif%22%20%2F%3E%0A%0A%23%23%20Video%20version%0A%0AThis%20tutorial%20is%20also%20available%20as%20a%20video%20version%3A%0A%0A%3CAppleFireworksTutorial%20%2F%3E%0A%0A%23%23%20Source%20code%0A%0A%5BGitHub%5D(https%3A%2F%2Fgithub.com%2Fremotion-dev%2Fapple-wow-tutorial)%0A%0A%23%23%20Getting%20started%0A%0AStart%20a%20new%20Remotion%20project%20and%20select%20the%20blank%20template%3A%0A%0A%3CTabs%0AdefaultValue%3D%22npm%22%0Avalues%3D%7B%5B%0A%7B%20label%3A%20'npm'%2C%20value%3A%20'npm'%2C%20%7D%2C%0A%7B%20label%3A%20'yarn'%2C%20value%3A%20'yarn'%2C%20%7D%2C%0A%7B%20label%3A%20'pnpm'%2C%20value%3A%20'pnpm'%2C%20%7D%2C%0A%5D%0A%7D%3E%0A%3CTabItem%20value%3D%22npm%22%3E%0A%0A%60%60%60bash%0Anpm%20init%20video%20--blank%0A%60%60%60%0A%0A%20%20%3C%2FTabItem%3E%0A%20%20%3CTabItem%20value%3D%22pnpm%22%3E%0A%0A%60%60%60bash%0Apnpm%20create%20video%20--blank%0A%60%60%60%0A%0A%20%20%3C%2FTabItem%3E%0A%0A%20%20%3CTabItem%20value%3D%22yarn%22%3E%0A%0A%60%60%60bash%0Ayarn%20create%20video%20--blank%0A%60%60%60%0A%0A%20%20%3C%2FTabItem%3E%0A%3C%2FTabs%3E%0A%0A%23%23%20Composition%20setup%0A%0AA%20%5B%60%3CComposition%3E%60%5D(https%3A%2F%2Fwww.remotion.dev%2Fdocs%2Fterminology%2Fcomposition)%20defines%20the%20dimensions%20and%20duration%20of%20the%20video.%20In%20the%20%60src%2FRoot.tsx%60%20file%2C%20adjust%20the%20width%20and%20height%20to%20the%20following%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FRoot.tsx%22%0Aimport%20%7BComposition%7D%20from%20'remotion'%3B%0Aexport%20const%20MyComposition%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20---cut---%0Aexport%20const%20RemotionRoot%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3C%3E%0A%20%20%20%20%20%20%3CComposition%20id%3D%22MyComp%22%20component%3D%7BMyComposition%7D%20durationInFrames%3D%7B150%7D%20fps%3D%7B30%7D%20width%3D%7B1920%7D%20height%3D%7B1080%7D%20%2F%3E%0A%20%20%20%20%3C%2F%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0A%23%23%20Create%20a%20background%0A%0ACreate%20a%20new%20file%20%60src%2FBackground.tsx%60%20and%20return%20a%20background%20with%20linear%20gradient%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FBackground.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Background%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20background%3A%20'linear-gradient(to%20bottom%2C%20%23000021%2C%20%23010024)'%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%2F%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AAdd%20the%20created%20background%20to%20the%20%60%3CMyComposition%2F%3E%60%20component%2C%20which%20can%20be%20found%20in%20the%20file%20%60src%2FComposition.tsx%60.%20This%20file%20will%20contain%20all%20the%20components%20that%20you%20create%20in%20this%20tutorial.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Composition.tsx%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AThis%20results%20in%20the%20following%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FBackground.png%22%20%2F%3E%0A%0A%23%23%20Render%20a%20dot%0A%0ARender%20a%20white%20dot%20by%20creating%20a%20new%20file%20%60src%2FDot.tsx%60%20and%20return%20a%20centered%20circle.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FDot.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Dot%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20justifyContent%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20alignItems%3A%20'center'%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%3Cdiv%0A%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20height%3A%2014%2C%0A%20%20%20%20%20%20%20%20%20%20width%3A%2014%2C%0A%20%20%20%20%20%20%20%20%20%20borderRadius%3A%2014%20%2F%202%2C%0A%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'%23ccc'%2C%0A%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%2F%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AAdd%20the%20%60%3CDot%3E%60%20in%20your%20main%20composition%20%60src%2FComposition.tsx%60%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Composition.tsx%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDot%7D%20from%20'.%2FDot'%3B%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CDot%20%2F%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0ANow%20we%20got%20a%20white%20dot%20on%20top%20of%20our%20background%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FDot.png%22%20%2F%3E%0A%0A%23%23%20Animate%20the%20dot%0A%0ALet's%20apply%20some%20animation%20to%20the%20white%20dot%20we%20created%20above.%20We%20create%20another%20component%20called%20%60%3CShrinking%3E%60%20in%20a%20new%20file%20%60src%2FShrinking.tsx%60%2C%20which%20then%20wraps%20the%20dot%20in%20the%20main%20composition%20%60src%2FComposition.tsx%60.%0A%0A%60%60%60tsx%20title%3D%22src%2FShrinking.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%2C%20interpolate%2C%20useCurrentFrame%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bchildren%7D)%20%3D%3E%20%7B%0A%20%20const%20frame%20%3D%20useCurrentFrame()%3B%0A%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20scale%3A%20String(%0A%20%20%20%20%20%20%20%20%20%20interpolate(frame%2C%20%5B60%2C%2090%5D%2C%20%5B1%2C%200%5D%2C%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20extrapolateLeft%3A%20'clamp'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20extrapolateRight%3A%20'clamp'%2C%0A%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%7Bchildren%7D%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AAdd%20the%20%60%3CShrinking%3E%60%20component%20in%20your%20main%20composition%20%60src%2FComposition.tsx%60%3A%0A%0A%60%60%60tsx%20twoslash%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Composition.tsx%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDot%7D%20from%20'.%2FDot'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0A%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%3CDot%20%2F%3E%0A%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0ANow%2C%20you%20have%20some%20action%20to%20show.%20By%20using%20%60%3CShrinking%3E%60%20in%20your%20main%20composition%20you%20have%20created%20a%20scale%20out%20effect%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FShrinking.gif%22%20%2F%3E%0A%0A%23%23%20Move%20the%20dot%0A%0ANext%2C%20create%20a%20component%20called%20%60%3CMove%3E%60.%20This%20component%20has%20a%20spring%20animation%2C%20which%20by%20default%20goes%20from%20zero%20to%20one%2C%20and%20has%20a%20duration%20of%20four%20seconds%20(%60durationInFrames%3A%20120%60)%20in%20the%20code%20snippet%20below%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FMove.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%2C%20interpolate%2C%20spring%2C%20useCurrentFrame%2C%20useVideoConfig%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bchildren%7D)%20%3D%3E%20%7B%0A%20%20const%20%7Bfps%7D%20%3D%20useVideoConfig()%3B%0A%20%20const%20frame%20%3D%20useCurrentFrame()%3B%0A%0A%20%20const%20down%20%3D%20spring(%7B%0A%20%20%20%20fps%2C%0A%20%20%20%20frame%2C%0A%20%20%20%20config%3A%20%7B%0A%20%20%20%20%20%20damping%3A%20200%2C%0A%20%20%20%20%7D%2C%0A%20%20%20%20durationInFrames%3A%20120%2C%0A%20%20%7D)%3B%0A%0A%20%20const%20y%20%3D%20interpolate(down%2C%20%5B0%2C%201%5D%2C%20%5B0%2C%20-400%5D)%3B%0A%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20translate%3A%20%600%20%24%7By%7Dpx%60%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%7Bchildren%7D%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AAdd%20the%20%60%3CMove%3E%60%20component%20to%20your%20composition%20%60src%2FComposition.tsx%60.%20You%20get%20a%20nice%20animation%20by%20combining%20the%20effect%20of%20moving%20and%20shrinking%20by%20surrounding%20the%20shrinking%20dot%20in%20the%20%60%3CMove%3E%60%20component%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bchildren%7D)%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Composition.tsx%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDot%7D%20from%20'.%2FDot'%3B%0Aimport%20%7BMove%7D%20from%20'.%2FMove'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0A%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CMove%3E%0A%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%3CDot%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%3C%2FMove%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AAnd%20up%20goes%20the%20dot%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FMove.gif%22%20%2F%3E%0A%0A%23%23%20Duplicate%20the%20moving%20dot%0A%0AHere%20it%20gets%20a%20little%20bit%20trickier%2C%20but%20the%20following%20steps%20are%20going%20to%20make%20your%20animation%20a%20lot%20more%20entertaining.%20First%2C%20you%20add%20a%20%60delay%60%20prop%20into%20the%20%60%3CMove%3E%60%20component%20and%20then%20change%20the%20%60frame%60%20parameter%20of%20your%20%60spring()%60%20function.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FMove.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%2C%20interpolate%2C%20spring%2C%20useCurrentFrame%2C%20useVideoConfig%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20(%7Bchildren%2C%20delay%7D)%20%3D%3E%20%7B%0A%20%20const%20%7Bfps%7D%20%3D%20useVideoConfig()%3B%0A%20%20const%20frame%20%3D%20useCurrentFrame()%3B%0A%0A%20%20const%20down%20%3D%20spring(%7B%0A%20%20%20%20fps%2C%0A%20%20%20%20frame%3A%20frame%20-%20delay%2C%0A%20%20%20%20config%3A%20%7B%0A%20%20%20%20%20%20damping%3A%20200%2C%0A%20%20%20%20%7D%2C%0A%20%20%20%20durationInFrames%3A%20120%2C%0A%20%20%7D)%3B%0A%0A%20%20const%20y%20%3D%20interpolate(down%2C%20%5B0%2C%201%5D%2C%20%5B0%2C%20-400%5D)%3B%0A%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20translate%3A%20%600%20%24%7By%7Dpx%60%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%7Bchildren%7D%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0ANow%2C%20let's%20create%20a%20%60%3CTrail%3E%60%20component.%20It%20takes%20some%20React%20children%20and%20duplicates%20them.%20The%20component%20adds%20a%20delay%20to%20each%20subsequent%20dot%20so%20they%20don't%20start%20all%20at%20once.%20Each%20dot%20will%20have%20a%20scale%20applied%20to%20it%2C%20so%20that%20each%20dot%20is%20smaller%20than%20the%20previous%20one.%0A%0APut%20the%20previously%20created%20%60%3CMove%3E%60%20component%20within%20the%20%60%3CTrail%3E%60%20component.%0AThe%20order%20is%20crucial%20here.%20Things%20are%20done%20from%20inside%20out%3A%0A%0A1.%20Apply%20a%20scale%20so%20that%20the%20dots%20become%20smaller%20over%20time.%0A2.%20Apply%20the%20move%20animation.%0A3.%20Apply%20a%20delay%20between%20the%20animation%20start%20of%20each%20dot%20by%20using%20Remotion's%20%60%3CSequence%3E%60%20component.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FTrail.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Trail.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%2C%20Sequence%7D%20from%20'remotion'%3B%0Aimport%20%7BMove%7D%20from%20'.%2FMove'%3B%0A%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20amount%3A%20number%3B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bamount%2C%20children%7D)%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%7Bnew%20Array(amount).fill(true).map((a%2C%20i)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%3CSequence%20from%3D%7Bi%20*%203%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CMove%20delay%3D%7B0%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20scale%3A%20String(1%20-%20i%20%2F%20amount)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bchildren%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FMove%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FSequence%3E%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D)%7D%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AIn%20your%20main%20component%2C%20you%20now%20replace%20the%20%60%3CMove%3E%60%20component%20with%20the%20%60%3CTrail%3E%60%20component%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Trail.tsx%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20amount%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Composition.tsx%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDot%7D%20from%20'.%2FDot'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0Aimport%20%7BTrail%7D%20from%20'.%2FTrail'%3B%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CTrail%20amount%3D%7B4%7D%3E%0A%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%3CDot%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%3C%2FTrail%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AAnd%20this%20is%20how%20your%20animation%20with%20the%20duplicated%20dots%20should%20look%20like%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FTrail.gif%22%20%2F%3E%0A%0A%23%23%20Duplicating%20markup%20and%20arranging%20it%20in%20a%20circle%0A%0ANow%20let's%20create%20a%20%60%3CExplosion%3E%60%20component.%20It%20takes%20children%20and%20renders%20them%20for%20example%2010%20times%20and%20applies%20a%20rotation%20to%20each%20instance.%20It's%20worth%20mentioning%20here%20that%20a%20full%20rotation%20amounts%20to%202%CF%80%2C%20while%20%60(i%2FAMOUNT)%60%20represents%20a%20factor%20between%200%20and%201.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FExplosion.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0A%0Aconst%20AMOUNT%20%3D%2010%3B%0A%0Aexport%20const%20Explosion%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bchildren%7D)%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%7Bnew%20Array(AMOUNT).fill(true).map((_%2C%20i)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20rotate%3A%20(i%20%2F%20AMOUNT)%20*%20(2%20*%20Math.PI)%20%2B%20'rad'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%7Bchildren%7D%0A%20%20%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D)%7D%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0A%60%3CTrail%3E%60%20gets%20put%20inside%20the%20%60%3CExplosion%3E%60%20component.%20Your%20main%20component%20(%60src%2FComposition.tsx%60)%20looks%20like%20this%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Explosion.tsx%0Aexport%20const%20Explosion%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Trail.tsx%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20amount%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDot%7D%20from%20'.%2FDot'%3B%0Aimport%20%7BExplosion%7D%20from%20'.%2FExplosion'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0Aimport%20%7BTrail%7D%20from%20'.%2FTrail'%3B%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CExplosion%3E%0A%20%20%20%20%20%20%20%20%3CTrail%20amount%3D%7B4%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CDot%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%20%20%3C%2FTrail%3E%0A%20%20%20%20%20%20%3C%2FExplosion%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AThe%20animated%20explosion%20should%20look%20like%20this%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FExplosion.gif%22%20%2F%3E%0A%0A%23%23%20Cleanup%0A%0AYou%20have%20created%20a%20bunch%20of%20files%20until%20now%2C%20let's%20put%20most%20of%20them%20together%20in%20one%20file%20called%20%60src%2FDots.tsx%60.%20Extract%20%60%3CExplosion%3E%60%20and%20it's%20children%20into%20a%20new%20separate%20component%20called%20Dots.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FDots.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Explosion.tsx%0Aexport%20const%20Explosion%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Trail.tsx%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20amount%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BSequence%7D%20from%20'remotion'%3B%0Aimport%20%7BDot%7D%20from%20'.%2FDot'%3B%0Aimport%20%7BExplosion%7D%20from%20'.%2FExplosion'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0Aimport%20%7BTrail%7D%20from%20'.%2FTrail'%3B%0A%0Aexport%20const%20Dots%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CExplosion%3E%0A%20%20%20%20%20%20%3CTrail%20amount%3D%7B4%7D%3E%0A%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%3CSequence%20from%3D%7B5%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CDot%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FSequence%3E%0A%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%3C%2FTrail%3E%0A%20%20%20%20%3C%2FExplosion%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AReplace%20the%20%60%3CExplosion%3E%60%20with%20the%20new%20%60%3CDots%3E%60%20component%3A%0A%0A%60%60%60tsx%20twoslash%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dots.tsx%0Aexport%20const%20Dots%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDots%7D%20from%20'.%2FDots'%3B%0A%2F%2F%20---cut---%0A%0Aexport%20const%20MyComposition%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CDots%20%2F%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0ANothing%20has%20changed%20on%20the%20animation%20itself%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FDots.gif%22%20%2F%3E%0A%0A%23%23%20Adding%20hearts%20and%20stars%0A%0ATo%20make%20the%20animation%20more%20exciting%2C%20let's%20add%20some%20stars%20and%20hearts%20in%20different%20colors.%20To%20do%20this%2C%20we%20need%20to%20basically%20repeat%20the%20previous%20steps.%20Besides%20the%20%60%3CDots%3E%60component%2C%20we'll%20add%20three%20more%20components%20in%20the%20next%20few%20steps.%0A%0ALet's%20start%20with%20red%20hearts.%20First%20you%20render%20a%20red%20heart%20by%20creating%20a%20new%20file%20%60src%2FRedHeart.tsx%60%20and%20return%20a%20centered%20red%20heart%20emoji.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FRedHeart.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20RedHeart%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20justifyContent%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20alignItems%3A%20'center'%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%E2%9D%A4%EF%B8%8F%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AEffects%20like%20%60%3CShrinking%3E%60%2C%20%60%3CMove%3E%60%20and%20%60%3CExplosion%3E%60%20need%20to%20be%20applied%20to%20that%20red%20heart.%20We%20do%20this%20in%20a%20new%20component%20called%20RedHearts.%0A%0AConsider%20s%20that%20we%20need%20to%20add%20an%20offset%20to%20%60%3CRedHearts%3E%60%2C%20otherwise%20they%20would%20be%20positioned%20the%20same%20as%20the%20%60%3CDots%3E%60.%0A%0AWe%20change%20the%20position%20by%20giving%20the%20red%20hearts%20a%20bigger%20radius%20than%20the%20dots%2C%20and%20apply%20a%20%60100px%60%20translation.%20Also%2C%20we%20add%20a%20short%20delay%20of%205%20frames%20to%20the%20%60%3CMove%3E%60%20component%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FRedHearts.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Explosion.tsx%0Aexport%20const%20Explosion%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20RedHeart.tsx%0Aexport%20const%20RedHeart%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Trail.tsx%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20extraOffset%3A%20number%3B%0A%20%20amount%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BExplosion%7D%20from%20'.%2FExplosion'%3B%0Aimport%20%7BMove%7D%20from%20'.%2FMove'%3B%0Aimport%20%7BRedHeart%7D%20from%20'.%2FRedHeart'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0A%0Aexport%20const%20RedHearts%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CExplosion%3E%0A%20%20%20%20%20%20%3CMove%20delay%3D%7B5%7D%3E%0A%20%20%20%20%20%20%20%20%3CAbsoluteFill%20style%3D%7B%7Btransform%3A%20%60translateY(-100px)%60%7D%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CRedHeart%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%3C%2FMove%3E%0A%20%20%20%20%3C%2FExplosion%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AWe%20do%20the%20same%20to%20get%20some%20yellow%20hearts%20in%20our%20animation%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FYellowHeart.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20YellowHeart%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20justifyContent%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20alignItems%3A%20'center'%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%F0%9F%92%9B%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AFor%20the%20yellow%20hearts%20we%20are%20going%20to%20change%20the%20position%20by%20applying%20a%20translation%20of%20%6050px%60%20and%20adding%20a%20delay%20of%2020%20frames%20to%20the%20%60%3CMove%3E%60%20component%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FYellowHearts.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Explosion.tsx%0Aexport%20const%20Explosion%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20YellowHeart.tsx%0Aexport%20const%20YellowHeart%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20RedHeart.tsx%0Aexport%20const%20RedHeart%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Trail.tsx%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20extraOffset%3A%20number%3B%0A%20%20amount%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BExplosion%7D%20from%20'.%2FExplosion'%3B%0Aimport%20%7BMove%7D%20from%20'.%2FMove'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0Aimport%20%7BYellowHeart%7D%20from%20'.%2FYellowHeart'%3B%0A%0Aexport%20const%20YellowHearts%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20rotate%3A%20'0.3rad'%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%3CExplosion%3E%0A%20%20%20%20%20%20%20%20%3CMove%20delay%3D%7B20%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20transform%3A%20%60translateY(-50px)%60%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CYellowHeart%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20%3C%2FMove%3E%0A%20%20%20%20%20%20%3C%2FExplosion%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AYour%20main%20composition%20should%20look%20like%20this%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FDotsAndHearts.gif%22%20%2F%3E%0A%0A%3Cbr%20%2F%3E%0A%3Cbr%20%2F%3E%0A%0AIn%20addition%20to%20the%20dots%20and%20hearts%20let's%20also%20add%20stars.%0A%0ACreate%20a%20new%20file%20%60src%2FStar.tsx%60%20and%20return%20a%20centered%20star%20emoji.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FStar.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Star%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20justifyContent%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20alignItems%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20fontSize%3A%2014%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%E2%AD%90%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AConsider%20that%20we%20need%20to%20change%20the%20positioning%20of%20the%20stars%2C%20otherwise%20they%20would%20be%20on%20top%20of%20the%20%60%3CDots%3E%60.%0A%0ALet's%20give%20%60%3CTrail%3E%60%20an%20%60extraOffset%60%20prop%2C%20so%20the%20stars%20can%20start%20more%20outwards%20than%20the%20dots.%0A%0AAn%20%60extraOffset%60%20of%20100%20for%20the%20stars%20leads%20to%20the%20same%20circumference%20at%20the%20beginning%20and%20end%20as%20the%20red%20hearts%20have.%20Here%20is%20the%20adjusted%20%60%3CTrail%3E%60%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FTrail.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20Trail.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%2C%20Sequence%7D%20from%20'remotion'%3B%0Aimport%20%7BMove%7D%20from%20'.%2FMove'%3B%0A%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20amount%3A%20number%3B%0A%20%20extraOffset%3A%20number%3B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bamount%2C%20extraOffset%2C%20children%7D)%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%7Bnew%20Array(amount).fill(true).map((a%2C%20i)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%3CSequence%20from%3D%7Bi%20*%203%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20translate%3A%20%600%20%24%7B-extraOffset%7Dpx%60%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CMove%20delay%3D%7B0%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20scale%3A%20String(1%20-%20i%20%2F%20amount)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bchildren%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FMove%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FSequence%3E%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D)%7D%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AEffects%20like%20%60%3CShrinking%3E%60%2C%20the%20new%20%60%3CTrail%3E%60%20and%20%60%3CExplosion%3E%60%20need%20to%20be%20applied%20to%20the%20star%20we%20created%20above.%20Additionally%20we%20also%20add%20some%20rotation.%20We%20do%20all%20of%20this%20in%20a%20new%20component%20called%20Stars%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FStars.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Explosion.tsx%0Aexport%20const%20Explosion%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dot.tsx%0Aexport%20const%20Dot%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Star.tsx%0Aexport%20const%20Star%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Trail.tsx%0Aexport%20const%20Trail%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20extraOffset%3A%20number%3B%0A%20%20amount%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BExplosion%7D%20from%20'.%2FExplosion'%3B%0Aimport%20%7BShrinking%7D%20from%20'.%2FShrinking'%3B%0Aimport%20%7BStar%7D%20from%20'.%2FStar'%3B%0Aimport%20%7BTrail%7D%20from%20'.%2FTrail'%3B%0A%0Aexport%20const%20Stars%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20rotate%3A%20'0.3rad'%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%3CExplosion%3E%0A%20%20%20%20%20%20%20%20%3CTrail%20extraOffset%3D%7B100%7D%20amount%3D%7B4%7D%3E%0A%20%20%20%20%20%20%20%20%20%20%3CShrinking%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CStar%20%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FShrinking%3E%0A%20%20%20%20%20%20%20%20%3C%2FTrail%3E%0A%20%20%20%20%20%20%3C%2FExplosion%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AHere%20is%20how%20the%20almost%20complete%20firework%20should%20look%20like%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FDotsAndHeartsAndStars.gif%22%20%2F%3E%0A%0A%23%23%20Slow%20motion%20effect%0A%0ALastly%20let's%20apply%20a%20slow%20motion%20effect%20to%20the%20firework.%20For%20this%2C%20create%20a%20new%20file%20%60src%2FSlowedTrail.tsx%60.%20It%20should%20contain%20a%20component%20called%20Slowed%20and%20a%20helper%20function%20%60remapSpeed()%60%20which%20will%20apply%20different%20speed%20levels%20to%20the%20firework.%20In%20the%20code%20snippet%20below%20a%20speed%20of%201.5%20is%20applied%20until%20frame%2020%2C%20afterwards%20the%20speed%20slows%20down%20to%200.5.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FSlowedTrail.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BFreeze%2C%20interpolate%2C%20useCurrentFrame%7D%20from%20'remotion'%3B%0A%0A%2F%2F%20remapSpeed()%20is%20a%20helper%20function%20for%20the%20component%20%3CSlowed%3E%20that%20takes%20a%20frame%20number%20and%20a%20speed%0Aconst%20remapSpeed%20%3D%20(%7Bframe%2C%20speed%7D%3A%20%7Bframe%3A%20number%3B%20speed%3A%20(fr%3A%20number)%20%3D%3E%20number%7D)%20%3D%3E%20%7B%0A%20%20let%20framesPassed%20%3D%200%3B%0A%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%3D%20frame%3B%20i%2B%2B)%20%7B%0A%20%20%20%20framesPassed%20%2B%3D%20speed(i)%3B%0A%20%20%7D%0A%0A%20%20return%20framesPassed%3B%0A%7D%3B%0A%0Aexport%20const%20Slowed%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20(%7Bchildren%7D)%20%3D%3E%20%7B%0A%20%20const%20frame%20%3D%20useCurrentFrame()%3B%0A%20%20const%20remappedFrame%20%3D%20remapSpeed(%7B%0A%20%20%20%20frame%2C%0A%20%20%20%20speed%3A%20(f)%20%3D%3E%0A%20%20%20%20%20%20interpolate(f%2C%20%5B0%2C%2020%2C%2021%5D%2C%20%5B1.5%2C%201.5%2C%200.5%5D%2C%20%7B%0A%20%20%20%20%20%20%20%20extrapolateRight%3A%20'clamp'%2C%0A%20%20%20%20%20%20%7D)%2C%0A%20%20%7D)%3B%0A%0A%20%20return%20%3CFreeze%20frame%3D%7BremappedFrame%7D%3E%7Bchildren%7D%3C%2FFreeze%3E%3B%0A%7D%3B%0A%60%60%60%0A%0AIn%20the%20main%20component%2C%20wrap%20all%20moving%20dots%2C%20hearts%20and%20stars%20in%20the%20component%20%60%3CSlowed%3E%60.%20As%20you%20sure%20can%20tell%20by%20now%2C%20everything%20is%20very%20composable%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Stars.tsx%0Aexport%20const%20Stars%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dots.tsx%0Aexport%20const%20Dots%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20RedHearts.tsx%0Aexport%20const%20RedHearts%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20YellowHearts.tsx%0Aexport%20const%20YellowHearts%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20SlowedTrail.tsx%0Aexport%20const%20Slowed%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDots%7D%20from%20'.%2FDots'%3B%0Aimport%20%7BRedHearts%7D%20from%20'.%2FRedHearts'%3B%0Aimport%20%7BSlowed%7D%20from%20'.%2FSlowedTrail'%3B%0Aimport%20%7BStars%7D%20from%20'.%2FStars'%3B%0Aimport%20%7BYellowHearts%7D%20from%20'.%2FYellowHearts'%3B%0A%0Aexport%20const%20MyComposition%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CSlowed%3E%0A%20%20%20%20%20%20%20%20%3CDots%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CRedHearts%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CYellowHearts%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CStars%20%2F%3E%0A%20%20%20%20%20%20%3C%2FSlowed%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0AYour%20final%20firework%20should%20look%20like%20this%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FSlowed.gif%22%20%2F%3E%0A%0A%23%23%20Adding%20your%20animoji%0A%0AAs%20the%20final%20step%20of%20this%20tutorial%2C%20we%20add%20your%20animoji%20on%20top%20of%20the%20firework.%20For%20the%20animoji%20you%20need%20to%20have%20an%20iPhone%20and%20a%20Mac.%20This%20is%20how%20you%20get%20it%3A%20On%20your%20iPhone%20in%20iMessage%2C%20record%20an%20animoji%20of%20yourself%20and%20send%20it%20to%20a%20friend.%20After%20you've%20done%20that%2C%20it%20will%20also%20appear%20in%20the%20Messages%20app%20on%20your%20Mac.%20Download%20your%20animoji%20there%20by%20right-clicking.%20Once%20you%20have%20done%20that%2C%20create%20a%20transparent%20version%20of%20your%20animoji.%20Just%20follow%20these%20points%3A%0A%0A1.%20Right-click%20your%20downloaded%20animoji%0A2.%20Select%20%22Services%22%0A3.%20Select%20%22Encode%20Selected%20Video%20Files%22%0A4.%20Choose%20%22Apple%20ProRes%22%20in%20the%20settings%20dropdown%0A5.%20Tick%20the%20box%20that%20says%20%22Preserve%20Transparency%22.%0A%0AA%20new%20encoded%20file%20of%20your%20animoji%20will%20be%20created.%20Give%20it%20a%20simple%20name%20like%20animoji.mov.%0A%0AIn%20addition%20to%20the%20%60src%60%20folder%20in%20your%20Remotion%20project%2C%20create%20a%20new%20one%20called%20%60public%60.%20Put%20your%20encoded%20video%20in%20this%20folder.%20You%20can%20then%20use%20FFmpeg%20to%20turn%20the%20encoded%20video%20into%20a%20series%20of%20frames%3A%0A%0A1.%20Change%20the%20current%20working%20directory%20to%20%60public%60%3A%20%60cd%20public%60%0A2.%20Use%20this%20command%3A%20%60ffmpeg%20-i%20animoji.mov%20-pix_fmt%20rgba%20-start_number%200%20frame%2503d.png%60%0A%0AOnly%20assets%20that%20are%20being%20used%20by%20Remotion%20need%20to%20be%20in%20the%20%60public%60%20folder.%20You%20don't%20need%20the%20encoded%20video%2C%20so%20you%20can%20delete%20it%20after%20the%20frames%20have%20been%20extracted.%0A%0AHere%20is%20a%20screenshot%20right%20before%20creating%20the%20series%20of%20frames%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FFFmpegCommand.png%22%20%2F%3E%0A%0A%3Cbr%20%2F%3E%0A%3Cbr%20%2F%3E%0A%0AAlright%2C%20so%20far%20you've%20prepared%20the%20animoji%20to%20be%20used%20in%20a%20new%20component%20called%20Animoji.%20You%20can%20import%20this%20series%20of%20frames%20by%20using%20the%20%5BstaticFile()%5D(https%3A%2F%2Fwww.remotion.dev%2Fdocs%2Fstaticfile)%20API.%20The%20file%20name%20of%20each%20frame%20will%20help%20you%20to%20determine%20the%20current%20frame%20number.%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FAnimoji.tsx%22%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%2C%20Img%2C%20staticFile%2C%20useCurrentFrame%7D%20from%20'remotion'%3B%0A%0Aexport%20const%20Animoji%3A%20React.FC%20%3D%20()%20%3D%3E%20%7B%0A%20%20const%20frame%20%3D%20useCurrentFrame()%3B%0A%0A%20%20const%20src%20%3D%20%60frame%24%7B(frame%20*%202).toString().padStart(3%2C%20'0')%7D.png%60%3B%0A%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%0A%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20justifyContent%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20alignItems%3A%20'center'%2C%0A%20%20%20%20%20%20%20%20marginTop%3A%2080%2C%0A%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%3CImg%0A%20%20%20%20%20%20%20%20style%3D%7B%7B%0A%20%20%20%20%20%20%20%20%20%20height%3A%20800%2C%0A%20%20%20%20%20%20%20%20%7D%7D%0A%20%20%20%20%20%20%20%20src%3D%7BstaticFile(src)%7D%0A%20%20%20%20%20%20%2F%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0ARender%20the%20%60%3CAnimoji%3E%60%20component%20in%20your%20main%20composition%3A%0A%0A%60%60%60tsx%20twoslash%20title%3D%22src%2FComposition.tsx%22%0A%2F%2F%20%40filename%3A%20Move.tsx%0Aexport%20const%20Move%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%20%20delay%3A%20number%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Shrinking.tsx%0Aexport%20const%20Shrinking%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Stars.tsx%0Aexport%20const%20Stars%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Background.tsx%0Aexport%20const%20Background%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Dots.tsx%0Aexport%20const%20Dots%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20RedHearts.tsx%0Aexport%20const%20RedHearts%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20YellowHearts.tsx%0Aexport%20const%20YellowHearts%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20Animoji.tsx%0Aexport%20const%20Animoji%3A%20React.FC%3C%7B%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%2F%2F%20%40filename%3A%20SlowedTrail.tsx%0Aexport%20const%20Slowed%3A%20React.FC%3C%7B%0A%20%20children%3A%20React.ReactNode%3B%0A%7D%3E%20%3D%20()%20%3D%3E%20null%3B%0A%0A%2F%2F%20%40filename%3A%20MyComposition.tsx%0A%2F%2F%20---cut---%0Aimport%20React%20from%20'react'%3B%0Aimport%20%7BAbsoluteFill%7D%20from%20'remotion'%3B%0Aimport%20%7BAnimoji%7D%20from%20'.%2FAnimoji'%3B%0Aimport%20%7BBackground%7D%20from%20'.%2FBackground'%3B%0Aimport%20%7BDots%7D%20from%20'.%2FDots'%3B%0Aimport%20%7BRedHearts%7D%20from%20'.%2FRedHearts'%3B%0Aimport%20%7BSlowed%7D%20from%20'.%2FSlowedTrail'%3B%0Aimport%20%7BStars%7D%20from%20'.%2FStars'%3B%0Aimport%20%7BYellowHearts%7D%20from%20'.%2FYellowHearts'%3B%0A%0Aexport%20const%20MyComposition%20%3D%20()%20%3D%3E%20%7B%0A%20%20return%20(%0A%20%20%20%20%3CAbsoluteFill%3E%0A%20%20%20%20%20%20%3CBackground%20%2F%3E%0A%20%20%20%20%20%20%3CSlowed%3E%0A%20%20%20%20%20%20%20%20%3CDots%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CRedHearts%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CYellowHearts%20%2F%3E%0A%20%20%20%20%20%20%20%20%3CStars%20%2F%3E%0A%20%20%20%20%20%20%3C%2FSlowed%3E%0A%20%20%20%20%20%20%3CAnimoji%20%2F%3E%0A%20%20%20%20%3C%2FAbsoluteFill%3E%0A%20%20)%3B%0A%7D%3B%0A%60%60%60%0A%0ABy%20doing%20all%20of%20this%20you%20have%20imported%20a%20transparent%20version%20of%20your%20animoji%20into%20your%20composition.%20You%20can%20run%20%60npm%20run%20build%60%20to%20export%20your%20video%20as%20MP4.%20Which%20should%20look%20like%20this%3A%0A%0A%3Cimg%20src%3D%22https%3A%2F%2Fpub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev%2FFinal.gif%22%20%2F%3E%0A%0ACongrats%20on%20your%20programmatically%20generated%20video!%20%F0%9F%8E%89%0A" hidden="" id="__doc_raw"></span>
<!-- -->
<p>Learn how to create an animation that Apple has on its website during the holiday season with this beginner-friendly Remotion tutorial!</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Final.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="video-version">Video version<a href="https://www.remotion.dev/learn/apple-wow#video-version" class="hash-link" aria-label="Direct link to Video version" title="Direct link to Video version" translate="no">​</a></h2>
<p>This tutorial is also available as a video version:</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="source-code">Source code<a href="https://www.remotion.dev/learn/apple-wow#source-code" class="hash-link" aria-label="Direct link to Source code" title="Direct link to Source code" translate="no">​</a></h2>
<p><a href="https://github.com/remotion-dev/apple-wow-tutorial" target="_blank" rel="noopener noreferrer" class="">GitHub</a></p>
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="getting-started">Getting started<a href="https://www.remotion.dev/learn/apple-wow#getting-started" class="hash-link" aria-label="Direct link to Getting started" title="Direct link to Getting started" translate="no">​</a></h2>
<p>Start a new Remotion project and select the blank template:</p>
<div class="theme-tabs-container tabs-container tabList_eNpY"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_rhlu tabs__item--active">npm</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_rhlu">yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_rhlu">pnpm</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_hjd2"><div><pre class="shiki github-dark" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#B392F0">npm</span><span style="color:#9ECBFF"> init</span><span style="color:#9ECBFF"> video</span><span style="color:#79B8FF"> --blank</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div></div><div role="tabpanel" class="tabItem_hjd2" hidden=""><div><pre class="shiki github-dark" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#B392F0">pnpm</span><span style="color:#9ECBFF"> create</span><span style="color:#9ECBFF"> video</span><span style="color:#79B8FF"> --blank</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div></div><div role="tabpanel" class="tabItem_hjd2" hidden=""><div><pre class="shiki github-dark" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#B392F0">yarn</span><span style="color:#9ECBFF"> create</span><span style="color:#9ECBFF"> video</span><span style="color:#79B8FF"> --blank</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div></div></div></div>
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="composition-setup">Composition setup<a href="https://www.remotion.dev/learn/apple-wow#composition-setup" class="hash-link" aria-label="Direct link to Composition setup" title="Direct link to Composition setup" translate="no">​</a></h2>
<p>A <a href="https://www.remotion.dev/docs/terminology/composition" target="_blank" rel="noopener noreferrer" class=""><code>&lt;Composition&gt;</code></a> defines the dimensions and duration of the video. In the <code>src/Root.tsx</code> file, adjust the width and height to the following:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Root.tsx</div><code><span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const RemotionRoot: React.FC<{}>">RemotionRoot</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
export namespace React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Composition: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(props: CompositionProps<Schema, Props>) => JSX.Element | null
import Composition">Composition</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) id: string">id</data-lsp></span><span style="color:#F97583">=</span><span style="color:#9ECBFF">"MyComp"</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) component: LooseComponentType<{}>">component</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#E1E4E8"><data-lsp lsp="const MyComposition: React.FC<{}>">MyComposition</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#B392F0"><data-lsp lsp="(property) durationInFrames: number">durationInFrames</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">150</span><span style="color:#E1E4E8">} </span><span style="color:#B392F0"><data-lsp lsp="(property) fps: number">fps</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">30</span><span style="color:#E1E4E8">} </span><span style="color:#B392F0"><data-lsp lsp="(property) width: number">width</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">1920</span><span style="color:#E1E4E8">} </span><span style="color:#B392F0"><data-lsp lsp="(property) height: number">height</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">1080</span><span style="color:#E1E4E8">} /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="create-a-background">Create a background<a href="https://www.remotion.dev/learn/apple-wow#create-a-background" class="hash-link" aria-label="Direct link to Create a background" title="Direct link to Create a background" translate="no">​</a></h2>
<p>Create a new file <code>src/Background.tsx</code> and return a background with linear gradient:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Background.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const Background: React.FC<{}>">Background</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardShorthandProperties<string | number, string &amp; {}>.background?: Property.Background<string | number> | undefined">background</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'linear-gradient(to bottom, #000021, #010024)'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Add the created background to the <code>&lt;MyComposition/&gt;</code> component, which can be found in the file <code>src/Composition.tsx</code>. This file will contain all the components that you create in this tutorial.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: React.FC<{}>">MyComposition</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>This results in the following:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Background.png">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="render-a-dot">Render a dot<a href="https://www.remotion.dev/learn/apple-wow#render-a-dot" class="hash-link" aria-label="Direct link to Render a dot" title="Direct link to Render a dot" translate="no">​</a></h2>
<p>Render a white dot by creating a new file <code>src/Dot.tsx</code> and return a centered circle.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Dot.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const Dot: React.FC<{}>">Dot</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.justifyContent?: Property.JustifyContent | undefined">justifyContent</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.alignItems?: Property.AlignItems | undefined">alignItems</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#85E89D"><data-lsp lsp="(property) React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>">div</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">        </span><span style="color:#B392F0"><data-lsp lsp="(property) React.HTMLAttributes<T>.style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">          </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.height?: Property.Height<string | number> | undefined">height</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">14</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">          </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.width?: Property.Width<string | number> | undefined">width</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">14</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">          </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardShorthandProperties<string | number, string &amp; {}>.borderRadius?: Property.BorderRadius<string | number> | undefined">borderRadius</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">14</span><span style="color:#F97583"> /</span><span style="color:#79B8FF"> 2</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">          </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.backgroundColor?: Property.BackgroundColor | undefined">backgroundColor</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#ccc'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        }}</span></span>
<span class="line"><span style="color:#E1E4E8">      /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Add the <code>&lt;Dot&gt;</code> in your main composition <code>src/Composition.tsx</code>:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: React.FC<{}>">MyComposition</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Now we got a white dot on top of our background:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Dot.png">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="animate-the-dot">Animate the dot<a href="https://www.remotion.dev/learn/apple-wow#animate-the-dot" class="hash-link" aria-label="Direct link to Animate the dot" title="Direct link to Animate the dot" translate="no">​</a></h2>
<p>Let's apply some animation to the white dot we created above. We create another component called <code>&lt;Shrinking&gt;</code> in a new file <code>src/Shrinking.tsx</code>, which then wraps the dot in the main composition <code>src/Composition.tsx</code>.</p>
<div><pre class="shiki with-title github-dark" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Shrinking.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> React </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {AbsoluteFill, interpolate, useCurrentFrame} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> Shrinking</span><span style="color:#F97583">:</span><span style="color:#B392F0"> React</span><span style="color:#E1E4E8">.</span><span style="color:#B392F0">FC</span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  children</span><span style="color:#F97583">:</span><span style="color:#B392F0"> React</span><span style="color:#E1E4E8">.</span><span style="color:#B392F0">ReactNode</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70">children</span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> frame</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> useCurrentFrame</span><span style="color:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF">AbsoluteFill</span></span>
<span class="line"><span style="color:#B392F0">      style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        scale: </span><span style="color:#B392F0">String</span><span style="color:#E1E4E8">(</span></span>
<span class="line"><span style="color:#B392F0">          interpolate</span><span style="color:#E1E4E8">(frame, [</span><span style="color:#79B8FF">60</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">90</span><span style="color:#E1E4E8">], [</span><span style="color:#79B8FF">1</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">], {</span></span>
<span class="line"><span style="color:#E1E4E8">            extrapolateLeft: </span><span style="color:#9ECBFF">'clamp'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">            extrapolateRight: </span><span style="color:#9ECBFF">'clamp'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">          }),</span></span>
<span class="line"><span style="color:#E1E4E8">        ),</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      {children}</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF">AbsoluteFill</span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Add the <code>&lt;Shrinking&gt;</code> component in your main composition <code>src/Composition.tsx</code>:</p>
<div><pre class="shiki github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: React.FC<{}>">MyComposition</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Now, you have some action to show. By using <code>&lt;Shrinking&gt;</code> in your main composition you have created a scale out effect:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Shrinking.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="move-the-dot">Move the dot<a href="https://www.remotion.dev/learn/apple-wow#move-the-dot" class="hash-link" aria-label="Direct link to Move the dot" title="Direct link to Move the dot" translate="no">​</a></h2>
<p>Next, create a component called <code>&lt;Move&gt;</code>. This component has a spring animation, which by default goes from zero to one, and has a duration of four seconds (<code>durationInFrames: 120</code>) in the code snippet below:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Move.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) function interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number (+4 overloads)
import interpolate">interpolate</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) function spring({ frame: passedFrame, fps, config, from, to, durationInFrames: passedDurationInFrames, durationRestThreshold, delay, reverse }: {
    frame: number;
    fps: number;
    config?: Partial<SpringConfig>;
    from?: number;
    to?: number;
    durationInFrames?: number;
    durationRestThreshold?: number;
    delay?: number;
    reverse?: boolean;
}): number
import spring">spring</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const useCurrentFrame: () => number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const useVideoConfig: () => VideoConfig
import useVideoConfig">useVideoConfig</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const Move: React.FC<{
    children: React.ReactNode;
}>">Move</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) children: React.ReactNode">children</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.ReactNode = string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | null | undefined">ReactNode</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#E1E4E8"> {</span><span style="color:#79B8FF"><data-lsp lsp="const fps: number">fps</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">=</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) useVideoConfig(): VideoConfig
import useVideoConfig">useVideoConfig</data-lsp></span><span style="color:#E1E4E8">();</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const frame: number">frame</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) useCurrentFrame(): number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const down: number">down</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) spring({ frame: passedFrame, fps, config, from, to, durationInFrames: passedDurationInFrames, durationRestThreshold, delay, reverse }: {
    frame: number;
    fps: number;
    config?: Partial<SpringConfig>;
    from?: number;
    to?: number;
    durationInFrames?: number;
    durationRestThreshold?: number;
    delay?: number;
    reverse?: boolean;
}): number
import spring">spring</data-lsp></span><span style="color:#E1E4E8">({</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) fps: number">fps</data-lsp></span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) frame: number">frame</data-lsp></span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) config?: Partial<SpringConfig> | undefined">config</data-lsp></span><span style="color:#E1E4E8">: {</span></span>
<span class="line"><span style="color:#E1E4E8">      </span><span style="color:#E1E4E8"><data-lsp lsp="(property) damping?: number | undefined">damping</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">200</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">    },</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) durationInFrames?: number | undefined">durationInFrames</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">120</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">  });</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const y: number">y</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number (+4 overloads)
import interpolate">interpolate</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="const down: number">down</data-lsp></span><span style="color:#E1E4E8">, [</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">1</span><span style="color:#E1E4E8">], [</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">, </span><span style="color:#F97583">-</span><span style="color:#79B8FF">400</span><span style="color:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.translate?: Property.Translate<string | number> | undefined">translate</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">`0 ${</span><span style="color:#E1E4E8"><data-lsp lsp="const y: number">y</data-lsp></span><span style="color:#9ECBFF">}px`</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      {</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Add the <code>&lt;Move&gt;</code> component to your composition <code>src/Composition.tsx</code>. You get a nice animation by combining the effect of moving and shrinking by surrounding the shrinking dot in the <code>&lt;Move&gt;</code> component:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: () => JSX.Element">MyComposition</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>And up goes the dot:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Move.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="duplicate-the-moving-dot">Duplicate the moving dot<a href="https://www.remotion.dev/learn/apple-wow#duplicate-the-moving-dot" class="hash-link" aria-label="Direct link to Duplicate the moving dot" title="Direct link to Duplicate the moving dot" translate="no">​</a></h2>
<p>Here it gets a little bit trickier, but the following steps are going to make your animation a lot more entertaining. First, you add a <code>delay</code> prop into the <code>&lt;Move&gt;</code> component and then change the <code>frame</code> parameter of your <code>spring()</code> function.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Move.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) function interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number (+4 overloads)
import interpolate">interpolate</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) function spring({ frame: passedFrame, fps, config, from, to, durationInFrames: passedDurationInFrames, durationRestThreshold, delay, reverse }: {
    frame: number;
    fps: number;
    config?: Partial<SpringConfig>;
    from?: number;
    to?: number;
    durationInFrames?: number;
    durationRestThreshold?: number;
    delay?: number;
    reverse?: boolean;
}): number
import spring">spring</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const useCurrentFrame: () => number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const useVideoConfig: () => VideoConfig
import useVideoConfig">useVideoConfig</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>">Move</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) children: React.ReactNode">children</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.ReactNode = string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | null | undefined">ReactNode</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) delay: number">delay</data-lsp></span><span style="color:#F97583">:</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) delay: number">delay</data-lsp></span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#E1E4E8"> {</span><span style="color:#79B8FF"><data-lsp lsp="const fps: number">fps</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">=</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) useVideoConfig(): VideoConfig
import useVideoConfig">useVideoConfig</data-lsp></span><span style="color:#E1E4E8">();</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const frame: number">frame</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) useCurrentFrame(): number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const down: number">down</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) spring({ frame: passedFrame, fps, config, from, to, durationInFrames: passedDurationInFrames, durationRestThreshold, delay, reverse }: {
    frame: number;
    fps: number;
    config?: Partial<SpringConfig>;
    from?: number;
    to?: number;
    durationInFrames?: number;
    durationRestThreshold?: number;
    delay?: number;
    reverse?: boolean;
}): number
import spring">spring</data-lsp></span><span style="color:#E1E4E8">({</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) fps: number">fps</data-lsp></span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) frame: number">frame</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#E1E4E8"><data-lsp lsp="const frame: number">frame</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">-</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) delay: number">delay</data-lsp></span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) config?: Partial<SpringConfig> | undefined">config</data-lsp></span><span style="color:#E1E4E8">: {</span></span>
<span class="line"><span style="color:#E1E4E8">      </span><span style="color:#E1E4E8"><data-lsp lsp="(property) damping?: number | undefined">damping</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">200</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">    },</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) durationInFrames?: number | undefined">durationInFrames</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">120</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">  });</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const y: number">y</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number (+4 overloads)
import interpolate">interpolate</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="const down: number">down</data-lsp></span><span style="color:#E1E4E8">, [</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">1</span><span style="color:#E1E4E8">], [</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">, </span><span style="color:#F97583">-</span><span style="color:#79B8FF">400</span><span style="color:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.translate?: Property.Translate<string | number> | undefined">translate</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">`0 ${</span><span style="color:#E1E4E8"><data-lsp lsp="const y: number">y</data-lsp></span><span style="color:#9ECBFF">}px`</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      {</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Now, let's create a <code>&lt;Trail&gt;</code> component. It takes some React children and duplicates them. The component adds a delay to each subsequent dot so they don't start all at once. Each dot will have a scale applied to it, so that each dot is smaller than the previous one.</p>
<p>Put the previously created <code>&lt;Move&gt;</code> component within the <code>&lt;Trail&gt;</code> component.
The order is crucial here. Things are done from inside out:</p>
<ol>
<li class="">Apply a scale so that the dots become smaller over time.</li>
<li class="">Apply the move animation.</li>
<li class="">Apply a delay between the animation start of each dot by using Remotion's <code>&lt;Sequence&gt;</code> component.</li>
</ol>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Trail.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Move'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const Trail: React.FC<{
    amount: number;
    children: React.ReactNode;
}>">Trail</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) amount: number">amount</data-lsp></span><span style="color:#F97583">:</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) children: React.ReactNode">children</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.ReactNode = string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | null | undefined">ReactNode</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) amount: number">amount</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      {</span><span style="color:#F97583">new</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="var Array: ArrayConstructor
new (arrayLength?: number) => any[] (+2 overloads)">Array</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) amount: number">amount</data-lsp></span><span style="color:#E1E4E8">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Array<any>.fill(value: any, start?: number, end?: number): any[]">fill</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#79B8FF">true</span><span style="color:#E1E4E8">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Array<any>.map<JSX.Element>(callbackfn: (value: any, index: number, array: any[]) => JSX.Element, thisArg?: any): JSX.Element[]">map</data-lsp></span><span style="color:#E1E4E8">((</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) a: any">a</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8">) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">        return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) from?: number | undefined">from</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">*</span><span style="color:#79B8FF"> 3</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">              &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) delay: number">delay</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">                &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">                  </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">                    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.scale?: Property.Scale | undefined">scale</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#B392F0"><data-lsp lsp="var String: StringConstructor
(value?: any) => string">String</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#79B8FF">1</span><span style="color:#F97583"> -</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">/</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) amount: number">amount</data-lsp></span><span style="color:#E1E4E8">),</span></span>
<span class="line"><span style="color:#E1E4E8">                  }}</span></span>
<span class="line"><span style="color:#E1E4E8">                &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">                  {</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}</span></span>
<span class="line"><span style="color:#E1E4E8">                &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">              &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        );</span></span>
<span class="line"><span style="color:#E1E4E8">      })}</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>In your main component, you now replace the <code>&lt;Move&gt;</code> component with the <code>&lt;Trail&gt;</code> component:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: () => JSX.Element">MyComposition</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) amount: number">amount</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">4</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>And this is how your animation with the duplicated dots should look like:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Trail.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="duplicating-markup-and-arranging-it-in-a-circle">Duplicating markup and arranging it in a circle<a href="https://www.remotion.dev/learn/apple-wow#duplicating-markup-and-arranging-it-in-a-circle" class="hash-link" aria-label="Direct link to Duplicating markup and arranging it in a circle" title="Direct link to Duplicating markup and arranging it in a circle" translate="no">​</a></h2>
<p>Now let's create a <code>&lt;Explosion&gt;</code> component. It takes children and renders them for example 10 times and applies a rotation to each instance. It's worth mentioning here that a full rotation amounts to 2π, while <code>(i/AMOUNT)</code> represents a factor between 0 and 1.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Explosion.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const AMOUNT: 10">AMOUNT</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#79B8FF"> 10</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const Explosion: React.FC<{
    children: React.ReactNode;
}>">Explosion</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) children: React.ReactNode">children</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.ReactNode = string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | null | undefined">ReactNode</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      {</span><span style="color:#F97583">new</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="var Array: ArrayConstructor
new (arrayLength?: number) => any[] (+2 overloads)">Array</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#79B8FF"><data-lsp lsp="const AMOUNT: 10">AMOUNT</data-lsp></span><span style="color:#E1E4E8">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Array<any>.fill(value: any, start?: number, end?: number): any[]">fill</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#79B8FF">true</span><span style="color:#E1E4E8">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Array<any>.map<JSX.Element>(callbackfn: (value: any, index: number, array: any[]) => JSX.Element, thisArg?: any): JSX.Element[]">map</data-lsp></span><span style="color:#E1E4E8">((</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) _: any">_</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8">) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">        return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">            </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">              </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.rotate?: Property.Rotate | undefined">rotate</data-lsp></span><span style="color:#E1E4E8">: (</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">/</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const AMOUNT: 10">AMOUNT</data-lsp></span><span style="color:#E1E4E8">) </span><span style="color:#F97583">*</span><span style="color:#E1E4E8"> (</span><span style="color:#79B8FF">2</span><span style="color:#F97583"> *</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="var Math: Math">Math</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#79B8FF"><data-lsp lsp="(property) Math.PI: number">PI</data-lsp></span><span style="color:#E1E4E8">) </span><span style="color:#F97583">+</span><span style="color:#9ECBFF"> 'rad'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">            }}</span></span>
<span class="line"><span style="color:#E1E4E8">          &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            {</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        );</span></span>
<span class="line"><span style="color:#E1E4E8">      })}</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p><code>&lt;Trail&gt;</code> gets put inside the <code>&lt;Explosion&gt;</code> component. Your main component (<code>src/Composition.tsx</code>) looks like this:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: () => JSX.Element">MyComposition</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) amount: number">amount</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">4</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>The animated explosion should look like this:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Explosion.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="cleanup">Cleanup<a href="https://www.remotion.dev/learn/apple-wow#cleanup" class="hash-link" aria-label="Direct link to Cleanup" title="Direct link to Cleanup" translate="no">​</a></h2>
<p>You have created a bunch of files until now, let's put most of them together in one file called <code>src/Dots.tsx</code>. Extract <code>&lt;Explosion&gt;</code> and it's children into a new separate component called Dots.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Dots.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Dot'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Explosion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Shrinking'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Trail'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const Dots: React.FC<{}>">Dots</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) amount: number">amount</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">4</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) from?: number | undefined">from</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">5</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dot: React.FC<{}>
import Dot">Dot</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Replace the <code>&lt;Explosion&gt;</code> with the new <code>&lt;Dots&gt;</code> component:</p>
<div><pre class="shiki github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><code><span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: () => JSX.Element">MyComposition</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dots: React.FC<{}>
import Dots">Dots</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Nothing has changed on the animation itself:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Dots.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="adding-hearts-and-stars">Adding hearts and stars<a href="https://www.remotion.dev/learn/apple-wow#adding-hearts-and-stars" class="hash-link" aria-label="Direct link to Adding hearts and stars" title="Direct link to Adding hearts and stars" translate="no">​</a></h2>
<p>To make the animation more exciting, let's add some stars and hearts in different colors. To do this, we need to basically repeat the previous steps. Besides the <code>&lt;Dots&gt;</code>component, we'll add three more components in the next few steps.</p>
<p>Let's start with red hearts. First you render a red heart by creating a new file <code>src/RedHeart.tsx</code> and return a centered red heart emoji.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/RedHeart.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const RedHeart: React.FC<{}>">RedHeart</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.justifyContent?: Property.JustifyContent | undefined">justifyContent</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.alignItems?: Property.AlignItems | undefined">alignItems</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      ❤️</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Effects like <code>&lt;Shrinking&gt;</code>, <code>&lt;Move&gt;</code> and <code>&lt;Explosion&gt;</code> need to be applied to that red heart. We do this in a new component called RedHearts.</p>
<p>Consider s that we need to add an offset to <code>&lt;RedHearts&gt;</code>, otherwise they would be positioned the same as the <code>&lt;Dots&gt;</code>.</p>
<p>We change the position by giving the red hearts a bigger radius than the dots, and apply a <code>100px</code> translation. Also, we add a short delay of 5 frames to the <code>&lt;Move&gt;</code> component:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/RedHearts.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Explosion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Move'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const RedHeart: React.FC<{}>
import RedHeart">RedHeart</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './RedHeart'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Shrinking'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const RedHearts: React.FC<{}>">RedHearts</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) delay: number">delay</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">5</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.transform?: Property.Transform | undefined">transform</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">`translateY(-100px)`</span><span style="color:#E1E4E8">}}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const RedHeart: React.FC<{}>
import RedHeart">RedHeart</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>We do the same to get some yellow hearts in our animation:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/YellowHeart.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const YellowHeart: React.FC<{}>">YellowHeart</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.justifyContent?: Property.JustifyContent | undefined">justifyContent</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.alignItems?: Property.AlignItems | undefined">alignItems</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      💛</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>For the yellow hearts we are going to change the position by applying a translation of <code>50px</code> and adding a delay of 20 frames to the <code>&lt;Move&gt;</code> component:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/YellowHearts.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Explosion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Move'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Shrinking'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const YellowHeart: React.FC<{}>
import YellowHeart">YellowHeart</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './YellowHeart'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const YellowHearts: React.FC<{}>">YellowHearts</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.rotate?: Property.Rotate | undefined">rotate</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'0.3rad'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) delay: number">delay</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">20</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">            </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">              </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.transform?: Property.Transform | undefined">transform</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">`translateY(-50px)`</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">            }}</span></span>
<span class="line"><span style="color:#E1E4E8">          &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">              &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const YellowHeart: React.FC<{}>
import YellowHeart">YellowHeart</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Your main composition should look like this:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/DotsAndHearts.gif">
<br>
<br>
<p>In addition to the dots and hearts let's also add stars.</p>
<p>Create a new file <code>src/Star.tsx</code> and return a centered star emoji.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Star.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const Star: React.FC<{}>">Star</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.justifyContent?: Property.JustifyContent | undefined">justifyContent</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.alignItems?: Property.AlignItems | undefined">alignItems</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.fontSize?: Property.FontSize<string | number> | undefined">fontSize</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">14</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      ⭐</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Consider that we need to change the positioning of the stars, otherwise they would be on top of the <code>&lt;Dots&gt;</code>.</p>
<p>Let's give <code>&lt;Trail&gt;</code> an <code>extraOffset</code> prop, so the stars can start more outwards than the dots.</p>
<p>An <code>extraOffset</code> of 100 for the stars leads to the same circumference at the beginning and end as the red hearts have. Here is the adjusted <code>&lt;Trail&gt;</code>:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Trail.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Move'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const Trail: React.FC<{
    amount: number;
    extraOffset: number;
    children: React.ReactNode;
}>">Trail</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) amount: number">amount</data-lsp></span><span style="color:#F97583">:</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) extraOffset: number">extraOffset</data-lsp></span><span style="color:#F97583">:</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) children: React.ReactNode">children</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.ReactNode = string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | null | undefined">ReactNode</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) amount: number">amount</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) extraOffset: number">extraOffset</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      {</span><span style="color:#F97583">new</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="var Array: ArrayConstructor
new (arrayLength?: number) => any[] (+2 overloads)">Array</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) amount: number">amount</data-lsp></span><span style="color:#E1E4E8">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Array<any>.fill(value: any, start?: number, end?: number): any[]">fill</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#79B8FF">true</span><span style="color:#E1E4E8">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Array<any>.map<JSX.Element>(callbackfn: (value: any, index: number, array: any[]) => JSX.Element, thisArg?: any): JSX.Element[]">map</data-lsp></span><span style="color:#E1E4E8">((</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) a: any">a</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8">) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">        return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) from?: number | undefined">from</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">*</span><span style="color:#79B8FF"> 3</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">              </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">                </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.translate?: Property.Translate<string | number> | undefined">translate</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">`0 ${</span><span style="color:#F97583">-</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) extraOffset: number">extraOffset</data-lsp></span><span style="color:#9ECBFF">}px`</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">              }}</span></span>
<span class="line"><span style="color:#E1E4E8">            &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">              &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) delay: number">delay</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">                &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">                  </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">                    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.scale?: Property.Scale | undefined">scale</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#B392F0"><data-lsp lsp="var String: StringConstructor
(value?: any) => string">String</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#79B8FF">1</span><span style="color:#F97583"> -</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">/</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) amount: number">amount</data-lsp></span><span style="color:#E1E4E8">),</span></span>
<span class="line"><span style="color:#E1E4E8">                  }}</span></span>
<span class="line"><span style="color:#E1E4E8">                &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">                  {</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}</span></span>
<span class="line"><span style="color:#E1E4E8">                &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">              &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Move: React.FC<{
    children: React.ReactNode;
    delay: number;
}>
import Move">Move</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Sequence: React.ComponentType<SequenceProps &amp; React.RefAttributes<HTMLDivElement>>
import Sequence">Sequence</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        );</span></span>
<span class="line"><span style="color:#E1E4E8">      })}</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Effects like <code>&lt;Shrinking&gt;</code>, the new <code>&lt;Trail&gt;</code> and <code>&lt;Explosion&gt;</code> need to be applied to the star we created above. Additionally we also add some rotation. We do all of this in a new component called Stars:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Stars.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Explosion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Shrinking'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Star: React.FC<{}>
import Star">Star</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Star'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    extraOffset: number;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Trail'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const Stars: React.FC<{}>">Stars</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.rotate?: Property.Rotate | undefined">rotate</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'0.3rad'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    extraOffset: number;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) extraOffset: number">extraOffset</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">100</span><span style="color:#E1E4E8">} </span><span style="color:#B392F0"><data-lsp lsp="(property) amount: number">amount</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#79B8FF">4</span><span style="color:#E1E4E8">}&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">            &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Star: React.FC<{}>
import Star">Star</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">          &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Shrinking: React.FC<{
    children: React.ReactNode;
}>
import Shrinking">Shrinking</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Trail: React.FC<{
    children: React.ReactNode;
    extraOffset: number;
    amount: number;
}>
import Trail">Trail</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Explosion: React.FC<{
    children: React.ReactNode;
}>
import Explosion">Explosion</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Here is how the almost complete firework should look like:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/DotsAndHeartsAndStars.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="slow-motion-effect">Slow motion effect<a href="https://www.remotion.dev/learn/apple-wow#slow-motion-effect" class="hash-link" aria-label="Direct link to Slow motion effect" title="Direct link to Slow motion effect" translate="no">​</a></h2>
<p>Lastly let's apply a slow motion effect to the firework. For this, create a new file <code>src/SlowedTrail.tsx</code>. It should contain a component called Slowed and a helper function <code>remapSpeed()</code> which will apply different speed levels to the firework. In the code snippet below a speed of 1.5 is applied until frame 20, afterwards the speed slows down to 0.5.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/SlowedTrail.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Freeze: React.FC<FreezeProps>
import Freeze">Freeze</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) function interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number (+4 overloads)
import interpolate">interpolate</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const useCurrentFrame: () => number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D">// remapSpeed() is a helper function for the component &lt;Slowed&gt; that takes a frame number and a speed</span></span>
<span class="line"><span style="color:#F97583">const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const remapSpeed: ({ frame, speed }: {
    frame: number;
    speed: (fr: number) => number;
}) => number">remapSpeed</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) frame: number">frame</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70"><data-lsp lsp="(parameter) speed: (fr: number) => number">speed</data-lsp></span><span style="color:#E1E4E8">}</span><span style="color:#F97583">:</span><span style="color:#E1E4E8"> {</span><span style="color:#FFAB70"><data-lsp lsp="(property) frame: number">frame</data-lsp></span><span style="color:#F97583">:</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">; </span><span style="color:#B392F0"><data-lsp lsp="(property) speed: (fr: number) => number">speed</data-lsp></span><span style="color:#F97583">:</span><span style="color:#E1E4E8"> (</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) fr: number">fr</data-lsp></span><span style="color:#F97583">:</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">) </span><span style="color:#F97583">=&gt;</span><span style="color:#79B8FF"> number</span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  let</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="let framesPassed: number">framesPassed</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">=</span><span style="color:#79B8FF"> 0</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">  for</span><span style="color:#E1E4E8"> (</span><span style="color:#F97583">let</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="let i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">=</span><span style="color:#79B8FF"> 0</span><span style="color:#E1E4E8">; </span><span style="color:#E1E4E8"><data-lsp lsp="let i: number">i</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">&lt;=</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) frame: number">frame</data-lsp></span><span style="color:#E1E4E8">; </span><span style="color:#E1E4E8"><data-lsp lsp="let i: number">i</data-lsp></span><span style="color:#F97583">++</span><span style="color:#E1E4E8">) {</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="let framesPassed: number">framesPassed</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">+=</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(parameter) speed: (fr: number) => number">speed</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="let i: number">i</data-lsp></span><span style="color:#E1E4E8">);</span></span>
<span class="line"><span style="color:#E1E4E8">  }</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="let framesPassed: number">framesPassed</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const Slowed: React.FC<{
    children: React.ReactNode;
}>">Slowed</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#E1E4E8">&lt;{</span></span>
<span class="line"><span style="color:#FFAB70">  </span><span style="color:#FFAB70"><data-lsp lsp="(property) children: React.ReactNode">children</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.ReactNode = string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | null | undefined">ReactNode</data-lsp></span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#E1E4E8">}&gt; </span><span style="color:#F97583">=</span><span style="color:#E1E4E8"> ({</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}) </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const frame: number">frame</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) useCurrentFrame(): number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">();</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const remappedFrame: number">remappedFrame</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const remapSpeed: ({ frame, speed }: {
    frame: number;
    speed: (fr: number) => number;
}) => number">remapSpeed</data-lsp></span><span style="color:#E1E4E8">({</span></span>
<span class="line"><span style="color:#E1E4E8">    </span><span style="color:#E1E4E8"><data-lsp lsp="(property) frame: number">frame</data-lsp></span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#B392F0">    </span><span style="color:#B392F0"><data-lsp lsp="(property) speed: (fr: number) => number">speed</data-lsp></span><span style="color:#E1E4E8">: (</span><span style="color:#FFAB70"><data-lsp lsp="(parameter) f: number">f</data-lsp></span><span style="color:#E1E4E8">) </span><span style="color:#F97583">=&gt;</span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(alias) interpolate(input: number, inputRange: readonly number[], outputRange: readonly number[], options?: InterpolateOptions): number (+4 overloads)
import interpolate">interpolate</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) f: number">f</data-lsp></span><span style="color:#E1E4E8">, [</span><span style="color:#79B8FF">0</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">20</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">21</span><span style="color:#E1E4E8">], [</span><span style="color:#79B8FF">1.5</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">1.5</span><span style="color:#E1E4E8">, </span><span style="color:#79B8FF">0.5</span><span style="color:#E1E4E8">], {</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) extrapolateRight?: ExtrapolateType | undefined">extrapolateRight</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'clamp'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }),</span></span>
<span class="line"><span style="color:#E1E4E8">  });</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Freeze: React.FC<FreezeProps>
import Freeze">Freeze</data-lsp></span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(property) frame: number">frame</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#E1E4E8"><data-lsp lsp="const remappedFrame: number">remappedFrame</data-lsp></span><span style="color:#E1E4E8">}&gt;{</span><span style="color:#E1E4E8"><data-lsp lsp="(parameter) children: React.ReactNode">children</data-lsp></span><span style="color:#E1E4E8">}&lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Freeze: React.FC<FreezeProps>
import Freeze">Freeze</data-lsp></span><span style="color:#E1E4E8">&gt;;</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>In the main component, wrap all moving dots, hearts and stars in the component <code>&lt;Slowed&gt;</code>. As you sure can tell by now, everything is very composable:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Background'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Dots: React.FC<{}>
import Dots">Dots</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Dots'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const RedHearts: React.FC<{}>
import RedHearts">RedHearts</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './RedHearts'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Slowed: React.FC<{
    children: React.ReactNode;
}>
import Slowed">Slowed</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './SlowedTrail'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Stars: React.FC<{}>
import Stars">Stars</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Stars'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const YellowHearts: React.FC<{}>
import YellowHearts">YellowHearts</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './YellowHearts'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: () => JSX.Element">MyComposition</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Slowed: React.FC<{
    children: React.ReactNode;
}>
import Slowed">Slowed</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dots: React.FC<{}>
import Dots">Dots</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const RedHearts: React.FC<{}>
import RedHearts">RedHearts</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const YellowHearts: React.FC<{}>
import YellowHearts">YellowHearts</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Stars: React.FC<{}>
import Stars">Stars</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Slowed: React.FC<{
    children: React.ReactNode;
}>
import Slowed">Slowed</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Your final firework should look like this:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Slowed.gif">
<h2 class="anchor anchorTargetStickyNavbar_tKYe" id="adding-your-animoji">Adding your animoji<a href="https://www.remotion.dev/learn/apple-wow#adding-your-animoji" class="hash-link" aria-label="Direct link to Adding your animoji" title="Direct link to Adding your animoji" translate="no">​</a></h2>
<p>As the final step of this tutorial, we add your animoji on top of the firework. For the animoji you need to have an iPhone and a Mac. This is how you get it: On your iPhone in iMessage, record an animoji of yourself and send it to a friend. After you've done that, it will also appear in the Messages app on your Mac. Download your animoji there by right-clicking. Once you have done that, create a transparent version of your animoji. Just follow these points:</p>
<ol>
<li class="">Right-click your downloaded animoji</li>
<li class="">Select "Services"</li>
<li class="">Select "Encode Selected Video Files"</li>
<li class="">Choose "Apple ProRes" in the settings dropdown</li>
<li class="">Tick the box that says "Preserve Transparency".</li>
</ol>
<p>A new encoded file of your animoji will be created. Give it a simple name like animoji.mov.</p>
<p>In addition to the <code>src</code> folder in your Remotion project, create a new one called <code>public</code>. Put your encoded video in this folder. You can then use FFmpeg to turn the encoded video into a series of frames:</p>
<ol>
<li class="">Change the current working directory to <code>public</code>: <code>cd public</code></li>
<li class="">Use this command: <code>ffmpeg -i animoji.mov -pix_fmt rgba -start_number 0 frame%03d.png</code></li>
</ol>
<p>Only assets that are being used by Remotion need to be in the <code>public</code> folder. You don't need the encoded video, so you can delete it after the frames have been extracted.</p>
<p>Here is a screenshot right before creating the series of frames:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/FFmpegCommand.png">
<br>
<br>
<p>Alright, so far you've prepared the animoji to be used in a new component called Animoji. You can import this series of frames by using the <a href="https://www.remotion.dev/docs/staticfile" target="_blank" rel="noopener noreferrer" class="">staticFile()</a> API. The file name of each frame will help you to determine the current frame number.</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Animoji.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Img: React.ComponentType<NativeImgProps &amp; {
    readonly maxRetries?: number | undefined;
    readonly pauseWhenLoading?: boolean | undefined;
    readonly delayRenderRetries?: number | undefined;
    readonly delayRenderTimeoutInMilliseconds?: number | undefined;
    readonly onImageFrame?: ((imageElement: HTMLImageElement) => void) | undefined;
    readonly src: string;
    readonly effects?: EffectsProp | undefined;
    readonly showInTimeline?: boolean | undefined;
    readonly name?: string | undefined;
    readonly stack?: string | undefined;
} &amp; InteractiveBaseProps>
import Img">Img</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const staticFile: (path: string) => string
import staticFile">staticFile</data-lsp></span><span style="color:#E1E4E8">, </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const useCurrentFrame: () => number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const Animoji: React.FC<{}>">Animoji</data-lsp></span><span style="color:#F97583">:</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8">.</span><span style="color:#B392F0"><data-lsp lsp="type React.FC<P = {}> = React.FunctionComponent<P>">FC</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const frame: number">frame</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) useCurrentFrame(): number
import useCurrentFrame">useCurrentFrame</data-lsp></span><span style="color:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  const</span><span style="color:#79B8FF"> </span><span style="color:#79B8FF"><data-lsp lsp="const src: string">src</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#9ECBFF"> `frame${</span><span style="color:#9ECBFF">(</span><span style="color:#E1E4E8"><data-lsp lsp="const frame: number">frame</data-lsp></span><span style="color:#F97583"> *</span><span style="color:#79B8FF"> 2</span><span style="color:#9ECBFF">).</span><span style="color:#B392F0"><data-lsp lsp="(method) Number.toString(radix?: number): string">toString</data-lsp></span><span style="color:#9ECBFF">().</span><span style="color:#B392F0"><data-lsp lsp="(method) String.padStart(maxLength: number, fillString?: string): string">padStart</data-lsp></span><span style="color:#9ECBFF">(</span><span style="color:#79B8FF">3</span><span style="color:#9ECBFF">, </span><span style="color:#9ECBFF">'0'</span><span style="color:#9ECBFF">)</span><span style="color:#9ECBFF">}.png`</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">      </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.justifyContent?: Property.JustifyContent | undefined">justifyContent</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.alignItems?: Property.AlignItems | undefined">alignItems</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'center'</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.marginTop?: Property.MarginTop<string | number> | undefined">marginTop</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">80</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">      }}</span></span>
<span class="line"><span style="color:#E1E4E8">    &gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Img: React.ComponentType<NativeImgProps &amp; {
    readonly maxRetries?: number | undefined;
    readonly pauseWhenLoading?: boolean | undefined;
    readonly delayRenderRetries?: number | undefined;
    readonly delayRenderTimeoutInMilliseconds?: number | undefined;
    readonly onImageFrame?: ((imageElement: HTMLImageElement) => void) | undefined;
    readonly src: string;
    readonly effects?: EffectsProp | undefined;
    readonly showInTimeline?: boolean | undefined;
    readonly name?: string | undefined;
    readonly stack?: string | undefined;
} &amp; InteractiveBaseProps>
import Img">Img</data-lsp></span></span>
<span class="line"><span style="color:#B392F0">        </span><span style="color:#B392F0"><data-lsp lsp="(property) style?: React.CSSProperties | undefined">style</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{{</span></span>
<span class="line"><span style="color:#E1E4E8">          </span><span style="color:#E1E4E8"><data-lsp lsp="(property) StandardLonghandProperties<string | number, string &amp; {}>.height?: Property.Height<string | number> | undefined">height</data-lsp></span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">800</span><span style="color:#E1E4E8">,</span></span>
<span class="line"><span style="color:#E1E4E8">        }}</span></span>
<span class="line"><span style="color:#B392F0">        </span><span style="color:#B392F0"><data-lsp lsp="(property) src: string">src</data-lsp></span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0"><data-lsp lsp="(alias) staticFile(path: string): string
import staticFile">staticFile</data-lsp></span><span style="color:#E1E4E8">(</span><span style="color:#E1E4E8"><data-lsp lsp="const src: string">src</data-lsp></span><span style="color:#E1E4E8">)}</span></span>
<span class="line"><span style="color:#E1E4E8">      /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>Render the <code>&lt;Animoji&gt;</code> component in your main composition:</p>
<div><pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">src/Composition.tsx</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> </span><span style="color:#E1E4E8"><data-lsp lsp="(alias) namespace React
import React">React</data-lsp></span><span style="color:#E1E4E8"> </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'react'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'remotion'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Animoji: React.FC<{}>
import Animoji">Animoji</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Animoji'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Background'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Dots: React.FC<{}>
import Dots">Dots</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Dots'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const RedHearts: React.FC<{}>
import RedHearts">RedHearts</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './RedHearts'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Slowed: React.FC<{
    children: React.ReactNode;
}>
import Slowed">Slowed</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './SlowedTrail'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const Stars: React.FC<{}>
import Stars">Stars</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './Stars'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const YellowHearts: React.FC<{}>
import YellowHearts">YellowHearts</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './YellowHearts'</span><span style="color:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583">export</span><span style="color:#F97583"> const</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="const MyComposition: () => JSX.Element">MyComposition</data-lsp></span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> () </span><span style="color:#F97583">=&gt;</span><span style="color:#E1E4E8"> {</span></span>
<span class="line"><span style="color:#F97583">  return</span><span style="color:#E1E4E8"> (</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Background: React.FC<{}>
import Background">Background</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Slowed: React.FC<{
    children: React.ReactNode;
}>
import Slowed">Slowed</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Dots: React.FC<{}>
import Dots">Dots</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const RedHearts: React.FC<{}>
import RedHearts">RedHearts</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const YellowHearts: React.FC<{}>
import YellowHearts">YellowHearts</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">        &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Stars: React.FC<{}>
import Stars">Stars</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Slowed: React.FC<{
    children: React.ReactNode;
}>
import Slowed">Slowed</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">      &lt;</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const Animoji: React.FC<{}>
import Animoji">Animoji</data-lsp></span><span style="color:#E1E4E8"> /&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">    &lt;/</span><span style="color:#79B8FF"><data-lsp lsp="(alias) const AbsoluteFill: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, &quot;ref&quot;> &amp; React.RefAttributes<HTMLDivElement>>
import AbsoluteFill">AbsoluteFill</data-lsp></span><span style="color:#E1E4E8">&gt;</span></span>
<span class="line"><span style="color:#E1E4E8">  );</span></span>
<span class="line"><span style="color:#E1E4E8">};</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre></div>
<p>By doing all of this you have imported a transparent version of your animoji into your composition. You can run <code>npm run build</code> to export your video as MP4. Which should look like this:</p>
<img src="https://pub-646d808d9cb240cea53bedc76dd3cd0c.r2.dev/Final.gif">
<p>Congrats on your programmatically generated video! 🎉</p>]]></content:encoded>
        </item>
    </channel>
</rss>