Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • React Tutorial
  • React Exercise
  • React Basic Concepts
  • React Components
  • React Props
  • React Hooks
  • React Router
  • React Advanced
  • React Examples
  • React Interview Questions
  • React Projects
  • Next.js Tutorial
  • React Bootstrap
  • React Material UI
  • React Ant Design
  • React Desktop
  • React Rebass
  • React Blueprint
  • JavaScript
  • Web Technology
Open In App
Next Article:
Create Changelog Template using React and Tailwind CSS
Next article icon

Create Landing Page Template using React and Tailwind CSS

Last Updated : 26 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

This article guides you through creating a professional landing page template using React and Tailwind CSS, designed to showcase your skills, projects, and services effectively. It covers the setup of various sections, including a hero area for introductions, a services section to highlight offerings, a skills display to demonstrate proficiency, and a contact form for potential clients. With easy-to-follow code examples and explanations, you’ll learn how to leverage React’s component-based architecture alongside Tailwind's utility-first styling to create a responsive and visually appealing webpage

Prerequisites

  • React
  • Tailwind CSS
  • React Icons
  • Node.js

Approach

To build the landing page template, start by setting up a new React project and integrating Tailwind CSS for styling. Use the App.js file to define functional components for each section of the landing page, utilizing React's useState hook for interactive features like hovering over skills to reveal proficiency levels. Organize content into structured layouts using Tailwind's utility classes for consistent spacing, typography, and responsiveness. The approach emphasizes clarity and simplicity, allowing developers of all levels to create a polished landing page that effectively communicates their personal or professional brand.

Steps to Create & Configure the Project

Here we will create a sample React JS project and install Tailwind CSS once it is completed we will start development for the Landing Page Template using React and Tailwind CSS.

Step 1: Set up a React Application

First, create a sample React JS application using the mentioned command then navigate to the project folder.

npx create-react-app react-app
cd react-app

Project Structure:

Screenshot-2024-09-12-114329
project structure

Updated dependencies:

"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
}

Step 2: Install and Configure Tailwind CSS

Once Project is created successfully Now install and configure the Tailwind css by using below commands in your project.

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
npm install react-icons

Step 3: Develop Business logic

Once Tailwind css installation and configuration is completed. Now we need to develop user interface for Landing Page Template using tailwind CSS and for making it responsive we will use App.js and App.css files.

  • App.js ( src\App.js )
  • index.css ( src\index.js )
  • tailwind.config.js ( tailwind.config.js )

Example: This demonstrates the creation of Landing Page Template using React and Tailwind CSS:

