Moayyad Faris
Arabic Developer Tools

Processed locally in your browser — not uploaded

Arabic Developer Kit (RTL Snippets)

A complete developer utility hub containing copy-paste TypeScript code snippets for Arabic text normalization, URL slug generation, Next.js App Router RTL layout setup, and BiDi text isolation.

Arabic Developer Kit

TypeScript & React Utilities for Next.js RTL Apps

Copy production-tested functions or test them in the live playground below.

Read RTL Architecture Guide →

1. Arabic Text Normalizer (TypeScript)

Strips diacritics (tashkeel), Tatweel elongation, unifies Alef/Ya variants, and converts digits.

export function normalizeArabicText(text: string): string {
  return text
    // Remove diacritics (fatha, damma, kasra, sukun, tanwin)
    .replace(/[\u064B-\u0652]/g, "")
    // Strip Tatweel (elongation character ـ)
    .replace(/\u0640/g, "")
    // Normalize Alef variants (أ, إ, آ -> ا)
    .replace(/[أإآ]/g, "ا")
    // Normalize Alef Maqsura to Ya (ى -> ي)
    .replace(/ى/g, "ي")
    // Convert Arabic-Indic digits (٠١٢٣٤٥٦٧٨٩ -> 0123456789)
    .replace(/[٠-٩]/g, (d) => (d.charCodeAt(0) - 0x0660).toString());
}

⚡ Interactive Live Utility Playground

Normalized Output

اهلا وسهلا بكم في مدينتي الحبيبة سنة 2026!

Generated URL Slug

/blog/أهلا-وسهلا-بكم-في-مدينتي-الحبيبة-سنة-٢٠٢٦

01

How to use

  1. Select any utility code snippet tab (Arabic Normalizer, Arabic Slugify, Next.js RTL Root Layout, or BiDi Isolation).
  2. Use the 1-click Copy Snippet button to paste the utility directly into your codebase.
  3. Test the live utility playground using sample Arabic text to see instant transformations.
02

Understanding the output

The Arabic Developer Kit provides zero-dependency TypeScript functions and React components tailored for Next.js App Router applications handling Arabic text normalization, URL slug generation, and bidirectional (BiDi) layout mirroring.

03

Common issues & tips

  • Always wrap user-submitted mixed Arabic and English strings in <bdi> or set dir="auto" to prevent trailing periods and numbers from jumping sides.
  • When using localized URLs, ensure your web server and CDN preserve UTF-8 percent-encoding for Arabic slugs.

Frequently asked questions

Can I use these snippets in commercial projects?
Yes. All code snippets in the Arabic Developer Kit are zero-dependency, open-source, and free to use in any commercial or personal codebase.
Does this require any external NPM packages?
No. All utilities are written in pure TypeScript and native web standards with zero third-party dependencies.
Is any data uploaded to a server?
No. The live playground and code copy buttons run entirely locally in your browser.

Related tools