Paper
Provide a themed surface with elevation, outline and corner treatment.
This guide covers Material UI Core with the default Emotion engine; extensions and additional demos are explicitly classified.
Use case and business boundary
Elevation is a presentation token, not stacking order or modal behavior.
Native composition and scope
Paper
Preserve native Material UI composition and types; do not substitute JGuang UI/Base UI/Radix APIs. Example entries are not extra components.
Native installation and initialization
npm install @mui/material@9.4.0 @emotion/react@11.14.0 @emotion/styled@11.14.1
Use native npm and Emotion, not an invented JGuang UI Registry URL. Place examples inside native ThemeProvider; choose CssBaseline or ScopedCssBaseline for the project. Inspect React, existing providers, lockfile and SSR first. Never overwrite files or conceal peer conflicts. This batch verified React 19.2.8; React 18 and below require matching react-is. See the included bilingual setup guide.
Practical native parameters
These selected parameters are not a flattened universal API. Preserve the native declaring owner, slot structure, nullable values and generics.
| Owner.prop | Practical role | Declaration source |
|---|---|---|
Paper.elevation | Native surface shadow level; not CSS z-index. | Paper |
Paper.variant | Owning native presentation enum; never substitute a universal variant prop. | Paper |
Paper.square | Remove native Paper corner rounding. | Paper |
Runnable native examples
Machine keys select example entries, not universal variant props. Native demo JSX/data stay unchanged; JGuang-authored acceptance fixtures are explicitly labelled.
- Introduction ·
SimplePaper· upstream native demo - Elevation ·
Elevation· upstream native demo - Variants ·
Variants· upstream native demo - Corners ·
SquareCorners· upstream native demo
Actual usage example
Unmodified pinned native demo; copy its required local helper files together.
import Box from '@mui/material/Box';
import Paper from '@mui/material/Paper';
export default function SimplePaper() {
return (
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
'& > :not(style)': {
m: 1,
width: 128,
height: 128,
},
}}
>
<Paper elevation={0} />
<Paper />
<Paper elevation={3} />
</Box>
);
}
Example dependency boundaries
@mui/material/Box, @mui/material/Paper, @mui/material/Grid, @mui/material/styles, @mui/material/Stack
Direct Icons/System/Utils example imports require their matching 9.4.0 packages. Relative data/helpers are part of the example closure, not extra components. Remote images and simulated operations do not supply a backend.
Pinned upstream API metadata reference
These tables retain the upstream metadata, not a newly inferred generic type system. Conditional generics, inherited props and callback details are defined by the source declarations below. Theme defaults may override metadata defaults.
Paper
import Paper from '@mui/material/Paper';
import { Paper } from '@mui/material';
| Prop | Required | Upstream metadata type / constraint | Metadata default |
|---|---|---|---|
children | no | node | — |
classes | no | object | — |
component | no | elementType | — |
elevation | no | integer | 1 |
square | no | bool | false |
sx | no | Array<func | object | bool> | func | object | — |
variant | no | 'elevation' | 'outlined' | string | 'elevation' |
Native source declarations
Declarations/imports are extracted from pinned source without flattening unions or external inheritance. Original English comments/types are source reference, not a claim of translated upstream prose. Shared types stay in their native packages.
vendor/src/Paper/Paper.d.ts
import * as React from 'react';
import { SxProps } from '@mui/system';
import { OverridableStringUnion } from '@mui/types';
import { Theme } from '../styles';
import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
import { PaperClasses } from './paperClasses';
export interface PaperPropsVariantOverrides {}
export interface PaperOwnProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<PaperClasses> | undefined;
/**
* Shadow depth, corresponds to `dp` in the spec.
* It accepts values between 0 and 24 inclusive.
* @default 1
*/
elevation?: number | undefined;
/**
* If `true`, rounded corners are disabled.
* @default false
*/
square?: boolean | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
/**
* The variant to use.
* @default 'elevation'
*/
variant?:
OverridableStringUnion<'elevation' | 'outlined', PaperPropsVariantOverrides> | undefined;
}
export interface PaperTypeMap<
AdditionalProps = {},
RootComponent extends React.ElementType = 'div',
> {
props: AdditionalProps & PaperOwnProps;
defaultComponent: RootComponent;
}
declare const Paper: OverridableComponent<PaperTypeMap>;
export interface ExtendPaperTypeMap<TypeMap extends OverridableTypeMap, Keys extends string = ''> {
props: TypeMap['props'] & Omit<PaperTypeMap['props'], Keys>;
defaultComponent: TypeMap['defaultComponent'];
}
export type PaperProps<
RootComponent extends React.ElementType = PaperTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<PaperTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType | undefined;
};
Post-install acceptance
Run strict types, production build and real interactions. Check keyboard labels/focus, disabled/error/read-only semantics where natively supported, both themes, narrow screens and reduced motion. Verify callbacks against the real host data; do not declare installation complete from copying a prompt. Initialization fixtures also require server HTML and warning-free hydration.
Source and license
https://github.com/mui/material-ui/tree/809a7717b4c050ba3f69b75300689f07c050a16e
MIT · @mui/material@9.4.0. Vendor originals and license are preserved. Full original upstream prose remains in vendor/docs and is not represented as fully translated.