Skip to content

SharePoint Application Customizer that adds an alert bar to the top of a site (all screens). It will display alerts from the Alerts list.

Notifications You must be signed in to change notification settings

MRSCompanyLtd/spfx-alert-bar

Repository files navigation

spfx-alert-bar

Summary

Short summary on functionality and used technologies.

alert bar image

Used SharePoint Framework Version

version

Applies to

Get your own free development tenant by subscribing to Microsoft 365 developer program

Prerequisites

Create a list called Alerts on the site you want to deploy this extension on with these fields:

  • Title - this will be the field that shows in the top bar
  • Expires (Date and time) - this will be the field to determine if an alert should show

Solution

Solution Author(s)
spfx-alert-bar MRS Company Ltd

Version history

Version Date Comments
1.0 November 22, 2023 Initial release

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.


Minimal Path to Awesome

Clone repository and navigate to solution folder

git clone https://github.com/mrscompanyltd/spfx-alert-bar
cd spfx-alert-bar

Add dependencies

npm i

Serve (update /config/serve.json with your page URL)

gulp serve

Build and package

gulp build && gulp bundle --ship && gulp package-solution --ship # Builds, bundles, and creates sppkg file

Upload sppkg package from /sharepoint/solution/spfx-alert-bar.sppkg.

Features

This application customizer reads alerts from a list (list should be called "Alerts" on the same site as the extension). Based on the "Expires" date for the alert, the application customizer will render each alert at the top of the page, cycling every 10 seconds. They can also be cycled manually.

Specifically, it uses the following features:

  • SPFx Application Customizer
  • Page Placeholder (top)
  • SPHttpClient and SharePoint List API

References

About

SharePoint Application Customizer that adds an alert bar to the top of a site (all screens). It will display alerts from the Alerts list.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published