The Wayback Machine - https://web.archive.org/web/20240926120146/https://www.geeksforgeeks.org/how-to-add-text-reveals-in-next-js/
Open In App

How to add Text Reveals in Next.js?

Last Updated : 25 Jul, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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 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 conditionally. Approach: To add our Text Highlighter
2 min read
How to pass variables to the next middleware using next() in Express.js ?
The following example covers how to pass variables to the next middleware using next() in Express.js. Approach: We cannot directly pass data to the next middleware, but we can send data through the request object. [Middleware 1] [Middleware 2] request.mydata = someData; -------> let dataFromMiddleware1 = request.mydata; Installation of Express m
2 min read
Next.js next/head
In this article, we'll learn about the Head component in NextJS and see how the head component is SEO friendly. The Head component is a built-in component provided by NextJS. We can add any element like we were adding in the head component of HTML. If you know HTML and CSS well then NextJS will be easy for you to learn. To keep everything simple th
4 min read
When to use next() and return next() in Node.js ?
In Node.js, particularly when working with the Express framework, middleware functions play a crucial role in handling requests. Two commonly used patterns within these middleware functions are next() and return next(). Understanding when and how to use these can significantly affect the flow and functionality of your application. Table of Content
4 min read
Next.js Create Next App
In Next.js, the create next app command is used to automatically initialize a new NextJS project with the default configuration, providing a streamlined way to build applications efficiently and quickly. System Requirements: Node.js 12.22.0 or laterNPM 6.14.4 or later OR Yarn 1.22.10 or latermacOS, Windows, and Linux are supportedGetting started wi
3 min read
Next.js next/link
In Next.js, next/link component enables client-side navigation between pages, enhancing performance by prefetching linked pages. It simplifies routing in your application, making it seamless and efficient. Table of Content Next.js next/link ComponentBasic usage of 'next/link'Dynamic routing with 'next/link'ConclusionNext.js next/link ComponentThe n
4 min read
Next.js next/amp
AMP (Accelerated Mobile Pages) is a web component framework developed by Google that enables the creation of fast-loading web pages. Next.js supports AMP out of the box, allowing you to create AMP pages seamlessly. What is Next.js AMP?AMP is designed to improve the performance of web pages, particularly on mobile devices. By using a subset of HTML
3 min read
Next.js next.config.js File
The next.config.js file in a Next.js application is a configuration file used to customize and extend the behavior of Next.js. It allows developers to adjust various settings such as routing, environment variables, image optimization, and more to tailor the application to their specific needs. What is next.config.js?The next.config.js is a configur
3 min read
How to display icon next to show/hide text on button ?
In this article, we will learn how to add icons with the show/hide text button and also you can use that icon as a button. It will be done here by using JavaScript. In this example, with the help of JavaScript, you can easily toggle between show and hide. Add any icons beside the button or you can use icons as a button also. Here you just need to l
2 min read
How to find all inputs that don't have color name and appends text to the span next to it using jQuery ?
Given some input elements and the task is to find all inputs that don't have the name = "color" and append text to the span next to it using jQuery. In simple words, we have to find all the input with the name != "color" and then we have to append some text next to the span element. Used Method: next() method: This method is used to return the next
2 min read
How to find all inputs with a value Green and change the text of next sibling span using jQuery ?
The purpose of this article is to find all the inputs with a value "Green" and changes the text of the next sibling span using jQuery. Used Methods - next() method - This method is used to returns the next sibling element of the selected element. text() method - This method is used to returns the text content of the selected elements. Approach - Cr
2 min read
How to Vertically Align Text Next to an Image using CSS ?
Adding images into our websites is a common practice, and there are situations where text must be vertically aligned alongside an image. For example, a user’s name should appear immediately next to their profile picture, vertically aligned for optimal readability . In this article, we will see how to align text next to an image using various method
2 min read
How to add Typewriter effect in Next.js ?
In this article, we are going to learn how we can add the Typewriter effect 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 typewriter e
2 min read
How to add Loading Quotes in Next.js ?
In this article, we are going to learn how we can add loading quotes 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 loading quotes we are g
2 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 conditionally. Approach: To add our Testimonials we a
2 min read
How to add layout in Next.js ?
Next.js is a React-based full-stack framework developed by vercel that enables functionalities like pre-rendering of web pages. Unlike traditional react app where the entire app is loaded on the client, Next.js allow the web page to be rendered on the server, which is great for performance and SEO. You can learn more about Next.js here. Layout Comp
3 min read
How to Add a Background Image in Next.js?
Next.js is a powerful React framework that allows for server-side rendering and the generation of static websites. Adding a background image to your Next.js application can enhance the visual appeal of your web pages. This article will guide you through the process of adding a background image to a Next.js project. Prerequisites:Next.jsReactJSCSSNo
3 min read
How to Add Analytics in Next.js with Plausible
In this article, we will learn how to add analytics to our Next.js app using Plausible. Adding analytics to any app is a crucial aspect of web development as it helps in understanding how the website is performing for users and how many visitors the website is getting. We will accomplish this by integrating Plausible for analytics. PrerequisitesNPM
5 min read
How to Add a Favicon to a Next.js Static Website?
To add a favicon to a next.js static website we can utilize the public directory of our next js project. A favicon is a small icon that appears in the browser tab next to the page title. It helps users identify your website easily. In this article, we'll explore different approaches to adding a favicon to a Next.js static site. Here are 2 approache
3 min read
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 about adding stylesheet in NextJs. Stylesheet ar
4 min read
How to add Slider in Next.js ?
Adding a slider in Next.js involves integrating a slider component, like react-range, managing its state using React hooks and applying styles for customization, enhancing user interaction and input precision in your application. ApproachTo add our Slider we are going to use the react-range package. The react-range package helps us to integrate sli
2 min read
How to add a Digital Clock in Next.js ?
Adding a digital clock to your Next.js application can enhance the user experience by providing real-time updates in an aesthetically pleasing manner. We can simply add it with packages available on NPM. In this article, we are going to learn how we can add Clock in Next.js ApproachTo add our Clock we are going to use the react-live-clock package.
2 min read
How to add Filters in Next.js using Algolia ?
In this article, we will learn How we can add filters in the NextJS project using Algolia. 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 filters
4 min read
How to add Video Player in Next.js ?
Adding a video player in a Next.js application enhances the user experience by enabling video playback. The react-player library simplifies integrating various video sources such as YouTube, Vimeo, and local files. In this article, we are going to learn how we can add Video Player in NextJS.  ApproachTo add a Video Player in Next.js, we will use th
2 min read
How to add Tag Input in Next.js ?
In this article, we are going to learn how we can add Tag input 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. Approach: To add our tag input, we are going to use the react-tag-input-component package. The react-tag-input-component package he
2 min read
How to Add Star Rating in Next.js ?
We can add star rating in next.js application using NPM package or create a Star rating component with css styling and state management for interactivity, enhancing user feedback and engagement. In this article, we are going to learn how we can add Star Rating in NextJS. ApproachTo add our ratings we are going to use the react-stars package. The re
2 min read
How to add CodeBlock in Next.js ?
In this article, we are going to learn how we can add CodeBlock 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. ApproachTo add CodeBlock in Next.js applicati
2 min read
How to add ESLint in Next.js ?
ESLint is a popular linting tool for identifying and fixing issues in JavaScript code. Adding ESLint to your Next.js project ensures that your code follows best practices and maintains a consistent style. This enhances code quality, helps catch errors early, and makes the codebase easier to maintain. In this article, we are going through the steps
3 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 way to share content directly from the web applica
2 min read
How to add Downloadable Spreadsheet in Next.js ?
Adding a downloadable spreadsheet in a Next.js application involves several steps, including generating the spreadsheet file and providing a download link to the user. In this article, we are going to learn how we can add a downloadable spreadsheet in NextJS. ApproachTo add our downloadable spreadsheet we are going to use the react-xls package. The
2 min read