Sunset Notice

Sunset Notice is a copy-paste React component that stops api shutdown arrives as an outage 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/sunset-notice
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

StopsAPI shutdown arrives as an outage

GET /v1/orders · 200 OK

Was this component page useful?

How do I install Sunset Notice?

pnpm dlx shadcn@latest add @bollard/sunset-notice

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

How do I use Sunset Notice in React?

sunset-notice-usage.tsx
import { SunsetNotice } from "@/components/ui/sunset-notice"

<SunsetNotice
  key={run}
  subject="Orders API v1"
  headers={headers}
  storageKey={storageKey}
  onSnooze={setSnoozed}
  stops={["Creating orders with POST /v1/orders", "Webhooks in the v1 payload format"]}
/>

What input mistakes does Sunset Notice catch?

  • Sunset and Deprecation dates from response headers
  • Sunset earlier than deprecation, or already past
  • A local date that differs from the header's UTC date
  • Approaching deadlines (soonDays, finalDays)
  • Migration and policy links from Link rel=deprecation/sunset

What props does Sunset Notice accept?

SunsetNotice props
PropTypeDefault
subject* (required)

What is going away, e.g. "Orders API v1".

string—
headers

The API response (or its Headers, or a plain header map). Cross-origin APIs must list Sunset, Deprecation and Link in Access-Control-Expose-Headers.

HeaderSource—
sunset

Overrides the Sunset header.

When—
deprecation

Overrides the Deprecation header.

When—
stops

Exactly what stops working at sunset.

string[][]
migrateHref

Migration guide. Defaults to the Link rel="deprecation", then rel="sunset".

string—
timeZone

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

string—
locale

Locale for dates.

string—
storageKey

Remembers "Remind me later" per subject and sunset date. A changed date shows the notice again.

string"cui-sunset"
onSnooze

Called when the user snoozes, with the days-left mark the notice returns at.

(days: number) => void—
soonDays

Turns amber this many days before sunset, red at `finalDays`.

number30
finalDays

Days before sunset when the notice turns red.

number7
announcedText

Templates: `{subject}`, `{left}`, `{date}`, `{utc}`, `{days}` are filled in.

string"{subject} will be deprecated on {date}"
deprecatedText

Text once deprecated.

string"{subject} is deprecated"
sunsetText

Text with the sunset date.

string"{subject} stops working in {left}"
pastText

Text once the sunset has passed.

string"{subject} was due to stop on {date}"
noDateText

Text when deprecated with no date.

string"No shutdown date has been announced yet."
shiftedText

Note when the local day differs from the UTC date.

string"{date} your time ({utc} in UTC)"
pastDetailText

Detail after the sunset passed.

string"Requests may start failing at any moment."
stopsLabel

Heading of what stops working.

string"Stops working"
migrateLabel

Label of the migration link.

string"Migration guide"
remindLabel

Label of the remind-me-later button.

string"Remind me {days} before"
deprecatedLabel

Label of the deprecation date.

string"Deprecated {date}"
sunsetLabel

Label of the sunset date.

string"Sunset {date}"

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

How is Sunset Notice accessible?

  • Banner is a region with an aria-label; status is role=status, or role=alert once past
  • Snooze and migrate are labelled actions; icons are aria-hidden
  • Countdown bar is aria-hidden

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

What are the limitations and server boundaries?

  • Sunset timestamps are hints; the API can stop earlier or later
  • Snooze state lives in localStorage on this device
  • Accepts legacy "Deprecation: true" with no date

What validation rules apply to Sunset Notice?

Rules last verified:

Confirmed: Sunset = HTTP-date with rel="sunset" links; Deprecation is a Structured Field date (e.g. @1688169599). Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Sunset Notice stop?

API shutdown arrives as an outage

Also known as

sunset header · deprecation · api versioning · end of life · breaking change · migration · rfc 8594 · developer console

Field type

What dependencies does Sunset Notice require?

Sunset Notice facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameSunset Notice
Registry identifier@bollard/sunset-notice
Install commandnpx shadcn@latest add @bollard/sunset-notice
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 Sunset Notice

What form validation mistake does Sunset Notice catch?

Sunset Notice prevents aPI shutdown arrives as an outage. Turns Sunset and Deprecation response headers into a visible countdown, so an API shutdown isn't a surprise outage. Catches: Sunset and Deprecation dates from response headers, Sunset earlier than deprecation, or already past, A local date that differs from the header's UTC date, Approaching deadlines (soonDays, finalDays), Migration and policy links from Link rel=deprecation/sunset. Limitation: validate sunset-notice schemas on backend.

How do I install sunset-notice with shadcn?

Run `npx shadcn@latest add @bollard/sunset-notice`. Sources added: registry/default/sunset-notice/sunset-headers.ts, registry/default/sunset-notice/sunset-notice.tsx. Package requirements: lucide-react.

What props customize Sunset Notice?

Sunset Notice accepts `subject`, `headers`, `sunset`, `deprecation`, `stops`. Configures sunset header, deprecation, api versioning behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of sunset-notice?

Sunset timestamps are hints; the API can stop earlier or later. Snooze state lives in localStorage on this device. Accepts legacy "Deprecation: true" with no date Server requirement: backend verification for sunset-notice.

How does Sunset Notice meet accessibility guidelines?

Banner is a region with an aria-label; status is role=status, or role=alert once past. Snooze and migrate are labelled actions; icons are aria-hidden. Countdown bar is aria-hidden. Minimizes errors: deprecated api stopped working, missed api sunset date.

Which components pair with Sunset Notice?