Elements: Buttons

General


<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-danger">Danger</button>

Outline


<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">Secondary</button>
<button type="button" class="btn btn-outline-success">Success</button>
<button type="button" class="btn btn-outline-info">Info</button>
<button type="button" class="btn btn-outline-warning">Warning</button>
<button type="button" class="btn btn-outline-danger">Danger</button>

Sizes

<button type="button" class="btn btn-lg btn-primary">Large Button</button>
<button type="button" class="btn btn-primary">Normal Button</button>
<button type="button" class="btn btn-sm btn-primary">Small Button</button>

Block Level Buttons

<button class="btn mb-2 btn-primary btn-block">Block Level Button</button>
<button class="btn btn-secondary btn-block">Block Level Button</button>

Button Group

<div class="btn-group" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Middle</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>

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 type="button" class="btn btn-primary"><i class="icon fa fa-play"></i></button>
        <button type="button" class="btn btn-primary"><i class="icon fa fa-pause"></i></button>
        <button type="button" class="btn btn-primary"><i class="icon fa fa-forward"></i></button>
    </div>
    <div class="btn-group mr-2" role="group" aria-label="Second group">
        <button type="button" class="btn btn-primary"><i class="icon fa fa-fast-backward"></i></button>
        <button type="button" class="btn btn-primary"><i class="icon fa fa-fast-forward"></i></button>
    </div>
    <div class="btn-group" role="group" aria-label="Third group">
        <button type="button" class="btn btn-primary"><i class="icon fa fa-stop"></i></button>
    </div>
</div>

Sizing

<!-- Large Group -->
<div class="btn-group btn-group-lg" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>
<!-- /Large Group -->

<!-- Normal Group -->
<div class="btn-group" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>
<!-- /Normal Group -->

<!-- Small Group -->
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
    <button type="button" class="btn btn-secondary">Left</button>
    <button type="button" class="btn btn-secondary">Right</button>
</div>
<!-- /Small Group -->

Nesting

<div class="btn-group" role="group" aria-label="Button group with nested dropdown">
    <button type="button" class="btn btn-primary">1</button>
    <button type="button" class="btn btn-primary">2</button>
    <div class="btn-group" role="group">
        <button type="button" class="btn btn-light dropdown-toggle"
                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Dropdown
        </button>
        <div class="dropdown-menu">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
</div>

Vertical Variation

<div class="btn-group-vertical " role="group" aria-label="Basic example">
    <button type="button" class="btn btn-primary">Top</button>
    <div class="btn-group" role="group">
        <button type="button" class="btn btn-primary dropdown-toggle"
                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            Dropdown
        </button>
        <div class="dropdown-menu">
            <a class="dropdown-item" href="#">Dropdown link</a>
            <a class="dropdown-item" href="#">Dropdown link</a>
        </div>
    </div>
    <button type="button" class="btn btn-primary">Bottom</button>
</div>