ButtonGroup handles overflow for a group of Buttons. When there isn't enough horizontal space
for every Button, then it switches to a vertical layout. Anytime there are two or more
Buttons next to each other, a ButtonGroup should be used.
To see the orientation switch, reduce the width of your window.
<ButtonGroupwidth="50%"><Buttonvariant="primary">Rate Now</Button><Buttonvariant="secondary">No, thanks</Button><Buttonvariant="secondary">Remind me later</Button></ButtonGroup>
Setting this to 'vertical' will prevent any dynamic orientation changes, the ButtonGroup will remain in vertical regardless of the available width.
<ButtonGrouporientation="vertical"><Buttonvariant="secondary">No, thanks</Button><Buttonvariant="secondary">Remind me later</Button><Buttonvariant="primary">Rate Now</Button></ButtonGroup>
Button groups are aligned contextually. Generally (in LTR languages), button groups should be left-aligned to follow content. However, they should be right-aligned inside container components, such as in dialogs, popovers, or cards. They should be center-aligned in the context of an empty state. In RTL, left and right should be flipped.
To see the orientation switch, reduce the width of your window.
<Viewwidth="50%"><ButtonGroupalign="end"width="100%"><Buttonvariant="secondary">No, thanks</Button><Buttonvariant="secondary">Remind me later</Button><Buttonvariant="primary">Rate Now</Button></ButtonGroup></View>
<Viewwidth="50%"><ButtonGroupalign="center"width="100%"><Buttonvariant="secondary">No, thanks</Button><Buttonvariant="secondary">Remind me later</Button><Buttonvariant="primary">Rate Now</Button></ButtonGroup></View>