import * as React from 'react'; import Grid, { GridDirection } from '@mui/material/Grid'; import FormControl from '@mui/material/FormControl'; import FormLabel from '@mui/material/FormLabel'; import FormControlLabel from '@mui/material/FormControlLabel'; import RadioGroup from '@mui/material/RadioGroup'; import Radio from '@mui/material/Radio'; import Paper from '@mui/material/Paper'; import { HighlightedCode } from '@mui/docs/HighlightedCode'; type GridItemsAlignment = | 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'; type GridJustification = | 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'; export default function InteractiveGrid() { const [direction, setDirection] = React.useState('row'); const [justifyContent, setJustifyContent] = React.useState('center'); const [alignItems, setAlignItems] = React.useState('center'); const jsx = ` `; return ( {[0, 1, 2].map((value) => ( ({ p: 2, backgroundColor: '#fff', height: '100%', color: 'text.secondary', pt: `${(value + 1) * 10}px`, pb: `${(value + 1) * 10}px`, ...theme.applyStyles('dark', { backgroundColor: '#1A2027', }), })} > {`Cell ${value + 1}`} ))} direction { setDirection( (event.target as HTMLInputElement).value as GridDirection, ); }} > } label="row" /> } label="row-reverse" /> justifyContent { setJustifyContent( (event.target as HTMLInputElement).value as GridJustification, ); }} > } label="flex-start" /> } label="center" /> } label="flex-end" /> } label="space-between" /> } label="space-around" /> } label="space-evenly" /> alignItems { setAlignItems( (event.target as HTMLInputElement).value as GridItemsAlignment, ); }} > } label="flex-start" /> } label="center" /> } label="flex-end" /> } label="stretch" /> } label="baseline" /> ); }