import React from 'react'; import Grid, { GridItemsAlignment, GridJustification, GridDirection } from '@material-ui/core/Grid'; import FormControl from '@material-ui/core/FormControl'; import FormLabel from '@material-ui/core/FormLabel'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import RadioGroup from '@material-ui/core/RadioGroup'; import Radio from '@material-ui/core/Radio'; import Paper from '@material-ui/core/Paper'; import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; import HighlightedCode from 'docs/src/modules/components/HighlightedCode'; const useStyles = makeStyles((theme: Theme) => createStyles({ root: { flexGrow: 1, }, demo: { height: 240, }, paper: { padding: theme.spacing(2), height: '100%', color: theme.palette.text.secondary, }, control: { padding: theme.spacing(2), }, }), ); export default function InteractiveGrid() { const classes = useStyles(); const [direction, setDirection] = React.useState('row'); const [justify, setJustify] = 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); }} > } label="row" /> } label="row-reverse" /> } label="column" /> } label="column-reverse" /> justify { setJustify((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" /> ); }