Forum Discussion

Adhonai_KOUKA's avatar
Adhonai_KOUKA
Tin Contributor
Sep 11, 2026

Did you know that a local HTML file can be embedded in a SharePoint Online modern page ?

Hello SharePoint community,

 

I recently tested something that surprised me.

 

I created a simple HTML file containing custom HTML, CSS and JavaScript and uploaded it to the Site Assets library of a SharePoint Online site.

 

Instead of converting the file to ASPX or developing an SPFx web part, I used the file URL in the Modern Embed web part.

 

The result was successful:

 

 HTML rendered correctly

CSS styles were applied

JavaScript executed correctly

The page was displayed inside a modern SharePoint page

 

This was tested with a basic dashboard containing cards, custom styling and JavaScript interactions.

 

One limitation I found is that when using a sharing URL, SharePoint may display the file viewer toolbar (Open, Share, etc.) above the content. I am currently investigating whether a direct file URL provides a cleaner experience.

 

Has anyone used this approach in production?

 

I'd be interested in learning about:

- Security considerations

- Governance implications

- Browser compatibility

- Microsoft recommendations for this scenario

 

Thank you.

No RepliesBe the first to reply