MUIのCardActionsをalign centerやrightにする方法(備忘録)

2024-02-02

はじめに

MUIのCardActionに配置しているボタンなど要素を中央寄せ、右寄せにする方法を記します。

方法

<CardActions sx={{ justifyContent: 'center' }}>
</CardActions>

CardActionsは、display: flex 要素なので、上記のように指定してあげれば、中にある要素を中央寄せや右寄せに変更できます。