Skip to content

GCC Address Form

Beta
Get Ritla UI

An address form whose fields follow the country: the Saudi National Address short code or full address, and the UAE emirate, area and Makani number with no postal code.

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add gcc-address-form

    Also works with shadcn: npx shadcn@latest add @ritla/gcc-address-form

  2. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

gcc-address-form.tsx
import { GccAddressForm } from "@/components/ui/gcc-address-form";<GccAddressForm name="address" onValueChange={setAddress} />

Examples

UAE

Emirate, area, street and building, and the Makani number.

EnglishMirroredArabic
LTR →

API reference

GccAddressForm

PropTypeDefaultDescription
countries("SA" | "AE")[]["SA", "AE"]Figma's Country: the countries offered.
value / defaultValue / onValueChangeGccAddressNoneThe address: the country and its fields.
citiesSelectOption[]NoneSaudi cities as a list; a text field without it.
errorsPartial<Record<keyof GccAddress, ReactNode>>NoneYour own errors; otherwise the codes are checked when their fields are left.
namestringNonePrefixes the fields' form names: address.street.
gccPatterns{ shortAddress, building, postalCode, makani }NoneThe patterns the checks use.

Accessibility

ARIA

  • Changing the country swaps the fields below; every field keeps its own label.
  • The “Or the full address” rule is a separator; either address is enough.

Arabic and RTL notes

Mirrors

  • Labels, fields and selects mirror; the building number sits on the right and the postal code on the left.

Does not mirror

  • The short address, building number, postal code and Makani number stay left to right.
Numerals
Arabic-Indic digits typed into the codes become Western digits, and letters become capitals.
Arabic typography
label-16 in the fields, label-12 for the hints.