Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/v4/content/docs/rtl/start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ Add the `dir="rtl"` and `lang="ar"` attributes to the `html` tag. Update `lang="

Then wrap your app with the `DirectionProvider` component with the `direction="rtl"` prop in your `__root.tsx`:

```tsx title="src/routes/__root.tsx" showLineNumbers {1,9,14-16}
```tsx title="src/routes/__root.tsx" showLineNumbers {3,11,16}
import { createRootRoute, HeadContent, Scripts } from "@tanstack/react-router"

import { DirectionProvider } from "@/components/ui/direction"

export const Route = createRootRoute({
component: RootComponent,
shellComponent: RootDocument,
})

function RootComponent() {
function RootDocument({ children }: { children: React.ReactNode }) {
return (
<html lang="ar" dir="rtl">
<head>
<Meta />
<HeadContent />
</head>
<body>
<DirectionProvider direction="rtl">{children}</DirectionProvider>
Expand Down