HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

RTL

PreviousNext

Right-to-left support for Another UI components.

Another UI components work in right-to-left layouts. Text alignment, positioning and directional styles adapt for languages like Arabic, Hebrew and Persian.

تسجيل الدخول إلى حسابك
أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك
نسيت كلمة المرور؟
A card component in RTL mode.

Turn on RTL in components.json#

Add "rtl": true to your components.json. Components you add after this use logical classes, so left-* becomes start-*, right-* becomes end-*, and directional animations like slide-in-from-right become slide-in-from-end.

components.json
{
  "rtl": true
}

Add the Direction component#

pnpm dlx shadcn@latest add https://anotherui.dev/r/direction.json

Set the direction#

Add dir="rtl" and your language to the html tag, then wrap your app in DirectionProvider.

app/layout.tsx
import { DirectionProvider } from "@/components/ui/direction"
 
export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="ar" dir="rtl">
      <body>
        <DirectionProvider direction="rtl">{children}</DirectionProvider>
      </body>
    </html>
  )
}

In Vite, set dir and lang on the html tag in index.html and wrap <App /> in src/main.tsx the same way.

Pick a font#

Use a font that supports your language. Noto has Arabic, Hebrew and Persian families that pair well with most sans fonts.

Icons#

Arrows and carets that point a direction should flip. Add rtl:rotate-180 to them.

<ArrowRightIcon weight="bold" className="rtl:rotate-180" />

Portals#

Popovers, tooltips and menus render in a portal. If one slides in from the wrong side, pass dir to its content.

<Popover>
  <PopoverTrigger>Open</PopoverTrigger>
  <PopoverContent dir="rtl">
    <div>Content</div>
  </PopoverContent>
</Popover>

Components to check by hand#

These components need a small manual change for RTL. See the RTL section on each page.

  • Calendar
  • Pagination
  • Sidebar
Dark Modellms.txt

On This Page

Turn on RTL in components.jsonAdd the Direction componentSet the directionPick a fontIconsPortalsComponents to check by hand