Member-only story
Building a Basic Header with React and Tailwind
3 min readJun 20, 2021
Read on for how to build a clean and simple header
Hi Folks, Farhan here. I am a Front-End Developer who recently helped build a responsive header for one of my side project. In this article, I will guide you through how to create your own simple desktop header using React and TailwindCSS.
By the end of this tutorial, you should accomplish the following result :
1. Setup
- Create a new React App by running this command in your terminal :
npx create-react-app header-app
cd
into yourheader-app
- Install Tailwind by running this command :
npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
- Install and Configure CRACO and react-router-dom package by running this commad :
npm install @craco/craco react-router-dom
- Open header-app in text-editor with
code .
You’ll have structure like this : - Once it’s installed, update your
scripts
in yourpackage.json
file to usecraco
instead ofreact-scripts
for all scripts excepteject
:
{
// ...
"scripts": {
+ "start": "craco start",
+ "build": "craco…