Skip to content

UseRatingOptions

allowClear?: boolean;

Re-selecting the current value clears to 0.

true when interactive

defaultValue?: number;

Uncontrolled initial score. Ignored when value is provided.


disabled?: boolean;

id?: string;

Base id; option inputs derive ${id}-1, ${id}-2, …


max?: number;

Number of icons rendered. Positive integer.

5

name?: string;

Radio group name; also emits a value readable by a native <form>.


onBlur?: (event) => void;

Fires when focus leaves the whole group, not when moving between icons.

ParameterType
eventFocusEvent<HTMLElement>

void


onChange?: (value) => void;

Providing this makes the component interactive.

ParameterType
valuenumber

void


onHoverChange?: (value) => void;

Hover/keyboard preview; null when the preview ends.

ParameterType
valuenumber | null

void


onWarn?: (warning) => void;

Callback invoked when a warning is emitted.

ParameterType
warningRatingWarning

void


precision?: number;

Quantization grid: 1 = whole icons, 0.5 = halves, 0 = continuous.

0

readOnly?: boolean;

Force read-only even when onChange is present.

!onChange


rounding?: RatingRounding;

Direction of the snap onto the grid.

'nearest'

value?: number;

Controlled score. Clamped to [0, max]; NaN/Infinity become 0.