DEV Community

Bipon Biswas
Bipon Biswas

Posted on • Updated on

How to Setup React Bootstrap

Create new project in react create-react-app project-name.

Step 1: start project npm start using this command into terminal.

Now you can install your bootstrap using npm i --save react-bootstrap. After you're done you should install bootstrap npm i --save bootstrap as well.

Okey then after you're done with installing both react bootstrap and bootstrap.

You can go to your react folder. Under src > index.js. That is your entry point for your web app.

From there you should import bootstrap through this line here

import Bootstrap from `bootstrap/dist/css/bootstrap.css
Enter fullscreen mode Exit fullscreen mode

You can save that.

Now you can go to your app.js file. It's under src as well.

You can import anything bootstrap as an example. I'll just button because it's simple.

import { Button } from 'react-bootstrap'

App.js file


return(
  <Button bsStyle='success'> Hello </Button>
)
Enter fullscreen mode Exit fullscreen mode

Reference - React Bootstrap

Top comments (0)