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.

elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Provider

PropDefaultType
value() => RatingGroupApi<PropTypes>

elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Context

PropDefaultType
childrenSnippet<[() => RatingGroupApi<PropTypes>]>

Label

txt
label-text
PropDefaultType
elementSnippet<[HTMLAttributes<"label">]> | undefined

Render the element yourself

Control

txt
flex gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50
PropDefaultType
elementSnippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Item

PropDefaultType
emptyStarEmpty (SVG)Snippet<[]> | undefined

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

halfStarHalf (SVG)Snippet<[]> | undefined

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

fullStarFull (SVG)Snippet<[]> | undefined

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

indexnumber

elementSnippet<[HTMLAttributes<"span">]> | undefined

Render the element yourself

HiddenInput

PropDefaultType
elementSnippet<[HTMLAttributes<"input">]> | undefined

Render the element yourself

View page on GitHub