SPFx Extensions: Types, Examples and How to Build and Deploy Them

SPFx Extensions: Types, Examples and How to Build and Deploy Them

Learn the 5 SPFx extension types, how they differ from web parts, and how to build, debug and deploy them with the Heft toolchain, including tenant-wide.

In this article

Let's Discuss your tech Solution

book a consultation now
October 28, 2026
Author Image
Sharjeel Hashmi
SharePoint & .NET Team Lead
Sharjeel Hashmi is a SharePoint & .NET Team Lead at Centric, with extensive experience in designing, developing, and leading enterprise-level solutions. He specializes in building scalable SharePoint platforms and robust .NET applications that align technology with business objectives. With a strong focus on collaboration, performance, and security, Sharjeel leads teams to deliver high-quality solutions while driving continuous improvement and best development practices. His expertise spans solution architecture, team leadership, and modern Microsoft technologies, enabling organizations to streamline processes and achieve long-term digital success.

SPFx extensions are SharePoint Framework components that customize the SharePoint user experience outside the page canvas: headers and footers, list fields, command bars, list forms and search queries. There are five types: Application Customizers, Field Customizers, Command Sets, Form Customizers and Search Query Modifiers. They run in modern SharePoint pages and libraries and are built with the same SPFx toolchain as web parts.

This guide explains each extension type with practical examples, how extensions differ from web parts, and how to build, debug and deploy one with the current SPFx toolchain, including tenant-wide deployment.

What Are SPFx Extensions?

The SharePoint Framework (SPFx) is Microsoft's client-side development model for SharePoint. It has two main component families: web parts, which users add to a page, and extensions, which change how SharePoint itself looks and behaves.

Microsoft describes extensions as a way to customize more facets of the SharePoint experience, including notification areas, toolbars, list data views, and forms. They are available in all Microsoft 365 subscriptions for production use and work in modern pages and document libraries, not classic pages.

Explore Our SharePoint Consulting Services!

The 5 Types of SPFx Extensions

Type

What it does

Typical examples

Application Customizer

Adds scripts to the page and renders content in well-known placeholders (top and bottom of the page)

Branded header or footer, global notice banner, analytics script, cookie notice

Field Customizer

Changes how a field's data is displayed in list views

Color-coded status, progress bars, icons for priority, formatted links

Command Set (ListView Command Set)

Adds actions to the list or library command bar and context menu

"Send for approval", "Export selected to Excel", "Copy to archive"

Form Customizer

Replaces the default new, edit and view forms of a list or library, associated with a content type

Multi-step request forms, forms with validation and lookups to other systems

Search Query Modifier

Modifies SharePoint search queries before they run

Adding filters or adjusting search behavior for specific sites

1. Application Customizers

Application Customizers are the most common extension type. They load on every modern page where they are activated and can render content into the Top and Bottom placeholders. Organizations use them for consistent branding across an intranet, alert banners and site-wide scripts.

2. Field Customizers

Field Customizers change how a single column renders in list views. They suit cases where column formatting (JSON) is not enough, for example when a cell needs data from another API or complex interactive behavior. For simple visual formatting, JSON column formatting is usually lighter to maintain. Learn more about SharePoint lists.

3. Command Sets

Command Sets add buttons to the command bar and context menu of lists and libraries. Each command can be shown or hidden based on the current selection, so a "Send for approval" button only appears when one document is selected.

4. Form Customizers

Form Customizers were introduced in SPFx v1.15. They let you replace the standard new, edit and view forms with your own component by associating it with a content type. They are an alternative to Power Apps list forms when you need full control of the code.

5. Search Query Modifiers

Search Query Modifiers let you change SharePoint search queries before they run, for example to inject filters or refine results. They are the least used type and are relevant mainly for search-heavy intranets.

Contact Us Now!

SPFx Extensions vs Web Parts

Factor

Web parts

Extensions

Where they appear

Inside the page canvas, where an editor places them

Outside the canvas: placeholders, list views, command bars, forms

Who adds them

Page editors

Developers or admins activate them on a site, list or tenant

Scope

One instance per placement

Site, list or tenant-wide

Local testing

SharePoint Workbench

Live SharePoint Online page in debug mode (Workbench is not supported)

For page-level components, see our guide to SharePoint web parts.

Where SPFx Extensions Are Supported?

SharePoint version

SPFx versions

Extensions

SharePoint Online

All

Yes, all types

SharePoint Server Subscription Edition

v1.0 to v1.5

Yes, in modern pages

SharePoint Server 2019

v1.0 to v1.4.1

Yes, in modern pages

SharePoint Server 2016 with Feature Pack 2

v1.0 to v1.1

No (web parts in classic pages only)

Source: Microsoft's SPFx compatibility reference. Newer extension types such as Form Customizers need SPFx v1.15 or later, so they are available in SharePoint Online only.

How to Build an SPFx Extension?

Prerequisites

  • Node.js LTS: Microsoft recommends Node.js v22 for SPFx v1.22, and the compatibility table lists v22, v24 and v26 for SPFx v1.24. Always match Node.js to your SPFx version.

  • Heft, Yeoman and the SharePoint generator: SPFx v1.22 replaced the old gulp-based toolchain with Heft. Install the tools globally:

npm install @rushstack/heft yo @microsoft/generator-sharepoint --global

  • A SharePoint Online tenant with an app catalog and a modern site for testing

  • TypeScript and React knowledge (React is the default framework; plain TypeScript also works)

