<Accordion><AccordionSummary helperText="Helper Text" expandIcon={<ArrowDown />} aria-controls="panel1d-content" id="panel1d-header"><Typography variant="h4" component="h4">Accordion #1</Typography></AccordionSummary><AccordionDetails><Typography>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendissemalesuada lacus ex, sit amet blandit leo lobortis eget. Lorem ipsum dolorsit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,sit amet blandit leo lobortis eget.</Typography></AccordionDetails></Accordion><Accordion><AccordionSummary helperText="Helper Text" expandIcon={<ArrowDown />} aria-controls="panel1d-content" id="panel1d-header"><Typography variant="h4" component="h4">Accordion #2</Typography></AccordionSummary><AccordionDetails><Typography>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendissemalesuada lacus ex, sit amet blandit leo lobortis eget. Lorem ipsum dolorsit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,sit amet blandit leo lobortis eget.</Typography></AccordionDetails></Accordion>
Prop | Type | Default | Description |
---|---|---|---|
action | ReactNode | The content of the component. | |
children | ReactNode | The content of the component. | |
classes | object | Override or extend the styles applied to the component. | |
defaultExpanded | boolean | If true, expands the accordion by default. | |
disabled | boolean | If true, the component is disabled. | |
disableGutters | boolean | If true, it removes the margin between two expanded accordion items and the increase of height. | |
expanded | boolean | If true, expands the accordion, otherwise collapse it. Setting this prop enables control over the accordion. |
The ref
is forwarded to the root element.
<Accordion disableGutters elevation={0}><AccordionSummary helperText="Helper Text" expandIcon={<ArrowDown />} aria-controls="panel1d-content" id="panel1d-header"><Typography variant="h4" component="h4"><Switch />Switch #1</Typography></AccordionSummary><AccordionDetails><div style={{ paddingLeft: 32 }}><MenuItem value="Ten"><Checkbox checked={true} /><ListItemText primary="Ten" /></MenuItem><MenuItem value="Twenty"><Checkbox checked={true} /><ListItemText primary="Twenty" /></MenuItem><MenuItem value="Thirty"><Checkbox checked={false} /><ListItemText primary="Thirty" /></MenuItem><MenuItem value="Forty"><Checkbox checked={true} /><ListItemText primary="Forty" /></MenuItem></div></AccordionDetails></Accordion><Accordion disableGutters elevation={0}><AccordionSummary helperText="Helper Text" expandIcon={<ArrowDown />} aria-controls="panel1d-content" id="panel1d-header"><Typography variant="h4" component="h4"><Switch />Switch #1</Typography></AccordionSummary><AccordionDetails><div style={{ paddingLeft: 32 }}><FormControl component="fieldset"><FormControlLabelvalue="disabled1"control={<Radio />}label="Selected disabled option"/><FormControlLabelvalue="disabled2"control={<Radio />}label="Unselected disabled option"/></FormControl></div></AccordionDetails></Accordion>
<Accordion disableGutters elevation={0}><AccordionSummary helperText="Helper Text" expandIcon={<ArrowDown />} aria-controls="panel1d-content" id="panel1d-header"><Typography variant="h4" component="h4"><Checkbox />CheckBox #1</Typography></AccordionSummary><AccordionDetails><div style={{ paddingLeft: 32 }}><MenuItem value="Ten"><Checkbox checked={true} /><ListItemText primary="Ten" /></MenuItem><MenuItem value="Twenty"><Checkbox checked={true} /><ListItemText primary="Twenty" /></MenuItem><MenuItem value="Thirty"><Checkbox checked={false} /><ListItemText primary="Thirty" /></MenuItem><MenuItem value="Forty"><Checkbox checked={true} /><ListItemText primary="Forty" /></MenuItem></div></AccordionDetails></Accordion><Accordion disableGutters elevation={0}><AccordionSummary helperText="Helper Text" expandIcon={<ArrowDown />} aria-controls="panel1d-content" id="panel1d-header"><Typography variant="h4" component="h4"><Checkbox />CheckBox #2</Typography></AccordionSummary><AccordionDetails><div style={{ paddingLeft: 32 }}><FormControl component="fieldset"><FormControlLabel value="disabled1" control={<Radio />} label="Selected disabled option" /><FormControlLabel value="disabled2" control={<Radio />} label="Unselected disabled option" /></FormControl></div></AccordionDetails></Accordion>