# `FrappeUIPhx.Components.Rating`
[🔗](https://github.com/moacirbishopcamata/frappe_ui_phx/blob/v0.3.1/lib/frappe_ui_phx/components/rating.ex#L1)

Avaliação em estrelas (`1..max`). Cada estrela é um `<input type=radio>`, então
funciona em formulários e `phx-change`; o preenchimento vem do valor no servidor.
Combine com `FrappeUIPhx.Ecto.Rating` no schema.

# `current`

```elixir
@spec current(term(), pos_integer()) :: non_neg_integer()
```

Valor (string ou inteiro) normalizado para `0..max`; inválido vira 0.

# `rating`

## Attributes

* `field` (`Phoenix.HTML.FormField`) - Defaults to `nil`.
* `id` (`:any`) - Defaults to `nil`.
* `name` (`:any`)
* `value` (`:any`)
* `max` (`:integer`) - Defaults to `5`.
* `readonly` (`:boolean`) - Defaults to `false`.
* `errors` (`:list`) - Defaults to `[]`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted. Supports all globals plus: `["form"]`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
