Maintenance Window

Maintenance Window is a copy-paste React component that stops work lost to planned downtime 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/maintenance-window
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

StopsWork lost to planned downtime

Was this component page useful?

How do I install Maintenance Window?

pnpm dlx shadcn@latest add @bollard/maintenance-window

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

How do I use Maintenance Window in React?

maintenance-window-usage.tsx
import { MaintenanceTaskButton, MaintenanceWindow } from "@/components/ui/maintenance-window"

<MaintenanceWindow start={start} end={start + 30 * 60_000} hasUnsavedChanges={draft.length > 0}>
  <div className="grid gap-3 rounded-lg border bg-background p-3">
    <label className="grid gap-1.5">
      <span className="text-sm font-medium">Notes</span>
      <textarea
        rows={2}
        value={draft}
        onChange={(event) => setDraft(event.target.value)}
        className="w-full resize-none rounded-md border bg-transparent px-3 py-2 text-base shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed md:text-sm dark:bg-input/30"
      />
    </label>
    <MaintenanceTaskButton estimateMinutes={45} onStart={() => setStarted(true)} anywayLabel="Export anyway">
      Export all invoices
    </MaintenanceTaskButton>
    {started && <p className="text-xs text-muted-foreground">Export started.</p>}
  </div>
</MaintenanceWindow>

What input mistakes does Maintenance Window catch?

  • Downtime shown in the wrong time zone: converted to the reader's
  • Starting a long job that maintenance would cut off
  • Reloading with unsaved changes during the window (beforeunload warning)
  • Window crossing midnight

What props does Maintenance Window accept?

MaintenanceWindow props
PropTypeDefault
start* (required)

When maintenance begins.

When—
end* (required)

When it is expected to end.

When—
locale

Locale for dates; defaults to the browser's.

string—
timeZone

Time zone for display; defaults to the reader's own.

string—
soonMinutes

How long before the start the banner turns into a countdown, in minutes.

number60
hasUnsavedChanges

True while the wrapped form holds unsaved changes; during the window a reload is then warned about.

booleanfalse
scheduledText

Templates: `{window}`, `{countdown}`, `{start}`, `{end}` are filled in.

string"Scheduled maintenance {window} · in {countdown}"
soonText

Template shown when the window is close.

string"Maintenance starts in {countdown}, at {start}. Editing p…
activeText

Template shown during the window.

string"Maintenance until {end} · {countdown} left. Editing is p…
overText

Shown after the window ends.

string"Maintenance is over. Your changes are still here; save w…
dismissLabel

Accessible label for the dismiss button.

string"Got it"

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

How is Maintenance Window accessible?

  • Banner is role=status
  • Cut-off hint is a polite live region linked to the start button
  • Dismiss is a button; 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?

This is a UX guard rail. Enforce on the server: Reject writes during maintenance on the server with a clear error so clients can retry later.

  • Disables only the fields it wraps (a disabled fieldset) in this tab; it doesn't make your app or API read-only, so block writes on the server during the window
  • Times come from your start and end props
  • The reload warning depends on the browser showing beforeunload prompts

What expensive mistakes does Maintenance Window stop?

Work lost to planned downtime

Also known as

maintenance · downtime · scheduled maintenance · banner · countdown · read only · status page · outage

Field type

What dependencies does Maintenance Window require?

Maintenance Window facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameMaintenance Window
Registry identifier@bollard/maintenance-window
Install commandnpx shadcn@latest add @bollard/maintenance-window
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 Maintenance Window

How does Maintenance Window handle date and time accuracy?

Maintenance Window catches work lost to planned downtime. Validates calendar constraints: Downtime shown in the wrong time zone: converted to the reader's, Starting a long job that maintenance would cut off, Reloading with unsaved changes during the window (beforeunload warning), Window crossing midnight. Limitation: match maintenance-window with server timezone.

How do I install maintenance-window with shadcn?

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

What props customize Maintenance Window?

Maintenance Window accepts `start`, `end`, `locale`, `timeZone`, `soonMinutes`. Configures maintenance, downtime, scheduled maintenance behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of maintenance-window?

Disables only the fields it wraps (a disabled fieldset) in this tab; it doesn't make your app or API read-only, so block writes on the server during the window. Times come from your start and end props. The reload warning depends on the browser showing beforeunload prompts Server requirement: Reject writes during maintenance on the server with a clear error so clients can retry later.

How does Maintenance Window meet accessibility guidelines?

Banner is role=status. Cut-off hint is a polite live region linked to the start button. Dismiss is a button; icons are aria-hidden. Minimizes errors: site down for maintenance lost work, maintenance started mid task.

Which components pair with Maintenance Window?