Update Available

Update Available is a copy-paste React component that stops deploy refresh wiped unsaved work before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/update-available
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsDeploy refresh wiped unsaved work

Was this component page useful?

How do I install Update Available?

pnpm dlx shadcn@latest add @bollard/update-available

The files land in your project. They're yours to edit.

How do I use Update Available in React?

update-available-usage.tsx
import { UpdateAvailable } from "@/components/ui/update-available"

<UpdateAvailable
  currentVersion={running}
  latestVersion="2026.10.13"
  dirty={dirty}
  whatsNew="Fixes rounding on invoice totals."
  onRefresh={() => setRunning("2026.10.13")}
/>

What input mistakes does Update Available catch?

  • A newer build than the one running
  • Unsaved changes, which hold the refresh until saved
  • "Later" applied to one build only

What props does Update Available accept?

UpdateAvailable props
PropTypeDefault
currentVersion* (required)

The build this page is running, baked in at build time.

string—
latestVersion

The deployed build, if you learn it yourself (websocket, service worker). Wins over `versionUrl`.

string—
versionUrl

Endpoint to poll for the deployed build id, e.g. "/version.json".

string—
pollInterval

How often to poll `versionUrl`, in ms.

number—
dirty

There are unsaved changes. The banner never refreshes while this is true.

booleanfalse
onRefresh

Loads the new version. Defaults to `location.reload()`.

() => void() => location.reload()
whatsNew

One line on what's new, e.g. "Fixes rounding on invoice totals."

React.ReactNode—
message

Main banner text.

string"A new version is available."
explainText

What refreshing does, shown before anyone presses it.

string"Refreshing reloads this page in about a second. You stay…
dirtyText

Shown when unsaved changes hold the refresh.

string"You have unsaved changes, so it won't refresh yet. Refre…
armedText

Shown once refresh-after-save is armed.

string"Will refresh as soon as your changes are saved."
refreshLabel

Label of the Refresh button.

string"Refresh"
refreshAfterSaveLabel

Label of the refresh-after-I-save button.

string"Refresh after I save"
cancelLabel

Label of the cancel-armed button.

string"Cancel"
laterLabel

Label of the Later button.

string"Later"
regionLabel

Accessible name of the banner.

string"Update available"

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Update Available accessible?

  • Banner is a region with an aria-label; message in a polite live region
  • Actions are labelled buttons; icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Polling interval and endpoint are yours; nothing is pushed
  • Dirty state comes from your dirty prop

What expensive mistakes does Update Available stop?

Deploy refresh wiped unsaved work

Also known as

update available · new version · refresh · deploy · service worker · chunkloaderror · version polling · release banner

What dependencies does Update Available require?

Update Available facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameUpdate Available
Registry identifier@bollard/update-available
Install commandnpx shadcn@latest add @bollard/update-available
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Update Available

How does Update Available handle date and time accuracy?

Update Available catches deploy refresh wiped unsaved work. Validates calendar constraints: A newer build than the one running, Unsaved changes, which hold the refresh until saved, "Later" applied to one build only. Limitation: match update-available with server timezone.

How do I install update-available with shadcn?

Run `npx shadcn@latest add @bollard/update-available`. Sources added: registry/default/update-available/update-available.tsx. Package requirements: lucide-react.

What props customize Update Available?

Update Available accepts `currentVersion`, `latestVersion`, `versionUrl`, `pollInterval`, `dirty`. Configures update available, new version, refresh behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of update-available?

Polling interval and endpoint are yours; nothing is pushed. Dirty state comes from your dirty prop Server requirement: backend verification for update-available.

How does Update Available meet accessibility guidelines?

Banner is a region with an aria-label; message in a polite live region. Actions are labelled buttons; icons are aria-hidden. Minimizes errors: new version available refresh, app refreshed and lost form.

Which components pair with Update Available?