Skip to content

Reusable property pane controls for the SharePoint Framework solutions

This repository provides developers with a set of reusable property pane controls that can be used in their SharePoint Framework (SPFx) solutions.

Attention

In order to migrate to v2 and v3 from v1 it is advicded to follow this guide: Migrating from V1.

Library Versions

Currently there are 3 active versions of the controls. Please, reference the table below to see what version to use in your project.

Version SPFx minimal dependency Fluent UI (Office UI Fabric React) version SharePoint Version Comments
v3 1.12.0 7.156.0 Online The most current, actively maintained version of the library.
v2 1.11.0 6.214.0 Online The version will be deprecated in May/June timeframe.
We strongly recommend to update to SPFx 1.12 and v3 of Controls.
v1 1.3.0 5.131.0 On-Prem The version is maintained for SharePoint On-Prem 2016 and 2019 implementations. Be aware that the controls might not work in solutions you're building for on-premises. As for on-premises solutions version 1.1.0 will get used.

Getting started

Installation

To get started you have to install the following dependency to your project: @pnp/spfx-property-controls.

Enter the following command to install the dependency to your project:

npm install @pnp/spfx-property-controls --save --save-exact

Configuration

Note

Since v1.7.0 the localized resource path will automatically be configured during the dependency installing.

Once the package is installed, you will have to configure the resource file of the property controls to be used in your project. You can do this by opening the config/config.json and adding the following line to the localizedResources property:

"PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js"

Telemetry

All controls gather telemetry to verify the usage. Only the name of the control and related data gets captured.

More information about the service that we are using for this can be found here: PnP Telemetry Proxy.

Since version 1.17.0 it is possible to opt-out of the telemetry by adding the following code to your web part:

import PnPTelemetry from "@pnp/telemetry-js";
...
const telemetry = PnPTelemetry.getInstance();
telemetry.optOut();

Controls

The following controls are currently available:

The following controls are extended controls that show a callout next to the label