Chip API
API documentation for the React Chip component. Learn about the available props, and the CSS API.
Import
import Chip from '@material-ui/core/Chip';
// o
import { Chip } from '@material-ui/core';
Chips represent complex entities in small blocks, such as a contact.
Component name
The nameMuiChip
can be used when providing default props or style overrides in the theme.Props
Nombre | Tipo | Por defecto | Descripción |
---|---|---|---|
avatar | element | The Avatar for the Card Header. | |
children | unsupportedProp | This prop isn't supported. Use the component prop 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 | false | 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 onDelete is set. | |
disabled | bool | false | If true , the accordion is displayed in a disabled state. |
icon | element | Icon element. | |
label | node | The content of the component. | |
onDelete | func | Callback fired when the delete icon is clicked. If set, the delete icon will be shown. | |
size | 'medium' | 'small' | 'medium' | The size of the autocomplete. |
variant | 'filled' | 'outlined' | string | 'filled' | 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 | Descripción |
---|---|---|
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 onClick is defined or clickable={true} . |
clickableColorPrimary | .MuiChip-clickableColorPrimary | Styles applied to the root element if onClick and color="primary" is defined or clickable={true} . |
clickableColorSecondary | .MuiChip-clickableColorSecondary | Styles applied to the root element if onClick and color="secondary" is defined or clickable={true} . |
deletable | .MuiChip-deletable | Styles applied to the root element if onDelete is defined. |
deletableColorPrimary | .MuiChip-deletableColorPrimary | Styles applied to the root element if onDelete and color="primary" is defined. |
deletableColorSecondary | .MuiChip-deletableColorSecondary | Styles applied to the root element if onDelete and color="secondary" is defined. |
outlined | .MuiChip-outlined | Styles applied to the root element if variant="outlined" . |
filled | .MuiChip-filled | Styles applied to the root element if variant="filled" . |
outlinedPrimary | .MuiChip-outlinedPrimary | Styles applied to the root element if variant="outlined" and color="primary" . |
outlinedSecondary | .MuiChip-outlinedSecondary | Styles applied to the root element if variant="outlined" and color="secondary" . |
avatar | .MuiChip-avatar | Styles applied to the avatar element. |
avatarSmall | .MuiChip-avatarSmall | Styles applied to the avatar element if size="small" . |
avatarColorPrimary | .MuiChip-avatarColorPrimary | Styles applied to the avatar element if color="primary" . |
avatarColorSecondary | .MuiChip-avatarColorSecondary | Styles applied to the avatar element if color="secondary" . |
icon | .MuiChip-icon | Styles applied to the icon element. |
iconSmall | .MuiChip-iconSmall | Styles applied to the icon element if size="small" . |
iconColorPrimary | .MuiChip-iconColorPrimary | Styles applied to the icon element if color="primary" . |
iconColorSecondary | .MuiChip-iconColorSecondary | Styles applied to the icon element if color="secondary" . |
label | .MuiChip-label | Styles applied to the label `span` element. |
labelSmall | .MuiChip-labelSmall | Styles applied to the label `span` element if size="small" . |
deleteIcon | .MuiChip-deleteIcon | Styles applied to the deleteIcon element. |
deleteIconSmall | .MuiChip-deleteIconSmall | Styles applied to the deleteIcon element if size="small" . |
deleteIconColorPrimary | .MuiChip-deleteIconColorPrimary | Styles applied to the deleteIcon element if color="primary" and variant="filled" . |
deleteIconColorSecondary | .MuiChip-deleteIconColorSecondary | Styles applied to the deleteIcon element if color="secondary" and variant="filled" . |
deleteIconOutlinedColorPrimary | .MuiChip-deleteIconOutlinedColorPrimary | Styles applied to the deleteIcon element if color="primary" and variant="outlined" . |
deleteIconOutlinedColorSecondary | .MuiChip-deleteIconOutlinedColorSecondary | Styles applied to the deleteIcon element if color="secondary" and variant="outlined" . |
focusVisible | .Mui-focusVisible | Pseudo-class applied to the root element if keyboard focused. |
You can override the style of the component using one of these customization options:
- With a rule name of the
classes
object prop. - With a global class name.
- With a theme and an
styleOverrides
property.