HextaUI

Command: Right to left

Icons, shortcuts, the page chip and the page slide all follow the reading direction.

import { IconCalendar, IconSettings } from "@tabler/icons-react"

import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandShortcut,
} from "@/components/ui/command"

export function CommandRtl() {
  return (
    <div dir="rtl" className="w-full max-w-sm">
      <Command dir="rtl">
        <CommandInput placeholder="ابحث عن أمر…" />
        <CommandList>
          <CommandEmpty>لا توجد نتائج.</CommandEmpty>
          <CommandGroup heading="اقتراحات">
            <CommandItem>
              <IconCalendar />
              التقويم
              <CommandShortcut>⌘T</CommandShortcut>
            </CommandItem>
            <CommandItem>
              <IconSettings />
              الإعدادات
              <CommandShortcut>⌘S</CommandShortcut>
            </CommandItem>
          </CommandGroup>
        </CommandList>
      </Command>
    </div>
  )
}

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

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

To add only the component, follow the Command installation.

Props in this example

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

PropTypeDefault
placeholder
string–
PropTypeDefault
heading
ReactNode–

Every prop is in the Command API reference.

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