Stablev0.1.0invoice

PhoneBarcodeInput

手機條碼載具

手機條碼載具輸入,自動帶入斜線前綴,即時格式驗證。

Taiwan mobile barcode carrier input (/XXXXXXX format) for e-invoice carrier identification.

Installation

CLI

npx taiwan-ui add phone-barcode-input

npm package

npm install @taiwan-ui/react

Live Demo

Props API

PropTypeDefault
value*string
onChange*(value: string, result: BarcodeResult) => void
placeholderstring"/ABC+123"
disabledbooleanfalse

Playground

Props

目前輸入值

佔位文字

停用輸入

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

export default function Example() {
  return (
    <PhoneBarcodeInput
  placeholder="/ABC+123"
/>
  );
}

Code Examples

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

export default function MyForm() {
  const [barcode, setBarcode] = useState("/");

  return <PhoneBarcodeInput value={barcode} onChange={(val) => setBarcode(val)} />;
}
載具電子發票barcode

Related Components