TkxPanInput, TkxVoterIdInput, TkxDrivingLicenceInput
Three focused KYC components, each validating the format defined by the relevant authority.
TkxPanInput
Section titled “TkxPanInput”Permanent Account Number — 10 chars, format [A-Z]{5}[0-9]{4}[A-Z]. The
4th character indicates entity type and is validated against the official
Income Tax codes (P=Individual, F=Firm, C=Company, H=HUF, etc.)
import { TkxPanInput, isValidPan } from 'tekivex-ui';
<TkxPanInput label="PAN" required onChange={({ normalised, valid }) => { if (valid) submit(normalised); }}/>
isValidPan('ABCPK1234F'); // → true (P = individual)isValidPan('abcde1234f'); // → true (auto-uppercased)isValidPan('ABCXK1234F'); // → false (X is not a valid entity char)TkxVoterIdInput
Section titled “TkxVoterIdInput”EPIC (Electors Photo Identity Card) — 10 chars, format [A-Z]{3}[0-9]{7}.
import { TkxVoterIdInput, isValidVoterId } from 'tekivex-ui';
<TkxVoterIdInput label="Voter ID" required onChange={({ normalised, valid }) => /* … */}/>
isValidVoterId('ABC1234567'); // → trueTkxDrivingLicenceInput
Section titled “TkxDrivingLicenceInput”Indian Driving Licence — multi-state format. Pattern:
[State 2 letters][RTO 2 digits][Year 4 digits][Sequence 7 digits]e.g. MH-12-2010-0012345 → normalised "MH1220100012345"The component accepts spaces and hyphens, normalises, and offers a pretty form via the change payload:
import { TkxDrivingLicenceInput, isValidDrivingLicence } from 'tekivex-ui';
<TkxDrivingLicenceInput label="DL number" onChange={({ raw, normalised, pretty, valid }) => { // raw: 'mh 12 2010 0012345' // normalised: 'MH1220100012345' // pretty: 'MH-12-2010-0012345' // valid: true }}/>Why three components instead of one polymorphic TkxKycInput type="…" ?
Section titled “Why three components instead of one polymorphic TkxKycInput type="…" ?”Each has different format rules, different aria-labels, different keyboards (PAN is mixed alphanumeric, DL is mostly numeric, Voter ID is mostly alphanumeric). Splitting them keeps the auto-complete + a11y behaviour clean per document type.
Standalone validators
Section titled “Standalone validators”Every validator is exported as a pure function:
| Function | Returns |
|---|---|
isValidAadhaar(s) | true if 12 digits + Verhoeff passes |
isValidPan(s) | true if format + entity-type char valid |
isValidVoterId(s) | true if format [A-Z]{3}[0-9]{7} |
isValidDrivingLicence(s) | true if format passes after normalisation |
Use them in Zod / Yup / Formik schemas, in tests, on the server side.