I have a SharePoint Modern Page with an image web part. The Image is linked to open the a pdf or ppt document. While clicking on the image it opens the file in the same window or tab.

Can we open the file in a popup like dialog or window?

Please help me on this.

  • Not using the SharePoint out of the box web parts. Feb 1 at 10:04

1 Answer 1


Unfortunately, this is not possible using SharePoint out of the box web parts.

In SharePoint we have:

  1. Image web part:

    • It shows the selected image in the web part
    • If Link is not provided in web part settings, it opens the image in pop up
    • If Link is provided: If the link is internal (from same site), it will open in same tab. If the link is from external web site, it will open in new tab
  2. File and Media (File viewer) web part

    • Shows the selected file directly inside the site page
    • No dialog/pop up functionality with this web part.

So, you will have to create a custom SPFx web part for your requirements. Check below links for more information:

  1. Overview of the SharePoint Framework
  2. Build your first SharePoint SPFx client-side web part
  3. SPFx web part samples - check if there is any relevant sample web part available on this GitHub repository which you can refer for your web part development

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.