Wrap the app, and set dir on the same element or on <html>.
app-root.tsx
Sets the reading direction for the parts inside it. In right to left, arrow keys swap and menus open on the correct side.
Added Nov 8, 2026 · MIT + Commons Clause
$ npx shadcn@latest add @gelatin-ui/directionWrap the app, and set dir on the same element or on <html>.
import type { ReactNode } from "react";
import { DirectionProvider } from "@/components/ui/direction";
export function AppRoot({ children }: { children: ReactNode }) {
return (
<div dir="rtl">
<DirectionProvider direction="rtl">{children}</DirectionProvider>
</div>
);
}DirectionProvider direction="rtl" and set dir="rtl" on <html>.useDirection() in your own component when its behavior depends on the direction.dir alone: the components use logical classes.In right to left, the arrow keys follow the reading order: ArrowLeft moves to the next tab.