Files
shadcn-ui/apps/v4/examples/base/textarea-rtl.tsx
shadcn 38de7fddc2 feat: rtl (#9498)
* feat: rtl

* feat

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* feat: add sidebar

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* chore: changeset

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2026-01-30 21:08:39 +04:00

56 lines
1.4 KiB
TypeScript

"use client"
import * as React from "react"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/examples/base/ui-rtl/field"
import { Textarea } from "@/examples/base/ui-rtl/textarea"
import {
useTranslation,
type Translations,
} from "@/components/language-selector"
const translations: Translations = {
en: {
dir: "ltr",
values: {
label: "Feedback",
placeholder: "Your feedback helps us improve...",
description: "Share your thoughts about our service.",
},
},
ar: {
dir: "rtl",
values: {
label: "التعليقات",
placeholder: "تعليقاتك تساعدنا على التحسين...",
description: "شاركنا أفكارك حول خدمتنا.",
},
},
he: {
dir: "rtl",
values: {
label: "משוב",
placeholder: "המשוב שלך עוזר לנו להשתפר...",
description: "שתף את מחשבותיך על השירות שלנו.",
},
},
}
export default function TextareaRtl() {
const { dir, t } = useTranslation(translations, "ar")
return (
<Field className="w-full max-w-xs" dir={dir}>
<FieldLabel htmlFor="feedback" dir={dir}>
{t.label}
</FieldLabel>
<Textarea id="feedback" placeholder={t.placeholder} dir={dir} rows={4} />
<FieldDescription dir={dir}>{t.description}</FieldDescription>
</Field>
)
}