Build your web apps using Smart Web Components
Smart Web Components Right-to-Left Support
The Smart HTML Elements framework provides right-to-left support for its custom elements that can be useful for developers who wish to localize their web projects to languages that use right-to-left scripts, such as Hebrew, Arabic, Syriac, and Thaana. Numerous different languages are written with these scripts, including Hebrew, Arabic, Pashto, Persian, Sindhi, Syriac, Dhivehi, Urdu, Yiddish, etc.
Moreover, when right-to-left support is enabled for Smart custom elements, their layouts are inverted as is the expectation for right-to-left reading, scrolling and navigation.
Enabling Right-to-Left Layout for Elements
All Smart web components support right-to-left layout. To enable it, the property rightToLeft has to be set to true. This can be done statically in the element's tag:
<smart-calendar right-to-left></smart-calendar>
or by setting it with JavaScript:
document.querySelector('smart-calendar').rightToLeft = true;
This functionality complements the localization capability of Smart HTML Elements. For example, by enabling rightToLeft and setting locale to 'he', a Smart.Calendar element will have right-to-left layout and labels in Hebrew, as seen in the image below:
Examples
Smart.Accordion with right-to-left layout
Below you can find a list of demos that showcase the right-to-Left support of various elements:
- Accordion Right-to-Left
- Button Right-to-Left
- Calendar Right-to-Left
- Card Right-to-Left
- Card View Right-to-Left
- Carousel Right-to-Left
- Chart Right-to-Left
- Checkbox Right-to-Left
- Chip Right-to-Left
- Color Panel Right-to-Left
- Color Picker Right-to-Left
- Combo Box Right-to-Left
- Date Time Picker Right-to-Left
- Docking Layout Right-to-Left
- Drop Down Button Right-to-Left
- Drop Down List Right-to-Left
- File Upload Right-to-Left
- Gantt Right-to-Left
- Gauge Right-to-Left
- Grid Right-to-Left
- Input Right-to-Left
- List Menu Right-to-Left
- Masked Text Box Right-to-Left
- Menu Right-to-Left
- Multiline Text Box Right-to-Left
- Multi Split Button Right-to-Left
- Numeric Text Box Right-to-Left
- Pager Right-to-Left
- Password Text Box Right-to-Left
- Progressbar Right-to-Left
- Query Builder Right-to-Left
- Radio Button Right-to-Left
- Rating Right-to-Left
- Slider Right-to-Left
- Scrollbar Right-to-Left
- Sortable Right-to-Left
- Splitter Right-to-Left
- Switch Button Right-to-Left
- Table Right-to-Left
- Tabs Right-to-Left
- Tank Right-to-Left
- Text Box Right-to-Left
- Time Picker Right-to-Left
- Toast Right-to-Left
- Tooltip Right-to-Left
- Tree Right-to-Left
- Window Right-to-Left