HextaUI

Password input (UI SDK): Right to left

The toggle sits on the left, and the strength meter fills from the right. Pass labels in your language.

import { Label } from "@/components/ui/label"
import {
  PasswordInput,
  PasswordInputCapsLock,
  PasswordInputControl,
  PasswordInputGroup,
  PasswordInputStrength,
  PasswordInputToggle,
} from "@/components/ui/ui-sdk-password-input"

function UiSdkPasswordInputRtl() {
  return (
    <div dir="rtl" className="flex w-full max-w-64 flex-col gap-2">
      <Label htmlFor="rtl-password">كلمة المرور</Label>
      <PasswordInput autoComplete="new-password">
        <PasswordInputGroup>
          <PasswordInputControl id="rtl-password" />
          <PasswordInputToggle aria-label="إظهار كلمة المرور" />
        </PasswordInputGroup>
        <PasswordInputCapsLock>مفتاح الأحرف الكبيرة مفعّل</PasswordInputCapsLock>
        <PasswordInputStrength
          label="قوة كلمة المرور"
          labels={["", "ضعيفة", "مقبولة", "جيدة", "قوية"]}
        />
      </PasswordInput>
    </div>
  )
}

export { UiSdkPasswordInputRtl }

This adds the example as components/examples/ui-sdk-password-input/rtl.tsx, together with the Password input component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/ui-sdk-password-input-rtl.json

To add only the component, follow the Password input installation.

Props in this example

The Password input props this example sets, from the API reference.

PropTypeDefault
autoComplete
"current-password" | "new-password" | "off" | string"current-password"
PropTypeDefault
id
string–
PropTypeDefault
aria-label
string"Show password"
PropTypeDefault
labels
[string, string, string, string, string]["", "Weak", "Fair", "Good", "Strong"]
label
string"Password strength"

Every prop is in the Password input API reference.

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