Files
react-test/docs/data/material/components/skeleton/SkeletonTypography.tsx
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

38 lines
828 B
TypeScript

import Typography, { TypographyProps } from '@mui/material/Typography';
import Skeleton from '@mui/material/Skeleton';
import Grid from '@mui/material/Grid';
const variants = [
'h1',
'h3',
'body1',
'caption',
] as readonly TypographyProps['variant'][];
function TypographyDemo(props: { loading?: boolean }) {
const { loading = false } = props;
return (
<div>
{variants.map((variant) => (
<Typography component="div" key={variant} variant={variant}>
{loading ? <Skeleton /> : variant}
</Typography>
))}
</div>
);
}
export default function SkeletonTypography() {
return (
<Grid container spacing={8}>
<Grid size="grow">
<TypographyDemo loading />
</Grid>
<Grid size="grow">
<TypographyDemo />
</Grid>
</Grid>
);
}