Accessibility & Internationalization (RTL)
Explore Hashti's WCAG 2.2 AAA compliance, keyboard interaction model, and native Persian/Arabic bidirectional architecture.
Accessibility & Internationalization (RTL)
Universal access and international equity are core foundations of Hashti Design System. Accessibility is not an afterthought, and Right-to-Left (RTL) languages are first-class citizens, never second-class overrides.
1. WCAG 2.2 AAA Compliance
Hashti is engineered to satisfy the rigorous criteria of WCAG 2.2 Level AAA:
Enhanced Contrast Ratios (7:1 Minimum)
- Body Text: Standard WCAG AA requires a 4.5:1 contrast ratio. Hashti enforces a minimum 7:1 contrast ratio for all body text, labels, and critical indicators against their respective canvas and layer backgrounds.
- Large Text & Headings: Contrast exceeds 4.5:1 across all 8 themes.
- Interactive UI Components & Focus Indicators: Exceed 3:1 against adjacent backgrounds to ensure buttons, toggles, borders, and input rings are unmistakable.
| Element | WCAG AA Requirement | Hashti AAA Standard | Light Theme Value | Dark Theme Value |
|---|---|---|---|---|
| Body & Text | 4.5:1 | ≥ 7.0:1 | Obsidian on Chalk (21:1) | Chalk on Ink (19.8:1) |
| Secondary / Muted | 3.0:1 | ≥ 4.8:1 | #606674 on #FFFFFF (5.1:1) | #B1B6C3 on #18191D (7.2:1) |
| Focus Rings | 3.0:1 | ≥ 4.5:1 | Cobalt #365CCB (6.2:1) | Azure #A9BDFF (7.8:1) |
| Error Status | 3.0:1 | ≥ 7.0:1 | Ruby #AA2735 (7.3:1) | Coral #FFACB3 (8.1:1) |
2. Keyboard Interaction Model
Built on React Aria Components, every interactive primitive follows W3C WAI-ARIA authoring practices with zero gaps:
Focus Rings (:focus-visible)
Hashti provides high-contrast, dual-offset focus rings that only appear during keyboard navigation:
/* Authentic Hashti focus ring signature */
:focus-visible {
outline: 2px solid var(--hashti-focus);
outline-offset: 2px;
}
Keyboard Navigation Contracts
- Tab / Shift+Tab: Linear focus movement across interactive tab stops.
- Arrow Keys: Roving
tabindexinside composite widgets (Tabs, Radio Groups, Menus, Toolbars, and GridLists). - Space / Enter: Activates buttons, toggles checkboxes, and opens dropdown menus.
- Escape: Universally dismisses open dialogs, menus, tooltips, and popovers, gracefully returning focus to the trigger element without scrolling the page.
3. Screen Reader Landmarks & ARIA Live Regions
Hashti components automatically announce dynamic updates to assistive technologies (VoiceOver, NVDA, JAWS):
- Landmarks: Modals, Drawers, and Sheets apply
role="dialog"orrole="alertdialog"witharia-modal="true"and automatic focus trapping. - Dynamic Feedback: Alert banners and inline notifications implement
role="status"orrole="alert"usingaria-live="polite"oraria-live="assertive". - Form Descriptions & Errors: Input fields automatically link their helper text and error messages via
aria-describedbyand mark validity viaaria-invalid="true".
4. Internationalization & Persian/Arabic RTL Parity
Most design systems treat Right-to-Left (RTL) as an afterthought — flipping CSS margins with utility hacks that often break icons, date pickers, and logical flows.
Hashti was created from Persian architectural roots, meaning RTL is a primary design axis:
import { Theme, TextField, Button } from "@hashti/react";
export function PersianForm() {
return (
<Theme locale="fa-IR" dir="rtl" theme="frame-light">
<div style={{ maxWidth: "400px", padding: "24px" }}>
<TextField
label="نام و نام خانوادگی"
description="لطفاً نام رسمی خود را مطابق کارت ملی وارد کنید"
placeholder="سهراب سپهری"
/>
<div style={{ marginTop: "16px", display: "flex", gap: "8px" }}>
<Button variant="primary">تأیید و ادامه</Button>
<Button variant="ghost">انصراف</Button>
</div>
</div>
</Theme>
);
}
What Happens Automatically in RTL Mode:
- Layout Direction: Layout flows right-to-left naturally using CSS logical properties (
margin-inline-start,padding-inline-end,inset-inline). - Bidirectional Typography: Switches automatically to Vazirmatn, an open-source Persian typeface optimized for on-screen legibility and balanced Nastaliq proportions.
- Control Mirroring: Checkbox checkmarks, disclosure chevrons, form action button alignments, and slider thumbs mirror their spatial axes.
- Dates and Numbers: Calendar pickers and NumberFields respect Persian solar Hijri / Arabic numeric formats via
@internationalized/date. - Icon Orientation: Directional icons (arrows, chevrons, step wizards) mirror automatically, while semantic physical icons (like search magnifiers or media players) maintain physical meaning.
[!IMPORTANT] Always pass both
locale="fa-IR"(orar-SA) anddir="rtl"to the<Theme>provider or<I18nProvider>to guarantee both linguistic formatting and DOM reading order are aligned.