Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions samples/react-accessibility-content-auditor/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.14.0
43 changes: 43 additions & 0 deletions samples/react-accessibility-content-auditor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Accessibility Content Auditor

This SharePoint Framework 1.23.2 React 17 web part is a read-only heuristic auditor for content quality. It reads one configured modern page or up to 50 items from a configured list and inspects only the configured allow-listed fields:

- missing or empty image `alt` text;
- empty or generic link labels such as “Click here” and “Read more”;
- skipped heading levels;
- empty configured required fields.

Each finding includes severity, rule, evidence, item, and a same-origin SharePoint edit-form URL for safe human remediation. The URL opens an item; the web part never calls mutation APIs and does not edit, delete, publish, or write audit results. “Heuristic” is intentional: this is not WCAG certification, an accessibility conformance statement, or a replacement for manual testing.

## Configuration and bounds

Use the property pane to choose `page` or `list`. Page mode reads `Site Pages` and matches the file name from `pagePath` (for example `/SitePages/Home.aspx`); list mode reads `listTitle`. List reads are capped at 50 items, page reads at one item, and PnPjs `$select` includes only the fixed allow-list plus `Id`, `FileRef`, and `FileLeafRef`. Unknown field names are ignored. The UI reports empty sources and partial item failures.

## Permissions and validation

The solution requests no Microsoft Graph application permissions. It uses the current SharePoint user’s delegated access to the current site through SharePoint REST/PnPjs. The user needs read access to the selected list and items; opening remediation URLs may require edit access, which SharePoint enforces separately. Validate in a non-production tenant with a test page/list and least-privileged accounts. Hosted Workbench is required; the local Workbench is not supported by current SPFx.

## Run and test

```bash
nvm use
npm install
npm test
npm run start
```

Package the solution with `npm run package`. The sample uses Node 22.14.0, SPFx 1.23.2, React 17, Fluent UI v9, and PnPjs 4.20.x.

## Official references

- [SharePoint Framework overview](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
- [Build a SharePoint client-side web part](https://learn.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part)
- [SharePoint Framework compatibility matrix](https://aka.ms/spfx-matrix)
- [PnPjs SharePoint documentation](https://pnp.github.io/pnpjs/sp/)
- [Fluent UI React components](https://react.fluentui.dev/)

## Credits and dates

Created and updated 2026-08-30. Credited to [vystartasv](https://github.com/vystartasv).

<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/react-accessibility-content-auditor" />
21 changes: 21 additions & 0 deletions samples/react-accessibility-content-auditor/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-react-accessibility-content-auditor",
"source": "pnp",
"title": "Accessibility Content Auditor",
"shortDescription": "Read-only heuristic accessibility and content quality audit for bounded SharePoint content.",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-accessibility-content-auditor",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-accessibility-content-auditor",
"longDescription": ["Reads a configured SharePoint page or list through PnPjs, inspects allow-listed fields, and reports evidence with safe item remediation links. It is not WCAG certification."],
"creationDateTime": "2026-08-30",
"updateDateTime": "2026-08-30",
"products": ["SharePoint"],
"metadata": [{"key": "SAMPLE-TYPE", "value": "SPFx-WebPart"}, {"key": "CLIENT-SIDE-DEV", "value": "React"}, {"key": "SPFX-VERSION", "value": "1.23.2"}],
"thumbnails": [],
"authors": [{"gitHubAccount": "vystartasv", "pictureUrl": "https://github.com/vystartasv.png", "name": "vystartasv"}],
"references": [
{"name": "SharePoint Framework overview", "description": "Official Microsoft documentation for SharePoint Framework.", "url": "https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview"},
{"name": "Build a SharePoint client-side web part", "description": "Official Microsoft tutorial for client-side web parts.", "url": "https://learn.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part"}
]
}
]
18 changes: 18 additions & 0 deletions samples/react-accessibility-content-auditor/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"accessibility-content-auditor-web-part": {
"components": [
{
"entrypoint": "./lib/webparts/accessibilityContentAuditor/AccessibilityContentAuditorWebPart.js",
"manifest": "./src/webparts/accessibilityContentAuditor/AccessibilityContentAuditorWebPart.manifest.json"
}
]
}
},
"externals": {},
"localizedResources": {
"AccessibilityContentAuditorWebPartStrings": "lib/webparts/accessibilityContentAuditor/loc/{locale}.js"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "accessibility-content-auditor-client-side-solution",
"title": "Accessibility Content Auditor",
"id": "2d4e9d93-91c4-4e73-9a8b-a1ef7808fa1c",
"version": "1.0.0.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "vystartasv",
"websiteUrl": "https://github.com/vystartasv",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.23.2"
},
"metadata": {
"shortDescription": {"default": "Read-only heuristic accessibility and content quality audit for SharePoint."},
"longDescription": {"default": "Inspects bounded, allow-listed SharePoint page or list content and reports actionable heuristic findings without changing content."},
"screenshotPaths": [],
"videoUrl": "",
"categories": ["Productivity"]
},
"features": [
{
"title": "Accessibility Content Auditor",
"description": "Deploys the read-only SharePoint content auditor web part.",
"id": "0c8a5c26-a171-4a62-b2c8-6bf0e9ba2ee0",
"version": "1.0.0.0"
}
]
},
"paths": {
"zippedPackage": "solution/accessibility-content-auditor.sppkg"
}
}
4 changes: 4 additions & 0 deletions samples/react-accessibility-content-auditor/config/rig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
"rigPackageName": "@microsoft/spfx-web-build-rig"
}
4 changes: 4 additions & 0 deletions samples/react-accessibility-content-auditor/config/sass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft-sass-plugin.schema.json",
"extends": "@microsoft/spfx-web-build-rig/profiles/default/config/sass.json"
}
6 changes: 6 additions & 0 deletions samples/react-accessibility-content-auditor/config/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@microsoft/spfx-web-build-rig/profiles/default/config/typescript.json",
"staticAssetsToCopy": {
"fileExtensions": [".resx", ".jpg", ".jpeg", ".png", ".woff", ".eot", ".ttf", ".svg", ".gif"],
"includeGlobs": ["webparts/*/loc/*.js"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cdnBasePath": "<!-- PATH TO CDN -->"
}
Loading
Loading