Open In App
Related Articles

React-Bootstrap Jumbotron Component

Improve Article
Save Article
Like Article

React-Bootstrap is a front-end framework that was designed keeping react in mind. Bootstrap was re-built and revamped for React, hence it is known as React-Bootstrap. 


Jumbotron is mainly used to display the core and main content of the website.

Jumbotron props:

  • as: It can be used as a custom element type for this component.
  • fluid: This property is used to make the jumbotron full width and without rounded corners.
  • bsPrefix: It is an escape hatch for working with strongly customized bootstrap css.

Creating React Application And Installing Module:

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

    npx create-react-app foldername
  • Step 2: After creating your project folder i.e. foldername, move to it using the following command:

    cd foldername
  • Step 3: After creating the ReactJS application, Install the required modules using the following command:

    npm install react-bootstrap bootstrap
  • Step 4: Add the below line in index.js file:

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

Project Structure: It will look like the following.

Example: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.


import Jumbotron from 'react-bootstrap/Jumbotron';
import Button from 'react-bootstrap/Button';
import Container from 'react-bootstrap/Container'
import React from 'react';
export default function JumbotronExample() {
  return (
      <h1>Regular, Jumbotron!</h1>
        This is a simple Jumbotron example.
        <Button variant="primary">
          Primary Button
    <Jumbotron fluid>
        <h1>Fluid jumbotron !</h1>
           This is a modified fluid jumbotron which
           stretches the whole horizontal space.    
        <Button variant="primary">
         Primary Button

Step to Run Application: Run the application using the following command from the root directory of the project:

npm start

Output: Now open your browser and go to http://localhost:3000/, you will see the following output.

Reference link:

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 21 Jan, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials