Tax ID Input

Tax ID Input is a copy-paste React component that stops invoice sent with a mistyped gstin 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/tax-id-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

StopsInvoice sent with a mistyped GSTIN

Was this component page useful?

How do I install Tax ID Input?

pnpm dlx shadcn@latest add @bollard/tax-id-input

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

How do I use Tax ID Input in React?

tax-id-input-usage.tsx
import { TaxIdInput } from "@/components/ui/tax-id-input"

<TaxIdInput kind="gstin" label="Supplier GSTIN" defaultValue="27AAPFUO939F1ZV" />

What input mistakes does Tax ID Input catch?

  • GSTIN check character that doesn't match (mod-36)
  • Look-alike characters (O/0, I/1) and swapped neighbours
  • State code, PAN holder type and EU country read back
  • EU VAT body shape per country, and GR typed instead of EL
  • Wrong length for the chosen kind

What props does Tax ID Input accept?

TaxIdInput props
PropTypeDefault
kind* (required)

Which number the field holds.

TaxIdKind—
label

Visible label. Defaults to the kind's name.

stringLABELS[kind]
value

Controlled value, without spaces.

string—
defaultValue

Initial value when uncontrolled.

string""
onValueChange

Called with the cleaned value (no spaces, upper case) and whether it passed every check.

(value: string, valid: boolean) => void—
hint

Helper text shown while there is nothing to report.

string—
locale

Locale for EU country names.

string"en"
messages

Override any of the default messages.

Partial<typeof TAX_ID_MESSAGES>—

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

How is Tax ID Input accessible?

  • Visible <label>; aria-invalid with status via aria-describedby
  • Status and fixes in a polite live region
  • After a fix, focus returns to the input
  • External verify link has visible 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: Verify GSTIN/VAT registration with the official service server-side before issuing tax invoices.

  • Format looks valid ≠ registered: it does not confirm the number exists or is active
  • Use the GST portal or VIES to verify registration
  • EU VAT patterns check structure, not national check digits

What validation rules apply to Tax ID Input?

Rules not yet verified against an official source.

GSTIN check-character algorithm, GST state codes, PAN 4th-character holder types and EU VAT body patterns were not re-verified against a primary source this round. Informational; verify registration with the GST portal or VIES. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Tax ID Input stop?

Invoice sent with a mistyped GSTIN

Also known as

gstin · gst number · pan · vat number · tax id · invoice · billing · b2b checkout

Field type

What dependencies does Tax ID Input require?

Tax ID Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameTax ID Input
Registry identifier@bollard/tax-id-input
Install commandnpx shadcn@latest add @bollard/tax-id-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 Tax ID Input

How does Tax ID Input validate Indian financial identifiers?

Tax ID Input stops invoice sent with a mistyped GSTIN. Complies with national standards for GSTIN check character that doesn't match (mod-36), Look-alike characters (O/0, I/1) and swapped neighbours, State code, PAN holder type and EU country read back, EU VAT body shape per country, and GR typed instead of EL, Wrong length for the chosen kind. Limitation: verify tax-id-input with issuer gateway.

How do I install tax-id-input with shadcn?

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

What props customize Tax ID Input?

Tax ID Input accepts `kind`, `label`, `value`, `defaultValue`, `onValueChange`. Configures gstin, gst number, pan behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of tax-id-input?

Format looks valid ≠ registered: it does not confirm the number exists or is active. Use the GST portal or VIES to verify registration. EU VAT patterns check structure, not national check digits Server requirement: Verify GSTIN/VAT registration with the official service server-side before issuing tax invoices.

How does Tax ID Input meet accessibility guidelines?

Visible <label>; aria-invalid with status via aria-describedby. Status and fixes in a polite live region. After a fix, focus returns to the input. External verify link has visible text. Minimizes errors: gstin validation, pan number format.

Which components pair with Tax ID Input?