Glossary / Right-to-left layouts

Right-to-left layouts

Right-to-left (RTL) layouts support languages and scripts whose primary inline direction is right to left, such as Arabic and Hebrew. Correct RTL is more than mirroring a page: text direction, punctuation, embedded Latin strings and numbers, icons, navigation, tables, and bidirectional text all require deliberate handling. Direction should follow the content’s language and writing direction, while layout should use logical properties so the browser can adapt without brittle left/right overrides.

What to know

Testing

Test RTL at the document and component levels, including mixed Arabic/Hebrew plus Latin names, punctuation, numbers, links, and user-generated text. Check focus order remains logical even when the visual layout flips. Verify menus, breadcrumbs, charts, icons, input cursor direction, and responsive breakpoints. Use pseudo-RTL and real locale translations; pseudo mirroring alone will not reveal bidi algorithm edge cases.

Interview questions

  1. Why use logical CSS properties? They express start/end and inline/block relationships, so layout adapts to writing direction and writing mode.
  2. Does dir="rtl" mirror every icon? No. Only directional affordances whose meaning changes with reading direction should mirror.
  3. What does <bdi> do? It isolates a text run’s direction so its characters do not affect surrounding bidirectional ordering.
  4. Why can concatenated RTL strings break? The bidi algorithm reorders runs based on character classes, and punctuation or numbers may resolve against neighboring text unexpectedly.
  5. How do you test RTL thoroughly? Use real translations and mixed-direction values across forms, navigation, focus order, and responsive layouts.

References