AppBar API
Documentação da API para o componente React AppBar . Aprenda sobre as propriedades disponíveis e a API CSS.
Demonstrações
For examples and details on the usage of this React component, visit the component demo pages:
Importação
import AppBar from '@mui/material/AppBar';
// ou
import { AppBar } from '@mui/material';Nome do componente
The nameMuiAppBar can be used when providing default props or style overrides in the theme.Propriedades
Propriedades do componente Paper 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 | 'default' | 'inherit' | 'primary' | 'secondary' | 'transparent' | string | 'primary' | The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide. |
| enableColorOnDark | bool | false | Se verdadeiro, a propriedade color é aplicada em modo escuro. |
| position | 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky' | 'fixed' | O tipo de posicionamento. O comportamento das diferentes opções é descrito na documentação MDN web docs. Nota: sticky não é universalmente suportado e será modificado para static quando indisponível. |
| 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.Herança
While not explicitly documented above, the props of the Paper component are also available on AppBar. You can take advantage of this to target nested components.CSS
| Nome da regra | Classe global | Descrição |
|---|---|---|
| root | .MuiAppBar-root | Estilos aplicados ao elemento raiz. |
| positionFixed | .MuiAppBar-positionFixed | Estilos aplicados para o elemento raiz se position="fixed". |
| positionAbsolute | .MuiAppBar-positionAbsolute | Estilos aplicados para o elemento raiz se position="absolute". |
| positionSticky | .MuiAppBar-positionSticky | Estilos aplicados para o elemento raiz se position="sticky". |
| positionStatic | .MuiAppBar-positionStatic | Estilos aplicados para o elemento raiz se position="static". |
| positionRelative | .MuiAppBar-positionRelative | Estilos aplicados para o elemento raiz se position="relative". |
| colorDefault | .MuiAppBar-colorDefault | Estilos aplicados para o elemento raiz se color="default". |
| colorPrimary | .MuiAppBar-colorPrimary | Estilos aplicados para o elemento raiz se color="primary". |
| colorSecondary | .MuiAppBar-colorSecondary | Estilos aplicados para o elemento raiz se color="secondary". |
| colorInherit | .MuiAppBar-colorInherit | Estilos aplicados para o elemento raiz se color="inherit". |
| colorTransparent | .MuiAppBar-colorTransparent | Estilos aplicados para o elemento raiz se color="transparent". |
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.