Bootstrap Button Groups: Creating Button Groups
Table of Content:
Button Groups
Bootstrap 4 allows you to group a series of buttons together (on a single line) in a button group:
Only Important Code
Button Group
The .btn-group class creates a button group:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Button Group
The .btn-group class creates a button group:
Tip: Instead of applying button sizes to every button in a group, use class .btn-group-lg for a large button group or the .btn-group-sm for a small button group:
Only Important Code
Button Groups Sizes
Add class .btn-group-* to size all buttons in a button group.
Large Buttons:
Default Buttons:
Small Buttons:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Button Groups Sizes
Add class .btn-group-* to size all buttons in a button group.
Large Buttons:
Default Buttons:
Small Buttons:
Vertical Button Groups
Bootstrap 4 also supports vertical button groups:
Only Important Code
Vertical Button Group
Use the .btn-group-vertical class to create a vertical button group:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Vertical Button Group
Use the .btn-group-vertical class to create a vertical button group:
Nesting Button Groups & Dropdown Menus
Nest button groups to create dropdown menus (you will learn more about dropdowns in a later chapter):
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Nesting Button Groups
Nest button groups to create dropdown menus:
Split Button Dropdowns
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Split Buttons
Vertical Button Group w/ Dropdown
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Vertical Button Group with Dropdown
Button Groups Side by Side
Button groups are "inline" by default, which makes them appear side by side when you have multiple groups:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Button Group
Button groups are "inline" by default, which makes them appear side by side when you have multiple groups: