# RatingProps (@salmonui/inputs/rating)

> The RatingProps interface of @salmonui/inputs/rating.

Canonical: https://salmonui.dev/docs/reference/inputs/rating/RatingProps

```ts
import type { RatingProps } from '@salmonui/inputs/rating';
```

Entry index: https://salmonui.dev/docs/reference/inputs/rating (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/inputs/rating.md).

## Reference

Kind: interface

```ts
interface RatingProps extends FieldCommonProps {
    readonly value?: number | undefined;
    readonly defaultValue?: number | undefined;
    readonly onValueChange?: ((value: number, details: RatingChangeDetails) => void) | undefined;
    readonly count?: number | undefined;
    readonly min?: number | undefined;
    readonly precision?: 'full' | 'half' | 'quarter' | 'exact' | undefined;
    readonly clearable?: boolean | undefined;
    readonly highlightSelectedOnly?: boolean | undefined;
    readonly showLabel?: boolean | undefined;
    readonly labelPlacement?: 'top' | 'bottom' | 'start' | 'end' | undefined;
    readonly renderLabel?: ((ctx: {
        readonly value: number;
        readonly count: number;
    }) => ReactNode) | undefined;
    readonly icon?: ReactNode;
    readonly emptyIcon?: ReactNode;
    readonly renderItem?: ((ctx: {
        readonly index: number;
        readonly state: RatingItemState;
        readonly fill: number;
    }) => ReactNode) | undefined;
    readonly showTooltip?: boolean | undefined;
    readonly renderTooltip?: ((ctx: {
        readonly value: number;
        readonly count: number;
    }) => ReactNode) | undefined;
    readonly onHoverChange?: ((value: number | null) => void) | undefined;
    readonly name?: string | undefined;
    readonly form?: string | undefined;
    readonly required?: boolean | undefined;
    readonly disabled?: boolean | undefined;
    readonly readOnly?: boolean | undefined;
    readonly localeText?: RatingLocaleText | undefined;
    readonly id?: string | undefined;
    readonly dir?: 'ltr' | 'rtl' | 'auto' | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly classNames?: {
        readonly label?: string;
        readonly items?: string;
        readonly item?: string;
        readonly value?: string;
        readonly description?: string;
        readonly error?: string;
    } | undefined;
    readonly ref?: Ref<HTMLElement> | undefined;
}
```

Members (36):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `label` | `label?: ReactNode;` | optional, inherited |  |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) \| ReactNode;` | optional, inherited | Error text (or a function of the errors) shown while the field is invalid. |
| `invalid` | `invalid?: boolean;` | optional, inherited | Forces the error state. |
| `validation` | `validation?: FieldValidation;` | optional, inherited | Rules in the Data Grid vocabulary. |
| `validateOn` | `validateOn?: ValidateOn;` | optional, inherited | When errors appear; default the `Form`'s, else `'blur'`. |
| `size` | `size?: FieldSize;` | optional, inherited | Metric set. Default `'md'`. |
| `value` | `readonly value?: number \| undefined;` | optional |  |
| `defaultValue` | `readonly defaultValue?: number \| undefined;` | optional | Default `min`. |
| `onValueChange` | `readonly onValueChange?: ((value: number, details: RatingChangeDetails) => void) \| undefined;` | optional |  |
| `count` | `readonly count?: number \| undefined;` | optional | Number of items. Default 5. |
| `min` | `readonly min?: number \| undefined;` | optional | Lowest value a selection can set; the cleared value. Default 0. |
| `precision` | `readonly precision?: 'full' \| 'half' \| 'quarter' \| 'exact' \| undefined;` | optional | Step: `'full'` or `'half'` while editing; `'quarter'` and `'exact'` only with `readOnly` (a `role="img"` display). Default `'full'`. |
| `clearable` | `readonly clearable?: boolean \| undefined;` | optional | Shows a clear button while the value is above `min`. |
| `highlightSelectedOnly` | `readonly highlightSelectedOnly?: boolean \| undefined;` | optional | Fills only the selected item. |
| `showLabel` | `readonly showLabel?: boolean \| undefined;` | optional | Shows the value next to the items. |
| `labelPlacement` | `readonly labelPlacement?: 'top' \| 'bottom' \| 'start' \| 'end' \| undefined;` | optional | Where the value label sits. Default `'end'`. |
| `renderLabel` | `readonly renderLabel?: ((ctx: {     readonly value: number;     readonly count: number; }) => ReactNode) \| undefined;` | optional |  |
| `icon` | `readonly icon?: ReactNode;` | optional | Filled icon. Default a star. |
| `emptyIcon` | `readonly emptyIcon?: ReactNode;` | optional | Empty icon. Default `icon` (drawn in the empty color). |
| `renderItem` | `readonly renderItem?: ((ctx: {     readonly index: number;     readonly state: RatingItemState;     readonly fill: number; }) => ReactNode) \| undefined;` | optional | Replaces both icons of an item. |
| `showTooltip` | `readonly showTooltip?: boolean \| undefined;` | optional | Shows a value bubble over the hovered or focused step. |
| `renderTooltip` | `readonly renderTooltip?: ((ctx: {     readonly value: number;     readonly count: number; }) => ReactNode) \| undefined;` | optional |  |
| `onHoverChange` | `readonly onHoverChange?: ((value: number \| null) => void) \| undefined;` | optional | The step under the pointer, `null` when it leaves. Bound listeners only when given; no state. |
| `name` | `readonly name?: string \| undefined;` | optional | Submitted name. Without it the radios share a generated name and are not submitted. |
| `form` | `readonly form?: string \| undefined;` | optional |  |
| `required` | `readonly required?: boolean \| undefined;` | optional |  |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean \| undefined;` | optional | Display only: radios stay focusable but ignore changes; `'quarter'` / `'exact'` render a `role="img"`. |
| `localeText` | `readonly localeText?: RatingLocaleText \| undefined;` | optional |  |
| `id` | `readonly id?: string \| undefined;` | optional |  |
| `dir` | `readonly dir?: 'ltr' \| 'rtl' \| 'auto' \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: {     readonly label?: string;     readonly items?: string;     readonly item?: string;     readonly value?: string;     readonly description?: string;     readonly error?: string; } \| undefined;` | optional | Part classes: `root` is `className`; `label`, `items`, `item`, `value`, `description`, `error`. |
| `ref` | `readonly ref?: Ref<HTMLElement> \| undefined;` | optional | The root element (`<fieldset>`, or `<div>` for the image display). |
