I'm just getting in to customizing the modern interface in SharePoint Online for a new project. If this has been answered repeatedly before, my Google-fu may be off.

We've disabled sharing on a site, but the Share button still shows up when a file is selected - granted, the only option available is "People with existing access" but this is confusing people. So we'd like to hide this button all together.

enter image description here

It sounds like it was possible to do this in the classic interface, but I haven't found anything about doing it in the modern interface.

I've tried using CSS, which the modern interface doesn't support. I've also started looking into PnP Custom Actions, but I haven't found anything specific about hiding a built-in button with that.

Any pointers, thoughts, links to articles that I've clearly missed ... all welcome.


You could create SPFx Application Customizer to inject custom CSS to hide element.

Check below threads for demos.



| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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