Skip to main content
  1. Docs
  2. Guides
  3. 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.

root.tsx
<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.

continue.tsx
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.

LayoutStack, Inline, Grid and Box use logical properties: start and end swap.
KeysTabs, Toggle group, Radio, Slider, Menu submenus and Tree view: Left and Right follow the reading way.
ChevronsBreadcrumb, Pagination and Link's external arrow mirror on their own.
DrawersDrawer's side is logical: end is on the left.
NumbersPagination's range keeps each number whole, in a <bdi>.

Every example on these pages has an RTL switch: try it.

Next — GuidesServer rendering