Components
Rating group

Rating Group

The RatingGroup allows a user to add and remove ratings for an item.

API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.

RatingProps

index

number

RatingContext

isChecked

boolean

isEqual

boolean

isHalf

boolean

isHighlighted

boolean

isValueEmpty

boolean

RatingGroupProps

allowHalf

boolean

Whether to allow half stars.

autoFocus

boolean

Whether to autofocus the rating.

defaultValue

number

dir

'ltr' | 'rtl'

The document's text/writing direction.

disabled

boolean

Whether the rating is disabled.

form

string

The associate form of the underlying input element.

getRootNode

() => ShadowRoot | Node | Document

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

id

string

The unique identifier of the machine.

ids

Partial<{ root: string label: string hiddenInput: string control: string rating(id: string): string }>

The ids of the elements in the rating. Useful for composition.

max

number

The maximum rating value.

name

string

The name attribute of the rating element (used in forms).

onHoverChange

(details: HoverChangeDetails) => void

Function to be called when the rating value is hovered.

onValueChange

(details: ValueChangeDetails) => void

Function to be called when the rating value changes.

readOnly

boolean

Whether the rating is readonly.

translations

IntlTranslations

Specifies the localized strings that identifies the accessibility elements and their states

value

number

The current rating value.