DEV Community

Bipon Biswas
Bipon Biswas

Posted on • Edited on

1 1

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

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →