import * as React from 'react'; import FormControl from '@mui/joy/FormControl'; import FormLabel from '@mui/joy/FormLabel'; import Grid from '@mui/joy/Grid'; import Sheet from '@mui/joy/Sheet'; import RadioGroup from '@mui/joy/RadioGroup'; import Radio from '@mui/joy/Radio'; import Stack, { StackProps } from '@mui/joy/Stack'; import { styled } from '@mui/joy/styles'; import { HighlightedCode } from '@mui/docs/HighlightedCode'; import { BrandingProvider } from '@mui/docs/branding'; const Item = styled(Sheet)(({ theme }) => ({ ...theme.typography['body-sm'], textAlign: 'center', fontWeight: theme.fontWeight.md, color: theme.vars.palette.text.secondary, border: '1px solid', borderColor: theme.palette.divider, borderRadius: theme.radius.md, })); export default function InteractiveStack() { const [direction, setDirection] = React.useState('row'); const [justifyContent, setJustifyContent] = React.useState('center'); const [alignItems, setAlignItems] = React.useState('center'); const [spacing, setSpacing] = React.useState(2); const jsx = ` `; return ( {[0, 1, 2].map((value) => ( {`Item ${value + 1}`} ))} ({ p: 2, borderRadius: 'md', bgcolor: theme.palette.neutral[50], borderColor: theme.palette.neutral[100], [theme.getColorSchemeSelector('dark')]: { borderColor: theme.palette.neutral[800], backgroundColor: theme.palette.neutral[900], }, })} > direction { setDirection(event.target.value as StackProps['direction']); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > alignItems { setAlignItems(event.target.value); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > justifyContent { setJustifyContent(event.target.value); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > spacing ) => { setSpacing(Number((event.target as HTMLInputElement).value)); }} sx={{ flexWrap: 'wrap', gap: 2, '--RadioGroup-gap': '0px' }} > {[0, 0.5, 1, 2, 3, 4, 8, 12].map((value) => ( ))} ); }