跳到主要内容

Button group

Group a series of buttons together on a single line or stack them in a vertical column.

Basic example

Wrap a series of <Button>s in a <ButtonGroup>.

结果
Loading...
实时编辑器

Button toolbar

Combine sets of <ButtonGroup>s into a <ButtonToolbar> for more complex components.

结果
Loading...
实时编辑器

Feel free to mix input groups with button groups in your toolbars. Similar to the example above, you’ll likely need some utilities though to space things properly.

结果
Loading...
实时编辑器

Sizing

Instead of applying button sizing props to every button in a group, just add size prop to the <ButtonGroup>.

结果
Loading...
实时编辑器

Nesting

You can place other button types within the <ButtonGroup> like <DropdownButton>s.

结果
Loading...
实时编辑器

Vertical variation

Make a set of buttons appear vertically stacked rather than horizontally, by adding vertical to the <ButtonGroup>. Split button dropdowns are not supported here.

结果
Loading...
实时编辑器

API

ButtonGroup

ButtonToolbar