Reactjs

Install React-Bootstrap into React.js App?

React-Bootstrap is a library build in react js help of the bootstrap CSS framework.

Rajdeep Singh
FrontEnd web

--

React-bootstrap is a package build with react js and bootstrap.

React-bootstrap rebuilt Bootstrap components designed to work as React components.

Use React-bootstrap. You easily create react app help of bootstrap. react-bootstrap also speed up your workflow

Feature

  • Easily create reusable react component
  • Speed up your work
  • Less code
  • One command setup
  • Well define documentation
Install React-Bootstrap into React.js App?
Photo by Kris Atomic on Unsplash

Installation

Firstly create react app using npm,npx, and yarn. After installation of react.js now available to install React-bootstrap in your app.

Firstly install react js.

npx create-react-app my-app
OR
npm install react
OR
yarn add react

Secondly, install React-bootstrap.

In the second step, you install React-bootstrap in your project with two steps.

  1. yarn or npm
  2. CDN

Yarn or NPM

Install react-bootstrap use of yarn or npm

npm install react-bootstrap bootstrap
OR
yarn add react-bootstrap bootstrap

CDN

Install react-bootstrap by CDN. I do not recommend you to use CDN.

<script src="https://unpkg.com/react/umd/react.production.min.js" crossorigin></script>

<script
src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"
crossorigin></script>

<script
src="https://unpkg.com/react-bootstrap@next/dist/react-bootstrap.min.js"
crossorigin></script>

<script>var Alert = ReactBootstrap.Alert;</script>

How use it?

Steps

  1. Import Bootstrap CSS
  2. Import Component

Import Bootstrap CSS

Firstly import the Bootstrap CSS file inside the index.js file in react.js

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import 'bootstrap/dist/css/bootstrap.min.css';
ReactDOM.render(<React.StrictMode><App /></React.StrictMode>,document.getElementById('root'));

Import Component

Firstly import React-bootstrap Component, Which you like to use in the project currently. In my care, I use Container, Row, and Col Component in my project.

React Code

React-Bootstrap provides lots of Building components by default. You use a predefined build component to build your own website.

Demo

Reference

Read More

--

--

Rajdeep Singh
FrontEnd web

Follow me if you learn more about JavaScript | TypeScript | React.js | Next.js | Linux | NixOS | https://linktr.ee/officialrajdeepsingh