Can You Disable the SharePoint Image Web Part Lightbox?
Question details
The user wants to know if there is a way to stop the lightbox from automatically opening when an image is clicked in the modern SharePoint Image Web Part.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Displaying static images on a modern SharePoint page without triggering the full-screen lightbox overlay upon clicking.
- Observed behavior
- Clicking an image in the Image Web Part or Image Gallery Web Part automatically opens it in a lightbox view, and there is no native toggle to turn this behavior off.
Verify your SharePoint site permissions to ensure you have edit access to modify page web parts, and note that the native Image Web Part currently lacks a toggle to disable the lightbox feature.
Use the File Viewer Web Part as a Workaround
Since the native Image Web Part forces the lightbox, you can use the File Viewer Web Part to embed images on your page without triggering the popup.
The modern SharePoint Image Web Part does not currently offer an option to disable the lightbox. The Image Gallery Web Part has the same limitation.
As an alternative, the File Viewer Web Part allows you to display a specific file on the page without the native image click-to-expand behavior.
Upload the desired image to a standard SharePoint Document Library or your OneDrive.
Navigate to your modern SharePoint page, click 'Edit' in the top right corner, and hover over the page canvas to click the '+' icon to add a new web part.
Search for 'File viewer' in the web part menu and select it to add it to your page.
Choose the image you previously uploaded to your Document Library or OneDrive to display it on the page, then republish the page.

Submit Feedback to the SharePoint Product Team
Since disabling the lightbox is a feature limitation, submitting feedback can help Microsoft prioritize adding this toggle in future updates.
Manage Your Documents Seamlessly with WPS Office
While dealing with SharePoint web part limitations can be frustrating, managing your daily documents doesn't have to be. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office, offering an intuitive interface and seamless file management.
- 1. Download and Install: Download the free WPS Office installer from the official website and follow the setup wizard.
- 2. Open Your Files: Launch WPS Office and open your existing Word, Excel, or PowerPoint documents directly.
- 3. Edit and Save: Edit your documents with advanced tools and save them in standard Microsoft formats to upload to your SharePoint Document Library.

Frequently Asked Questions
Does the SharePoint Image Gallery Web Part have a lightbox toggle?
No, the Image Gallery Web Part shares the exact same feature limitation as the standard Image Web Part. Images clicked in the gallery will automatically open in a lightbox, and there is no native setting to disable it.
Can I use images stored in Site Assets with the File Viewer Web Part workaround?
Typically, no. The File Viewer Web Part restricts file selection to standard Document Libraries or OneDrive, so images stored in the backend Site Assets folder might not be selectable.
Are there custom code solutions to disable the SharePoint lightbox?
Yes. While out-of-the-box settings do not allow it, developers can build custom web parts using the SharePoint Framework (SPFx) to render images exactly as desired without triggering the lightbox effect.




