Rate this docs

Angular Bootstrap button group

Angular Button Group - Bootstrap 4 & Material Design

Angular Bootstrap button groups are buttons grouped together in a single line with no space between them. They can be grouped both vertically and horizontally.

This solution allows you to put a number of options the users can choose from.

Examples of Angular Bootstrap button group use:

  • Group of pricing options
  • Group of licenses you can see on our MDB Pro page

See the following button groups examples:


Basic example


                        <div class="btn-group" role="group" aria-label="Basic example">
                            <button mdbBtn type="button" color="primary" class="waves-light" mdbWavesEffect>Left</button>
                            <button mdbBtn type="button" color="primary" class="waves-light" mdbWavesEffect>Middle</button>
                            <button mdbBtn type="button" color="primary" class="waves-light" mdbWavesEffect>Right</button>
                        </div>
                

Button toolbar


<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
    <div class="btn-group mr-2" role="group" aria-label="First group">
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>1</button>
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>2</button>
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>3</button>
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>4</button>
    </div>
    <div class="btn-group mr-2" role="group" aria-label="Second group">
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>5</button>
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>6</button>
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>7</button>
    </div>
    <div class="btn-group" role="group" aria-label="Third group">
        <button mdbBtn type="button" color="default" class="waves-light" mdbWavesEffect>8</button>
    </div>
</div>
               

Button group sizing


<div class="btn-group btn-group-lg" role="group" aria-label="Basic example">
    <button mdbBtn type="button" color="unique" size="lg" class="waves-light" mdbWavesEffect>Left</button>
    <button mdbBtn type="button" color="unique" size="lg" class="waves-light" mdbWavesEffect>Middle</button>
    <button mdbBtn type="button" color="unique" size="lg" class="waves-light" mdbWavesEffect>Right</button>
</div>
<div class="btn-group" role="group" aria-label="Basic example">
    <button mdbBtn type="button" color="unique" class="waves-light" mdbWavesEffect>Left</button>
    <button mdbBtn type="button" color="unique" class="waves-light" mdbWavesEffect>Middle</button>
    <button mdbBtn type="button" color="unique" class="waves-light" mdbWavesEffect>Right</button>
</div>
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
    <button mdbBtn type="button" color="unique" size="sm" class="waves-light" mdbWavesEffect>Left</button>
    <button mdbBtn type="button" color="unique" size="sm" class="waves-light" mdbWavesEffect>Middle</button>
    <button mdbBtn type="button" color="unique" size="sm" class="waves-light" mdbWavesEffect>Right</button>
</div>
                

Button group nesting


<div class="btn-group" role="group" aria-label="Button group with nested dropdown">
    <button mdbBtn type="button" color="info" class="waves-light" mdbWavesEffect>1</button>
    <button mdbBtn type="button" color="info" class="waves-light" mdbWavesEffect>2</button>

    <div class="btn-group" mdbDropdown>
        <button mdbDropdownToggle type="button" mdbBtn color="info" class="dropdown-toggle waves-light" mdbWavesEffect>
            Dropdown
        </button>

        <div class="dropdown-menu dropdown-primary">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
</div>
                

Button group vertical variation


<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
    <button mdbBtn type="button" color="amber" class="waves-light ml-0" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="amber" class="waves-light" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="amber" class="waves-light" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="amber" class="waves-light" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="amber" class="waves-light" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="amber" class="waves-light" mdbWavesEffect>Button</button>
</div>
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
    <button mdbBtn type="button" color="indigo" class="waves-light ml-0" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect>Button</button>
    <div class="btn-group" mdbDropdown>
        <button mdbDropdownToggle type="button" mdbBtn color="indigo" class="dropdown-toggle waves-light" mdbWavesEffect>
            Dropdown
        </button>

        <div class="dropdown-menu dropdown-primary">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
    <button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect>Button</button>
    <button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect>Button</button>
    <div class="btn-group" mdbDropdown>
        <button mdbDropdownToggle type="button" mdbBtn color="indigo" class="dropdown-toggle waves-light" mdbWavesEffect>
            Dropdown
        </button>

        <div class="dropdown-menu dropdown-primary">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
    <div class="btn-group" mdbDropdown>
        <button mdbDropdownToggle type="button" mdbBtn color="indigo" class="dropdown-toggle waves-light" mdbWavesEffect>
            Dropdown
        </button>

        <div class="dropdown-menu dropdown-primary">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
    <div class="btn-group" mdbDropdown>
        <button mdbDropdownToggle type="button" mdbBtn color="indigo" class="dropdown-toggle waves-light" mdbWavesEffect>
            Dropdown
        </button>

        <div class="dropdown-menu dropdown-primary">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
</div>
                

Angular Button Group - API

In this section you will find informations about button group and its required modules and available inputs, outputs, methods and events.


Modules used

In order to speed up your application, you can choose to import only the modules you actually need, instead of importing the entire MDB Angular library. Remember that importing the entire library, and immediately afterwards a specific module, is bad practice, and can cause application errors.

// MDB Angular Pro
import { ButtonsModule, WavesModule } from 'ng-uikit-pro-standard'
// MDB Angular Pro
import { ButtonsModule, WavesModule } from 'angular-bootstrap-md'

Angular Button Group - examples & customization


Checkbox and radio button group MDB Pro component


<div class="btn-group">
<label mdbBtn color="mdb-color" [(ngModel)]="checkModel.left" mdbCheckbox mdbWavesEffect>
    Pre-checked
</label>
<label mdbBtn color="mdb-color" [(ngModel)]="checkModel.middle" mdbCheckbox mdbWavesEffect>
    Check
