Grupo de botões
O componente ButtonGroup pode ser usado para agrupar botões relacionados.
Grupo de botões básico
The buttons can be grouped by wrapping them with the ButtonGroup
component. They need to be immediate children.
<ButtonGroup variant="contained" aria-label="outlined primary button group">
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
<ButtonGroup variant="outlined" aria-label="outlined button group">
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
<ButtonGroup variant="text" aria-label="text button group">
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
<ButtonGroup size="small" aria-label="small button group">
{buttons}
</ButtonGroup>
<ButtonGroup color="secondary" aria-label="medium secondary button group">
{buttons}
</ButtonGroup>
<ButtonGroup size="large" aria-label="large button group">
{buttons}
</ButtonGroup>
Botão dividido
ButtonGroup
também pode ser usado para criar um botão dividido. The dropdown can change the button action (as in this example) or be used to immediately trigger a related action.
<ButtonGroup disableElevation variant="contained">
<Button>One</Button>
<Button>Two</Button>
</ButtonGroup>