Skip to main content

Rating

A 0-5 rating input, or a read only display of any number, even with decimals, between 0 and 5.

Examples

Interactive Rating

<Rating 
size="small|medium(default)"
defaultValue={2}
/>

Read Only Rating

<Rating 
...
readOnly
value={3.5}
/>

Controlled Interactive Rating

<ExampleRating
...
value={someValue}
onChange={handleChange}
/>

Props

NameTypeDefault ValueRequiredDescription
defaultValuestring | numberNoThe default value of the rating.
onChangeFormControlChangeEventHandler<InputType, string | number | readonly string[] | (string | number | readonly string[])[]> | undefinedNoEmit a new value when the input's selected value changes.
size"small" | FormControlSize | "medium"FormControlSize.MediumNoThe size of the field.
valuestring | numberNoThe current value of the rating.