D Dev Notebook

React Bootstrap CSS

Bootstrap with React

dev notebook

Install Bootstrap via npm

Inside your React project folder, install bootstrap:

npm install bootstrap

Import Bootstrap CSS in src/index.js

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

Use Bootstrap classes in your components

function App() {
  return (
    <div className="container mt-5">
      <h1 className="text-primary">Hello, Bootstrap in React!</h1>
      <button className="btn btn-success">Click Me</button>
    </div>
  );
}

Check out the official Bootstrap CSS website for full details and documentation.

On this page