1. framework components
  2. rating group

Rating Group

Rating Group allows users to rate something

Allow Half

Custom Icons

Label

Disabled

Direction

API Reference

Root

txt
flex flex-col gap-2
PropDefaultType
idsPartial<{ root: string; label: string; hiddenInput: string; control: string; item: (id: string) => string; }> | undefined

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

translationsIntlTranslations | undefined

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

count5number | undefined

The total number of ratings.

namestring | undefined

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

formstring | undefined

The associate form of the underlying input element.

valuenumber | undefined

The controlled value of the rating

defaultValuenumber | undefined

The initial value of the rating when rendered. Use when you don't need to control the value of the rating.

readOnlyboolean | undefined

Whether the rating is readonly.

disabledboolean | undefined

Whether the rating is disabled.

requiredboolean | undefined

Whether the rating is required.

allowHalfboolean | undefined

Whether to allow half stars.

autoFocusboolean | undefined

Whether to autofocus the rating.

onValueChange((details: ValueChangeDetails) => void) | undefined

Function to be called when the rating value changes.

onHoverChange((details: HoverChangeDetails) => void) | undefined

Function to be called when the rating value is hovered.

dir"ltr""ltr" | "rtl" | undefined

The document's text/writing direction.

getRootNode(() => ShadowRoot | Node | Document) | undefined

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

element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Provider

PropDefaultType
valueRatingGroupApi<PropTypes>

element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Context

PropDefaultType
children(ratingGroup: RatingGroupApi<PropTypes>) => ReactNode

Label

txt
label-text
PropDefaultType
element((attributes: HTMLAttributes<"label">) => Element) | undefined

Render the element yourself

Control

txt
flex gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50
PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Item

PropDefaultType
emptyStarEmpty (SVG)ReactNode

The content to render when the item is in the empty state.

halfStarHalf (SVG)ReactNode

The content to render when the item is in the half state.

fullStarFull (SVG)ReactNode

The content to render when the item is in the full state.

indexnumber

element((attributes: HTMLAttributes<"span">) => Element) | undefined

Render the element yourself

HiddenInput

PropDefaultType
element((attributes: HTMLAttributes<"input">) => Element) | undefined

Render the element yourself

View page on GitHub