Using Bootstrap 5 with React JS ( CSS Style )

Desi Programmer
2 min readAug 30, 2021

A blog about using the latest Bootstrap 5 with react JS in CSS style. I am not going to use react-bootstrap as it is still in alpha ( on the day of writing this ).

Create a project

npx create-react-app bootstrap5-react

Installing bootstrap

npm i bootstrap

Installing node sass

Since node-sass is now deprecated, I will be using sass. It solves a common error.

npm i sass

Now in our src folder, we will create a main.scss file and add the following overrite to it.

Carbon Syntax Image

Now, import this scss on top in your index.js file.

import './main.scss';

I will simply add the following code to show that our bootstrap setup along with variable overite is working correctly.

Run this using npm start and you will see the output.

--

--