React JS - Install Bootstrap

Bootstrap is a CSS Framework used to make website responsive.

To install Bootstrap, write following command in terminal:

npm install react-bootstrap

Once Bootstrap is installed, include it in index.js :

// Bootstrap CSS
import "bootstrap/dist/css/bootstrap.min.css";

// Bootstrap Bundle JS
import "bootstrap/dist/js/bootstrap.bundle.min";


That's it! Now, we can start using Bootstrap 5 classes and components in our React component.

For example, to use button and alert components :

<button className="btn btn-primary">Click me</button>

<p class="alert alert-success">Hey I am Alert Success</p>










Output :


















Comments