<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kylecj21 on Medium]]></title>
        <description><![CDATA[Stories by Kylecj21 on Medium]]></description>
        <link>https://medium.com/@kylecj21?source=rss-47558820c599------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xrgkXWxh0AbfWqWq</url>
            <title>Stories by Kylecj21 on Medium</title>
            <link>https://medium.com/@kylecj21?source=rss-47558820c599------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:57:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kylecj21/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to easily add world class animations to your Next.js website]]></title>
            <link>https://medium.com/beginner-next-js/how-to-easily-add-world-class-animations-to-your-next-js-website-fd586f930a93?source=rss-47558820c599------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd586f930a93</guid>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[website-animation]]></category>
            <category><![CDATA[framer-motion]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Kylecj21]]></dc:creator>
            <pubDate>Tue, 02 Jan 2024 06:15:19 GMT</pubDate>
            <atom:updated>2024-01-02T06:15:19.156Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ssLvyv5OsJCp9w99iyvlyw.gif" /><figcaption>Button we will be making</figcaption></figure><p>When I began my software engineering journey, one of the skills I started with was website development. I read online about a hot new framework: Next.js, and decided to give it a try.</p><p>What did I learn from my first experiences?</p><p>Next.js is one of the most user-friendly website development frameworks available right now. When combined with tailwind CSS, it allowed even a beginner like me to make eye-catching, appealing websites.</p><p>But static websites are often overlooked, and animations are essential to have a more complete, modern look.</p><p>Luckily, there are easy steps that I can show you to add smooth transitions to any Next.js website.</p><h3>1. Make sure you have node installed.</h3><p>The framework we will be using requires npm, so make sure to install it if you have not already.</p><p>You can check if node is already installed by typing in the terminal:</p><pre>npm -v</pre><p>If you do not have a version of npm installed, you can use this command to set it up:</p><pre>npm init</pre><h3>2. Install framer-motion and tailwind CSS</h3><p>We will be using the framer animatiom framework to easily intergrate awesome animations. We also need to install tailwind CSS, to easily edit our components styling. This can be easily done once node is installed, by typing this command in the terminal:</p><pre>npm install framer-motion<br>npm install -D tailwindcss<br>npx tailwindcss init</pre><h3>3. Import the specific type of animation you prefer</h3><p>Framer has a lot of different animations, such as motion or on-scroll effects. You have to individually import each type you want to use.</p><p>You can read about the different component types on their website <a href="https://www.framer.com/motion/">here</a>.</p><p>All Next.js projects have pages where you program your HTML. This is where you will import the framer code.</p><p>For my example, I will import the motion component by putting this line at the top of my page.js:</p><pre>import { motion} from &#39;framer-motion&#39;;</pre><h3>4. Add ‘use-client’ to the top of the page.js</h3><p>Since animations are a webhook, they need to be rendered client side rather than server side. Before any of your code on page.js, add in:</p><pre>&#39;use-client&#39;</pre><h3>5. Wrap the desired component in &lt;Motion.div&gt;</h3><p>The last step is to put our HTML components inside of a Motion.div component. Whatever containers are <strong>inside</strong> of these tags are going to be included in the animation</p><p>For example, if I want to animate a Next.js button that I have added in, I could do so like this:</p><pre>&lt;motion.div<br>className=&quot;w-full h-full rounded-xl justify-center pt-5&quot;<br>whileHover={{ scale: 1.1 }}<br>transition={{ type: &quot;spring&quot;, stiffness: 400, damping: 10 }}<br>&gt;<br>  &lt;div className=&quot;flex w-full justify-center items-center pb-8 &quot;&gt;<br>    &lt;Link className=&quot;w-1/5 bg-slate-100 rounded-xl h-full py-4&quot; href=&quot;/signup&quot;&gt;<br>     Sign up<br>    &lt;/Link&gt;<br>  &lt;/div&gt;<br>&lt;/motion.div&gt;</pre><p>This animates a button so that it springs when hovered over. This adds an eye-catching pop to your components that can add more depth to a web page.</p><p>Explanation: The <em>whileHover</em> tag allows us to choose how big our image gets, and the <em>transition</em> tag lets us choose the features of our transition. Feel free to try different stiffnesses and dampings until the animation is how you like</p><p>The result of the above code is this:</p><figure><img alt="Sign up button result" src="https://cdn-images-1.medium.com/max/600/1*ssLvyv5OsJCp9w99iyvlyw.gif" /></figure><h3>Final words</h3><p>Now that we finished an example of our button, you can explore other animations on framer-motion’s website. There are a lot of flashy animations you can add to your website with this tool.</p><p>It is important to remember that animations are like paint: <strong>a little bit goes a long way</strong>.</p><p>Adding to many animations can make your website look like an 8th grade google slides presentation, which is the last thing we want. It can also <strong>slow down the rendering of your website</strong>, so use sparingly!!</p><p>If you have any questions or things to add, feel free to comment them below and I will try to respond promptly.</p><p>If anyone has any specific animation requests, I may make a post on them later.</p><p>— Kyle</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd586f930a93" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beginner-next-js/how-to-easily-add-world-class-animations-to-your-next-js-website-fd586f930a93">How to easily add world class animations to your Next.js website</a> was originally published in <a href="https://medium.com/beginner-next-js">Beginner Next.js</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>