Screen resolution using SPFX React


Hi All I want to set the width and height of my Visio SPFx WebPart regarding the resolution of the screen. For now I use some properties but they are set in the Property Tab so fixed when the WebPart is published. In Large Screen the WebPart displays very small.


Is there a way to get the resolution of the screen so I can change the Width and Height accordingly with the screen on which the WebPart is displayed  when in the DidMount method.




1 Reply

@Michel LAPLANE Have you had a look at the Layout styles in Office Fabric UI -

You could have different sizes set for the different widths


Or the ResizeGroup react control might be of use