CSS
/*src/index.css*/ @tailwind base; @tailwind components; @tailwind utilities;  body {     overflow-x: hidden;     margin: 0;     font-family: 'Times New Roman', Times, serif;     -webkit-font-smoothing: antialiased;     -moz-osx-font-smoothing: grayscale; }  code {     font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',         monospace; }  h2 {     margin-top: 2rem;     /* Adjust top margin for spacing */ } 
JavaScript
//App.js import React, { useState } from 'react'; import { FaCode, FaBook, FaUserTie, FaSchool,           FaHospital, FaShoppingCart, FaDumbbell,          FaUtensils, FaClipboardList, FaChalkboardTeacher,          FaHeadset, FaConciergeBell, FaJava, FaDatabase,          FaBitcoin, FaChartLine, FaServer, FaPenNib } from 'react-icons/fa';  export default function App() {     const [hoveredSkill, setHoveredSkill] = useState(null);      const skills = [         { name: 'Java', icon: FaJava, percentage: '85%' },         { name: 'Web Development', icon: FaCode, percentage: '90%' },         { name: 'Database', icon: FaDatabase, percentage: '80%' },         { name: 'Crypto Development', icon: FaBitcoin, percentage: '70%' },         { name: 'Trading', icon: FaChartLine, percentage: '75%' },         { name: 'Backend', icon: FaServer, percentage: '88%' },         { name: 'Article Writing', icon: FaPenNib, percentage: '95%' },     ];      const projects = [         {             title: 'Library Management System',             description: `A comprehensive system for managing library resources.`,             icon: <FaBook className="text-6xl" />         },         {             title: 'School Management System',             description: `An efficient system for school administration.`,             icon: <FaSchool className="text-6xl" />         },         {             title: 'Employee Management System',             description: `Manage employee records and tasks seamlessly.`,             icon: <FaUserTie className="text-6xl" />         },         {             title: 'Hospital Management System',             description: `A system to streamline hospital operations and patient care.`,             icon: <FaHospital className="text-6xl" />         },         {             title: 'E-commerce Platform',             description: `An online platform for buying and selling goods.`,             icon: <FaShoppingCart className="text-6xl" />         },         {             title: 'Restaurant Management System',             description: `Manage restaurant operations efficiently.`,             icon: <FaUtensils className="text-6xl" />         },         {             title: 'Gym Management System',             description: `A system for managing gym memberships and schedules.`,             icon: <FaDumbbell className="text-6xl" />         },         {             title: 'Inventory Management System', description: `Keep track of inventory levels and orders.`,             icon: <FaClipboardList className="text-6xl" />         },     ];      const [formData, setFormData] = useState({         firstName: '',         lastName: '',         email: '',         phone: '',         message: '',     });      const handleChange = (e) => {         const { name, value } = e.target;         setFormData({ ...formData, [name]: value });     };      const handleSubmit = (e) => {         e.preventDefault();         // Handle form submission logic here         console.log('Form Data Submitted:', formData);         // Reset form after submission if needed         setFormData({             firstName: '',             lastName: '',             email: '',             phone: '',             message: '',         });     };      return (         <div className="bg-green-400 p-10">             {/* Hero Section */}             <div className="section_hero h-auto                             bg-inherit w-11/12 m-10                             rounded-md p-10 flex flex-col                             items-center justify-center">                 {/* Name Section */}                 <h1 className="text-4xl font-bold text-white mb-4">                     John Doe                 </h1>                 <p className="text-xl text-gray-600 mb-8">                     Full Stack Developer | Web Designer | Programmer                 </p>                  {/* Contact Information with different styles */}                 <div className="flex flex-col items-center                                 sm:flex-row sm:space-x-6                                 space-y-4 sm:space-y-0">                     {/* Email */}                     <div className="flex items-center space-x-2">                         <span className="text-lg font-medium text-white">                             Email:                         </span>                         <a href="mailto:[email protected]"                             className="text-lg text-blue-600 hover:underline">                             john.doe@example.com                         </a>                     </div>                      {/* Phone */}                     <div className="flex items-center space-x-2">                         <span className="text-lg font-medium                            text-white">                             Phone:                         </span>                         <a href="tel:+1234567890"                             className="text-lg text-blue-600 hover:underline">                             +123 456 7890                         </a>                     </div>                 </div>                  {/* Social Links */}                 <div className="mt-6 flex space-x-4">                     <a href="#" className="text-green-600                                             text-2xl hover:text-green-700                                             transition duration-300">                         <i className="fab fa-linkedin"></i>                     </a>                     <a href="#" className="text-green-600                                            text-2xl hover:text-green-700                                            transition duration-300">                         <i className="fab fa-github"></i>                     </a>                     <a href="#" className="text-green-600                                            text-2xl hover:text-green-700                                            transition duration-300">                         <i className="fab fa-twitter"></i>                     </a>                 </div>             </div>              {/* Services Section */}             <div className="section_service h-auto                             bg-white w-11/12 m-10 rounded-md p-5">                 <p className="text-green-600 font-bold                               text-center text-[25px] my-5">                     Services                 </p>                 <p className='text-center font-bold                               text-[18px]'>                     Our diverse range of services                     is designed to support your personal                     and professional growth.                 </p>                 <div className="grid grid-cols-1 sm:grid-cols-2                                 lg:grid-cols-4 gap-8 p-10 mt-8">                     <div className="service-card bg-green-500                                     text-white rounded-lg p-6                                     flex flex-col items-center                                     transition-all duration-300                                     ease-in-out hover:scale-105">                         <FaCode className="text-4xl mb-4" />                         <p className="font-bold text-lg">Application Development</p>                     </div>                     <div className="service-card bg-green-500                                     text-white rounded-lg p-6 flex                                     flex-col items-center transition-all                                     duration-300 ease-in-out hover:scale-105">                         <FaChalkboardTeacher className="text-4xl mb-4" />                         <p className="font-bold text-lg">Teaching</p>                     </div>                     <div className="service-card bg-green-500                                     text-white rounded-lg p-6                                     flex flex-col items-center                                     transition-all duration-300                                     ease-in-out hover:scale-105">                         <FaHeadset className="text-4xl mb-4" />                         <p className="font-bold text-lg">24/7 Student Support</p>                     </div>                     <div className="service-card bg-green-500                                     text-white rounded-lg p-6                                     flex flex-col items-center                                     transition-all duration-300                                     ease-in-out hover:scale-105">                         <FaConciergeBell className="text-4xl mb-4" />                         <p className="font-bold text-lg">Other Service</p>                     </div>                 </div>             </div>              {/* Skills Section */}             <div className="section_skills h-auto bg-green-600                             w-11/12 m-10 rounded-md p-5">                 <p className="text-white font-bold text-center text-[25px] my-5">Skills</p>                 <p className='text-center text-white font-bolder text-[18px]'>                     A diverse skill set including Java,                     Web Development, Database Management,                     Crypto Development, Trading, Backend Development,                     and Article Writing for effective tech solutions.                     </p>                 <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 p-10">                     {skills.map((skill, index) => {                         const Icon = skill.icon;                         return (                             <div                                 key={index}                                 className="skill-card bg-green-500 text-white                                            rounded-lg p-6 flex flex-col items-center                                            transition-all duration-300 ease-in-out"                                 onMouseEnter={() => setHoveredSkill(index)}                                 onMouseLeave={() => setHoveredSkill(null)}                             >                                 <Icon className="text-4xl mb-4" />                                 <p className="font-bold text-lg">{skill.name}</p>                                 {hoveredSkill === index && (                                     <p className="text-sm mt-2">{skill.percentage} Proficiency</p>                                 )}                             </div>                         );                     })}                 </div>             </div>              {/* Projects Section */}             <div className="section_projects h-auto                             bg-white w-11/12 m-10 rounded-md p-5">                 <p className="text-green-600 font-bold                               text-center text-[25px] my-5">                                 Projects                                 </p>                 <p className='text-center text-green-600                               font-bolder text-[18px]'>                                 Innovative projects including a Library Management System,                                 School Management System, Employee Management System,                                 Hospital Management System, E-commerce Platform,                                 Restaurant Management System, Gym Management System,                                 and Inventory Management System.                                 </p>                 <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 p-10">                     {projects.map((project, index) => (                         <div key={index} className="project-card bg-white                                                     text-black rounded-lg p-6 flex                                                     flex-col items-center transition-all                                                     duration-300 ease-in-out hover:scale-105">                             {project.icon} {/* React Icon for the project */}                             <div className="p-2 text-center">                                 <h3 className="font-bold text-lg">{project.title}</h3>                                 <p className="text-sm mt-1">{project.description}</p>                             </div>                         </div>                     ))}                 </div>             </div>              {/* Contact Section */}             <div className="section_contact h-auto bg-white w-11/12 m-10 rounded-md p-5">                 <p className="text-green-600 font-bold text-center text-[25px]">                     Contact                     </p>                 <form onSubmit={handleSubmit} className="mt-5">                     <div className="grid grid-cols-1 sm:grid-cols-2 gap-4">                         <input                             type="text"                             name="firstName"                             placeholder="First Name"                             value={formData.firstName}                             onChange={handleChange}                             required                             className="border border-gray-300 rounded p-2"                         />                         <input                             type="text"                             name="lastName"                             placeholder="Last Name"                             value={formData.lastName}                             onChange={handleChange}                             required                             className="border border-gray-300 rounded p-2"                         />                     </div>                     <input                         type="email"                         name="email"                         placeholder="Email"                         value={formData.email}                         onChange={handleChange}                         required                         className="border border-gray-300 rounded p-2 mt-4 w-full"                     />                     <input                         type="tel"                         name="phone"                         placeholder="Phone Number"                         value={formData.phone}                         onChange={handleChange}                         required                         className="border border-gray-300 rounded p-2 mt-4 w-full"                     />                     <textarea                         name="message"                         placeholder="Message"                         value={formData.message}                         onChange={handleChange}                         required                         className="border border-gray-300 rounded p-2 mt-4 w-full"                         rows="4"                     />                     <button                         type="submit"                         className="bg-green-500 text-white                                    rounded p-2 mt-4 hover:bg-green-600                                    transition duration-300"                     >                         Submit                     </button>                 </form>             </div>         </div>     ); } 
JavaScript
/*src/tailwind.congif.js*/ /** @type {import('tailwindcss').Config} */ module.exports = {     content: [         "./src/**/*.{js,jsx,ts,tsx}",     ],     theme: {         extend: {},     },     plugins: [], } 

Step 4: Run the Application

Once Development is completed Now we need run the react js application by using below command. By default the react js application run on port number 3000.

npm start

Output: Once Project is successfully running then open the below URL to test the output.

http://localhost:3000/

Conclusion

This Landing Page Template is a powerful starting point for creating a polished and responsive web page. By using React for dynamic rendering and Tailwind CSS for rapid styling and we maintain clean code and ease of customization. The integration of React Icons adds professional looking icons to different sections and making the design both functional and aesthetically pleasing.


Next Article
Create Changelog Template using React and Tailwind CSS

M

myarticp87y
Improve
Article Tags :
  • Web Technologies
  • ReactJS
  • Tailwind CSS

Similar Reads

  • Create Podcast Template using React and Tailwind CSS
    Podcasts have become a popular medium for sharing knowledge and entertainment. Creating a podcast application can be a fun project that not only enhances your skills in React and Tailwind CSS but also provides a platform to showcase your favourite podcasts. In this template we will build a responsiv
    6 min read
  • Create Documentation Template using React and Tailwind CSS
    This documentation template serves as a comprehensive guide for developers to understand the setup configuration and functionalities of the project. We are going to build the Documentation Template using React and Tailwind CSS. PrerequisitesReact.jsTailwind CSSNode.js npmReact IconsApproachTo create
    4 min read
  • Blog Page Template using React JS and Tailwind
    A Blog Page is a web page that is used to display multiple blog posts on a website. Using blogs people can share their views, ideas, and opinions. A Blog Page generally contains a NavBar and Introduction followed by multiple blogs displayed in the form of a card. Prerequisites:React JSTailwind CSS p
    6 min read
  • Create Header using React and Tailwind CSS
    In modern web development building responsive and customizable user interfaces is crucial. One of the essential elements of any web application is the header which typically contains navigation links branding or other important controls. we will create a responsive header section using React and Tai
    4 min read
  • Create Changelog Template using React and Tailwind CSS
    A changelog is an essential tool for maintaining transparency and communication in a project by documenting changes, updates, and bug fixes and enhancements. This template will be built using React for the frontend framework and Tailwind CSS for the styling. The combination of these technologies all
    4 min read
  • Create Pagination UI Using React And Tailwind CSS
    When working with huge data sets in online applications, pagination is an essential feature. It makes a lengthy list of items easier to browse through by dividing them into digestible parts. This article will tell you how to use Tailwind CSS for styling and React for front-end functionality to creat
    3 min read
  • Create Modal Dialogs UI using React and Tailwind CSS
    Modal dialogs are an essential part of modern web applications. They offer a user-friendly way to present information or collect input without navigating away from the current page. Modals typically appear as overlays which help focus the user's attention on specific tasks like forms or alerts and c
    6 min read
  • Create Order History Page using React and Tailwind CSS
    We will create an order history page using React and Tailwind CSS. This page will display a list of previous orders in a clean and responsive layout. We'll incorporate basic functionalities like listing the order details (order ID, date, total amount, and status) and styling them using Tailwind CSS.
    3 min read
  • Create Navbars UI using React and Tailwind CSS
    A UI plays an important role because a clean, well-designed interface creates a positive first impression and if the UI is good then users can stay on our website some more time and if the UI is bad then they can not stay on our site for more time. we will see how to Create Navbars UI using React an
    5 min read
  • Create FAQs using React and Tailwind CSS
    A Frequently Asked Questions section is a common feature found on websites and applications that helps users find answers to common queries in an organized manner. A well-designed FAQ can improve user experience reduce support requests and provide users with quick and easy access to helpful informat
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences