I would like to embed a markdown file in a sharepoint online modern page, using the file and media web part or some alternative:

enter image description here

How can I remove the border that is shown around the file content?

Is there a custom pnp file web part, I could inherit from? I only could find one for viewing a whole document library: https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-documents-detailslist

Unfortunately, the source code for the original file and media web part does not seem to be available: https://github.com/pnp/sp-dev-solutions/issues/312

  • I don't think it is possible using the SharePoint out of the box web part functionality. Commented Dec 21, 2023 at 11:29
  • Yes. I am looking for a css style or something for the website template or maybe an extra web part to include markdown or word components?
    – Stefan
    Commented Dec 21, 2023 at 11:37
  • 1
    You can apply custom CSS using the modern script editor (SPFx) web part or SPFx application customizer. Check this thread: sharepoint.stackexchange.com/questions/306103/… Commented Dec 21, 2023 at 11:42

1 Answer 1


There are PnP Modern Search web parts available that you can use (https://pnp.github.io/blog/post/using-the-pnp-modern-search-web-parts/). You can use the @pnp/sp library when building your SharePoint Framework (SPFx) web parts (https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-sp-pnp-js-with-spfx-web-parts).

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.