Rating provides insight regarding others' opinions and experiences, and can allow the user to submit a rating of their own

base - The main wrapper which holds all of the rating elements.

label - The label part.

value-label - The value label part.

symbols - A wrapper for all rating symbols.

symbol - The part of the encapsulated default symbol.

full - The part of the encapsulated full symbols.

empty - The part of the encapsulated empty symbols.

--symbol-size - The size of the symbols.

--symbol-full-color - The color of the filled symbol.

--symbol-empty-color - The color of the empty symbol.

--symbol-full-filter - The filter(s) used for the filled symbol.

--symbol-empty-filter - The filter(s) used for the empty symbol.

Callable

  • Returns ReactNode

Events

onChange: (args: CustomEvent<number>) => void

Emitted when the value of the control changes.

Type declaration

onHover: (args: CustomEvent<number>) => void

Emitted when hover is enabled and the user mouses over a symbol of the rating.

Type declaration

Methods

  • Decrements the value of the control by n steps multiplied by the step factor.

    Parameters

    • n: number

    Returns void

  • Increments the value of the control by n steps multiplied by the step factor.

    Parameters

    • n: number

    Returns void

Properties

allowReset: boolean

Whether to reset the rating when the user selects the same value.

hoverPreview: boolean

Sets hover preview behavior for the component

label: string

The label of the control.

max: number

The maximum value for the rating.

If there are projected symbols, the maximum value will be resolved based on the number of symbols.

readOnly: boolean

Makes the control a readonly field.

single: boolean

Toggles single selection visual mode.

step: number

The minimum value change allowed.

Valid values are in the interval between 0 and 1 inclusive.

value: number

The current value of the component

valueFormat: string

A format string which sets aria-valuetext. Instances of '{0}' will be replaced with the current value of the control and instances of '{1}' with the maximum value for the control.

Important for screen-readers and useful for localization.