RatingInput

Star rating input that stores a numeric value (0..max).

Installation

pnpm dlx shadcn@latest add @shadmin/rating-input

Usage

import { RatingInput } from '@/components/admin';
 
<RatingInput source="rating" />
<RatingInput source="rating" max={10} allowHalf />
<RatingInput source="rating" disabled />

Props

PropRequiredTypeDefaultDescription
sourceRequiredstring-Form field name
maxOptionalnumber5Total stars rendered
allowHalfOptionalbooleanfalseAllow half-step selection
labelOptionalstring | falseInferredCustom label, or false to hide
helperTextOptionalReactNode-Helper text below the input
disabledOptionalbooleanfalseDisable input
defaultValueOptionalnumber-Initial value
validateOptionalValidator | Validator[]-Validation
classNameOptionalstring-CSS class on the radiogroup

Keyboard

The component renders a role="radiogroup" with role="radio" children. Standard arrow-key navigation applies; Space / Enter selects.