# Rating

Five stars with a label and value. Hover previews up to the pointer.

Tier: Free

## Installation

```bash
npx shadcn add @fetaui/rating
```

## Usage

```tsx
import { Rating } from '@/components/fetaui/rating'

export function Example() {
  return <Rating label="Rate this answer" onValueChange={save} />
}
```

## API

| Prop | Type | Default |
|---|---|---|
| label | string | required |
| value | number |  |
| defaultValue | number | 0 |
| onValueChange | (value) => void |  |
| readOnly | boolean | false |
| count | number |  |
| disabled | boolean | false |
| animated | boolean | true |

## When to use

- To rate one thing, like an answer.
- Read only, to show an average and how many ratings it comes from.

## When not to use

- For likelihood to recommend: use NPS Scale.

## Accessibility

- Native radio inputs in a radiogroup, so it reads as 3 of 5.
- Read only is one image with a full description.
- The value is written out, not only drawn.

## Motion

- Stars fill in 120 ms and press to 0.9 on a spring.
- With reduced motion, there is no press.
