Skip to content
Product block

Scheduled Maintenance Window

Planned downtime with a live countdown, an end time in the reader’s timezone, what still works — and a different sentence once the window overruns rather than a negative timer.

228 lineslucide-reactAdded 31 Aug 2026Updated 2 Sept 2026
  • maintenance
  • downtime
  • status
  • countdown
  • error state

What's included

  • components/maintenance-window-state.tsx
  • Needs lucide-react

Works with

  • React
  • Next.js
  • Tailwind CSS
  • TypeScript

npx hoverlab add maintenance-window-state

Or over MCP, from your editor's agent — no account needed.

License

Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.

Was this useful?

Start a page with this section — add more, order them, and leave with the page source.

Preview

Scheduled maintenance in progress

We are migrating the primary database. Dashboards, the CLI and sign-in are unavailable until this finishes.

Expected back in

02:14:09

About 2 hours and 14 minutes remaining. Estimated finish at

Still working

  • Published sites stay online and serving
  • The public API continues to read from cache
  • Existing sessions are not signed out
Live status

Hosted separately, so it stays up when this does not.

Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.

Source

components/maintenance-window-state.tsx
'use client'

/**
 * <MaintenanceWindowState> — planned downtime, with the two facts people
 * actually want.
 *
 * The catalog covers the unplanned failures: an error state with a retry,
 * an offline banner, a permission wall. Planned maintenance is a different
 * message with a different job. Nobody reading it needs to be apologised
 * to; they need to know when it ends and where to watch.
 *
 * WHAT MAINTENANCE PAGES GET WRONG
 *
 * They give a start time and no end, or an end time in a timezone the
 * reader has to convert, or — most commonly — a spinner and the word
 * "soon". This renders an explicit end time in the reader's own timezone,
 * a live countdown to it, and a link to a status page that is *not* on the
 * same infrastructure, because a status page hosted inside the outage is a
 * joke the reader has heard before.
 *
 * OVERRUNNING IS A FIRST-CLASS STATE
 *
 * Windows overrun. When the end time passes and the service is still down,
 * a countdown showing "-00:14:32" is worse than useless. Past the deadline
 * the component switches to a different sentence that stops promising a
 * time it has already missed and points at the status page instead. That
 * transition is the one thing here that is hard to get right and is the
 * reason this is a block rather than a paragraph.
 *
 * THE CLOCK CLEANS UP AFTER ITSELF. `setInterval` in an effect with a
 * matching `clearInterval`, and it stops once the deadline passes rather
 * than ticking forever in a background tab.
 *
 * ACCESSIBILITY: the countdown is `aria-live="off"` on purpose — a region
 * announcing every second is unusable — with a polite summary that updates
 * only when the state changes. The remaining time is also written out in
 * words for screen readers, since "02:14:09" is read as three numbers.
 */

import * as React from 'react'
import { ArrowUpRight, Clock, Wrench } from 'lucide-react'

export interface MaintenanceWindowStateProps {
  title?: string
  summary?: string
  /** ISO 8601 instant the window is expected to end. */
  endsAt?: string
  /** Fixed "now" so the preview and screenshots are deterministic. */
  now?: Date
  statusUrl?: string
  /** What still works while the rest is down. Empty renders nothing. */
  stillWorking?: string[]
  className?: string
}

const DEFAULT_WORKING = [
  'Published sites stay online and serving',
  'The public API continues to read from cache',
  'Existing sessions are not signed out',
]

function pad(value: number): string {
  return String(value).padStart(2, '0')
}

/** Milliseconds as `hh:mm:ss` plus a spoken form for assistive tech. */
function splitDuration(ms: number) {
  const total = Math.max(0, Math.floor(ms / 1000))
  const hours = Math.floor(total / 3600)
  const minutes = Math.floor((total % 3600) / 60)
  const seconds = total % 60
  return {
    clock: `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`,
    spoken:
      hours > 0
        ? `${hours} hour${hours === 1 ? '' : 's'} and ${minutes} minute${minutes === 1 ? '' : 's'}`
        : `${minutes} minute${minutes === 1 ? '' : 's'}`,
  }
}

