Private Mode Notice

Private Mode Notice is a copy-paste React component that stops drafts vanish in incognito 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/private-mode-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

StopsDrafts vanish in incognito

Was this component page useful?

How do I install Private Mode Notice?

pnpm dlx shadcn@latest add @bollard/private-mode-notice

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

How do I use Private Mode Notice in React?

private-mode-notice-usage.tsx
import { PrivateModeNotice, type StorageReport } from "@/components/ui/private-mode-notice"

<PrivateModeNotice
  report={report}
  hasUnsavedWork={notes.trim().length > 0}
  exportData={() => notes}
  exportFilename="trip-notes.txt"
  onReport={(r) =>
    real &&
    setFound(r.risk === "ok" ? "This browser keeps data normally." : `This browser: ${r.risk} (${r.confidence}).`)
  }
/>

What input mistakes does Private Mode Notice catch?

  • Private window that erases saved data on close
  • Site data blocked, so nothing can be saved
  • Storage nearly full, so new saves may fail
  • Unsaved work at risk: export button

What props does Private Mode Notice accept?

PrivateModeNotice props
PropTypeDefault
report

Skip detection and use this report (tests, or your own server-side signal).

StorageReport—
variant

`banner` above a form or editor; `inline` as a one-line hint under a "Remember me" box.

"banner" | "inline""banner"
hasUnsavedWork

The user has work that only exists in this window. Strengthens the message and guards closing the tab.

booleanfalse
exportData

Returns the unsaved work to download. Without it there's no Export button.

() => string | Blob—
exportFilename

File name for the export.

string"unsaved-work.txt"
onReport

Called once detection finishes.

(report: StorageReport) => void—
privateText

Banner messages per risk.

string"This is a private window. Drafts and “Remember me” are e…
blockedText

Shown when site data is blocked.

string"Your browser is blocking site storage. Drafts and “Remem…
fullText

Shown when storage is nearly full.

string"Storage for this site is nearly full. New drafts may not…
unsavedText

Appended when work is at stake.

string"Your unsaved work only exists in this window."
likelyText

Shown when the risk is inferred, not proven.

string"Detected from how your browser stores data, so it may be…
inlinePrivateText

One-line messages for the inline variant.

string"Private window: you’ll be signed out when you close it."
inlineBlockedText

Inline variant text for blocked storage.

string"Your browser blocks site storage, so this can’t be remem…
inlineFullText

Inline variant text for full storage.

string"Browser storage is full, so this may not be remembered."
exportLabel

Button text to download unsaved work.

string"Export"
exportedLabel

Button text after exporting.

string"Downloaded"
dismissLabel

Button text to dismiss the notice.

string"Got it"

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

How is Private Mode Notice accessible?

  • Notice is a labelled region inside a polite live region
  • Export and dismiss are 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?

  • Private-mode detection is sometimes inferred ("likely") when a write succeeds
  • Browsers change storage behaviour often
  • Export uses the data you pass in exportData

What expensive mistakes does Private Mode Notice stop?

Drafts vanish in incognito

Also known as

incognito · private browsing · localstorage · remember me · storage quota · drafts · cookies blocked · safari private

What dependencies does Private Mode Notice require?

Private Mode Notice facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePrivate Mode Notice
Registry identifier@bollard/private-mode-notice
Install commandnpx shadcn@latest add @bollard/private-mode-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 Private Mode Notice

What form validation mistake does Private Mode Notice catch?

Private Mode Notice prevents drafts vanish in incognito. Warns before someone relies on drafts or "Remember me" in a browser that won't keep them, after testing that storage really works. Catches: Private window that erases saved data on close, Site data blocked, so nothing can be saved, Storage nearly full, so new saves may fail, Unsaved work at risk: export button. Limitation: validate private-mode-notice schemas on backend.

How do I install private-mode-notice with shadcn?

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

What props customize Private Mode Notice?

Private Mode Notice accepts `report`, `variant`, `hasUnsavedWork`, `exportData`, `exportFilename`. Configures incognito, private browsing, localstorage behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of private-mode-notice?

Private-mode detection is sometimes inferred ("likely") when a write succeeds. Browsers change storage behaviour often. Export uses the data you pass in exportData Server requirement: backend verification for private-mode-notice.

How does Private Mode Notice meet accessibility guidelines?

Notice is a labelled region inside a polite live region. Export and dismiss are buttons; icons are aria-hidden. Minimizes errors: incognito lost my data, remember me not working.

Which components pair with Private Mode Notice?