Create an Agency Website using React and Tailwind
Last Updated :
23 Jul, 2025
An agency website using React and Tailwind consists of basic components such as a home page, services, contact us, features, etc. It also has a contact form that will enable the user to contact if any issue arises on the website or the benefits to be availed by the user through the website.
Preview of Final Output: Let us have a look at how the final output will look like.
Prerequisites
Approach
- Set up the project using vite and install basic dependencies.
- Create configurations for tailwind css.
- Create several components for header, home, contact us, services and footer.
- Create a form in contact us to contact with the client.
Steps to Create a React Application and Installing Module:
Step 1 : Set up the project using the command.
npm create vite@latest
Step 2 : Navigate to the path of the directory and install node modules using the command.
npm install
Step 3 : Install tailwind css using the command.
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Step 4 : Configure the tailwind paths in your tailwind.config.js file.
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Step 5 : Add tailwind directives to your index.css file.
@tailwind base;
@tailwind components;
@tailwind utilities;
Project Structure:
Project StructureThe updated dependencies in package.json file will look like:
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
}
"devDependencies": {
"autoprefixer": "^10.4.17",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1"
}
Example: Below is an example to build an agent website in Tailwind CSS and ReacJS.
CSS
@import url(
'https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
* {
font-family: "Poppins", sans-serif;
font-weight: 500;
font-style: normal;
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth
}
@tailwind base;
@tailwind components;
@tailwind utilities;
JavaScript
import React from 'react';
import Header from './components/Header';
import Main from './components/Main';
import Services from './components/Services';
import Contact from './components/Contact';
import Footer from './components/Footer';
const App = () => {
return (
<div className='bg-blue-50
min-h-[100vh] min-w-[100vw]'>
<Header />
<Main />
<Services />
<Contact />
<Footer />
</div>
)
}
export default App
JavaScript
import React from 'react';
const Header = () => {
return (
<div id='header'
className='flex items-center
justify-between'>
<div className='text-[24px]
ml-[80px] font-bold underline'>
Let's Create
</div>
<div>
<ul className='flex cursor-pointer m-6'>
<a href="#aboutUS">
<li
className='p-6 text-[20px]
hover:text-blue-950
text-orange-800
transition-all delay-75
hover:underline hover:delay-75
'>
<a href="#header">About Us</a>
</li>
</a>
<li
className='p-6 text-[20px]
hover:text-blue-950 text-orange-800
transition-all delay-75
hover:underline hover:delay-75
'>
<a href="#services">Services</a>
</li>
<li
className='p-6 text-[20px]
hover:text-blue-950
text-orange-800
transition-all delay-75
hover:underline hover:delay-75
'>
<a href="#contact">Contact Us</a>
</li>
<li
className='p-6 text-[20px]
hover:text-blue-950
text-orange-800
transition-all delay-75
hover:underline hover:delay-75
'>
<a href="#footer">Footer</a>
</li>
</ul>
</div>
<div>
<button className=' border-green-800
text text-2xl
text-green-800
mr-[35px]
border-4 p-[6px]
rounded-md hover:bg-green-800
hover:text-white
hover:transition-all
delay-75'>Let's Talk</button>
</div>
</div>
)
}
export default Header
JavaScript
import React from 'react'
const Main = () => {
return (
<div id='aboutUs' className='flex flex-col
gap-6 bg-white ml-[55px]
mr-[55px] rounded-lg p-8'>
<div className='mt-[45px] text-3xl
font-semibold text-green-800'>
Welcome to Our Agency
</div>
<div className='text-2xl text-indigo-900'>
Smart Ideas for your
<div className='italic font-bold mt-2'>
Designs are Here!
</div>
</div>
<div className='flex gap-28'>
<div className='text-[18px]'>
Welcome to <a href="#header">
<span className='text-cyan-800
text-[20px] cursor-pointer
font-bold underline'>
Let's Create
</span>
</a>, a place where innovation and
creativity collide! Our creative
team specialises in creating
eye-catching visual experiences
that are customised for your business.
We bring your ideas to life with
anything from gorgeous logos and
modern websites to captivating
packaging and persuasive marketing
materials. Allow our creative team to
take your brand to new heights.
Come discover the power of outstanding
design with us now!
</div>
<img src="../Images/work.avif"
className='w-[380px] h-[252px]
mr-[80px] rounded-full mt-[-75px] ' />
</div>
<div className="flex">
<button
className=' border-green-800 text text-xl
text-green-800 border-2 p-[8px]
pl-[25px] pr-[25px]
rounded-md hover:bg-green-800 hover:text-white
hover:transition-all delay-75'
>
Discover More
</button>
</div>
</div>
)
}
export default Main
JavaScript
import React from 'react';
const Contact = () => {
return (
<div id='contact'
className='bg-white ml-[55px]
mr-[55px] mt-10 rounded-lg '>
<div className="flex flex-col p-10">
<div className='text-3xl mt-6 font-semibold
text-green-900'>
Contact Us
</div>
<form>
<div className='flex flex-col gap-4'>
<label htmlFor="name"
className='text-[18px] mt-4
text-green-950'>
Name
</label>
<input type="text" className='mb-4
outline-none border-2 p-2 border-gray-500
rounded-md focus:ring focus:border-green-800'
required name="name" id="name" />
</div>
<div className='flex flex-col gap-4'>
<label htmlFor="no" className='text-[18px]
text-green-950'>
Mobile No
</label>
<input type="number" className='mb-4 outline-none
border-2 p-2 border-gray-500 rounded-md focus:ring
focus:border-green-800 '
required name="no" id="no" />
</div>
<div className='flex flex-col gap-4'>
<label htmlFor="email" className='text-[18px
] text-green-950'>
Email Id
</label>
<input type="email" className='mb-4 outline-none
border-2 p-2 border-gray-500 rounded-md focus:ring
focus:border-green-800 ' required name="email"
id="email " />
</div>
<div className='flex flex-col gap-4'>
<label htmlFor="text" className='text-[18px]
text-green-950'>
Feedback(If any)
</label>
<textarea name="text" className='mb-4 outline-none
border-2 p-2 border-gray-500 rounded-md h-[105px]
focus:ring focus:border-green-800 ' id="text" >
</textarea>
</div>
<div>
<button className=' border-green-800 text text-xl
text-green-800
border-2 p-[8px] pl-[25px] pr-[25px]
rounded-md hover:bg-green-800
hover:text-white hover:transition-all delay-75 mb-5
w-full
'>Submit</button>
</div>
</form>
</div>
</div>
)
}
export default Contact
JavaScript
import React from 'react'
const Services = () => {
return (
<div id='services'
className='bg-white ml-[55px] mr-[55px] rounded-lg '>
<div className="flex mt-[80px] items-center gap-20">
<img src="../Images/work2.avif"
className='rounded-full w-[380px]
h-[252px] ml-[80px]' />
<div className='ml-[-55px]'>
<div className='text-3xl
text-orange-950 drop-shadow mt-6'>
We create some things for you!
</div>
<div className='mt-2 mb-6 text-[20px]'>
<span className='text-3xl text-orange-600 italic'>
Designs
</span>
for your success future!
</div>
<div >
<ul className='mt-8 text-[18px] mb-6'>
<li className='list-disc ml-4'>
<span className='drop-shadow text-[20px]
font-semibold text-green-950'>
Inspiration Gallery:
</span>
a variety of UI/UX ideas in the inspiration
gallery to get fast creative inspiration
</li>
<li className='list-disc ml-4'>
<span className='drop-shadow text-[20px]
font-semibold text-green-950'>
Case Studies:
</span>
Gain knowledge from actual initiatives
and triumphs.
</li>
<li className='list-disc ml-4'>
<span className='drop-shadow text-[20px]
font-semibold text-green-950'>
Trend Insights:
</span>
Stay ahead with the latest design
trends and forecasts
</li>
<li className='list-disc ml-4'>
<span className='drop-shadow text-[20px]
font-semibold text-green-950'>
Workshops & Webinars:
</span>
Gain practical knowledge
and advice from experts.
</li>
<li className='list-disc ml-4'>
<span className='drop-shadow text-[20px]
font-semibold text-green-950'>
Community Involvement:
</span>
Make connections, exchange ideas,
and work together.
</li>
</ul>
</div>
<button
className=' border-green-800 text text-xl
text-green-800
border-2 p-[8px] pl-[25px] pr-[25px]
rounded-md hover:bg-green-800
hover:text-white hover:transition-all delay-75 mb-5'
>
Know More
</button>
</div>
</div>
</div>
)
}
export default Services
JavaScript
import React from 'react';
import { FaTwitter } from "react-icons/fa6";
import { FaFacebook } from "react-icons/fa";
import { FaInstagramSquare } from "react-icons/fa";
const Footer = () => {
return (
<footer id='footer'
className="bg-gray-800 text-white py-4 mt-20">
<div className="container mx-auto grid
grid-cols-4 gap-4 text-center">
<div className="flex flex-col justify-center">
<h2 className="text-lg font-bold">
Let's Create
</h2>
<input type="email" placeholder="Enter your email"
className="mt-2 px-4 py-2 bg-gray-700 text-white
border border-gray-600 rounded-md focus:ring
focus:border-green-400" />
</div>
<div className="flex flex-col justify-center">
<h2 className="text-lg font-semibold">
Our Services
</h2>
<ul className="mt-2">
<li className="hover:text-gray-300">
Inspiration Gallery
</li>
<li className="hover:text-gray-300">
Case Studies
</li>
<li className="hover:text-gray-300">
Trend Insights
</li>
<li className="hover:text-gray-300">
Workshops and Webinars
</li>
<li className="hover:text-gray-300">
Community Involvement
</li>
</ul>
</div>
<div className="flex flex-col justify-center">
<h2 className="text-lg font-bold">
Our Company
</h2>
<ul className="mt-2">
<li className="hover:text-gray-300">
Our Services
</li>
<li className="hover:text-gray-300">
Home Section
</li>
</ul>
</div>
<div className="flex flex-col justify-center">
<h2 className="text-lg font-bold">Contact Us</h2>
<address className="mt-2">
Don Bosco Street, Ottawa, Canada
</address>
<p className="mt-1">Phone: +1234567890</p>
<p>Email: letscreate153@gmail.com</p>
<div className="mt-2 flex justify-center">
<a href="#" className="mr-2 text-4xl
hover:text-green-300 cursor-default">
<FaTwitter />
</a>
<a href="#" className="mr-2 text-4xl
hover:text-green-300 cursor-default">
<FaInstagramSquare />
</a>
<a href="#" className="hover:text-green-300
text-4xl cursor-default">
<FaFacebook />
</a>
</div>
</div>
</div>
</footer>
);
};
export default Footer;
Start your application using the following command.
npm run dev
Output : The window opens on localhost : http://localhost:5173/
Create an Agency Website using React and Tailwind
Similar Reads
React Tutorial React is a powerful JavaScript library for building fast, scalable front-end applications. Created by Facebook, it's known for its component-based structure, single-page applications (SPAs), and virtual DOM,enabling efficient UI updates and a seamless user experience.Note: The latest stable version
7 min read
React Fundamentals
React IntroductionReactJS is a component-based JavaScript library used to build dynamic and interactive user interfaces. It simplifies the creation of single-page applications (SPAs) with a focus on performance and maintainability.React.jsWhy Use React?Before React, web development faced issues like slow DOM updates
7 min read
React Environment SetupTo run any React application, we need to first setup a ReactJS Development Environment. In this article, we will show you a step-by-step guide to installing and configuring a working React development environment.Pre-requisite:We must have Nodejs installed on our PC. So, the very first step will be
3 min read
React JS ReactDOMReactDOM is a core React package that provides methods to interact with the Document Object Model, or DOM. This package allows developers to access and modify the DOM. It is a package in React that provides DOM-specific methods that can be used at the top level of a web app to enable an efficient wa
3 min read
React JSXJSX stands for JavaScript XML, and it is a special syntax used in React to simplify building user interfaces. JSX allows you to write HTML-like code directly inside JavaScript, enabling you to create UI components more efficiently. Although JSX looks like regular HTML, itâs actually a syntax extensi
5 min read
ReactJS Rendering ElementsIn this article we will learn about rendering elements in ReactJS, updating the rendered elements and will also discuss about how efficiently the elements are rendered.What are React Elements?React elements are the smallest building blocks of a React application. They are different from DOM elements
3 min read
React ListsReact Lists are used to display a collection of similar data items like an array of objects and menu items. It allows us to dynamically render the array elements and display repetitive data.Rendering List in ReactTo render a list in React, we will use the JavaScript array map() function. We will ite
5 min read
React FormsForms are an essential part of any application used for collecting user data, processing payments, or handling authentication. React Forms are the components used to collect and manage the user inputs. These components include the input elements like text field, check box, date input, dropdowns etc.
5 min read
ReactJS KeysA key serves as a unique identifier in React, helping to track which items in a list have changed, been updated, or removed. It is particularly useful when dynamically creating components or when users modify the list. In this article, we'll explore ReactJS keys, understand their importance, how the
5 min read
Components in React
React ComponentsIn React, React components are independent, reusable building blocks in a React application that define what gets displayed on the UI. They accept inputs called props and return React elements describing the UI.In this article, we will explore the basics of React components, props, state, and render
4 min read
ReactJS Functional ComponentsIn ReactJS, functional components are a core part of building user interfaces. They are simple, lightweight, and powerful tools for rendering UI and handling logic. Functional components can accept props as input and return JSX that describes what the component should render.What are Reactjs Functio
5 min read
React Class ComponentsClass components are ES6 classes that extend React.Component. They allow state management and lifecycle methods for complex UI logic.Used for stateful components before Hooks.Support lifecycle methods for mounting, updating, and unmounting.The render() method in React class components returns JSX el
4 min read
ReactJS Pure ComponentsReactJS Pure Components are similar to regular class components but with a key optimization. They skip re-renders when the props and state remain the same. While class components are still supported in React, it's generally recommended to use functional components with hooks in new code for better p
4 min read
ReactJS Container and Presentational Pattern in ComponentsIn this article we will categorise the react components in two types depending on the pattern in which they are written in application and will learn briefly about these two categories. We will also discuss about alternatives to this pattern. Presentational and Container ComponentsThe type of compon
2 min read
ReactJS PropTypesIn ReactJS PropTypes are the property that is mainly shared between the parent components to the child components. It is used to solve the type validation problem. Since in the latest version of the React 19, PropeTypes has been removed. What is ReactJS PropTypes?PropTypes is a tool in React that he
5 min read
React Lifecycle In React, the lifecycle refers to the various stages a component goes through. These stages allow developers to run specific code at key moments, such as when the component is created, updated, or removed. By understanding the React lifecycle, you can better manage resources, side effects, and perfo
7 min read
React Hooks
Routing in React
Advanced React Concepts
React Projects