# RatingInput

> A star picker for a review form: a fieldset of native radios drawn as stars, where the picked star and every one before it fill, and hovering previews a score.

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

Renders one radio and its star label per entry of `labels`, in score order so the native
arrow keys step up and down the scale. A star fills when its own radio or any later one is
checked, and hovering a star fills it and every earlier one in place of the checked score.

## Examples

```tsx
<RatingInput name="rating" legend="Your rating" required labels={["1 star — Poor", "2 stars — Fair", "3 stars — Good", "4 stars — Great", "5 stars — Excellent"]} />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `name` | `string` | The field the score posts as. |
| `value?` | `number` | The score picked now, from 1 to the number of labels. |
| `required?` | `boolean` |  |
| `legend` | `RemixNode` | The question the stars answer, such as "Your rating". |
| `labels` | `string[]` | One name per star, lowest first, such as "1 star — Poor"; their count sets the scale. |

Also accepts everything in `Omit<TagProps<"fieldset">, "children" | "name">`.

