# thaizip documentation

> thaizip is a headless Thai address search library (fuzzy search by sub-district, district, province, or postal code in Thai or English, cascade enumeration, a React hook). react-thaizip is its CLI that scaffolds ready-made React components (autocomplete, cascade select, full address form, read-only display, react-hook-form field) into a project, shadcn/ui-style: the component source is copied into your project.

- [Full documentation](https://thai-zip.vercel.app/llms-full.txt): every page below in one file

## ไทย

### thaizip

- [บทนำ](https://thai-zip.vercel.app/docs.md): ค้นหาที่อยู่ไทยแบบ fuzzy ด้วยตำบล อำเภอ จังหวัด หรือรหัสไปรษณีย์ ทั้งภาษาไทยและอังกฤษ ไม่มี runtime dependency
- [การค้นหา](https://thai-zip.vercel.app/docs/search.md): searchThaiAddress และ lookupByZipCode ตัวเลือก การจัดอันดับ รหัสไปรษณีย์ และการค้นด้วยภาษาอังกฤษ
- [รายการแบบลำดับขั้น](https://thai-zip.vercel.app/docs/cascade.md): listProvinces, listAmphures และ listTambons สำหรับ dropdown จังหวัด → อำเภอ → ตำบล
- [จัดรูปแบบและแปลงที่อยู่](https://thai-zip.vercel.app/docs/format.md): แปลงผลการค้นหาเป็น label สำหรับ dropdown หรือเป็นที่อยู่แบบมีโครงสร้างสำหรับบันทึก
- [React hook](https://thai-zip.vercel.app/docs/react-hook.md): useThaiAddressAutocomplete จาก thaizip/react จัดการ state การค้นหาแบบ debounce สำหรับ UI autocomplete ของคุณเอง
- [ข้อมูลและ index](https://thai-zip.vercel.app/docs/data.md): โหลดชุดข้อมูลที่มากับแพ็กเกจ หรือสร้าง index จากข้อมูลของคุณเอง

### react-thaizip

- [เริ่มต้นใช้งาน](https://thai-zip.vercel.app/docs/react.md): Scaffold คอมโพเนนต์ที่อยู่ไทยพร้อมใช้ลงในโปรเจกต์ React หรือ Next.js แบบเดียวกับ shadcn/ui

### คอมโพเนนต์

- [ค้นหาที่อยู่แบบ autocomplete](https://thai-zip.vercel.app/docs/react/autocomplete.md): ค้นหาที่อยู่ไทยจากข้อความที่พิมพ์ พร้อมค่าที่อยู่แบบมีโครงสร้าง
- [เลือกที่อยู่แบบลำดับชั้น](https://thai-zip.vercel.app/docs/react/cascade-select.md): เลือกจังหวัด อำเภอหรือเขต และตำบลหรือแขวงตามลำดับ
- [ฟอร์มที่อยู่แบบเต็ม](https://thai-zip.vercel.app/docs/react/address-form.md): กรอกบ้านเลขที่ หมู่ ซอย ถนน พร้อมเลือกที่อยู่ตามลำดับชั้นในฟอร์มเดียว
- [แสดงที่อยู่แบบอ่านอย่างเดียว](https://thai-zip.vercel.app/docs/react/address-display.md): จัดรูปแบบที่อยู่ไทยที่เลือกไว้แล้วให้เป็นข้อความอ่านง่าย ไม่ต้องโหลดดัชนีที่อยู่
- [ฟิลด์ที่อยู่สำหรับ react-hook-form](https://thai-zip.vercel.app/docs/react/address-form-field.md): ครอบ cascade select ด้วย Controller ของ react-hook-form เพื่อผูกกับ validation และ state ของฟอร์มที่มีอยู่แล้ว

### อ้างอิง

- [การปรับแต่ง](https://thai-zip.vercel.app/docs/react/customization.md): ปรับธีมคอมโพเนนต์ที่ scaffold ด้วย design tokens หรือแก้ซอร์สโดยตรง
- [CLI](https://thai-zip.vercel.app/docs/react/cli.md): คำสั่ง flags, thaizip.config.json และวิธีแก้ปัญหาที่พบบ่อย

## English

### thaizip

- [Introduction](https://thai-zip.vercel.app/en/docs.md): Fast fuzzy search for Thai addresses (sub-district, district, province, postal code) in Thai or English, with no runtime dependencies
- [Search](https://thai-zip.vercel.app/en/docs/search.md): searchThaiAddress and lookupByZipCode — options, ranking, postal codes, and English input
- [Cascade lists](https://thai-zip.vercel.app/en/docs/cascade.md): listProvinces, listAmphures, and listTambons for province → district → sub-district dropdowns
- [Format and resolve](https://thai-zip.vercel.app/en/docs/format.md): Turn a search result into a dropdown label or a structured address to save
- [React hook](https://thai-zip.vercel.app/en/docs/react-hook.md): useThaiAddressAutocomplete from thaizip/react — debounced search state for your own autocomplete UI
- [Data and index](https://thai-zip.vercel.app/en/docs/data.md): Load the bundled dataset, or build an index from your own data

### react-thaizip

- [Get started](https://thai-zip.vercel.app/en/docs/react.md): Scaffold ready-made Thai address components into a React or Next.js project, shadcn/ui-style

### Components

- [Address autocomplete](https://thai-zip.vercel.app/en/docs/react/autocomplete.md): Search Thai addresses from typed text and receive a structured address value
- [Address cascade select](https://thai-zip.vercel.app/en/docs/react/cascade-select.md): Choose province, district, and sub-district in order
- [Full address form](https://thai-zip.vercel.app/en/docs/react/address-form.md): Capture house number, moo, soi, and street alongside an ordered address selection in one form
- [Read-only address display](https://thai-zip.vercel.app/en/docs/react/address-display.md): Format an already-resolved Thai address as readable text, with no address-index loading
- [react-hook-form address field](https://thai-zip.vercel.app/en/docs/react/address-form-field.md): Wrap the cascade select in react-hook-form's Controller to bind it to an existing form's validation and state

### Reference

- [Customization](https://thai-zip.vercel.app/en/docs/react/customization.md): Theme the scaffolded components with design tokens, or edit their source
- [CLI](https://thai-zip.vercel.app/en/docs/react/cli.md): Commands, flags, thaizip.config.json, and fixes for common problems
