# General Translation React SDKs (gt-react, gt-next): useLocaleDirection URL: https://generaltranslation.com/en-US/docs/react/reference/hooks/use-locale-direction.mdx --- title: useLocaleDirection description: Read the text direction for a locale with General Translation gt-react. API reference for useLocaleDirection. --- The `useLocaleDirection` hook returns the text direction — `'ltr'` or `'rtl'` — for the current locale, or for a locale you specify. *Available in `gt-react`, `gt-next`, and `gt-react-native`. Examples import from `gt-react`; import from your framework's package instead.* *Note: not exported by `gt-tanstack-start`.* ## Overview [#overview] Call `useLocaleDirection` to get the direction, and apply it with the `dir` attribute. ```tsx import { useLocaleDirection } from 'gt-react'; export default function DirectionWrapper({ children }) { const dir = useLocaleDirection(); // [!code highlight] return
Arabic text direction: {dir}
; } ``` ## Notes [#notes] - In an async App Router component, use [`getLocaleDirection`](/docs/react/nextjs/reference/functions/get-locale-direction) instead. - Useful for setting the `dir` attribute on elements for RTL support.