Basic Usage
Attributes
Controls the layout orientation of the button group:
true- Horizontal layout (usesbtn-groupclass)false- Vertical layout (usesbtn-group-verticalclass)
Examples
Horizontal Button Group (Default)
Vertical Button Group
Action Buttons
Toggle Buttons
Mixed Button Types
Vertical Action Menu
Form Actions
With Custom Classes
Toolbar with Multiple Groups
Status Filters
Implementation Details
The ButtonGroup component:- Renders a
<div>element withrole="group"for accessibility - Applies
btn-groupclass for horizontal layout wheninline=true - Applies
btn-group-verticalclass for vertical layout wheninline=false - Supports all standard HTML div attributes via attribute merging
- Automatically groups child buttons with proper Bootstrap styling
btn-group- Horizontal button groupbtn-group-vertical- Vertical button group
- Always includes
role="group"for screen readers - Consider adding
aria-labelfor better accessibility:
/src/Views/Components/ButtonGroup.php:15