Widget Embed
The widget embed adds a floating button to your app that opens a slide-out panel with your announcements. [TODO: ADD GIF - WIDGET BUTTON CLICK -> PANEL OPENS -> SCROLLING THROUGH ANNOUNCEMENTS]Installation
1. Create a widget embed
- Go to Settings → Developer → Embeds
- Click New Embed
- Select Widget as the type
- Configure your settings (see below)
- Click Create
2. Copy the script
Copy the generated script tag:3. Add to your site
Paste the script tag before the closing</body> tag on every page where you want the widget to appear.
Configuration options
| Option | Description | Default |
|---|---|---|
| Position | Bottom-left or bottom-right | Bottom-right |
| Theme | Light or dark | Light |
| Show badge | Display “new” indicator | Yes |
| Badge color | Color of the notification badge | Red |
| Categories | Which categories to include | All |
Customizing the trigger button
Default button
By default, the widget shows a floating button with a bell icon.Custom trigger
To use your own button, adddata-updates-trigger to any element:
data-hide-button="true" attribute hides the default floating button.
”New” badge
The widget shows a red badge when there are announcements the user hasn’t seen. [TODO: ADD IMAGE - WIDGET BUTTON WITH RED BADGE]How it works
- Badge appears when new announcements are published
- Disappears when the user opens the widget
- Uses localStorage to track what’s been seen
Disabling the badge
Adddata-hide-badge="true" to the script tag:
JavaScript API
Control the widget programmatically:Example: Open on custom event
Framework guides
React
React
Next.js
Next.js
Use the Script component:
Vue
Vue