Quaff

Right-to-left layouts

Make room for both reading directions.

رحلة بطاقة الصعود
RUH الرياض
DXB دبي
ليلى ناصر RH 204

Usage

Mixed-direction text
Names can use dir="auto". Keep email addresses and booking codes LTR with dir="ltr" or bdi.
بيانات المسافر

استخدم الاسم الوارد في جواز سفرك.

تحديثات الرحلة
رقم الحجز: RH7K2Q
<div dir="rtl" lang="ar">
  <QInput label="الاسم الكامل" dir="auto" bind:value={name} />
  <QInput label="البريد الإلكتروني" dir="ltr" type="email" bind:value={email} />
  <span>رقم الحجز: <bdi dir="ltr">RH7K2Q</bdi></span>
</div>
App setup
Call Quaff.init() once in your root layout. Use a plain object for fixed settings, or $state for a language switcher.
import { Quaff } from "@quaffui/quaff";

Quaff.init({ rtl: true });

For runtime changes, use this setup instead:

const config = $state({ rtl: true });
Quaff.init(config);

// When the language changes:
config.rtl = false;

For SSR, set the matching initial dir and lang on html. Language packs do not set these attributes. The same reactive pattern works for other Quaff settings.

<html lang="ar" dir="rtl">