Hide a default list/library button in modern UI
Category
- [x] Question
- [ ] Typo
- [ ] Bug
- [ ] Additional article idea
Expected or Desired Behavior
Is it currently possible to hide a default list/library Command Bar Button in the modern UI using a CustomAction? Or should I add this request to UserVoice?
Observed Behavior
For example, we would like to hide the default 'Export to Excel' button.

In the Classic view this could be done by a Custom Action:
<CustomAction
Id="RemoveRibbonButtonLibrary"
Location="CommandUI.Ribbon"
RegistrationId="101"
RegistrationType="List">>
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Library.Actions.ExportToSpreadsheet" />
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
But this doens't work for the Modern button. When we try location 'ClientSideExtension.ListViewCommandSet.CommandBar'. We get error: "The specified properties CommandUIExtension are not supported for client-side custom action".
We also cannot found anything related to hiding a button in the documentation: Customizing "modern" lists and libraries
This is not currently supported, so we would request to open up a UserVoice entry for the new capability. Thx.
Hi @VesaJuvonen , do we have any workaround for the same. Can we go creating an app customizer or any alternate css may be, but not supported in modern UI, I believe. Any workaround is much appreciated.
Thanks, Himanjan
+1 , This is important requirement
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues