Aadhaar Input

Aadhaar Input is a copy-paste React component that stops aadhaar typos and over-exposure 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/aadhaar-input
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

StopsAadhaar typos and over-exposure

Was this component page useful?

How do I install Aadhaar Input?

pnpm dlx shadcn@latest add @bollard/aadhaar-input

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

How do I use Aadhaar Input in React?

aadhaar-input-usage.tsx
import { AadhaarInput } from "@/components/ui/aadhaar-input"

<AadhaarInput value={value} onValueChange={setValue} accept={accept} onAcceptChange={setAccept} name="aadhaar" />

What input mistakes does Aadhaar Input catch?

  • Typos and swapped neighbouring digits, via the Verhoeff check digit
  • A first digit of 0 or 1, which Aadhaar numbers never use
  • A 16-digit VID, 28-digit enrolment ID, masked copy, PAN or mobile number pasted by mistake
  • Spaces, dashes and dots from a photocopy or PDF, and Indian-script or full-width digits
  • Letters typed for look-alike digits (O, I, l, S)

What props does Aadhaar Input accept?

AadhaarInput props
PropTypeDefault
accept

What the form wants. Defaults to `aadhaar`.

Accept"aadhaar"
value

Controlled entry (digits; letters only while a look-alike fix is pending).

string—
defaultValue

Initial entry when uncontrolled. Spaces and dashes are removed.

string""
onValueChange

Called with the entry and what it was read as. Store `maskAadhaar(entry)`, not the entry, unless you run an Aadhaar Data Vault.

(value: string, reading: AadhaarReading) => void—
onAcceptChange

Offer a one-tap switch when the other kind is pasted (VID in an Aadhaar field, or the reverse).

(accept: "aadhaar" | "vid") => void—
storage

How you keep the number, shown as the storage note. Defaults to `masked`.

"masked" | "vault" | "none""masked"
label

Visible label; defaults to one matching `accept`.

string—
messages

Any visible string.

Partial<AadhaarMessages>—

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

How is Aadhaar Input accessible?

  • Visible <label> tied to the input; aria-invalid and aria-describedby point at the error and storage note
  • Show/hide is a real button with aria-pressed and an aria-label, and returns focus to the field
  • Status changes are announced through a role="status" region
  • Icons are aria-hidden; errors carry text, not only colour

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: Verify the number through an authorised KYC/eKYC provider on the server, and avoid storing or logging full Aadhaar numbers unless you are permitted to.

  • Format and checksum only: it does not confirm the number exists or belongs to this person
  • On a failed check digit it offers to reveal the number rather than guessing which digit is wrong
  • Masking is visual; your form still receives the full number unless you handle it otherwise
  • The storage note only describes what you pass in `storage`; it does not store or encrypt anything

What validation rules apply to Aadhaar Input?

Rules not yet verified against an official source.

Not verified on 2026-10-17: the UIDAI site did not respond. The no-0-or-1 first digit, Verhoeff check digit, 16-digit VID and masked-Aadhaar conventions are unchecked here. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Aadhaar Input stop?

Aadhaar typos and over-exposure

Also known as

aadhaar · uidai · aadhar number · vid · masked aadhaar · kyc · ekyc · 12 digit

Field type

What dependencies does Aadhaar Input require?

Aadhaar Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameAadhaar Input
Registry identifier@bollard/aadhaar-input
Install commandnpx shadcn@latest add @bollard/aadhaar-input
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 Aadhaar Input

How does Aadhaar Input validate Indian financial identifiers?

Aadhaar Input stops aadhaar typos and over-exposure. Complies with national standards for Typos and swapped neighbouring digits, via the Verhoeff check digit, A first digit of 0 or 1, which Aadhaar numbers never use, A 16-digit VID, 28-digit enrolment ID, masked copy, PAN or mobile number pasted by mistake, Spaces, dashes and dots from a photocopy or PDF, and Indian-script or full-width digits, Letters typed for look-alike digits (O, I, l, S). Limitation: verify aadhaar-input with issuer gateway.

How do I install aadhaar-input with shadcn?

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

What props customize Aadhaar Input?

Aadhaar Input accepts `accept`, `value`, `defaultValue`, `onValueChange`, `onAcceptChange`. Configures aadhaar, uidai, aadhar number behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of aadhaar-input?

Format and checksum only: it does not confirm the number exists or belongs to this person. On a failed check digit it offers to reveal the number rather than guessing which digit is wrong. Masking is visual; your form still receives the full number unless you handle it otherwise. The storage note only describes what you pass in `storage`; it does not store or encrypt anything Server requirement: Verify the number through an authorised KYC/eKYC provider on the server, and avoid storing or logging full Aadhaar numbers unless you are permitted to.

How does Aadhaar Input meet accessibility guidelines?

Visible <label> tied to the input; aria-invalid and aria-describedby point at the error and storage note. Show/hide is a real button with aria-pressed and an aria-label, and returns focus to the field. Status changes are announced through a role="status" region. Icons are aria-hidden; errors carry text, not only colour. Minimizes errors: aadhaar number validation, verhoeff check aadhaar.

Which components pair with Aadhaar Input?