SharePoint Framework (SPFx) extensions provide a powerful way to customize and enhance SharePoint lists and libraries. However, there are scenarios where you want to render your SPFx list extensions (like Command Sets, Field Customizers, or Application Customizers) only for specific types of list templates. This is achievable by modifying the ClientSideInstance.xml and elements.xml files in your solution.
We will walk you through the process, provide a practical use case, and explore the pros and cons of this approach.
From the scaffold project, you need to edit the files shown below

Steps to Configure List Extensions for Specific Templates
1. Modify the elements.xml
File
The elements.xml
file defines the extension’s deployment scope. To restrict your extension to specific list templates, use the RegistrationType and RegistrationId attributes:
Example:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Title="My Custom Command Set"
RegistrationType="List"
RegistrationId="100" <!-- List template ID -->
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
ClientSideComponentId="GUID_OF_YOUR_COMPONENT">
</CustomAction>
</Elements>

Key Attributes:
- RegistrationType: Specifies the scope (e.g.,
List
,ContentType
, orNone
). - RegistrationId: Specifies the ID of the list template. Common IDs include:
100
: Generic List101
: Document Library102
: Survey
2. Update the ClientSideInstance.xml
File
If your extension requires additional configuration for targeting list templates, you can include the listTemplateIds
property.
Example:
<ClientSideComponentProperties>
{
"listTemplateIds": ["100", "101"] <!-- Target multiple list templates -->
}
</ClientSideComponentProperties>

3. Deploy Your Solution
After updating the files:
- Build your SPFx project.
- Package and deploy the solution.
- Test to ensure your extension is applied to the targeted list templates.
List of Common SharePoint List Template IDs
Below is a list of commonly used SharePoint list template IDs:
Template ID | Template Name |
---|---|
100 | Generic List |
101 | Document Library |
102 | Survey |
103 | Links |
104 | Announcements |
105 | Contacts |
106 | Events |
107 | Tasks |
108 | Discussion Board |
109 | Picture Library |
171 | Promoted Links |
850 | Access App |
For a full list of SharePoint list template IDs, refer to the official Microsoft documentation: SharePoint List Template IDs.
Use Case: Custom Command Set for Document Libraries
Scenario:
You are tasked with creating a custom Command Set extension for managing document approval workflows, but it should only be available in document libraries.
Steps:
- Set
RegistrationType="List"
andRegistrationId="101"
in theelements.xml
file. - Add any custom configuration for workflows in the
ClientSideInstance.xml
file. - Deploy and test the Command Set in document libraries.
Outcome:
The Command Set appears exclusively in document libraries, streamlining user interaction and reducing clutter in other list types.
Pros and Cons
Pros:
- Targeted Customization: Ensures extensions are only rendered where applicable, improving user experience.
- Performance Optimization: Reduces unnecessary processing in irrelevant list types.
- Streamlined UI: Avoids cluttering lists and libraries with irrelevant extensions.
Cons:
- Additional Maintenance: Requires careful management of IDs and scope settings in multiple files.
- Limited Flexibility: Extensions are restricted to specific list templates; dynamic adjustments may require redeployment.
- Testing Complexity: Requires testing across multiple list templates to verify proper behavior.
Customizing SharePoint list extensions for specific list templates is a valuable technique for creating tailored solutions. By modifying the ClientSideInstance.xml
and elements.xml
files, you can control where and how your extensions are rendered. While this approach adds complexity, the benefits of targeted functionality and optimized user experience often outweigh the challenges.
Whether you’re building a focused Command Set for document libraries or a specialized Field Customizer for surveys, these configurations ensure your extensions are precisely aligned with your requirements.
Do you have a specific list extension in mind? Let us know in the comments!
Accounting.js Connect Content Type CopyFiles CSS Currency Flows GetAllItems GULP Hillbilly Tabs Javascript JSON Format View Luxon Myths Node NodeJs Numeral.js O365 OneDrive Out Of The Box Permissions PnP PnPJS PowerAutomate Power Automate PowerShell Pwermissions ReactJs Rest Endpoint scss Send an HTTP Request to SharePoint SharePoint SharePoint Modern SharePoint Online SharePoint Tabs ShellScript SPFX SPO Sync Tags Taxonomy Termstore Transform JS TypeScript Versioning