Files
react-test/docs/data/material/components/skeleton/SkeletonTypography.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
828 B
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import Typography from '@mui/material/Typography';
import PropTypes from 'prop-types';
import Skeleton from '@mui/material/Skeleton';
import Grid from '@mui/material/Grid';
const variants = ['h1', 'h3', 'body1', 'caption'];
function TypographyDemo(props) {
const { loading = false } = props;
return (
<div>
{variants.map((variant) => (
<Typography component="div" key={variant} variant={variant}>
{loading ? <Skeleton /> : variant}
</Typography>
))}
</div>
);
}
TypographyDemo.propTypes = {
loading: PropTypes.bool,
};
export default function SkeletonTypography() {
return (
<Grid container spacing={8}>
<Grid size="grow">
<TypographyDemo loading />
</Grid>
<Grid size="grow">
<TypographyDemo />
</Grid>
</Grid>
);
}