Photo Spec Check

Photo Spec Check is a copy-paste React component that stops helps prevent an exam photo being rejected after upload 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/photo-spec-check
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 prevent an exam photo being rejected after upload

Was this component page useful?

How do I install Photo Spec Check?

pnpm dlx shadcn@latest add @bollard/photo-spec-check

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

How do I use Photo Spec Check in React?

photo-spec-check-usage.tsx
import { PhotoSpecCheck, type FaceBox } from "@/components/ui/photo-spec-check"

<PhotoSpecCheck key={preset} spec={preset} value={file} onValueChange={setFile} face={face} />

What input mistakes does Photo Spec Check catch?

  • File type that doesn't match its name
  • File size outside the KB window, and over-compression
  • Pixel size, aspect ratio or print size out of spec
  • Face too small or off-centre, when you pass a face box
  • Background that isn't white, or a black-and-white photo

What props does Photo Spec Check accept?

PhotoSpecCheck props
PropTypeDefault
spec* (required)

A preset key from `PHOTO_SPECS` ("upsc", "ssc", "nta", "neet", "us-visa") or your own spec.

string | PhotoSpec—
value

Controlled file.

File | null—
defaultValue

Initial file when uncontrolled.

File | nullnull
onValueChange

Called with the chosen file, or the fixed copy after a one-tap fix.

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

The face (or head) box in the file's pixels, or a detector that returns one. Enables the face checks and a face-aware crop.

FaceBox | null | ((file: File) => FaceBox | null | Promise<FaceBox | null>)—
onIssuesChange

Called whenever the open issues change, to gate the upload.

(issues: PhotoIssue[]) => void—
messages

Any visible string; `issues` may be partial.

Partial<Omit<PhotoSpecMessages, "issues">> & { issues?: Partial<PhotoSpecMessages["issues"]> }—

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

How is Photo Spec Check accessible?

  • Choose button is described by the spec; the hidden file input is removed from tab order
  • Status lines have text; icons are aria-hidden
  • Focus moves to the fix or choose button after reading

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

What are the limitations and server boundaries?

  • Presets reflect the sources below and change often; portals may also check things this can't (glasses, expression)
  • Face checks need a face box from your detector
  • The canvas fix re-encodes the photo

What validation rules apply to Photo Spec Check?

Rules last verified:

Informational; check the official source. Confirmed: US visa JPEG, square 600–1200 px, ≤ 240 kB, compression ≤ 20:1; UPSC colour JPG named photo, 20–200 KB. SSC, NTA and NEET presets were not re-checked this round. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Photo Spec Check stop?

Helps prevent an exam photo being rejected after upload

Also known as

photo upload · upsc · ssc · neet · nta · passport photo · visa photo · image resize

Field type

What dependencies does Photo Spec Check require?

Photo Spec Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePhoto Spec Check
Registry identifier@bollard/photo-spec-check
Install commandnpx shadcn@latest add @bollard/photo-spec-check
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 Photo Spec Check

How does Photo Spec Check validate Indian financial identifiers?

Photo Spec Check stops an exam photo being rejected after upload. Complies with national standards for File type that doesn't match its name, File size outside the KB window, and over-compression, Pixel size, aspect ratio or print size out of spec, Face too small or off-centre, when you pass a face box, Background that isn't white, or a black-and-white photo. Limitation: verify photo-spec-check with issuer gateway.

How do I install photo-spec-check with shadcn?

Run `npx shadcn@latest add @bollard/photo-spec-check`. Sources added: registry/default/photo-spec-check/photo-canvas.ts, registry/default/photo-spec-check/photo-spec-check.tsx, registry/default/photo-spec-check/photo-spec.ts. Package requirements: lucide-react.

What props customize Photo Spec Check?

Photo Spec Check accepts `spec`, `value`, `defaultValue`, `onValueChange`, `face`. Configures photo upload, upsc, ssc behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of photo-spec-check?

Presets reflect the sources below and change often; portals may also check things this can't (glasses, expression). Face checks need a face box from your detector. The canvas fix re-encodes the photo Server requirement: backend verification for photo-spec-check.

How does Photo Spec Check meet accessibility guidelines?

Choose button is described by the spec; the hidden file input is removed from tab order. Status lines have text; icons are aria-hidden. Focus moves to the fix or choose button after reading. Minimizes errors: photo size kb exam form, passport photo rejected.

Which components pair with Photo Spec Check?