CardMedia API
Importação
import CardMedia from '@mui/material/CardMedia';
// ou
import { CardMedia } from '@mui/material';Nome do componente
The nameMuiCardMedia can be used when providing default props or style overrides in the theme.Propriedades
Propriedades do componente nativo também estão disponíveis.
| Nome | Tipo | Padrão | Descrição | 
|---|---|---|---|
| children | node | O conteúdo do componente. | |
| classes | object | Sobrescreve ou extende os estilos aplicados para o componente. Veja a API CSS abaixo para maiores detalhes. | |
| component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
| image | string | Image to be displayed as a background image. Either  imageorsrcprop must be specified. Note that caller must specify height otherwise the image will not be visible. | |
| src | string | An alias for  imageproperty. Available only with media components. Media components:video,audio,picture,iframe,img. | |
| sx | Array<func | object | bool> | func | object | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. | 
O
ref é encaminhado para o elemento raiz.CSS
| Nome da regra | Classe global | Descrição | 
|---|---|---|
| root | .MuiCardMedia-root | Estilos aplicados ao elemento raiz. | 
| media | .MuiCardMedia-media | Estilos aplicados para o elemento raiz se component="video, audio, picture, iframe, or img". | 
| img | .MuiCardMedia-img | Estilos aplicados para o elemento raiz se component="picture or img". | 
Você pode sobrescrever o estilo do componente usando uma dessas opções de customização:
- With a global class name.
- With a rule name as part of the component's styleOverridesproperty in a custom theme.