Skip to content
v0.9.1
Guides

Right-to-left (RTL)

Arabic, Hebrew, Persian, Urdu: set the page's direction and Momo mirrors itself. Layouts, menus, drawers, arrows, switches, step lines and the split view all follow.

Turn it on

Set the language and the direction on the page. That is all.

<html lang="ar" dir="rtl">

Momo is written with "start" and "end" instead of "left" and "right", so nothing else changes. Code samples keep reading left to right.

See it

This box is right-to-left; the rest of the page is not. The same markup as everywhere else in these docs, with dir="rtl" on the wrapper.

آك
آنا كيم
قبل ساعتين
مدفوععرض
المجموع الفرعي
$118.00
الشحن
$11.00
الإجمالي
$129.00
  1. السلة
  2. العنوان
  3. الدفع
  4. تم
تم تحديث العنوان

سنرسل الطلب إلى العنوان الجديد.

<div dir="rtl" lang="ar" id="rtl-demo" class="stack" style="--stack-gap: 1.25rem">
  <nav class="breadcrumb" aria-label="مسار التنقل">
    <ol>
      <li><a href="#see-it"><i class="mi mi-house"></i> الرئيسية</a></li>
      <li><a href="#see-it">الطلبات</a></li>
      <li aria-current="page">طلب <bdi>#10421</bdi></li>
    </ol>
  </nav>

  <div class="tabs tabs-line" data-momo-tabs aria-label="الطلب" id="rtl-tabs">
    <button class="tab" aria-controls="rtl-p1" aria-selected="true">التفاصيل</button>
    <button class="tab" aria-controls="rtl-p2">الشحن</button>
    <button class="tab" aria-controls="rtl-p3">الفواتير</button>
  </div>
  <div class="tab-panel" id="rtl-p1">
    <div class="card">
      <div class="card-body">
        <div class="media media-center mb-4">
          <span class="avatar bg-pink">آك</span>
          <div class="media-body"><div class="media-title">آنا كيم</div><span class="media-meta">قبل ساعتين</span></div>
          <div class="media-actions"><span class="badge badge-green-soft">مدفوع</span><a class="btn btn-sm" href="#see-it">عرض <i class="mi mi-arrow-right rtl-flip"></i></a></div>
        </div>
        <dl class="dl dl-between">
          <dt>المجموع الفرعي</dt><dd><bdi>$118.00</bdi></dd>
          <dt>الشحن</dt><dd><bdi>$11.00</bdi></dd>
          <dt class="dl-total">الإجمالي</dt><dd><bdi>$129.00</bdi></dd>
        </dl>
      </div>
    </div>
  </div>
  <div class="tab-panel" id="rtl-p2" hidden><p class="mb-0">يُشحن خلال يوم عمل واحد إلى لشبونة.</p></div>
  <div class="tab-panel" id="rtl-p3" hidden><p class="mb-0">فاتورة واحدة، مدفوعة بالكامل.</p></div>

  <ol class="steps" id="rtl-steps">
    <li class="step is-done"><span class="step-marker"></span><span class="step-label">السلة</span></li>
    <li class="step is-done"><span class="step-marker"></span><span class="step-label">العنوان</span></li>
    <li class="step" aria-current="step"><span class="step-marker"></span><span class="step-label">الدفع</span></li>
    <li class="step"><span class="step-marker"></span><span class="step-label">تم</span></li>
  </ol>

  <div class="cluster" style="--stack-gap: 1.5rem">
    <label class="switch" id="rtl-switch"><input type="checkbox" role="switch" checked> إشعارات البريد</label>
    <label class="switch"><input type="checkbox" role="switch"> الوضع الداكن</label>
    <input class="slider w-48" type="range" min="0" max="100" value="30" aria-label="مستوى الصوت" id="rtl-slider">
  </div>

  <div class="form-icon" style="max-width: 22rem"><i class="mi mi-search" aria-hidden="true"></i><input class="form-control" type="search" placeholder="ابحث في الطلبات" aria-label="ابحث في الطلبات"></div>

  <div class="alert" role="status">
    <span class="alert-icon"><i class="mi mi-info"></i></span>
    <div class="alert-body"><b class="alert-title">تم تحديث العنوان</b><p>سنرسل الطلب إلى العنوان الجديد.</p></div>
    <button class="btn btn-icon btn-sm btn-ghost" type="button" data-momo-dismiss aria-label="إغلاق"><i class="mi mi-x"></i></button>
  </div>

  <nav aria-label="الصفحات">
    <ul class="pager" id="rtl-pager">
      <li><a href="#see-it" rel="prev" aria-label="الصفحة السابقة"><i class="mi mi-chevron-left rtl-flip" aria-hidden="true"></i></a></li>
      <li><a href="#see-it">1</a></li>
      <li><a href="#see-it" aria-current="page">2</a></li>
      <li><a href="#see-it">3</a></li>
      <li><a href="#see-it" rel="next" aria-label="الصفحة التالية"><i class="mi mi-chevron-right rtl-flip" aria-hidden="true"></i></a></li>
    </ul>
  </nav>
</div>

Look at what changed by itself: the breadcrumb and the tabs start on the right, the avatar sits at the start of its row and the buttons at the end, the step line runs right to left, the switch knob and the slider start on the right, the search icon and the close button swapped sides, and the pager arrows point the other way. Press the arrow keys on the tabs: Left now moves forward.

Icons that point

Momo flips its own arrows (breadcrumbs, menus, the split view's back button, tree and list chevrons). For an arrow icon of your own, add .rtl-flip and it mirrors in right-to-left only. Icons that do not point anywhere (a house, a bell, a check) need nothing.

التالي with .rtl-flip التالي without (points the wrong way)
<div dir="rtl" lang="ar" class="cluster">
  <a class="btn" href="#icons-that-point" id="rtl-flip-yes">التالي <i class="mi mi-arrow-right rtl-flip"></i></a>
  <span class="text-sm text-muted" dir="ltr">with .rtl-flip</span>
  <a class="btn" href="#icons-that-point" id="rtl-flip-no">التالي <i class="mi mi-arrow-right"></i></a>
  <span class="text-sm text-muted" dir="ltr">without (points the wrong way)</span>
</div>
<a class="btn" href="/next">التالي <i class="mi mi-arrow-right rtl-flip"></i></a>

In your own CSS and classes

Use the "start" and "end" names and your additions mirror too.

UseInstead of
ms-*, me-*, ps-*, pe-*left and right margins and padding
text-start, text-endtext-left, text-right
start-0, end-0, border-s, border-e, rounded-s, rounded-e, float-startleft-0, right-0 and the like
margin-inline-start, padding-inline-end, inset-inline-start, border-inline-endmargin-left, padding-right, left, border-right in your CSS
.rtl-flipmirroring a pointing icon by hand

Mixed text

Good to know

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close