Icon API
Documentação da API para o componente React Icon . Aprenda sobre as propriedades disponíveis e a API CSS.
Importação
import Icon from '@mui/material/Icon';
// ou
import { Icon } from '@mui/material';Nome do componente
The nameMuiIcon can be used when providing default props or style overrides in the theme.Propriedades
Props of the nativo component are also available.
| Nome | Tipo | Padrão | Descrição |
|---|---|---|---|
| baseClassName | string | 'material-icons' | The base class applied to the icon. Defaults to 'material-icons', but can be changed to any other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc). |
| children | node | The name of the icon font ligature. | |
| classes | object | Sobrescreve ou extende os estilos aplicados para o componente. Veja a API CSS abaixo para maiores detalhes. | |
| color | 'inherit' | 'action' | 'disabled' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | string | 'inherit' | A cor do componente. Ela da suporte para as cores do tema que fazem sentido para este componente. |
| component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
| fontSize | 'inherit' | 'large' | 'medium' | 'small' | string | 'medium' | The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size. |
| sx | 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 | .MuiIcon-root | Estilos aplicados ao elemento raiz. |
| colorPrimary | .MuiIcon-colorPrimary | Estilos aplicados para o elemento raiz se color="primary". |
| colorSecondary | .MuiIcon-colorSecondary | Estilos aplicados para o elemento raiz se color="secondary". |
| colorAction | .MuiIcon-colorAction | Estilos aplicados para o elemento raiz se color="action". |
| colorError | .MuiIcon-colorError | Estilos aplicados para o elemento raiz se color="error". |
| colorDisabled | .MuiIcon-colorDisabled | Estilos aplicados para o elemento raiz se color="disabled". |
| fontSizeInherit | .MuiIcon-fontSizeInherit | Estilos aplicados para o elemento raiz se fontSize="inherit". |
| fontSizeSmall | .MuiIcon-fontSizeSmall | Estilos aplicados para o elemento raiz se fontSize="small". |
| fontSizeLarge | .MuiIcon-fontSizeLarge | Estilos aplicados para o elemento raiz se fontSize="large". |
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.