FormLabel API
Importação
import FormLabel from '@mui/material/FormLabel';
// ou
import { FormLabel } from '@mui/material';Nome do componente
The nameMuiFormLabel 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. | |
| color | 'error' | 'info' | 'primary' | 'secondary' | 'success' | 'warning' | string | The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide. | |
| component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
| disabled | bool | false | If  true, the label should be displayed in a disabled state. | 
| error | bool | false | If  true, the label should be displayed in an error state. | 
| filled | bool | false | If  true, the label should use filled classes key. | 
| focused | bool | false | If  true, the input of this label is focused (used byFormGroupcomponents). | 
| required | bool | false | If  true, the label will indicate that theinputis required. | 
| 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 | .MuiFormLabel-root | Estilos aplicados ao elemento raiz. | 
| colorSecondary | .MuiFormLabel-colorSecondary | Estilos aplicados para o elemento raiz se the color is secondary. | 
| focused | .Mui-focused | Pseudo-class aplicada a o elemento raiz se focused={true}. | 
| disabled | .Mui-disabled | Pseudo-class aplicada a o elemento raiz se disabled={true}. | 
| error | .Mui-error | Pseudo-class aplicada a o elemento raiz se error={true}. | 
| filled | .MuiFormLabel-filled | Pseudo-class aplicada a o elemento raiz se filled={true}. | 
| required | .Mui-required | Pseudo-class aplicada a o elemento raiz se required={true}. | 
| asterisk | .MuiFormLabel-asterisk | Estilos aplicados a the asterisk element. | 
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.