Open In App

React-Bootstrap Jumbotron Component

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. 

NOTE: AS OF BOOTSTRAP 5.X, JUMBOTRONS ARE NO LONGER SUPPORTED

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



Jumbotron props:

Creating React Application And Installing Module:



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 (
    <>
    <Jumbotron>
      <h1>Regular, Jumbotron!</h1>
      <p>
        This is a simple Jumbotron example.
      </p>
  
      <p>
        <Button variant="primary">
          Primary Button
        </Button>
      </p>
    </Jumbotron>
    <br/>
    <Jumbotron fluid>
      <Container>
        <h1>Fluid jumbotron !</h1>
        <p>
           This is a modified fluid jumbotron which
           stretches the whole horizontal space.    
        </p>
        <Button variant="primary">
         Primary Button
        </Button>
      </Container>
    </Jumbotron>
    </>
  );
}

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.


Article Tags :