Stablev0.1.0identity

CompanyTaxIDInput

統編驗證

公司統一編號輸入,含財政部校驗碼驗證(加權總和 mod 5)。

Taiwan company tax ID (統一編號) input with MOF checksum validation using weighted sum algorithm.

Installation

CLI

npx taiwan-ui add company-tax-id-input

npm package

npm install @taiwan-ui/react

Live Demo

Props API

PropTypeDefault
value*string
onChange*(value: string) => void
onValidate(result: TaxIDResult) => void
placeholderstring"12345678"
disabledbooleanfalse

Playground

Props

目前輸入值

佔位文字

停用輸入

Generated code
import CompanyTaxIDInput from "@/components/taiwan/CompanyTaxIDInput";

export default function Example() {
  return (
    <CompanyTaxIDInput
  placeholder={12345678}
/>
  );
}

Code Examples

import { useState } from "react";
import CompanyTaxIDInput from "@/components/taiwan/CompanyTaxIDInput";

export default function MyForm() {
  const [taxId, setTaxId] = useState("");

  return <CompanyTaxIDInput value={taxId} onChange={setTaxId} />;
}
統一編號MOF checksum8 碼

Related Components