Widgets (Win10+)

circle-exclamation

Overview

Windows widgets allow your PWA to provide glanceable, at-a-glance information directly in the Windows widgets dashboard. Users can pin your app's widgets to their desktop for quick access to key information without opening the full application.

Key Features:

  • Display real-time information in the Windows widgets panel

  • Update automatically via service worker

  • Support for multiple widget instances

  • Customizable using Adaptive Cards templates

  • Integrated with Windows notifications and actions

Browser Support

Platform
Browser
Support

Windows 10+

Microsoft Edge

✅ Full support

Windows 10+

Chrome

❌ Not supported

macOS

All browsers

❌ Not supported

Linux

All browsers

❌ Not supported

Android

All browsers

❌ Not supported

iOS

All browsers

❌ Not supported

circle-info

Check before using: Always feature-detect widget support in your service worker before attempting to update widgets.

Configuration

Basic Widget Configuration

Complete Widget Configuration

All available widget properties:

Configuration Properties

Required Properties

Property
Type
Description

name

string

The title of the widget displayed to users

description

string

A description of what the widget shows

tag

string

Unique identifier used to reference the widget in the service worker

ms_ac_template

URL

URL to the Adaptive Cards template JSON file

screenshots

array

At least one screenshot showing the widget preview

Optional Properties

Property
Type
Default
Description

short_name

string

-

Short version of the name for small spaces

icons

array

Manifest icons

Custom icons for the widget (max 1024×1024)

data

URL

-

URL endpoint that returns JSON data for the template

type

string

-

MIME type for the widget data (e.g., application/json)

auth

boolean

false

Whether the widget requires authentication

update

integer

-

Update frequency in seconds for periodic refresh

multiple

boolean

true

Allow multiple instances of the same widget

Adaptive Cards Templates

Widgets use Microsoft Adaptive Cardsarrow-up-right for layout. The template defines the widget's visual structure.

Example Template

Data Endpoint

The data URL should return JSON matching your template variables:

Service Worker Integration

The bundle automatically generates service worker code to handle widget installation and updates. The generated code:

  1. Handles widget installation (widgetinstall event)

  2. Handles widget uninstallation (widgetuninstall event)

  3. Registers periodic sync for automatic updates

  4. Updates widget data by fetching from the data endpoint

How It Works

Use Cases

1. Weather Widget

Show current weather conditions:

2. Task Counter

Display pending tasks count:

3. Calendar Events

Show upcoming calendar events:

4. Stock Ticker

Display stock prices:

5. News Headlines

Show latest news:

Widget Screenshots

Widget screenshots are required and show users what the widget looks like before installation.

Screenshot Requirements

  • Size: Typically 300×200 or similar aspect ratio

  • Format: PNG or JPEG

  • Content: Show the actual widget appearance

  • At least one screenshot is required per widget

Authentication

If your widget requires user authentication, set auth: true:

Important: Ensure your data endpoint checks authentication:

Update Frequency

The update property controls how often the widget refreshes (in seconds):

Frequency
Seconds
Use Case

1 minute

60

Stock prices, live scores

5 minutes

300

Task counts, notifications

15 minutes

900

Calendar events, messages

30 minutes

1800

Weather, news headlines

1 hour

3600

Daily stats, summaries

circle-exclamation

Multiple Instances

Set multiple: true to allow users to install multiple instances of the same widget:

Use cases for multiple instances:

  • Different stock symbols

  • Multiple locations (weather)

  • Different calendars

  • Various project task boards

Testing

1. Feature Detection

Always check if widgets are supported:

2. Test on Windows 10/11

  1. Install Microsoft Edge (latest version)

  2. Install your PWA

  3. Open Windows widgets panel (Win + W)

  4. Look for your PWA in the widget picker

  5. Add widget and verify it displays correctly

3. Test Widget Updates

4. DevTools Debugging

Monitor widget events in the service worker console:

Adaptive Cards Designer

Use Microsoft's Adaptive Cards Designer to create and test your templates:

Designer URL: https://adaptivecards.io/designer/

  1. Design your widget layout

  2. Add data binding variables (${variableName})

  3. Export the JSON template

  4. Save to public/widgets/your-template.json

  5. Reference in PWA configuration

Best Practices

1. Keep Data Fresh

2. Handle Errors Gracefully

3. Optimize Template Size

  • Keep templates under 50KB

  • Minimize nested structures

  • Use concise variable names

  • Remove unnecessary whitespace in production

4. Test with Sample Data

Provide fallback data for development:

5. Localization

Widgets support translations via the bundle's translation system:

Common Issues

Widget Not Appearing

Problem: Widget doesn't show up in Windows widgets panel

Solutions:

  • Verify you're using Microsoft Edge on Windows 10/11

  • Ensure PWA is installed, not just running in browser tab

  • Check that screenshots array has at least one entry

  • Verify manifest is valid JSON

Widget Not Updating

Problem: Widget shows stale data

Solutions:

  • Check service worker is active (not waiting)

  • Verify update interval is set

  • Check data endpoint is returning fresh data

  • Monitor service worker console for errors

  • Ensure periodic sync is registered

Template Not Rendering

Problem: Widget shows blank or error

Solutions:

  • Validate Adaptive Card JSON at https://adaptivecards.io/designer/

  • Check template URL is accessible

  • Verify data variables match template placeholders

  • Check data endpoint returns valid JSON

  • Test template with sample data

Authentication Issues

Problem: Widget fails to load user-specific data

Solutions:

  • Ensure auth: true is set

  • Check cookies/session is maintained

  • Verify credentials are included in fetch

  • Add authentication headers if needed

Limitations

  1. Platform-specific: Only works on Microsoft Edge on Windows 10+

  2. No interactivity: Widgets are read-only, no buttons or input

  3. Size constraints: Limited to predefined widget sizes

  4. Update frequency: Minimum update interval enforced by OS

  5. Data size: Keep data payloads small (< 100KB)

Resources

  • Microsoft Docs: https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/widgets

  • Adaptive Cards: https://adaptivecards.io/

  • Adaptive Cards Designer: https://adaptivecards.io/designer/

  • Adaptive Cards Schema: https://adaptivecards.io/explorer/

  • Windows Widgets API: https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/widgets

Last updated

Was this helpful?