Rxova
Skip to content

RatingProps

optional allowClear?: boolean;

Re-selecting the current value clears to 0.

true when interactive

optional aria-describedby?: string;

ids of external error/help text.


optional className?: string;

optional defaultValue?: number;

Uncontrolled initial score. Ignored when value is provided.


optional dir?: "ltr" | "rtl";

Flips the fill origin.

inherited from the DOM

optional disabled?: boolean;

optional emptyIcon?: RatingIcon;

Empty/track icon.

same as icon, dimmed via --rfs-empty-filter


optional formatLabel?: (value, max) => string;

Formats the default accessible name.

ParameterType
valuenumber
maxnumber

string

${value} out of ${max}


optional formatOptionLabel?: (value, max) => string;

Accessible name for one option, e.g. for aria-label on each radio.

ParameterType
valuenumber
maxnumber

string


optional icon?: RatingIcon;

Filled icon. A function receives per-icon state.

a built-in star

optional id?: string;

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


optional invalid?: boolean;

Sets aria-invalid and data-invalid on the group.


optional label?: string;

Accessible name for the group.


optional max?: number;

Number of icons rendered. Positive integer.

5

optional name?: string;

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


optional onBlur?: (event) => void;

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

ParameterType
eventFocusEvent<HTMLElement>

void


optional onChange?: (value) => void;

Providing this makes the component interactive.

ParameterType
valuenumber

void


optional onHoverChange?: (value) => void;

Hover/keyboard preview; null when the preview ends.

ParameterType
valuenumber | null

void


optional onWarn?: (warning) => void;

Called in development whenever a prop is coerced to keep the component functional — see RatingWarning. The coerced result still renders, so this never changes what the user sees; it only surfaces the mistake. When omitted, the same warnings go to console.warn. The entire path is stripped from production builds, so this is a no-op there.

ParameterType
warningRatingWarning

void


optional precision?: number;

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

0

optional readOnly?: boolean;

Force read-only even when onChange is present.

!onChange


optional required?: boolean;

optional rounding?: RatingRounding;

Direction of the snap onto the grid.

'nearest'

optional style?: CSSProperties;

optional value?: number;

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