HextaUI

Rating (UI SDK): Disabled

A disabled rating can’t be focused or changed, and submits nothing.

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

function UiSdkRatingDisabled() {
  return (
    <Rating aria-label="Rating" disabled defaultValue={3}>
      <RatingItem />
    </Rating>
  )
}

export { UiSdkRatingDisabled }

This adds the example as components/examples/ui-sdk-rating/disabled.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-disabled.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–
disabled
booleanfalse

Every prop is in the Rating API reference.

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