/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/data/material/components/grid/NestedGrid.tsx
114 строк
3 KB
Siriwat K
[Grid] Remove system props support (#47846)
24 фев 2026, 12:29
Не верифицирован
24 фев 2026, 12:29
12ea064
Код
Авторство
О чём код?
import { styled } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Paper from '@mui/material/Paper'; import Grid from '@mui/material/Grid'; const Item = styled(Paper)(({ theme }) => ({ backgroundColor: '#fff', ...theme.typography.body2, padding: theme.spacing(1), textAlign: 'center', color: (theme.vars ?? theme).palette.text.secondary, ...theme.applyStyles('dark', { backgroundColor: '#1A2027', }), })); export default function NestedGrid() { return ( <Box sx={{ flexGrow: 1 }}> <Grid container spacing={2}> <Grid size={{ xs: 12, md: 5, lg: 4 }}> <Item>Email subscribe section</Item> </Grid> <Grid container spacing={4} size={{ xs: 12, md: 7, lg: 8 }}> <Grid size={{ xs: 6, lg: 3 }}> <Item> <Box id="category-a" sx={{ fontSize: '12px', textTransform: 'uppercase' }} > Category A </Box> <Box component="ul" aria-labelledby="category-a" sx={{ pl: 2 }}> <li>Link 1.1</li> <li>Link 1.2</li> <li>Link 1.3</li> </Box> </Item> </Grid> <Grid size={{ xs: 6, lg: 3 }}> <Item> <Box id="category-b" sx={{ fontSize: '12px', textTransform: 'uppercase' }} > Category B </Box> <Box component="ul" aria-labelledby="category-b" sx={{ pl: 2 }}> <li>Link 2.1</li> <li>Link 2.2</li> <li>Link 2.3</li> </Box> </Item> </Grid> <Grid size={{ xs: 6, lg: 3 }}> <Item> <Box id="category-c" sx={{ fontSize: '12px', textTransform: 'uppercase' }} > Category C </Box> <Box component="ul" aria-labelledby="category-c" sx={{ pl: 2 }}> <li>Link 3.1</li> <li>Link 3.2</li> <li>Link 3.3</li> </Box> </Item> </Grid> <Grid size={{ xs: 6, lg: 3 }}> <Item> <Box id="category-d" sx={{ fontSize: '12px', textTransform: 'uppercase' }} > Category D </Box> <Box component="ul" aria-labelledby="category-d" sx={{ pl: 2 }}> <li>Link 4.1</li> <li>Link 4.2</li> <li>Link 4.3</li> </Box> </Item> </Grid> </Grid> <Grid container sx={{ justifyContent: 'space-between', alignItems: 'center', flexDirection: { xs: 'column', sm: 'row' }, fontSize: '12px', }} size={12} > <Grid sx={{ order: { xs: 2, sm: 1 } }}> <Item>© Copyright</Item> </Grid> <Grid container columnSpacing={1} sx={{ order: { xs: 1, sm: 2 } }}> <Grid> <Item>Link A</Item> </Grid> <Grid> <Item>Link B</Item> </Grid> <Grid> <Item>Link C</Item> </Grid> </Grid> </Grid> </Grid> </Box> ); }