RTL

Right-to-left support for spartan/ui components.

spartan/ui components have first-class support for right-to-left (RTL) layouts. Text alignment, positioning, and directional styles automatically adapt for languages like Arabic, Hebrew, and Persian.

تسجيل الدخول إلى حسابك

أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك

A card component in RTL mode.

How it works

When you install components, the CLI automatically transforms physical positioning classes into their logical equivalents. This ensures your components work seamlessly in both LTR and RTL layouts.

To enable RTL support, simply add dir="rtl" to the <html> element. All Spartan components will then work out of the box.

  • Physical positioning classes like left-* and right-* are converted to logical equivalents like start-* and end-* .
  • Directional props are updated to use logical values.
  • Text alignment and spacing classes are adjusted accordingly.
  • Supported icons are automatically flipped using rtl:rotate-180 .
Typography CLI