sp-dev-fx-webparts/samples/js-propertycontrols-svg
Hugo Bernier 411f1b1eca Changed authors to contributors 2023-02-18 22:58:44 -05:00
..
.devcontainer Added all 1.12.1 and 1.13 containers 2022-02-14 02:52:18 -05:00
assets Changed docs links to learn 2022-10-24 09:42:45 -04:00
config Updated mocha and chai and cleaned up code for deployment. 2021-12-30 11:03:34 -05:00
release Updated sample.json 2022-04-11 03:09:56 +00:00
src/webparts/svgHero Js property controls svg (#364) 2017-12-01 16:40:23 +02:00
typings Js property controls svg (#364) 2017-12-01 16:40:23 +02:00
.editorconfig Js property controls svg (#364) 2017-12-01 16:40:23 +02:00
.gitignore Updated sample.json 2022-04-11 03:09:56 +00:00
.yo-rc.json Js property controls svg (#364) 2017-12-01 16:40:23 +02:00
README.md Changed authors to contributors 2023-02-18 22:58:44 -05:00
gulpfile.js Updated mocha and chai and cleaned up code for deployment. 2021-12-30 11:03:34 -05:00
package-lock.json Bump url-parse from 1.5.4 to 1.5.10 in /samples/js-propertycontrols-svg 2022-04-11 20:43:02 +00:00
package.json Update package.json 2022-04-07 13:41:27 -04:00
tsconfig.json Updated packages to 1.13.0 2021-12-29 14:54:34 -05:00
tslint.json Updated packages to 1.13.0 2021-12-29 14:54:34 -05:00

README.md

Dynamic Scalable Vector Graphics (SVG) image using properties

Summary

An SPFx web part that displays a Scalable Vector Graphics (SVG) image using properties to customize how it is rendered. The web part utilizes the PnP SPFx Property Controls package (specifially the SpinButton and ColorPicker) to set these properties.

picture of the web part in action

Compatibility

⚠️ Important
Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.
Refer to https://aka.ms/spfx-matrix for more information on SPFx compatibility.

This sample is designed to be used in the following environments:

SPFx 1.13.0 Node.js v6 Compatible with SharePoint Online Compatible with SharePoint 2019 Does not work with SharePoint 2016 (Feature Pack 2) Local Workbench Incompatible Hosted Workbench Compatible Compatible with Remote Containers

For more information about SPFx compatibility, please refer to https://aka.ms/spfx-matrix

Which PnP SPFx controls are being used in this sample?

Applies to

Contributors

Version history

Version Date Comments
1.1 December 30, 2021 Update to SPFx 1.13.0
1.0 November 12, 2017 Initial release

Minimal Path to Awesome

  • Clone this repository
  • in the command line run:
    • npm install
    • gulp serve
  • Customize your PnP Hero!

This sample can also be opened with VS Code Remote Development. Visit https://aka.ms/spfx-devcontainer for further instructions.

Features

Displays a Scalable Vector Graphics (SVG) image of the SharePoint Patterns and Practices Super Hero and allows users to customize the colors used and the size of the image through the use of PnP SPFx Property Controls (SpinButton & ColorPicker).

This Web Part illustrates the following concepts on top of the SharePoint Framework:

  • Rendering an SVG image
  • Using a PropertyFieldSpinButton control
  • Using a PropertyFieldColorPicker control

Screenshot

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.