PII Post Guard

PII Post Guard is a copy-paste React component that stops helps stop an aadhaar number being posted in public 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/pii-post-guard
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

StopsHelps stop an Aadhaar number being posted in public

Was this component page useful?

How do I install PII Post Guard?

pnpm dlx shadcn@latest add @bollard/pii-post-guard

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

How do I use PII Post Guard in React?

pii-post-guard-usage.tsx
import { PiiPostGuard } from "@/components/ui/pii-post-guard"

<PiiPostGuard
  label="Your review of QuickKart"
  defaultValue={REVIEW}
  delay={0}
  rows={5}
  aria-describedby="review-tip"
  onPost={() => setPosted(true)}
  audience={{ label: "Public review", who: "anyone on the internet", note: "Reviews are indexed by search engines." }}
/>

What input mistakes does PII Post Guard catch?

  • Aadhaar numbers (Verhoeff check)
  • Card numbers (Luhn check)
  • PAN numbers, including holder type
  • Phone numbers, emails and street addresses
  • OTPs near words like code or OTP

What props does PII Post Guard accept?

PiiPostGuard props
PropTypeDefault
label

Visible label.

string—
value

Controlled text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the text on every change, including masking.

(text: string) => void—
audience

Who will see the post. Defaults to the public internet.

PostAudience—
kinds

Which details to look for. Defaults to all of them.

PiiKind[]PII_KINDS
mask

Your own masking, e.g. to match a house style. Defaults to `maskPii`.

(match: PiiMatch) => string—
delay

Pause in ms before findings refresh while typing, so nothing is announced per keystroke.

number600
locale

Locale for joining the list of kinds ("phone number and PAN").

string—
onPost

Called on Post. With details left, the first click jumps to them and the second posts. May return a Promise.

(text: string) => void | Promise<void>—
messages

Any visible string; `kinds` and `why` may be partial.

Partial<Omit<PiiPostMessages, "kinds" | "why">> & { kinds?: Partial<PiiPostMessages["kinds"]>; why?: Partial<PiiPostMessages["why"]> }—
className

Class for the outer wrapper.

string—

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

How is PII Post Guard accessible?

  • Visible label; textarea is described by the audience line and findings
  • Announcements go to a polite live region
  • Focus moves to the next mask button, then back to the field

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: Scan and redact on the server before publishing, and never log the raw text.

  • India-focused identifiers; other countries' IDs aren't detected
  • Addresses are detected heuristically
  • The post still goes out if the user chooses to; it masks, it doesn't block

What expensive mistakes does PII Post Guard stop?

Helps stop an Aadhaar number being posted in public

Also known as

pii · aadhaar · pan · phone number · comment box · review · mask · luhn

What dependencies does PII Post Guard require?

PII Post Guard facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePII Post Guard
Registry identifier@bollard/pii-post-guard
Install commandnpx shadcn@latest add @bollard/pii-post-guard
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 PII Post Guard

How does PII Post Guard validate Indian financial identifiers?

PII Post Guard stops helps stop an Aadhaar number being posted in public. Complies with national standards for Aadhaar numbers (Verhoeff check), Card numbers (Luhn check), PAN numbers, including holder type, Phone numbers, emails and street addresses, OTPs near words like code or OTP. Limitation: verify pii-post-guard with issuer gateway.

How do I install pii-post-guard with shadcn?

Run `npx shadcn@latest add @bollard/pii-post-guard`. Sources added: registry/default/pii-post-guard/pii-post-guard.tsx, registry/default/pii-post-guard/pii.ts. Package requirements: lucide-react.

What props customize PII Post Guard?

PII Post Guard accepts `label`, `value`, `defaultValue`, `onValueChange`, `audience`. Configures pii, aadhaar, pan behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of pii-post-guard?

India-focused identifiers; other countries' IDs aren't detected. Addresses are detected heuristically. The post still goes out if the user chooses to; it masks, it doesn't block Server requirement: Scan and redact on the server before publishing, and never log the raw text.

How does PII Post Guard meet accessibility guidelines?

Visible label; textarea is described by the audience line and findings. Announcements go to a polite live region. Focus moves to the next mask button, then back to the field. Minimizes errors: posted phone number publicly, aadhaar in review.

Which components pair with PII Post Guard?