Hide modern list Command Bar button

%3CLINGO-SUB%20id%3D%22lingo-sub-162180%22%20slang%3D%22en-US%22%3EHide%20modern%20list%20Command%20Bar%20button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-162180%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20it%20currently%20possible%20to%20hide%20a%20default%20Command%20Bar%20Button%20using%20a%20CustomAction%3F%3C%2FP%3E%0A%3CP%3EWe%20would%20like%26nbsp%3Bfor%20example%20to%20hide%20the%20default%20'Export%20to%20Excel'%20button.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20570px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28977i7B8AC0306F9827A9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222018-02-21%2013_31_21-App%20development%20-%20Documents%20-%20Test%20View.png%22%20title%3D%222018-02-21%2013_31_21-App%20development%20-%20Documents%20-%20Test%20View.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%20the%20Classic%20view%20this%20could%20be%20done%20by%20a%20Custom%20Action%3A%3C%2FP%3E%0A%3CPRE%3E%26lt%3BCustomAction%0A%20%20%20%20%20%20%20%20Id%3D%22RemoveRibbonButtonLibrary%22%0A%20%20%20%20%20%20%20%20Location%3D%22CommandUI.Ribbon%22%0A%20%20%20%20%20%20%20%20RegistrationId%3D%22101%22%20%0A%20%20%20%20%20%20%20%20RegistrationType%3D%22List%22%26gt%3B%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3BCommandUIExtension%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3BCommandUIDefinitions%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3BCommandUIDefinition%20Location%3D%22Ribbon.Library.Actions.ExportToSpreadsheet%22%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3B%2FCommandUIDefinitions%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3B%2FCommandUIExtension%26gt%3B%0A%26lt%3B%2FCustomAction%26gt%3B%3C%2FPRE%3E%0A%3CP%3EBut%20this%20doens't%20work%20for%20the%20Modern%20button.%20When%20we%20try%20location%20'ClientSideExtension.ListViewCommandSet.CommandBar'.%20We%20get%20error%3A%20%22The%20specified%20properties%20CommandUIExtension%20are%20not%20supported%20for%20client-side%20custom%20action%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20also%20cannot%20found%20anything%20related%20to%20hiding%20a%20button%20in%20the%20documentation%3A%3C%2FP%3E%0A%3CP%3E%3CA%20title%3D%22Customizing%20%26quot%3Bmodern%26quot%3B%20lists%20and%20libraries%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsolution-guidance%2Fmodern-experience-customizations-customize-lists-and-libraries%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECustomizing%20%22modern%22%20lists%20and%20libraries%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-162180%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExtensibility%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-165281%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20modern%20list%20Command%20Bar%20button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-165281%22%20slang%3D%22en-US%22%3EAltough%20that%20might%20work%2C%20that's%20not%20my%20preferred%20solution.%20Still%20feels%20like%20a%20hack%20to%20hide%20the%20default%20button%20that%20way.%20%3CBR%20%2F%3EI%20have%20to%20create%20a%20Application%20Customizer%20or%20set%20a%20alternate%20CSS%20on%20each%20site.%3CBR%20%2F%3EWas%20expecting%20the%20same%20functionality%20as%20in%20the%20classic%20ribbon.%20But%20looks%20like%20that's%20currently%20not%20possible%20(yet).%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-165234%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20modern%20list%20Command%20Bar%20button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-165234%22%20slang%3D%22en-US%22%3E%3CP%3EHave%20you%20tried%20the%20css%20option%20.%20In%20classic%20by%20using%20chrome%20and%20locating%20ribbon%20element%20and%20setting%20the%20style%20to%20display%3Anone%20works%20perfect.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-162200%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20modern%20list%20Command%20Bar%20button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-162200%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Till%20now%20i%20have%20not%20seen%20a%20possibility%20to%20do%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-541286%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20modern%20list%20Command%20Bar%20button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-541286%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6105%22%20target%3D%22_blank%22%3E%40Ralfh%20Barten%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20chance%20you've%20found%20a%20way%20to%20do%20this%3F%20I'm%20looking%20for%20the%20same%20thing%2C%20at%20the%20moment%2C%20and%20not%20having%20any%20luck%20with%20the%20modern%20interface.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542283%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20modern%20list%20Command%20Bar%20button%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542283%22%20slang%3D%22en-US%22%3ESame%20here%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Is it currently possible to hide a default Command Bar Button using a CustomAction?

We would like for example to hide the default 'Export to Excel' button.

2018-02-21 13_31_21-App development - Documents - Test View.png

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

 

5 Replies
Highlighted

Hi Till now i have not seen a possibility to do that.

Highlighted

Have you tried the css option . In classic by using chrome and locating ribbon element and setting the style to display:none works perfect.

 

Highlighted
Altough that might work, that's not my preferred solution. Still feels like a hack to hide the default button that way.
I have to create a Application Customizer or set a alternate CSS on each site.
Was expecting the same functionality as in the classic ribbon. But looks like that's currently not possible (yet).
Highlighted

@Ralfh Barten 

 

Any chance you've found a way to do this? I'm looking for the same thing, at the moment, and not having any luck with the modern interface.

Highlighted
Same here