# Rating

> Star rating with exact fractional fill and optional review count.

- Tier: free, MIT
- Category: Data display
- Docs: https://ui.mlola.com/docs/components/rating

## Install

```bash
npx mlola-ui add rating
```

```tsx
import { Rating } from "@/components/ui/rating";
```

## Example

```tsx
import { Rating } from "@/components/ui/rating";

export default function Example() {
  return <Rating value={4.5} count={128} showValue label="Average rating" />;
}
```

## The same markup without React

```html
<span class="ml-rating" role="img" aria-label="Average rating"><span class="ml-rating-track" aria-hidden="true"><span class="ml-rating-fill" style="--ml-rating:90%">★★★★★</span>★★★★★</span><span class="ml-rating-value">4.5</span><span class="ml-rating-count">(128)</span></span>
```