export function MaintenanceWindowState({
  title = 'Scheduled maintenance in progress',
  summary = 'We are migrating the primary database. Dashboards, the CLI and sign-in are unavailable until this finishes.',
  endsAt = '2026-08-31T04:30:00Z',
  now = new Date(Date.UTC(2026, 7, 31, 2, 15, 51)),
  statusUrl = 'https://status.example.com',
  stillWorking = DEFAULT_WORKING,
  className = '',
}: MaintenanceWindowStateProps) {
  const deadline = React.useMemo(() => new Date(endsAt).getTime(), [endsAt])
  const [current, setCurrent] = React.useState(() => now.getTime())

  /*
   * Ticks once a second and stops at the deadline. An interval that keeps
   * running after the countdown is meaningless is the reason maintenance
   * pages left open overnight burn a phone battery.
   */
  React.useEffect(() => {
    if (current >= deadline) return
    const id = setInterval(() => setCurrent((value) => value + 1000), 1000)
    return () => clearInterval(id)
  }, [current, deadline])

  const overrunning = current >= deadline
  const { clock, spoken } = splitDuration(deadline - current)

  /*
   * The end time in the reader's timezone — resolved after mount, never
   * during render.
   *
   * `toLocaleString(undefined, …)` asks the *runtime* for a locale and a
   * zone, and the server's answers are not the browser's: this rendered
   * "10:00 am IST" on the server and "10:00 GMT+5:30" in the client, which
   * React discards the subtree over. It is invisible on screen and shows up
   * only as a hydration error in the console — the same bug this codebase
   * already fixed once in `article-header.tsx`, one API over.
   *
   * So the first paint uses an explicit UTC rendering that both sides agree
   * on, and the effect swaps in the local one. A reader with JavaScript off
   * gets a correct time in a named zone rather than a wrong one in theirs.
   */
  const utcEnd = React.useMemo(
    () =>
      new Date(deadline).toLocaleString('en-US', {
        hour: 'numeric',
        minute: '2-digit',
        timeZone: 'UTC',
        timeZoneName: 'short',
      }),
    [deadline],
  )
  const [localEnd, setLocalEnd] = React.useState(utcEnd)

  React.useEffect(() => {
    setLocalEnd(
      new Date(deadline).toLocaleString(undefined, {
        hour: 'numeric',
        minute: '2-digit',
        timeZoneName: 'short',
      }),
    )
  }, [deadline])

  return (
    <section
      className={`mx-auto max-w-xl rounded-2xl border border-border bg-card p-8 text-center text-card-foreground sm:p-12 ${className}`}
    >
      <span
        aria-hidden
        className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-amber-500/10"
      >
        <Wrench className="h-5 w-5 text-amber-600 dark:text-amber-400" />
      </span>

      <h1 className="mt-5 text-xl font-semibold sm:text-2xl">{title}</h1>
      <p className="mx-auto mt-3 max-w-md text-pretty text-sm text-muted-foreground">{summary}</p>

      {/* The countdown, or the sentence that replaces it once it is wrong. */}
      <div className="mt-7 rounded-xl border border-border bg-muted/40 p-5">
        {overrunning ? (
          <p aria-live="polite" className="text-sm">
            <span className="font-semibold">This is taking longer than planned.</span>{' '}
            <span className="text-muted-foreground">
              We have passed the {localEnd} estimate. The status page has the current
              position and is hosted separately from the systems under maintenance.
            </span>
          </p>
        ) : (
          <>
            <p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
              Expected back in
            </p>
            {/*
              Live region off: a per-second announcement is unusable. The
              spoken duration below carries the same information once.
            */}
            <p
              aria-live="off"
              className="mt-1.5 font-mono text-3xl font-bold tabular-nums sm:text-4xl"
            >
              {clock}
            </p>
            <p className="mt-2 text-sm text-muted-foreground">
              <span className="sr-only">About {spoken} remaining. </span>
              Estimated finish at{' '}
              <time dateTime={endsAt} className="font-medium text-foreground">
                {localEnd}
              </time>
            </p>
          </>
        )}
      </div>

      {stillWorking.length > 0 ? (
        <div className="mt-7 text-start">
          <h2 className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
            Still working
          </h2>
          <ul className="mt-2.5 space-y-1.5">
            {stillWorking.map((item) => (
              <li key={item} className="flex items-start gap-2 text-sm text-muted-foreground">
                <span
                  aria-hidden
                  className="mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500 border border-transparent"
                />
                {item}
              </li>
            ))}
          </ul>
        </div>
      ) : null}

      <a
        href={statusUrl}
        className="mt-7 inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
      >
        <Clock aria-hidden className="h-4 w-4" />
        Live status
        <ArrowUpRight aria-hidden className="h-3.5 w-3.5" />
      </a>

      <p className="mt-3 text-xs text-muted-foreground">
        Hosted separately, so it stays up when this does not.
      </p>
    </section>
  )
}

