English | العربية
Ready-made, gender-aware Arabic phrases for UI text. Lightweight, TypeScript-first, framework-agnostic.
This English README is a short gateway. The full documentation, including philosophy, both interfaces, limits, and the inclusivity guide, lives in the Arabic README, the project's heart.
Arabic verbs and many sentences change form depending on whom you address: احفظ to a man, احفظي to a woman. Most UIs ignore this and default to the masculine. khitab is a small dictionary plus a tiny function that returns the correctly-addressed Arabic phrase for a given gender, so your interface speaks to each user properly.
It ships 1367 reviewed phrases (780 gendered, 587 naturally neutral) across a core set and ten domains, has zero runtime dependencies, and is fully typed.
npm install @khitab/core@alphaThe
@alphatag is intentional: the library is currently in its alpha stage, and typingalphayourself is a conscious acknowledgment of that. Once it reaches stability, the plain install will become the recommended one, in shaa' Allah.
import { khitab, createKhitab } from '@khitab/core';
// Simple, stateless — recommended for servers. `gender` is required.
khitab('save', 'male'); // احفظ
khitab('save', 'female'); // احفظي
// Factory — for LOCAL scope only (a component or a request handler).
const k = createKhitab({ defaultGender: 'female' });
k('login'); // سجّلي الدخولSee examples/basic.ts for the neutral-fallback and error behaviors.
This is an alpha release (published to npm under the alpha tag): the phrase dictionary is complete and reviewed, but the library has not yet been tested in real-world projects. The API may change before a stable release.
The complete guide is in the Arabic README. It covers the philosophy behind gender-aware addressing, the simple vs. factory interfaces in depth, an honest account of the library's limits, the SSR warning, and how to contribute toward full inclusivity.
MIT © 2026 Ahmed Almnsour