useRTL is a custom hook to control the direction of the content flow.
Supports server-side rendering
Doesn't require page refresh


Browsers display text using the left-to-right (LTR) direction by default. However, some languages, like Arabic or Hebrew, use right-to-left direction (RTL). This means that the text direction should change along with the css properties like margin-left, padding-left etc.

useRTL helps you detecting which direction is currently used and switching between them.

Content direction is a value applicable to the whole application, so its default value can be set using Arcade provider.

To support the default RTL value with server-side rendering, make sure to pass the value to the dir attribute to the body element.

Arguments and return value