# Rating

> A score out of a few stars, read at a glance: a muted row of stars with a filled row laid over it and clipped to the score's share, so 4.3 shows the fourth star whole and a third of the fifth.

```ts
import { Rating } from "@sdxc/ui";
```

Renders the stars as one `role="img"` whose name states the score, followed by the count.
Stars take `--ui-rating-color` (the warning tone by default) and empty ones the border tone,
so a theme recolours every rating at once.

## Examples

```tsx
<Rating value={4.3} count={128} />
```

```tsx
<Rating value={5} size="sm" label="Rated {value} of {max}" />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `value` | `number` | The score, fractional, between 0 and `max`; a value outside is held to the scale. |
| `count?` | `number` | How many ratings the score averages, shown after the stars as "(128)". |
| `max?` | `number` |  |
| `size?` | `"sm" \| "md"` |  |
| `label?` | `string` | What assistive tech reads; `{value}` and `{max}` fill in. @default "{value} out of {max} stars" |
| `countLabel?` | `RemixNode` | Replaces the "(128)" text, such as "128 reviews" or a link to them. |

Also accepts everything in `Omit<TagProps<"span">, "children">`.

