Bootstrap Button Component

Bootstrap provides a range of classes to style buttons in different ways. These classes can be used to create various button styles and sizes.


Bootstrap Regular Button

    <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-danger">Danger</button>
    <button type="button" class="btn btn-warning">Warning</button>
    <button type="button" class="btn btn-info">Info</button>
    <button type="button" class="btn btn-light">Light</button>
    <button type="button" class="btn btn-dark">Dark</button>
    <button type="button" class="btn btn-link">Link</button>
  • Output :

Bootstrap CSS Regular Button


Bootstrap Outline Button

    <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-danger">Danger</button>
    <button type="button" class="btn btn-outline-warning">Warning</button>
    <button type="button" class="btn btn-outline-info">Info</button>
    <button type="button" class="btn btn-outline-light">Light</button>
    <button type="button" class="btn btn-outline-dark">Dark</button>
  • Output :

Bootstrap CSS Outline Button


Bootstrap Button Size

    <button type="button" class="btn btn-primary btn-lg">Large button</button>
    <button type="button" class="btn btn-primary">Default button</button>
    <button type="button" class="btn btn-primary btn-sm">Small button</button>
  • Output :

Bootstrap CSS Button Size


Bootstrap Button Group

    <div class="btn-group">
        <button type="button" class="btn btn-primary">Left</button>
        <button type="button" class="btn btn-secondary">Middle</button>
        <button type="button" class="btn btn-success">Right</button>
    </div>
  • Output :

Bootstrap CSS Button Group


    <div class="btn-group">
        <a href="#" class="btn btn-success active">Active link</a>
        <a href="#" class="btn btn-primary">Link</a>
        <a href="#" class="btn btn-secondary">Link</a>
    </div>
  • Output :

Bootstrap CSS Link Button Group


Bootstrap Outlined Button Group

    <div class="btn-group">
        <button type="button" class="btn btn-outline-primary">Left</button>
        <button type="button" class="btn btn-outline-primary">Middle</button>
        <button type="button" class="btn btn-outline-primary">Right</button>
    </div>
  • Output :

Bootstrap CSS Outlined Button Group


Bootstrap Nesting Button Group

    <div class="btn-group">
        <button type="button" class="btn btn-primary">1</button>
        <button type="button" class="btn btn-primary">2</button>

        <div class="btn-group">
            <button type="button" class="btn btn-warning dropdown-toggle" data-bs-toggle="dropdown">
                Dropdown
            </button>
            <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="#">Dropdown link</a></li>
                <li><a class="dropdown-item" href="#">Dropdown link</a></li>
            </ul>
        </div>
    </div>
  • Output :

Bootstrap CSS Nesting Button Group


Bootstrap Checkbox Button Group

    <div class="btn-group">
        <input type="checkbox" class="btn-check" id="btncheck1" autocomplete="off">
        <label class="btn btn-outline-primary" for="btncheck1">Checkbox 1</label>

        <input type="checkbox" class="btn-check" id="btncheck2" autocomplete="off">
        <label class="btn btn-outline-primary" for="btncheck2">Checkbox 2</label>

        <input type="checkbox" class="btn-check" id="btncheck3" autocomplete="off">
        <label class="btn btn-outline-primary" for="btncheck3">Checkbox 3</label>
    </div>
  • Output :

Bootstrap CSS Checkbox Button Group


Bootstrap Radio Button Group

    <div class="btn-group">
        <input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off" checked>
        <label class="btn btn-outline-primary" for="btnradio1">Radio 1</label>

        <input type="radio" class="btn-check" name="btnradio" id="btnradio2" autocomplete="off">
        <label class="btn btn-outline-primary" for="btnradio2">Radio 2</label>

        <input type="radio" class="btn-check" name="btnradio" id="btnradio3" autocomplete="off">
        <label class="btn btn-outline-primary" for="btnradio3">Radio 3</label>
    </div>
  • Output :

Bootstrap CSS Radio Button Group


Bootstrap Vertical Button Group

    <div class="btn-group-vertical">
      <button type="button" class="btn btn-primary">Button 1</button>
      <button type="button" class="btn btn-primary">Button 2</button>
      <button type="button" class="btn btn-primary">Button 3</button>
      <button type="button" class="btn btn-primary">Button 4</button>
    </div>
  • Output :

Bootstrap CSS Vertical Button Group