# `PUI.Components`

# `badge`

## Attributes

* `class` (`:string`) - Defaults to `""`.
* `variant` (`:string`) - Defaults to `"default"`. Must be one of `"default"`, `"secondary"`, `"destructive"`, or `"outline"`.
## Slots

* `inner_block`

# `field_error`

Renders form field error messages.

Displays validation errors below form inputs. Renders nothing when `errors` is empty.

## Examples

    <.field_error errors={["can't be blank"]} />
    <.field_error errors={["must be at least 3 characters", "is invalid"]} />
    <.field_error errors={[]} />

## Attributes

* `errors` (`:list`) - Defaults to `[]`.

# `progress`

## Attributes

* `min` (`:float`) - Defaults to `0.0`.
* `max` (`:float`) - Defaults to `100.0`.
* `value` (`:float`) - Defaults to `0.0`.
* `class` (`:string`) - Defaults to `""`.

# `translate_error`

Translates a form error tuple into a human-readable string.

Error tuples from changesets have the form `{msg, opts}` where `msg` may contain
interpolation placeholders like `%{count}`.

## Examples

    iex> PUI.Components.translate_error({"can't be blank", []})
    "can't be blank"

    iex> PUI.Components.translate_error({"should be at least %{count} character(s)", [count: 3]})
    "should be at least 3 character(s)"

---

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