Plate lays out each block by its own text. An Arabic or Hebrew paragraph starts at the right, an English paragraph in the same document starts at the left, and the editor UI mirrors with the page.
Set dir="rtl" on the html element, or on a container around the editor when only the editor runs right-to-left. Then wrap the same tree in the direction provider from shadcn's direction component, so toolbars and menus run right-to-left too.
import { DirectionProvider } from '@/components/ui/direction';
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="ar" dir="rtl">
<body>
<DirectionProvider direction="rtl">{children}</DirectionProvider>
</body>
</html>
);
}import { DirectionProvider } from '@/components/ui/direction';
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="ar" dir="rtl">
<body>
<DirectionProvider direction="rtl">{children}</DirectionProvider>
</body>
</html>
);
}In a Radix style, pass dir="rtl" instead, because Radix's types require it.
Plate's editor UI uses start and end classes, so it needs no rtl setting in components.json and works the same with one. shadcn's RTL guide covers fonts and the rest of your app.
Each text block, such as a paragraph, heading or list item, takes its direction from its first Arabic, Hebrew or Latin letter. A block without one, such as an empty line or a line of digits, follows the editor. Typing a first letter in the other script flips the block.
Arrow keys follow the block's direction, so in a right-to-left block ArrowLeft moves forward through the text.
Code blocks, equations and the equation's TeX source always run left-to-right.
Indent pushes from the start side of each block, so nested items in a right-to-left list indent from the right. The editor renders indent as margin-inline-start.
Media aligned left or right keep that side in any direction. Media aligned to the start or end follow the text direction, and file captions align to the start.
Block handles and the table's row handles sit on the mirrored side, and their menus open on that side too. Directional icons, such as Undo, indent and the arrows, mirror where their toolbar or menu runs right-to-left.
:dir() selector, which Chrome supports from version 120.