SharePoint Framework (SPFx) Extensions are client-side components which allow extending the SharePoint user experience. Read more about SPFx extensions here.
In this article, we will explore the ListView Command Set of SharePoint extensions.
Brief information about Field Customizer
ListView Command Set allows extending the command surfaces of SharePoint to add new actions. It supports toolbar and context menu.
In the classic SharePoint, we used to add the new actions the to SharePoint list by implementing custom actions. In the modern SharePoint, the ListView Command Set helps to implement these scenarios.
Create SPFx Solution
Open the command prompt. Create a directory for SPFx solution.
- md spfx-extensions-listviewcommandset
Navigate to the above created directory.
- cd spfx-extensions-listviewcommandset
Run Yeoman SharePoint Generator to create the solution.
- yo @microsoft/sharepoint
Yeoman generator will present you with the wizard by asking questions about the solution to be created.
Solution Name
Hit enter to have a default name (spfx-extensions-listviewcommandset in this case) or type in any other name for your solution.
Hit enter to have a default name (spfx-extensions-listviewcommandset in this case) or type in any other name for your solution.
Selected choice - Hit enter
Target for component
Here we can select the target environment where we are planning to deploy the client webpart i.e. SharePoint Online or SharePoint OnPremise (SharePoint 2016 onwards).
Here we can select the target environment where we are planning to deploy the client webpart i.e. SharePoint Online or SharePoint OnPremise (SharePoint 2016 onwards).
Selected choice - SharePoint Online only (latest)
Place of files
We may choose to use the same folder or create a subfolder for our solution.
We may choose to use the same folder or create a subfolder for our solution.
Selected choice - Same folder
Deployment option
Selecting Y will allow the app to be deployed instantly to all sites and will be accessible everywhere.
Selecting Y will allow the app to be deployed instantly to all sites and will be accessible everywhere.
Selected choice - N (install on each site explicitly)
Type of client-side component to create
We can choose to create client side webpart or an extension.
We can choose to create client side webpart or an extension.
Selected choice - Extension
Type of client-side extension to create
We can choose to create Application customizer, Field customizer, or ListView Command Set.
We can choose to create Application customizer, Field customizer, or ListView Command Set.
Selected choice - ListView Command Set
Command Set name
Hit enter to select the default name or type in any other name.
Hit enter to select the default name or type in any other name.
Selected choice - ModalDialog
Command Set description
Hit enter to select the default description or type in any other value.
Hit enter to select the default description or type in any other value.
Selected choice - Displays modal dialog using listview command set extension
Yeoman generator will perform scaffolding process to generate the solution. The scaffolding process will take a significant amount of time.
Once the scaffolding process is completed, lock down the version of project dependencies by running the below command.
Once the scaffolding process is completed, lock down the version of project dependencies by running the below command.
- npm shrinkwrap
In the command prompt type below command to open the solution in code editor of your choice.
- code .
Solution Structure
The solution structure is similar to client-side web parts with similar configuration options.
The solution structure is similar to client-side web parts with similar configuration options.

The file ModalDialogCommandSet.manifest.json inside the folder “\src\extensions\modalDialog\” defines the extension type and unique identifier for the solution. Please note down the id. We will need it later for debugging purposes.
- {
- "$schema": "https://developer.microsoft.com/json-schemas/spfx/command-set-extension-manifest.schema.json",
- "id": "78c7b88e-c176-4694-b95d-1b371279b6e8",
- "alias": "ModalDialogCommandSet",
- "componentType": "Extension",
- "extensionType": "ListViewCommandSet",
- // The "*" signifies that the version should be taken from the package.json
- "version": "*",
- "manifestVersion": 2,
- // If true, the component can only be installed on sites where Custom Script is allowed.
- // Components that allow authors to embed arbitrary script code should set this to true.
- // https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
- "requiresCustomScript": false,
- "items": {
- "COMMAND_1": {
- "title": { "default": "Command One" },
- "iconImageUrl": "icons/request.png",
- "type": "command"
- },
- "COMMAND_2": {
- "title": { "default": "Command Two" },
- "iconImageUrl": "icons/cancel.png",
- "type": "command"
- }
- }
- }






Guest UserPosted May 31, 2022, 3:43 AM
Event.selectedRows[0]["_values"];&event.selectedRows[0]["_fields"]; both are giving only results of visible coulmns in the library. is there a way to get all the fields and their values?
Prem PremPosted Jan 10, 2022, 1:39 PM
How can I know which item is selected and find its ID number
SubratPosted Feb 27, 2020, 4:40 AM
My new command button is coming after Export to Excel button. i wan to be added after Flow button.
Amit KumarPosted May 27, 2019, 12:37 AM
Can we remove existing menu from list or overwrite it's functionality?
Tobias MulzerPosted Dec 18, 2018, 4:05 AM
Why do you create the Number Column "Completion"? I don't see it used anywhere...