React

Install Bootstrap In React

In this blog, we will learn how to add React Bootstrap to our project.

Installation

The easy and best way to add Bootstrap in react is npm, using npm we can easily install bootstrap. we can also install using yarn. using the below npm command we will install bootstrap it also knows as React-Bootstrap.

npm install react-bootstrap bootstrap

when installation is done open the “index.js” file and write down the below line at the top of the file.

import 'bootstrap/dist/css/bootstrap.min.css';

The above line can be added to the App.js file also.

That’s it! now we can use bootstrap class in our pages anywhere. as an example below, I added few bootstrap buttons in the App.js file to check bootstrap class is working or not.

<button type="button" className="btn btn-warning ml-3"> Warning Button</button>
<button type="button" className="btn btn-primary ml-3"> Primary Button</button>
<button type="button" className="btn btn-success ml-3"> Success Button</button>

Hope you guys found something useful. Please give your valuable feedback/comments/questions about this article. Please let me know how you like and understand this article and how I could improve it.

Faisal Pathan

Faisal Pathan is a founder of TheCodeHubs, .NET Project Manager/Team Leader, and C# Corner MVP. He has extensive experience with designing and developing enterprise-scale applications. He has good skills in ASP.NET C#, ASP.NET Core, ASP.NET MVC, AngularJS, Angular, React, NodeJS, Amazon S3, Web API, EPPlus, Amazon MWS, eBay Integration, SQL, Entity Framework, JavaScript, eCommerce Integration like Walmart, Tanga, Newegg, Group-on Store, etc. and Windows services.

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

3 years ago