統編驗證
公司統一編號輸入,含財政部校驗碼驗證(加權總和 mod 5)。
Taiwan company tax ID (統一編號) input with MOF checksum validation using weighted sum algorithm.
CLI
npx taiwan-ui add company-tax-id-inputnpm package
npm install @taiwan-ui/react| Prop | Type | Default |
|---|---|---|
value* | string | — |
onChange* | (value: string) => void | — |
onValidate | (result: TaxIDResult) => void | — |
placeholder | string | "12345678" |
disabled | boolean | false |
目前輸入值
佔位文字
停用輸入
import CompanyTaxIDInput from "@/components/taiwan/CompanyTaxIDInput";
export default function Example() {
return (
<CompanyTaxIDInput
placeholder={12345678}
/>
);
}
import { useState } from "react";
import CompanyTaxIDInput from "@/components/taiwan/CompanyTaxIDInput";
export default function MyForm() {
const [taxId, setTaxId] = useState("");
return <CompanyTaxIDInput value={taxId} onChange={setTaxId} />;
}