Projects on SPFx v1.21.1 or earlier, and all SharePoint Server on-premises projects, still use the legacy gulp toolchain.

Step 1: Scaffold the project

md app-extension

cd app-extension

yo @microsoft/sharepoint

When prompted, choose Extension as the component type and then the extension type, for example Application Customizer.

Step 2: Write the extension

A simple Application Customizer that renders a notice in the top placeholder looks like this:

import { BaseApplicationCustomizer, PlaceholderContent, PlaceholderName } from '@microsoft/sp-application-base';

export default class NoticeApplicationCustomizer extends BaseApplicationCustomizer<{}>

{

  private _top: PlaceholderContent | undefined;

 

  public onInit(): Promise<void> {

    this.context.placeholderProvider.changedEvent.add(this, this._render);

    return Promise.resolve();

  }

 

  private _render(): void {

    if (!this._top) {

      this._top = this.context.placeholderProvider.tryCreateContent(PlaceholderName.Top);

      if (this._top) {

        this._top.domElement.innerHTML = '<div class="notice">Company notice</div>';

      }

    }

  }

}

Always check that the placeholder exists before rendering, because not every page or host provides every placeholder.

Step 3: Debug on a live page

Extensions cannot be tested in the SharePoint Workbench. Instead, set your test site URL in ./config/serve.json and run:

heft start

This serves the code from https://localhost:4321 and opens your test page with the debug query parameters. Select Load debug scripts when prompted to see the extension running.

Step 4: Package the solution

heft build

heft package-solution

This creates an .sppkg file in the ./sharepoint/solution folder.

How to Deploy SPFx Extensions?

  1. Upload the .sppkg file to the Apps for SharePoint library in your tenant app catalog (or a site collection app catalog).

  2. Choose whether to make the solution available to all sites. With skipFeatureDeployment set to true in package-solution.json, the solution is available tenant-wide without installing it on each site.

  3. Activate the extension where it should run:

  • Site or list level: add the app to a site, or register the extension through a custom action that references its ClientSideComponentId.

  • Tenant-wide: use the Tenant Wide Extensions list in the app catalog site to activate Application Customizers or ListView Command Sets across the tenant or based on site and list templates.

Microsoft documents both approaches in deploying your extension to SharePoint and tenant-wide deployment of extensions.

Best Practices for SPFx Extensions

  • Keep Application Customizers light. They load on every page where they are active, so slow code slows the whole site. Load large libraries only when needed.

  • Prefer built-in options first. Use JSON column and view formatting before a Field Customizer, and Power Automate buttons before a Command Set, when they meet the requirement.

  • Use supported placeholders only. Do not manipulate SharePoint's own page DOM; Microsoft can change it at any time.

  • Request only the API permissions you need when calling Microsoft Graph or other APIs.

  • Plan upgrades. Each SPFx release supports specific Node.js, TypeScript and React versions. Track the compatibility table when upgrading projects.

  • Use tenant-wide deployment carefully. Test on a pilot site before activating an extension everywhere.

SharePoint sites and libraries also surface in Microsoft Teams. See Teams and SharePoint integration.

Frequently Asked Questions

What are extensions in SPFx?

They are SharePoint Framework components that customize SharePoint outside the page canvas, such as headers, footers, list fields, command bars, list forms and search queries.

What is the difference between an SPFx extension and a web part?

A web part is placed inside a page by an editor. An extension is activated on a site, list or tenant and changes surrounding parts of SharePoint, such as placeholders, list views, command bars or forms.

How do I deploy an SPFx extension?

Package it with heft build and heft package-solution, upload the .sppkg file to the app catalog, then activate it on a site, list or tenant-wide through the Tenant Wide Extensions list.

Do SPFx extensions work on SharePoint on-premises?

Yes, in modern pages on SharePoint Server 2019 (SPFx up to v1.4.1) and Subscription Edition (SPFx up to v1.5). SharePoint Server 2016 does not support extensions.

Can I test SPFx extensions in the Workbench?

No. Extensions must be debugged against a live SharePoint Online page using heft start and the debug scripts prompt.

Extend SharePoint the Right Way

SPFx extensions are the supported way to brand SharePoint, add actions to lists and libraries, and replace forms without breaking when Microsoft updates the platform. Choose the right extension type, keep it lightweight, and deploy it with tenant-wide control.

Book A Free Call Now!

Conclusion

SPFX Extensions are essential for modern SharePoint development, enabling businesses to create customized, dynamic solutions that enhance user experience. As SharePoint evolves, SPFX Extensions continue to play a key role in meeting the growing needs of businesses by providing flexibility, scalability, and seamless integration with custom features. These extensions allow for custom branding, enhanced user interfaces, and business-specific functionality, making them invaluable for building feature-rich SharePoint sites.

Centric specializes in creating tailored SPFX Extensions that meet unique business requirements and delivers expert SharePoint consulting services to help organizations maximize performance, security, and usability. It helps businesses implement SPFX solutions for SharePoint that optimize performance, security, and usability. Contact Centric to elevate your SharePoint environment with customized, powerful SPFX Extensions.

Contact_Us_Op_02
Contact us
-

Spanning 8 cities worldwide and with partners in 100 more, we're your local yet global agency.

Fancy a coffee, virtual or physical? It's on us – let's connect!

Contact us
-
smoke effect
smoke effect
smoke effect
smoke effect
smoke effect

Spanning 8 cities worldwide and with partners in 100 more, we're your local yet global agency.

Fancy a coffee, virtual or physical? It's on us – let's connect!