Skip to content

RTL direction

Integrate right-to-left languages with the right markup and layout.

Lang and direction of the document

The plugin publishes the active language in lang and applies dir according to directions. Languages without an override use LTR.

Configuration and CSS ts
// Inside the options of the module:
directions: { ar: 'rtl' }

// Inside a component:
const i18n = useI18n()
i18n.switchLocale('ar')

/* CSS with logical properties */
.content {
  padding-inline: 1.5rem;
  margin-inline: auto;
  text-align: start;
}

Logical properties

Use padding-inline, margin-inline and text-align: start so the layout follows the direction of the content. UIContainer already uses logical margins and padding.

On this site the documentation shell speaks the language of the page in LTR (Spanish in the Arabic playground), while the playground result declares the language and direction of its catalog. That way you can read the instructions and check the Arabic block in RTL.

See the playground in Arabic

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters