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
AccordionSummary
component primarily usesflex
containers sotextAlign
won't do that work for you. You can usejustifyContent
instead. You may target thecontent
rule name to specifically target the content (i.e., your Filter text) of AccordionSummary