import * as React from 'react'; import Grid from '@mui/joy/Grid'; import FormControl from '@mui/joy/FormControl'; import FormLabel from '@mui/joy/FormLabel'; import RadioGroup from '@mui/joy/RadioGroup'; import Radio from '@mui/joy/Radio'; import Sheet from '@mui/joy/Sheet'; import { GridDirection } from '@mui/system'; import { BrandingProvider } from '@mui/docs/branding'; 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) => ( {`Cell ${value + 1}`} ))} direction { setDirection( (event.target as HTMLInputElement).value as GridDirection, ); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > justifyContent { setJustifyContent( (event.target as HTMLInputElement).value as GridJustification, ); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > alignItems { setAlignItems( (event.target as HTMLInputElement).value as GridItemsAlignment, ); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > ); }