Postal Code

Validate the structural format of an Iranian postal code (کد پستی): 10 digits, not starting with zero, and not a single digit repeated 10 times — after normalizing Persian/Arabic-Indic digits.

Last updated August 17, 2026

Overview

Installation

$ npx shadcn@latest add https://ui.persian-labs.ir/r/postal-code.json

Usage

import { isValidPostalCode } from "@/lib/postal-code"
 
isValidPostalCode("1985813151") // true
isValidPostalCode("0000000000") // false

API Reference

postal-code