HextaUI

Tabs: Right to left

Tabs, arrow keys and the indicator follow the reading direction.

إعدادات الحساب.

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"

export function TabsRtl() {
  return (
    <div dir="rtl" className="w-full max-w-sm">
      <Tabs defaultValue="account">
        <TabsList variant="line">
          <TabsTrigger value="account">الحساب</TabsTrigger>
          <TabsTrigger value="password">كلمة المرور</TabsTrigger>
          <TabsTrigger value="alerts">التنبيهات</TabsTrigger>
        </TabsList>
        <TabsContent value="account">
          <p className="py-2 text-sm text-muted-foreground">إعدادات الحساب.</p>
        </TabsContent>
        <TabsContent value="password">
          <p className="py-2 text-sm text-muted-foreground">
            غيّر كلمة المرور.
          </p>
        </TabsContent>
        <TabsContent value="alerts">
          <p className="py-2 text-sm text-muted-foreground">إدارة التنبيهات.</p>
        </TabsContent>
      </Tabs>
    </div>
  )
}

This adds the example as components/examples/tabs/rtl.tsx, together with the Tabs component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/tabs-rtl.json

To add only the component, follow the Tabs installation.

Props in this example

The Tabs props this example sets, from the API reference.

PropTypeDefault
defaultValue
any0
PropTypeDefault
variant
"default" | "line""default"
PropTypeDefault
value
any–
PropTypeDefault
value
any–

Every prop is in the Tabs API reference.

See them all, with keyboard support and accessibility notes, on the Tabs page.