How to add Text Reveals in Next.js?
Last Updated :
25 Jul, 2024
In this article, we are going to learn how we can add Text reveals in NextJs. NextJS is a React-based framework. It has the power to Develop beautiful Web applications for different platforms like Windows, Linux, and Mac. The linking of dynamic paths helps in rendering your NextJS components conditionally.
Approach:
To add our Text reveals we are going to use the react-awesome-reveal package. The react-awesome-reveal package helps us to integrate different types of Text reveal. So first, we will install the react-awesome-reveal package and then we will add different texts on our homepage.
Create NextJS Application: You can create a new NextJs project using the below command:
npx create-next-app gfg
Install the required package: Now we will install the react-awesome-reveal package using the below command:
npm i react-awesome-reveal
Project Structure: It will look like this.

Adding the Text Reveals: After installing the react-awesome-reveal package we can easily add different text reveals on any page in our app. For this example, we are going to add text reveals to our homepage.
Add the below content in the index.js file:
JavaScript
import { Fade,Bounce,Flip } from "react-awesome-reveal";
import React from 'react'
export default function Reveal() {
return (
<div>
<Fade duration='10000'>
<p>GeeksforGeeks - Text</p>
</Fade>
<Flip>
<p>Second Text</p>
</Flip>
<Bounce>
<p>Third Text</p>
</Bounce>
</div>
)
}
Explanation: In the above example first, we are importing different text reveal components like Fade, Bounce, and Flip from the installed package. Then we are using this component and set the text inside it. You can also set the duration for each animation using the duration property.
Steps to run the application: Run the below command in the terminal to run the app.
npm run dev
Output:
Similar Reads
How to Add Stylesheet in Next.js ? In Next.js, adding a stylesheet enhances your app's styling capabilities. Import CSS files directly in your components or pages using ES6 import syntax. Next.js optimizes and includes these styles in the build process, ensuring efficient and modular CSS management.In this post, we are going to learn
4 min read
How to add Testimonials in Next.js ? In this article, we are going to learn how we can add the Testimonials in NextJs. NextJS is a React-based framework. It has the power to Develop beautiful Web applications for different platforms like Windows, Linux, and mac. The linking of dynamic paths helps in rendering your NextJS components con
2 min read
How to Add Tweets in Next.js ? Adding tweets in Next.js involves using Twitter's embed feature or API to display tweets. You can embed tweets directly in components or fetch and display them using server-side rendering or client-side data fetching. In this article, we are going to learn how we can add Tweets in NextJs.ApproachTo
2 min read
How to add Web Share in Next.js ? The Web Share API enables web applications to share content (like URLs, text, or files) to other apps installed on a user's device, such as social media platforms, messaging apps, or email clients. Integrating the Web Share API into a Next.js project enhances user experience by providing a seamless
2 min read
How to add Text Highlighter in Next.js ? In this article, we are going to learn how we can add Text Highlighter in NextJs. NextJS is a React-based framework. It has the power to Develop beautiful Web applications for different platforms like Windows, Linux, and mac. The linking of dynamic paths helps in rendering your NextJS components con
2 min read