I'm working with the Accordion component from Material-UI (https://material-ui.com/api/expansion-panel-summary/). It seems like by default, regardless of what I do, the text (specifically the word 'Filter' which appears in AccordionSummary) is aligned to the left. How can I change this so it aligned to the right?
<Accordion>
<AccordionSummary expandIcon={<FilterListIcon style={{color: 'white'}} />}
style={{backgroundColor: 'black', color: 'white', textAlign: "right"}}>
Filter
</AccordionSummary>
<AccordionDetails style={{backgroundColor: 'black', color: 'white'}}>
//Some details here
</AccordionDetails>
</Accordion>
The
AccordionSummarycomponent primarily usesflexcontainers sotextAlignwon't do that work for you. You can usejustifyContentinstead. You may target thecontentrule name to specifically target the content (i.e., your Filter text) of AccordionSummary