Rating

Star rating input rendered as a radiogroup, with one labelled radio per star, a configurable max, disabled state, and controlled or uncontrolled value in React.

src/registry/ui/rating.tsx/r/rating.json

Installation#

bash
npx shadcn@latest add @minidev/rating

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/rating.json

Usage#

tsx
import { Rating } from "@/components/ui/rating"

export function Example() {
  return (
    <Rating defaultValue={4} aria-label="Rating" />
  )
}

API reference#

Rating props
PropTypeDefault
valuenumber-
defaultValuenumber0
onChange(value: number) => void-
maxnumber5
disabledboolean-
classNamestring-
aria-labelstring-

Dependencies#

npm

lucide-react

Built from

No other MiniDev files

Examples#

All form components