HextaUI

Select: Right to left

The trigger, list and check follow the reading direction.

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"

const cities = [
  { value: "cairo", label: "القاهرة" },
  { value: "riyadh", label: "الرياض" },
  { value: "dubai", label: "دبي" },
]

export function SelectRtl() {
  return (
    <div dir="rtl">
      <Select items={cities} defaultValue="riyadh">
        <SelectTrigger aria-label="المدينة" className="w-44">
          <SelectValue />
        </SelectTrigger>
        <SelectContent>
          {cities.map((city) => (
            <SelectItem key={city.value} value={city.value}>
              {city.label}
            </SelectItem>
          ))}
        </SelectContent>
      </Select>
    </div>
  )
}

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

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

To add only the component, follow the Select installation.

Props in this example

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

PropTypeDefault
defaultValue
Value | Value[] | null–
itemsLets SelectValue show labels.
Record<string, ReactNode> | { value, label }[]–
PropTypeDefault
value
Value–

Every prop is in the Select API reference.

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