direction-attribute
What it does
This skill checks that a web page sets the right text direction for its language. It is for developers building sites in right-to-left languages or with mixed-direction content.
When to use it
- ✓When your site adds Arabic, Hebrew, Persian or Urdu content.
- ✓When user names or comments mix left-to-right and right-to-left text.
- ✓When menus and layouts look backwards for right-to-left readers.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/direction-attribute/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you check that my site displays correctly for Arabic readers?”
5 new skills a week. 1 minute to read.
How it works
The agent checks the dir attribute on the page and on mixed-direction parts, such as user comments. It suggests adding the correct value or an isolation tag where needed.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Set text direction for RTL languages
Without proper dir attributes, RTL text displays incorrectly, UI elements appear backwards, and screen readers announce content in the wrong order.
Quick Reference
- Set
dir="rtl"on <html> for Arabic, Hebrew, Persian, Urdu - Use
dir="auto"for user-generated content - Combine with CSS logical properties (inline-start, inline-end)
- Test UI mirroring for navigation, icons, and layouts
- Use bidi isolation such as
<bdi>for inline mixed-direction user content
Check
Verify that this HTML document uses the appropriate dir attribute to indicate text direction for right-to-left languages like Arabic, Hebrew, or mixed content. Check user-generated inline text for dir="auto" or bidi isolation where names, handles, or snippets mix writing directions.
Fix
Add the dir attribute to the html element or specific elements with values 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto' for automatic detection. Use <bdi> or equivalent bidi isolation for mixed-direction inline content.
Explain
Explain how the dir attribute helps browsers and screen readers properly display and navigate text in different writing directions.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Set text direction for RTL languages. Flag exact elements, attributes, and routes where the rendered HTML violates the rule. Inspect user-generated inline content, not only page-level locale wrappers.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/direction-attribute
FAQ
What does the dir attribute do?
It tells the browser which way text should flow, either left to right or right to left.
What is bidi isolation?
It keeps mixed-direction text, such as a name in another script, from disturbing nearby text. The skill suggests the bdi tag for this.
Does it cover layout mirroring?
The skill suggests testing whether navigation, icons and layouts mirror correctly.
Details
Original description by the author
Use when reviewing templates, rendered HTML, or shared components related to Set text direction for RTL languages. Validate the final browser-facing markup, not just the source framework abstraction.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2816
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.