HextaUI

Rating (UI SDK): Right to left

Stars run from the right, and a half star fills from its right edge.

import { Rating, RatingItem } from "@/components/ui/ui-sdk-rating"

function UiSdkRatingRtl() {
  return (
    <div dir="rtl">
      <Rating aria-label="التقييم" step={0.5} defaultValue={2.5}>
        <RatingItem />
      </Rating>
    </div>
  )
}

export { UiSdkRatingRtl }

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

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

To add only the component, follow the Rating installation.

Props in this example

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

PropTypeDefault
defaultValue
number | null–
step
number1

Every prop is in the Rating API reference.

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