ButtonGroup API
The API documentation of the ButtonGroup React component. Learn more about the props and the CSS customization points.
import { ButtonGroup } from '@material-ui/core';
Props
| Name | Type | Default | Description |
|---|---|---|---|
| children * | node | The content of the button group. | |
| classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
| color | 'default' | 'inherit' | 'primary' | 'secondary' |
'default' | The color of the component. It supports those theme colors that make sense for this component. |
| component | elementType | 'div' | The component used for the root node. Either a string to use a DOM element or a component. |
| disabled | bool | false | If true, the buttons will be disabled. |
| disableFocusRipple | bool | false | If true, the button keyboard focus ripple will be disabled. disableRipple must also be true. |
| disableRipple | bool | false | If true, the button ripple effect will be disabled. |
| fullWidth | bool | false | If true, the buttons will take up the full width of its container. |
| size | 'small' | 'medium' | 'large' |
'medium' | The size of the button. small is equivalent to the dense button styling. |
| variant | 'outlined' | 'contained' |
'outlined' | The variant to use. |
The ref is forwarded to the root element.
Any other props supplied will be provided to the root element (native element).
CSS
- Style sheet name:
MuiButtonGroup. - Style sheet details:
| Rule name | Global class | Description |
|---|---|---|
| root | MuiButtonGroup-root | Styles applied to the root element. |
| contained | MuiButtonGroup-contained | Styles applied to the root element if variant="contained". |
| fullWidth | MuiButtonGroup-fullWidth | Styles applied to the root element if fullWidth={true}. |
| grouped | MuiButtonGroup-grouped | Styles applied to the children. |
| groupedOutlined | MuiButtonGroup-groupedOutlined | Styles applied to the children if variant="outlined". |
| groupedOutlinedPrimary | MuiButtonGroup-groupedOutlinedPrimary | Styles applied to the children if variant="outlined" & color="primary". |
| groupedOutlinedSecondary | MuiButtonGroup-groupedOutlinedSecondary | Styles applied to the children if variant="outlined" & color="secondary". |
| groupedContained | MuiButtonGroup-groupedContained | Styles applied to the children if variant="contained". |
| groupedContainedPrimary | MuiButtonGroup-groupedContainedPrimary | Styles applied to the children if variant="contained" & color="primary". |
| groupedContainedSecondary | MuiButtonGroup-groupedContainedSecondary | Styles applied to the children if variant="contained" & color="secondary". |
You can override the style of the component thanks to one of these customization points:
- With a rule name of the
classesobject prop. - With a global class name.
- With a theme and an
overridesproperty.
If that's not sufficient, you can check the implementation of the component for more detail.
Notes
The component is fully StrictMode compatible.