# Field: Rating (category: special)

URL: https://docs.forms.saastro.io/docs/rating

<FieldPreview name="rating" description="Star rating control" />

## Overview

`rating` renders a row of star buttons with `radiogroup` / `radio` semantics. Configure how many stars with `max` (default `5`).

## Value

The submitted value is an **integer from 1 to `max`** (`valueKind: 'number'`). Clicking the currently selected star clears the value back to `undefined`. Nothing is written until the user clicks — set `.value(n)` for an initial rating.

## Usage

```tsx

const config = FormBuilder.create('feedback')
  .addField('satisfaction', (f) =>
    f.type('rating').label('How satisfied are you?').prop('max', 5),
  )
  .addStep('main', ['satisfaction'])
  .build();
```

`max` has no dedicated fluent method — set it with `.prop('max', n)`.

## Props

| Prop  | Type     | Default | Description     |
| ----- | -------- | ------- | --------------- |
| `max` | `number` | `5`     | Number of stars |

The filled-star color can be themed via the `--saastro-rating` CSS variable.