</label>
<label mdbBtn color="mdb-color" [(ngModel)]="checkModel.right" mdbCheckbox mdbWavesEffect>
    Check
</label>
</div>

<div class="btn-group">
<label mdbBtn color="light-blue" [(ngModel)]="radioModel" mdbRadio="Left" mdbWavesEffect>
    Preselected
</label>
<label mdbBtn color="light-blue" [(ngModel)]="radioModel" mdbRadio="Middle" mdbWavesEffect>
    Radio
</label>
<label mdbBtn color="light-blue" [(ngModel)]="radioModel" mdbRadio="Right" mdbWavesEffect>
    Radio
</label>
</div>
            

import { Component } from '@angular/core';

@Component({
selector: 'checkbox-radio-group',
templateUrl: './checkbox-radio-group.component.html',
})
export class CheckboxRadioGroup {

public checkModel = { left: true, middle: false, right: false };
public radioModel = 'Left';

}
            

Rounded button group MDB Pro component


<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="pink" rounded="true" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" color="pink" rounded="true" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" color="pink" rounded="true" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" gradient="purple" rounded="true" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" gradient="purple" rounded="true" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" gradient="purple" rounded="true" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="purple" rounded="true" class="waves-light" mdbWavesEffect><mdb-icon icon="star" class="mr-1"></mdb-icon>Left</button>
<button mdbBtn type="button" color="purple" rounded="true" class="waves-light" mdbWavesEffect><mdb-icon icon="heart" class="mr-1"></mdb-icon>Middle</button>
<button mdbBtn type="button" color="purple" rounded="true" class="waves-light" mdbWavesEffect><mdb-icon icon="user" class="mr-1"></mdb-icon>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="deep-purple" rounded="true" outline="true" class="waves-light" mdbWavesEffect><mdb-icon icon="anchor" class="mr-1"></mdb-icon>Left</button>
<button mdbBtn type="button" color="deep-purple" rounded="true" outline="true" class="waves-light" mdbWavesEffect><mdb-icon icon="sun-o" class="mr-1"></mdb-icon>Middle</button>
<button mdbBtn type="button" color="deep-purple" rounded="true" outline="true" class="waves-light" mdbWavesEffect><mdb-icon icon="user" class="mr-1"></mdb-icon>Right</button>
</div>
            

Additional button group MDB Pro component


<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="cyan" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" color="cyan" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" color="cyan" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" gradient="aqua" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" gradient="aqua" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" gradient="aqua" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect><mdb-icon icon="instagram" class="mr-1"></mdb-icon>Left</button>
<button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect><mdb-icon icon="twitter" class="mr-1"></mdb-icon>Middle</button>
<button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect><mdb-icon icon="snapchat-ghost" class="mr-1"></mdb-icon>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="mdb-color" outline="true" class="waves-light" mdbWavesEffect><mdb-icon icon="car" class="mr-1"></mdb-icon>Left</button>
<button mdbBtn type="button" color="mdb-color" outline="true" class="waves-light" mdbWavesEffect><mdb-icon icon="plane" class="mr-1"></mdb-icon>Middle</button>
<button mdbBtn type="button" color="mdb-color" outline="true" class="waves-light" mdbWavesEffect><mdb-icon icon="train" class="mr-1"></mdb-icon>Right</button>
</div>
            

Multicolored button group


<div class="btn-group btn-group-lg" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="primary" size="lg" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" color="warning" size="lg" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" color="danger" size="lg" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="primary" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" color="warning" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" color="danger" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
<button mdbBtn type="button" color="primary" size="sm" class="waves-light" mdbWavesEffect>Left</button>
<button mdbBtn type="button" color="warning" size="sm" class="waves-light" mdbWavesEffect>Middle</button>
<button mdbBtn type="button" color="danger" size="sm" class="waves-light" mdbWavesEffect>Right</button>
</div>

<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
<button mdbBtn type="button" color="primary" class="waves-light ml-0" mdbWavesEffect>Button</button>
<button mdbBtn type="button" color="pink" class="waves-light" mdbWavesEffect>Button</button>
<button mdbBtn type="button" color="success" class="waves-light" mdbWavesEffect>Button</button>
<button mdbBtn type="button" color="amber" class="waves-light" mdbWavesEffect>Button</button>
<button mdbBtn type="button" color="red" class="waves-light" mdbWavesEffect>Button</button>
</div>

<div class="btn-toolbar mb-4" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group" aria-label="First group">
    <button mdbBtn type="button" color="mdb-color" class="waves-light" mdbWavesEffect>1</button>
    <button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect>2</button>
    <button mdbBtn type="button" color="blue" class="waves-light" mdbWavesEffect>3</button>
    <button mdbBtn type="button" color="light-blue" class="waves-light" mdbWavesEffect>4</button>
    <button mdbBtn type="button" color="cyan" class="waves-light" mdbWavesEffect>5</button>
</div>
</div>

<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group" aria-label="First group">
    <button mdbBtn type="button" color="indigo" class="waves-light" mdbWavesEffect><mdb-icon icon="star"></mdb-icon></button>
    <button mdbBtn type="button" color="blue" class="waves-light" mdbWavesEffect><mdb-icon icon="heart"></mdb-icon></button>
    <button mdbBtn type="button" color="light-blue" class="waves-light" mdbWavesEffect><mdb-icon icon="user"></mdb-icon></button>
    <button mdbBtn type="button" color="cyan" class="waves-light" mdbWavesEffect><mdb-icon icon="twitter"></mdb-icon></button>
</div>
</div>