Bootstrap 5 Basic
Bootstrap 5 Flexbox
Bootstrap 5 provides a button group component, which allows you to group a series of buttons together on a single line for compact user interfaces.
btn-group
: Wraps the group of buttons.btn
: Styles the buttons within the group.Try it yourself
To stack buttons vertically, use the btn-group-vertical
class:
Try it yourself
You can create small or large button groups by adding .btn-group-sm
or .btn-group-lg
.
Try it yourself
To make buttons stretch to fill the width of their parent, use utilities like d-flex
and w-100
.
Try it yourself
You can disable buttons individually in a group by adding the disabled
attribute.
Try it yourself