Chip API
The API documentation of the Chip React component. Learn more about the props and the CSS customization points.
Import
import Chip from '@material-ui/core/Chip';
// or
import { Chip } from '@material-ui/core';You can learn more about the difference by reading this guide.
Chips represent complex entities in small blocks, such as a contact.
Component name
The MuiChip name can be used for providing default props or style overrides at the theme level.
Props
| Name | Type | Default | Description | 
|---|---|---|---|
| avatar | element | Avatar element. | |
| children | unsupportedProp | This prop isn't supported. Use the componentprop if you need to change the children structure. | |
| classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
| clickable | bool | If true, the chip will appear clickable, and will raise when pressed, even if the onClick prop is not defined. If false, the chip will not be clickable, even if onClick prop is defined. This can be used, for example, along with the component prop to indicate an anchor Chip is clickable. | |
| color | 'default' | 'primary' | 'secondary' | 'default' | The color of the component. It supports those theme colors that make sense for this component. | 
| component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
| deleteIcon | element | Override the default delete icon element. Shown only if onDeleteis set. | |
| disabled | bool | false | If true, the chip should be displayed in a disabled state. | 
| icon | element | Icon element. | |
| label | node | The content of the label. | |
| onDelete | func | Callback function fired when the delete icon is clicked. If set, the delete icon will be shown. | |
| size | 'small' | 'medium' | 'medium' | The size of the chip. | 
| variant | 'default' | 'outlined' | 'default' | 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
| Rule name | Global class | Description | 
|---|---|---|
| root | .MuiChip-root | Styles applied to the root element. | 
| sizeSmall | .MuiChip-sizeSmall | Styles applied to the root element if size="small". | 
| colorPrimary | .MuiChip-colorPrimary | Styles applied to the root element if color="primary". | 
| colorSecondary | .MuiChip-colorSecondary | Styles applied to the root element if color="secondary". | 
| disabled | .Mui-disabled | Pseudo-class applied to the root element if disabled={true}. | 
| clickable | .MuiChip-clickable | Styles applied to the root element if onClickis defined orclickable={true}. | 
| clickableColorPrimary | .MuiChip-clickableColorPrimary | Styles applied to the root element if onClickandcolor="primary"is defined orclickable={true}. | 
| clickableColorSecondary | .MuiChip-clickableColorSecondary | Styles applied to the root element if onClickandcolor="secondary"is defined orclickable={true}. | 
| deletable | .MuiChip-deletable | Styles applied to the root element if onDeleteis defined. | 
| deletableColorPrimary | .MuiChip-deletableColorPrimary | Styles applied to the root element if onDeleteandcolor="primary"is defined. | 
| deletableColorSecondary | .MuiChip-deletableColorSecondary | Styles applied to the root element if onDeleteandcolor="secondary"is defined. | 
| outlined | .MuiChip-outlined | Styles applied to the root element if variant="outlined". | 
| outlinedPrimary | .MuiChip-outlinedPrimary | Styles applied to the root element if variant="outlined"andcolor="primary". | 
| outlinedSecondary | .MuiChip-outlinedSecondary | Styles applied to the root element if variant="outlined"andcolor="secondary". | 
| avatar | .MuiChip-avatar | Styles applied to the avatarelement. | 
| avatarSmall | .MuiChip-avatarSmall | Styles applied to the avatarelement ifsize="small". | 
| avatarColorPrimary | .MuiChip-avatarColorPrimary | Styles applied to the avatarelement ifcolor="primary". | 
| avatarColorSecondary | .MuiChip-avatarColorSecondary | Styles applied to the avatarelement ifcolor="secondary". | 
| icon | .MuiChip-icon | Styles applied to the iconelement. | 
| iconSmall | .MuiChip-iconSmall | Styles applied to the iconelement ifsize="small". | 
| iconColorPrimary | .MuiChip-iconColorPrimary | Styles applied to the iconelement ifcolor="primary". | 
| iconColorSecondary | .MuiChip-iconColorSecondary | Styles applied to the iconelement ifcolor="secondary". | 
| label | .MuiChip-label | Styles applied to the label spanelement. | 
| labelSmall | .MuiChip-labelSmall | Styles applied to the label spanelement ifsize="small". | 
| deleteIcon | .MuiChip-deleteIcon | Styles applied to the deleteIconelement. | 
| deleteIconSmall | .MuiChip-deleteIconSmall | Styles applied to the deleteIconelement ifsize="small". | 
| deleteIconColorPrimary | .MuiChip-deleteIconColorPrimary | Styles applied to the deleteIcon element if color="primary"andvariant="default". | 
| deleteIconColorSecondary | .MuiChip-deleteIconColorSecondary | Styles applied to the deleteIcon element if color="secondary"andvariant="default". | 
| deleteIconOutlinedColorPrimary | .MuiChip-deleteIconOutlinedColorPrimary | Styles applied to the deleteIcon element if color="primary"andvariant="outlined". | 
| deleteIconOutlinedColorSecondary | .MuiChip-deleteIconOutlinedColorSecondary | Styles applied to the deleteIcon element if color="secondary"andvariant="outlined". | 
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.