Monday, July 6, 2026
HomeLanguagesJavascriptJavascript MDBootstrap Button Group Component

Javascript MDBootstrap Button Group Component

MDBootstrap is a Material Design and bootstrap-based Javascript UI library that is used to make attractive web pages with its seamless and easy-to-use component. It is free for both personal & commercial use. In this article, we will know how to use List Group Component in MDBootstap Javascript.

MDBootstrap Button Group Component is used to wraps a series of buttons together into a single line (navbar) or stack in a vertical column, with the button group.

Syntax:

<div class="btn-group" role="group">
  <button type="button" class="btn btn-color">1st</button>
  <button type="button" class="btn btn-color">2nd</button>
  <button type="button" class="btn btn-color">3rd</button>
</div>

Approach:

  • Download Javascript MDBootstrap from the official site.
  • Extract the files to the current working directory.
  • In the Index.html file, specify the downloaded file path in the <head> tag.

<link rel=”icon” href=”img/mdb-favicon.ico” type=”image/x-icon” />
<link rel=”stylesheet” href=”https://use.fontawesome.com/releases/v5.15.2/css/all.css” />
<link rel=”stylesheet” href=”https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap”/>
<link rel=”stylesheet” href=”css/mdb.min.css” />
<script type=”text/javascript” src=”js/mdb.min.js”></script>
<script type=”text/javascript”></script>

Example 1: This is the basic example that shows how to use the button group component in Javascript MDBootstrap.

HTML




<!DOCTYPE html >
<html lang="en">
  
<head>
    <title>Javascript MDBootstrap Button Group Component</title>
    <meta charset="UTF-8" />
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1
                   shrink-to-fit=no" />
    <link rel="icon" 
          href="img/mdb-favicon.ico" 
          type="image/x-icon" />
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <link rel="stylesheet" href="css/mdb.min.css" />
    <script type="text/javascript" src="js/mdb.min.js"></script>
    <script type="text/javascript"></script>
</head>
  
<body>
    <div style="margin-left: 50px;">
        <h2 style="margin-top: 50px;">
            neveropen
        </h2>
        <h4>
            MDBootstrap Javascript Button Group Component
        </h4>
        <br>
        <div class="btn-group" role="group">
            <button type="button" 
                class="btn btn-secondary">Left
            </button>
            <button type="button" 
                class="btn btn-warning">Middle
            </button>
            <button type="button" 
                class="btn btn-success">Right
            </button>
        </div>
    </div>
</body>
</html>


Output:

Javascript MDBootstrap Button Group Component

Example 2: In this example, we will know how to create the Outlined-style button using the Button Group Component in Javascript MDBootstrap.

HTML




<!DOCTYPE html >
<html lang="en">
  
<head>
    <title>Javascript MDBootstrap Button Group Component</title>
    <meta charset="UTF-8" />
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1
                   shrink-to-fit=no" />
    <link rel="icon" 
          href="img/mdb-favicon.ico" 
          type="image/x-icon" />
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
    <link rel="stylesheet" href="css/mdb.min.css" />
    <script type="text/javascript" src="js/mdb.min.js"></script>
    <script type="text/javascript"></script>
</head>
  
<body>
    <div style="margin-left: 50px;">
        <h2 style="margin-top: 50px;">
            neveropen
        </h2>
        <h4>
            MDBootstrap Javascript Button Group Component
        </h4>
        <br>
        <div class="btn-group-vertical btn-group-lg" 
             role="group">
            <button type="button" 
                    class="btn btn-outline-secondary">Left
            </button>
            <button type="button" 
                    class="btn btn-outline-warning">Middle
            </button>
            <button type="button" 
                    class="btn btn-outline-success">Right
            </button>
        </div>
    </div>
</body>
</html>


Output:

Javascript MDBootstrap Button Group Component

Reference: https://mdbootstrap.com/docs/standard/components/button-group

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen 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!
RELATED ARTICLES

3 COMMENTS

Most Popular

Dominic
32519 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6900 POSTS0 COMMENTS
Nicole Veronica
12015 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12110 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7263 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6968 POSTS0 COMMENTS