Paper API
想要学习更多组件属性和 CSS API,可以查阅 React Paper 组件的 API 文档。
导入
import Paper from '@mui/material/Paper';
// 或
import { Paper } from '@mui/material';
组件名称
The nameMuiPaper
can be used when providing default props or style overrides in the theme.属性
原生(Native) 组件的属性也是可用的。
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
children | node | The content of the component. | |
classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
elevation | integer | 1 | 阴影深度,单位为 dp 。它接受的数值在 0 到 24 之间,包含 24。 |
square | bool | false | If true , rounded corners are disabled. |
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. | |
variant | 'elevation' | 'outlined' | string | 'elevation' | The variant to use. |
ref
则会被传递到根元素中。CSS
规则名称 | 全局类名 | 描述 |
---|---|---|
root | .MuiPaper-root | Styles applied to the root element. |
rounded | .MuiPaper-rounded | Styles applied to the root element unless square={true} . |
outlined | .MuiPaper-outlined | Styles applied to the root element if variant="outlined" . |
elevation | .MuiPaper-elevation | Styles applied to the root element if variant="elevation" . |
elevation0 | .MuiPaper-elevation0 | |
elevation1 | .MuiPaper-elevation1 | |
elevation2 | .MuiPaper-elevation2 | |
elevation3 | .MuiPaper-elevation3 | |
elevation4 | .MuiPaper-elevation4 | |
elevation5 | .MuiPaper-elevation5 | |
elevation6 | .MuiPaper-elevation6 | |
elevation7 | .MuiPaper-elevation7 | |
elevation8 | .MuiPaper-elevation8 | |
elevation9 | .MuiPaper-elevation9 | |
elevation10 | .MuiPaper-elevation10 | |
elevation11 | .MuiPaper-elevation11 | |
elevation12 | .MuiPaper-elevation12 | |
elevation13 | .MuiPaper-elevation13 | |
elevation14 | .MuiPaper-elevation14 | |
elevation15 | .MuiPaper-elevation15 | |
elevation16 | .MuiPaper-elevation16 | |
elevation17 | .MuiPaper-elevation17 | |
elevation18 | .MuiPaper-elevation18 | |
elevation19 | .MuiPaper-elevation19 | |
elevation20 | .MuiPaper-elevation20 | |
elevation21 | .MuiPaper-elevation21 | |
elevation22 | .MuiPaper-elevation22 | |
elevation23 | .MuiPaper-elevation23 | |
elevation24 | .MuiPaper-elevation24 |
您可以使用组件自定义选项对组件进行个性化:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.