Components
Direction
Bidirectional text support: the same components flipped for RTL locales.
LTR / RTL
dir="ltr"
dir="rtl"
{/* Logical properties only: ms-*/me-*, ps-*/pe-*, text-start.
Wrap in dir="rtl" and the layout flips for free. */}
<div dir="rtl">
<nav class="flex items-center gap-1 text-xs text-text-tertiary">
<a href="#">Type</a><span>/</span><a href="#">Weights</a>
</nav>
<label class="mt-3 block text-start text-xs">Family name</label>
<input class="mt-1.5 h-9 w-full rounded-md border border-border bg-transparent px-3 text-sm" />
<div class="mt-3 flex gap-2">
<button class="ms-auto …">Cancel</button>
<button class="bg-primary text-white …">Save</button>
</div>
</div>
Components use logical margins and padding — ms-*,
me-*, ps-*,
text-start — so setting
dir="rtl" flips the layout for free. No RTL stylesheet.
Mixed content
The Cairo release notes open with التصميم حيث تلتقي الكتابة والبرمجة — “design where writing meets code” — and the bidi algorithm keeps the dashes and quotes exactly where English prose expects them.
Wrap embedded opposite-direction runs in <bdi>
(or dir="auto") so surrounding punctuation never reorders.
Markdown for agents: /design/direction.md · spec: /design.md