Back
Component New
Update Popup
A popup component for displaying updates. Auto-installs a version-manager system: add your changelog content and the system does the rest.
Here is how it works:
The Update Popup auto-opens when the user visits your app and hasn't seen the latest
version yet. The last seen version is stored in localStorage under the key hasSeenVersion.
You can also manually trigger the popup (e.g. from a "What's New" link) using showVersionHighlights(version). Try the button below:
$lib/versions folder structure
versions/
├── content/
│ ├── v1.0.0.ts ← version data (changes, icons, detailedChanges)
│ ├── v1.1.0.ts
│ └── ... ← add new file per release
├── types.ts ← VersionData, ChangeEntry interfaces
└── version-manager.ts ← registers content, API (showVersionHighlights, etc.) Add a content/vX.Y.Z.ts for each release, import it in version-manager.ts,
and include it in the versions array.
Version Manager API
- getStoredVersion()
- Returns the version string stored in localStorage (or null if never seen).
- setStoredVersion(version)
- Stores the version when the user dismisses the popup. Called by UpdatePopup.
- getVersionsToShow()
- Returns versions the user hasn't seen. If no stored version: all versions. Otherwise: versions released after the stored one.
- hasNewVersions()
- Whether there are unseen versions (for showing a badge or "What's New" indicator).
- showVersionHighlights(version)
- Opens the popup for a specific version. Use for manual triggers like "Highlights anzeigen".
- getLatestVersion()
- Returns the latest VersionData. Use with showVersionHighlights to open the latest release.