Skip to content

Direction

Set the reading direction of a block on a multilingual page.

alpina-ui/ui/direction

Interactive preview

Design library
مكتبة التصميم

Usage notes

Set dir on the smallest region that changes writing direction. Logical alignment then follows the text direction in nested navigation and messages.

When to use

Establish the reading direction of an embedded passage whose script differs from the surrounding interface.

When to avoid

A change from German to French changes the language but keeps the same reading direction. Set the language tag for that change.

Accessibility

Use the correct language and direction on the passage itself. Isolate embedded references or names that use a different script.

Keys
KeyAction
Tab / Shift+TabMove through any links or controls supplied inside the component, in document order.

Content

Preserve names as supplied and use a short caption to identify the translated passage. Keep punctuation inside its language run.

Use
Original message / [passage in its own direction]
Avoid
Manually reversed characters in the translation

Copy in four languages

German
Originalnachricht17 characters
French
Message original16 characters
Italian
Messaggio originale19 characters
Romansh
Messadi original16 characters
Add to your project
npx --no-install alpina add direction