- Docs
- Guides
- Right to left
Right to left
Set the direction twice; mirror the icons that point.
- Set
- 2 placesdir on html, direction on the provider
- Icons
- mirrorInRtlFor arrows and chevrons you pass
01 — The direction
On the page, and on the provider.
dir lays out the page; direction tells the components, for keys, submenus, sliders and drawers. The provider renders no element of its own.
<html lang="ur" dir="rtl">
…
<QeetrixProvider direction="rtl" locale="ur-IN">…</QeetrixProvider>02 — Icons that point
mirrorInRtl, at the call site.
Icons that point a reading direction flip by themselves: send, reply, undo and redo, log in and out, indent, text align. Arrows and chevrons don't, as they point on paper: forward or back is yours to say, once per icon. Don't mirror an icon that doesn't point, such as search or a clock.
import { ArrowRightIcon } from "@qeetrix/icons";
import { Button, mirrorInRtl } from "@qeetrix/react";
// Points forward in both directions: once per icon, outside render.
const Forward = mirrorInRtl(ArrowRightIcon);
<Button icon={Forward}>Continue</Button>03 — What follows
Built in.
| Layout | Stack, Inline, Grid and Box use logical properties: start and end swap. |
|---|---|
| Keys | Tabs, Toggle group, Radio, Slider, Menu submenus and Tree view: Left and Right follow the reading way. |
| Chevrons | Breadcrumb, Pagination and Link's external arrow mirror on their own. |
| Drawers | Drawer's side is logical: end is on the left. |
| Numbers | Pagination's range keeps each number whole, in a <bdi>. |
Every example on these pages has an RTL switch: try it.