- components
- ›
- rating group
- ›
- react
Rating Group
Rating Group allows users to rate something
Allow Half
Custom Icons
Label
Disabled
Direction
API Reference
RatingGroupControl
flex gap-2 data-disabled:cursor-not-allowed data-disabled:opacity-50
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
RatingGroupHiddenInput
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"input">) => Element) | undefinedRender the element yourself |
RatingGroupItem
Property | Default | Type |
---|---|---|
empty | StarEmpty (SVG) | ReactNodeThe content to render when the item is in the empty state. |
half | StarHalf (SVG) | ReactNodeThe content to render when the item is in the half state. |
full | StarFull (SVG) | ReactNodeThe content to render when the item is in the full state. |
index | - | number |
element | - | ((attributes: HTMLAttributes<"span">) => Element) | undefinedRender the element yourself |
RatingGroupLabel
label-text
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"label">) => Element) | undefinedRender the element yourself |
RatingGroupRootProvider
Property | Default | Type |
---|---|---|
value | - | RatingGroupApi<PropTypes> |
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
RatingGroupRoot
flex flex-col gap-2
Property | Default | Type |
---|---|---|
ids | - | Partial<{ root: string; label: string; hiddenInput: string; control: string; item: (id: string) => string; }> | undefinedThe ids of the elements in the rating. Useful for composition. |
translations | - | IntlTranslations | undefinedSpecifies the localized strings that identifies the accessibility elements and their states |
count | 5 | number | undefinedThe total number of ratings. |
name | - | string | undefinedThe name attribute of the rating element (used in forms). |
form | - | string | undefinedThe associate form of the underlying input element. |
value | - | number | undefinedThe controlled value of the rating |
defaultValue | - | number | undefinedThe initial value of the rating when rendered. Use when you don't need to control the value of the rating. |
readOnly | - | boolean | undefinedWhether the rating is readonly. |
disabled | - | boolean | undefinedWhether the rating is disabled. |
required | - | boolean | undefinedWhether the rating is required. |
allowHalf | - | boolean | undefinedWhether to allow half stars. |
autoFocus | - | boolean | undefinedWhether to autofocus the rating. |
onValueChange | - | ((details: ValueChangeDetails) => void) | undefinedFunction to be called when the rating value changes. |
onHoverChange | - | ((details: HoverChangeDetails) => void) | undefinedFunction to be called when the rating value is hovered. |
dir | "ltr" | "ltr" | "rtl" | undefinedThe document's text/writing direction. |
getRootNode | - | (() => ShadowRoot | Node | Document) | undefinedA root node to correctly resolve document in custom environments. E.x.: Iframes, Electron. |
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
RatingGroupRootContext
Property | Default | Type |
---|---|---|
children | - | (ratingGroup: RatingGroupApi<PropTypes>) => ReactNode |