Author: Dawid Adach
Disclaimer: I will explain only the key concepts and basic usage. If you wise to master the use of Bootstrap I strongly suggest you finish this course first and come back here. On the other hand, if you are familiar with Bootstrap you can scan this lesson to check how to use it along with React or directly jump to the next lesson.
1. The concept of a grid




2. Responsive breakpoints
Bootstrap is developed to be mobile—first, so it uses a handful of media queries to create sensible breakpoints for our layouts. These breakpoints are mostly based on minimum viewport widths and allow you to scale up elements as the viewport changes.
This is one of the most important features — in other words: you can define a different column size for different screen sizes. Bootstrap lists 5 different screen sizes, extra small (default), small (sm), medium (md), large (lg) and extra large (xl). Each size has a breaking point defined according to the table below:

import React, { Component } from "react";
import ReactDOM from "react-dom";
import '@fortawesome/fontawesome-free/css/all.min.css';
import "bootstrap-css-only/css/bootstrap.min.css";
import "mdbreact/dist/css/mdb.css";
import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
import "./index.css";
class App extends Component {
state = {};
render() {
return (
<React.Fragment>
<MDBContainer>
<MDBRow>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
<MDBCol xl="1" lg="2" md="4" sm="6" size="12">xl=1 lg=2 md=4 sm=6 xs=12</MDBCol>
</MDBRow>
</MDBContainer>
</React.Fragment>
);
}
}
ReactDOM.render(<App />, document.getElementById("root"));
Run the app and resize the browser size:

I hope that you now you can understand how easy it is to build responsive components using Bootstrap. Let's get back to our app. We want to create a two—column layout which will be visible on the desktop (extra large and large) as well as tablets in horizontal aspect (medium). For smaller screen sizes we want our columns to nest one below the other.
4. The responsive grid of our Calendar App
Replace the render() function template with the following code:
<MDBContainer>
<MDBRow>
<MDBCol md="9">Left column</MDBCol>
<MDBCol md="3">Right column </MDBCol>
</MDBRow>
</MDBContainer>
Previous lesson Download Next lesson
Spread the word:
