- components
 - ›
 - rating group
 - ›
 - svelte
 
Rating Group
Rating Group allows users to rate something
Allow Half
Custom Icons
Label
Disabled
Direction
API Reference
Root
| Property | Default | Type | 
|---|---|---|
 ids  |  - |    Partial<{ root: string; label: string; hiddenInput: string; control: string; item: (id: string) => string; }> | undefined The 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  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
RootProvider
| Property | Default | Type | 
|---|---|---|
 value  |  - |    () => RatingGroupApi<PropTypes>  |  
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
RootContext
| Property | Default | Type | 
|---|---|---|
 children  |  - |    Snippet<[() => RatingGroupApi<PropTypes>]>  |  
Label
| Property | Default | Type | 
|---|---|---|
 element  |  - |    Snippet<[HTMLAttributes<"label">]> | undefinedRender the element yourself  |  
Control
| Property | Default | Type | 
|---|---|---|
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
Item
| Property | Default | Type | 
|---|---|---|
 empty  |  StarEmpty (SVG) |    Snippet<[]> | undefinedThe content to render when the item is in the empty state.  |  
 half  |  StarHalf (SVG) |    Snippet<[]> | undefinedThe content to render when the item is in the half state.  |  
 full  |  StarFull (SVG) |    Snippet<[]> | undefinedThe content to render when the item is in the full state.  |  
 index  |  - |    number  |  
 element  |  - |    Snippet<[HTMLAttributes<"span">]> | undefinedRender the element yourself  |  
HiddenInput
| Property | Default | Type | 
|---|---|---|
 element  |  - |    Snippet<[HTMLAttributes<"input">]> | undefinedRender the element yourself  |