Steps to create React App and install required modules

Step 1: Create a React application using the following command:

npx create-react-app vertical-col

Step 2: After creating your project folder(i.e. vertical-col), move to it by using the following command:

cd vertical-col

Step 3: Now install react-bootstrap in your working directory i.e. vertical-col by executing the below command in the VScode terminal:

npm install react-bootstrap bootstrap

Step 4: Now we need to Add Bootstrap CSS to the index.js file:

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

How to make columns stack vertically on smaller screens in React Bootstrap?

In the article, we used different components like rows, columns, etc. to display and deliver the information to the user. However, on smaller screen devices, there is an issue with the representation of these components. So, to handle the columns on the smaller screens, we can use grid classes and FlexBox classes provided by React Bootstrap.

Table of Content

  • Using Bootstrap Grid Classes
  • Using Flexbox Classes with React Bootstrap

Prerequisite:

Similar Reads

Steps to create React App and install required modules:

Step 1: Create a React application using the following command:...

Approach 1: Using Bootstrap Grid Classes

In this approach, we have created three columns with different content. Then we used React Bootstrap’s grid classes and responsive breakpoints like ‘xs’,’md’, and  ‘lg’. This is mainly used to control the representation of data on various small-screen devices. On smaller screen-sized devices, we can see in the output that all the columns are aligned in a vertical stack manner. This makes the content user-friendly even on smaller screen-sized devices....

Approach 2: Using Flexbox Classes with React Bootstrap

...