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
32 lines
856 B
JavaScript
32 lines
856 B
JavaScript
import Box from '@mui/material/Box';
|
|
import { styled } from '@mui/material/styles';
|
|
import Paper from '@mui/material/Paper';
|
|
import Masonry from '@mui/lab/Masonry';
|
|
|
|
const heights = [150, 30, 90, 70, 90, 100, 150, 30, 50, 80];
|
|
|
|
const Item = styled(Paper)(({ theme }) => ({
|
|
backgroundColor: '#fff',
|
|
...theme.typography.body2,
|
|
padding: theme.spacing(0.5),
|
|
textAlign: 'center',
|
|
color: (theme.vars || theme).palette.text.secondary,
|
|
...theme.applyStyles('dark', {
|
|
backgroundColor: '#1A2027',
|
|
}),
|
|
}));
|
|
|
|
export default function ResponsiveSpacing() {
|
|
return (
|
|
<Box sx={{ width: 500, minHeight: 377 }}>
|
|
<Masonry columns={3} spacing={{ xs: 1, sm: 2, md: 3 }}>
|
|
{heights.map((height, index) => (
|
|
<Item key={index} sx={{ height }}>
|
|
{index + 1}
|
|
</Item>
|
|
))}
|
|
</Masonry>
|
|
</Box>
|
|
);
|
|
}
|