vn/ui / Docs / Components

Tax Code Input

Check the format of Vietnamese tax identifiers.

Preview

The Code tab uses the common @/* alias. Import the copied file from the directory in vnui.json if your app uses a different path.

Installation

Initialize vn/ui in your app, then add this component.

npx @naminc/vnui@latest add tax-code-input

Usage and variants

Organization identifiers use a ten-digit checksum. Branch codes append a three-digit suffix. The personal profile checks the twelve-digit identifier format. Registration status requires an authoritative lookup.

<TaxCodeInput type="personal" label="Mã định danh cá nhân" />

API

PropTypeBehavior
value, defaultValuestringControlled value or initial uncontrolled value.
onValueChange(value) => voidReceives the next value; connect it to form state or React Hook Form Controller.
label, name, disabled, classNamestring, string, boolean, stringVisible label, form name, disabled state and CSS class.
typeTaxCodeTypeauto, organization, branch or personal.

Use value and onValueChange for controlled fields, including React Hook Form Controller. Use defaultValue for standalone fields. label, name, disabled and className customize the field.

Accessibility

Fields have visible labels and keyboard focus. Searchable selectors support typing, arrow keys, Enter and Escape; date controls use browser keyboard behavior.

An invalid identifier shows a linked inline message after blur or form validation. This does not confirm taxpayer registration.