How to install bootstrap in react js?
December 24, 2022Hi Friends 👋,
Welcome To aGuideHub! ❤️
To install bootstrap in React js, we have two ways
- Using package manager like
npm
oryarn
- Using CDN Link
Today, I am going to show you, how to install bootstrap using above methods in react js.
Using package manager
To install bootstrap in react js, we can use package manager like npm or yarn it will add bootstrap in react js.
-
For NPM Developers
npm install react-bootstrap bootstrap
-
For Yarn Developers
yarn add react-bootstrap bootstrap
Using CDN Link
Another option install bootstrap in react js is CDN Link, we can add CDN link index.html
file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Including the bootstrap css via CDN -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<title>React-Bootstrap CodeSandbox Starter</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
All the best 👍