Doc Upload Match

Doc Upload Match is a copy-paste React component that stops wrong document uploaded for kyc 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/doc-upload-match
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

StopsWrong document uploaded for KYC

Was this component page useful?

How do I install Doc Upload Match?

pnpm dlx shadcn@latest add @bollard/doc-upload-match

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

How do I use Doc Upload Match in React?

doc-upload-match-usage.tsx
import { DocUploadMatch, type DocGuess, type DocKind } from "@/components/ui/doc-upload-match"

<DocUploadMatch label="Aadhaar (front)" spec={{ kind: "aadhaar-front" }} value={file} onValueChange={setFile} classify={classify} onAccept={(f) => setAccepted(f.name)} />

What input mistakes does Doc Upload Match catch?

  • Password-locked PDFs, with how the e-Aadhaar password is formed
  • Multi-page PDFs where one page is expected
  • Images too small, blurry or in HEIC format
  • Screenshots of screenshots
  • The wrong document or side, when you provide a classify function

What props does Doc Upload Match accept?

DocUploadMatch props
PropTypeDefault
label* (required)

Visible label, e.g. "Aadhaar (front)".

string—
spec* (required)

What the slot asks for.

DocSpec—
value

Controlled file.

File | null—
defaultValue

Initial file when uncontrolled.

File | nullnull
onValueChange

Called when a file is chosen or removed.

(file: File | null) => void—
classify

Optional OCR or model check. Gets the file and the cheap signals; return null when unsure. Aborted when the file changes.

(file: File, signals: DocSignals, signal: AbortSignal) => Promise<DocGuess | null>—
blurBelow

Laplacian variance below which a photo counts as blurry.

number—
onAccept

Called with the file and its open issues once the user accepts it (no issues, or "Use anyway").

(file: File, issues: DocIssue[]) => void—
messages

Any visible string.

Partial<Omit<DocUploadMessages, "names" | "needs">> & { names?: Partial<Record<DocKind, string>>; needs?: Partial<Record<DocKind, string>> }—

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

How is Doc Upload Match accessible?

  • Labelled file picker; focus returns to it after a rejection
  • The preview image has empty alt (decorative); status is given in text
  • Checking and result messages use icons plus text

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: Re-validate document type, size and content on the server or with your KYC provider; client checks are hints.

  • Without a classify hook it can't tell which document is in the image
  • Blur and size checks are heuristics and can misjudge some photos
  • Runs in the browser; the file still goes wherever your onAccept sends it

What validation rules apply to Doc Upload Match?

Rules not yet verified against an official source.

Not verified on 2026-10-17: the UIDAI site did not respond. The e-Aadhaar password rule (first 4 letters of the name in capitals + birth year) is unchecked. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Doc Upload Match stop?

Wrong document uploaded for KYC

Also known as

kyc upload · document upload · e-aadhaar pdf · pan upload · file upload · dropzone · id proof · address proof

Field type

What dependencies does Doc Upload Match require?

Doc Upload Match facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameDoc Upload Match
Registry identifier@bollard/doc-upload-match
Install commandnpx shadcn@latest add @bollard/doc-upload-match
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 Doc Upload Match

How does Doc Upload Match validate Indian financial identifiers?

Doc Upload Match stops wrong document uploaded for KYC. Complies with national standards for Password-locked PDFs, with how the e-Aadhaar password is formed, Multi-page PDFs where one page is expected, Images too small, blurry or in HEIC format, Screenshots of screenshots, The wrong document or side, when you provide a classify function. Limitation: verify doc-upload-match with issuer gateway.

How do I install doc-upload-match with shadcn?

Run `npx shadcn@latest add @bollard/doc-upload-match`. Sources added: registry/default/doc-upload-match/doc-signals.ts, registry/default/doc-upload-match/doc-upload-match.tsx. Package requirements: lucide-react.

What props customize Doc Upload Match?

Doc Upload Match accepts `label`, `spec`, `value`, `defaultValue`, `onValueChange`. Configures kyc upload, document upload, e-aadhaar pdf behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of doc-upload-match?

Without a classify hook it can't tell which document is in the image. Blur and size checks are heuristics and can misjudge some photos. Runs in the browser; the file still goes wherever your onAccept sends it Server requirement: Re-validate document type, size and content on the server or with your KYC provider; client checks are hints.

How does Doc Upload Match meet accessibility guidelines?

Labelled file picker; focus returns to it after a rejection. The preview image has empty alt (decorative); status is given in text. Checking and result messages use icons plus text. Minimizes errors: aadhaar back uploaded instead, password protected e-aadhaar.

Which components pair with Doc Upload Match?