Before you paste

  • Styling is Tailwind utility classes on semantic tokens (bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.
  • Install: npm i lucide-react
  • Every prop has a default, so it renders standalone before you wire it up.

Where it goes

Drop it at components/maintenance-window-state.tsx and import it where you need the section:

import { MaintenanceWindowState } from '@/components/maintenance-window-state'

Customize

3 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.

Props

Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.

PropTypeDefault
titlestring'Scheduled maintenance in progress'
summarystring—
endsAtISO 8601 instant the window is expected to end.string'2026-08-31T04:30:00Z'
nowFixed "now" so the preview and screenshots are deterministic.Datenew Date(Date.UTC(2026, 7, 31, 2, 15, 51))
statusUrlstring'https://status.example.com'
stillWorkingWhat still works while the rest is down. Empty renders nothing.string[]DEFAULT_WORKING
classNamestring''

Not using React?

The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.

This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.

maintenance-window-state.html
<!--
  Scheduled Maintenance Window — markup from the Hoverlab catalog.

  This is the block rendered once to HTML and wrapped as a component
  file. It is not a port of the React source: the Tailwind classes carry
  the design, which is the part that took the work, and they are the same
  in every framework.

  This block is interactive in React and the handlers are NOT here.
  Buttons, toggles and menus render in their initial state and do
  nothing until you wire them up.
-->
<section class="mx-auto max-w-xl rounded-2xl border border-border bg-card p-8 text-center text-card-foreground sm:p-12 ">
  <span aria-hidden="true" class="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-amber-500/10">
    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wrench h-5 w-5 text-amber-600 dark:text-amber-400" aria-hidden="true">
      <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>
    </svg>
  </span>
  <h1 class="mt-5 text-xl font-semibold sm:text-2xl">Scheduled maintenance in progress</h1>
  <p class="mx-auto mt-3 max-w-md text-pretty text-sm text-muted-foreground">We are migrating the primary database. Dashboards, the CLI and sign-in are unavailable until this finishes.</p>
  <div class="mt-7 rounded-xl border border-border bg-muted/40 p-5">
    <p class="text-xs font-medium uppercase tracking-wider text-muted-foreground">Expected back in</p>
    <p aria-live="off" class="mt-1.5 font-mono text-3xl font-bold tabular-nums sm:text-4xl">02:14:09</p>
    <p class="mt-2 text-sm text-muted-foreground"><span class="sr-only">About 2 hours and 14 minutes remaining. </span>Estimated finish at <time dateTime="2026-08-31T04:30:00Z" class="font-medium text-foreground">4:30 AM UTC</time></p>
  </div>
  <div class="mt-7 text-start">
    <h2 class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">Still working</h2>
    <ul class="mt-2.5 space-y-1.5">
      <li class="flex items-start gap-2 text-sm text-muted-foreground"><span aria-hidden="true" class="mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500 border border-transparent"></span>Published sites stay online and serving</li>
      <li class="flex items-start gap-2 text-sm text-muted-foreground"><span aria-hidden="true" class="mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500 border border-transparent"></span>The public API continues to read from cache</li>
      <li class="flex items-start gap-2 text-sm text-muted-foreground"><span aria-hidden="true" class="mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500 border border-transparent"></span>Existing sessions are not signed out</li>
    </ul>
  </div>
  <a href="https://status.example.com" class="mt-7 inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock h-4 w-4" aria-hidden="true"><path d="M12 6v6l4 2"></path><circle cx="12" cy="12" r="10"></circle></svg>Live status<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right h-3.5 w-3.5" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a>
  <p class="mt-3 text-xs text-muted-foreground">Hosted separately, so it stays up when this does not.</p>
</section>
  • This is rendered HTML, not a translation of the React source. The Tailwind classes carry the design and work in any framework.
  • It is one frame: the component in its initial state, with no props applied beyond the defaults.
  • This block is interactive in React — toggles, menus or form state. None of that survives here; the markup is the closed/default state and the handlers are gone. Re-wire them in your own framework.
  • Requires Tailwind, and the design tokens the classes reference (bg-card, text-muted-foreground, and so on). The template ZIPs ship a globals.css that defines them.

What each framework gets across the whole catalog — effects convert properly; this rung is markup.

For AI

The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.

See the prompt

Used in these pages

Want the whole screen instead of this one section? Open a page and copy it entire.

7 more blocks in Empty & Error States

All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.

Browse Empty & Error States

Shipping one commercially

Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.

  • A commercial licence for everything in the catalog
  • Unlimited bundle exports, in Vue, Svelte and Tailwind
  • One payment — no subscription, nothing to renew
Pro — $79 once

More Empty & Error States blocks

View category
Open the full page for this block

Empty State With Illustration

Two variants — nothing created yet, versus filters excluded everything — because offering "create your first" to a bad filter is the classic bug.

Empty & Error States131 lines1 dep
Open the full page for this block

Error State With Retry

Failed-to-load panel with a visible retry, a copyable error reference and the stack tucked behind a disclosure.

Empty & Error States131 lines1 dep
Open the full page for this block

404 With Search & Suggestions

A 404 that helps: a real GET search form that works without JavaScript, likely destinations, and home as the fallback rather than the headline.

Empty & Error States146 lines1 dep
Open the full page for this block

Shimmer Skeleton List

Loading placeholders with varied row widths and a sweep that is motion-safe only, falling back to a flat tint under reduced motion.

Empty & Error States88 linesNo deps
Open the full page for this block

Permission Denied (403)

The state where the page exists and the account is not on the list: names who can grant access, sends the request, and leaks nothing about what is inside.

Empty & Error States175 lines1 dep
Open the full page for this block

Offline With Queued Changes

Leads with what still works — three edits saved on this device — instead of with the failure. The retry backoff counts down in the open, and the three things that genuinely cannot work offline are named rather than discovered.

Empty & Error States173 lines1 dep
Open the full page for this block

Empty Because of Filters

The empty state for a list emptied by its own filters: every active filter shown as a removable chip ordered by how many results it would restore, with clear-all deliberately second.

Empty & Error States186 lines1 dep