# Alert dialog: Right to left

> Pass `dir` to the content as well, because it renders in a portal outside your RTL container. Arrow keys in the footer follow the reading direction.

Example: https://hextaui.com/docs/alert-dialog/examples/rtl
Component docs: https://hextaui.com/docs/alert-dialog.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/alert-dialog-rtl.json
```

This adds `components/examples/alert-dialog/rtl.tsx` with the Alert dialog component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/alert-dialog/rtl.tsx"
import { IconTrash } from "@tabler/icons-react"

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogMedia,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"

export function AlertDialogRtl() {
  return (
    <div dir="rtl">
      <AlertDialog>
        <AlertDialogTrigger render={<Button variant="outline" />}>
          حذف الملف
        </AlertDialogTrigger>
        <AlertDialogContent dir="rtl">
          <AlertDialogHeader>
            <AlertDialogMedia variant="destructive">
              <IconTrash />
            </AlertDialogMedia>
            <AlertDialogTitle>حذف هذا الملف؟</AlertDialogTitle>
            <AlertDialogDescription>
              لا يمكن التراجع عن هذا الإجراء.
            </AlertDialogDescription>
          </AlertDialogHeader>
          <AlertDialogFooter>
            <AlertDialogCancel>إلغاء</AlertDialogCancel>
            <AlertDialogAction variant="destructive">حذف</AlertDialogAction>
          </AlertDialogFooter>
        </AlertDialogContent>
      </AlertDialog>
    </div>
  )
}
```

## Props in this example

### AlertDialogTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `render` | `ReactElement \| (props, state) => ReactElement` | `<button>` |  |

### AlertDialogContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `dir` | `"ltr" \| "rtl"` | – | Set it when the dialog should be right to left. |

### AlertDialogMedia

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"default" \| "destructive"` | `"default"` |  |

### AlertDialogAction

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `ButtonVariant` | `"default"` |  |

## More Alert dialog examples

- [Async action](https://hextaui.com/docs/alert-dialog/examples/async-action.md)
- [Media](https://hextaui.com/docs/alert-dialog/examples/media.md)
- [Small](https://hextaui.com/docs/alert-dialog/examples/small.md)
- [Detached triggers](https://hextaui.com/docs/alert-dialog/examples/detached-triggers.md)
- [Controlled](https://hextaui.com/docs/alert-dialog/examples/controlled.md)
- [Nested](https://hextaui.com/docs/alert-dialog/examples/nested.md)
- [Long content](https://hextaui.com/docs/alert-dialog/examples/long-content.md)
