UseRatingResult
Properties
Section titled “Properties”baseId
Section titled “baseId”baseId: string;canChange
Section titled “canChange”canChange: boolean;True when the control will actually accept input (interactive and not disabled).
commit
Section titled “commit”commit: (next) => void;Commit a value verbatim (keyboard entry).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next | number |
Returns
Section titled “Returns”void
disabled
Section titled “disabled”disabled: boolean;displayValue
Section titled “displayValue”displayValue: number;What should be painted right now — the hover preview if any, else value.
fills: number[];Per-icon fill ratios for displayValue.
focusedValue
Section titled “focusedValue”focusedValue: number | null;handleBlur
Section titled “handleBlur”handleBlur: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
hoverValue
Section titled “hoverValue”hoverValue: number | null;interactive
Section titled “interactive”interactive: boolean;True when the component renders as a control rather than an image.
max: number;Icon count after normalization.
name: string;rootRef
Section titled “rootRef”rootRef: object;Structural rather than RefObject: in @types/react 18 RefObject.current
is readonly, in 19 it is mutable. Declaring the shape keeps this assignable
under both, which matters because react >= 18 is a peer.
current
Section titled “current”current: HTMLSpanElement | null;select
Section titled “select”select: (next) => void;Pointer semantics: re-selecting the current value clears it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next | number |
Returns
Section titled “Returns”void
setFocused
Section titled “setFocused”setFocused: (next) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next | number | null |
Returns
Section titled “Returns”void
setHover
Section titled “setHover”setHover: (next) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next | number | null |
Returns
Section titled “Returns”void
steps: number[];Selectable grid values.
value: number;The committed score, clamped and snapped.