You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-rtl-utils — React Hooks & Components for RTL and Bidirectional Text
React hooks and components for RTL layouts — auto-detect text direction, flip styles, and handle bidirectional content for Hebrew, Arabic, and Persian apps. Zero dependencies.
import{useTextDirection,BidiText}from"react-rtl-utils";constdir=useTextDirection("שלום עולם");// "rtl"<BidiText>שלום עולם</BidiText>// auto dir="rtl"<BidiText>HelloWorld</BidiText>//autodir="ltr"
For Hebrew, Arabic, Persian, and Urdu apps. Zero dependencies.
import{BidiText,DirectionProvider,RtlFlip}from"react-rtl-utils";// Auto-detects direction per text content<BidiText>שלום עולם</BidiText><BidiText>HelloWorld</BidiText>// Wraps children with dir attribute<DirectionProviderdirection="rtl"><YourApp/></DirectionProvider>// Conditionally render based on direction<RtlFlipdirection={dir}rtl={<span>→</span>}ltr={<span>←</span>}/>