How to set the width of Dialog in Material UI based on the changing content?

Viewed 18

I am creating a dialog with MUI which contains three types of content whose width is very different. First, I need to upload an image and in the second content I need to crop it and it third I have to be able to add a caption for it. So how do I set the width for the dialog such that even if images of varied dimensions are chosen it is completely shown.

1 Answers

For that dialog, add sx = {{ width:'fitContent' }} and try if that works

Related