# `EzAuth.UI.Core.Errors`
[🔗](https://github.com/thiagomajesk/ez_auth/blob/v0.1.0/lib/ez_auth/ui/core/errors.ex#L1)

Error-rendering components.

`message/1` renders errors for a single form field. `summary/1` renders
a flow-level list for messages that don't belong to any single field.

# `message`

Renders errors for a form field.

Pass either a form field or an `inner_block` slot with a message. Field
errors only surface after the user has interacted with the field.

## Options

  * `:field` - form field whose visible errors should be rendered.
  * `:id` - unique id for the error message. Defaults to `"<field-id>-error"`
    when `:field` is set.

## Styling

  * `[data-part="error"]` - error message.

## Examples

    <EzAuth.UI.Core.Errors.message field={@form[:email]} />

    <EzAuth.UI.Core.Errors.message id="custom-error">
      Something went wrong
    </EzAuth.UI.Core.Errors.message>

## Attributes

* `field` (`Phoenix.HTML.FormField`)
* `id` (`:string`) - Defaults to `nil`.
* Global attributes are accepted.
## Slots

* `inner_block`

# `summary`

Renders a flow-level error summary for messages that don't belong to a
single field.

Announced as an alert and takes focus on mount so keyboard users land
on the summary after a failed submit.

## Options

  * `:errors` - list of error strings to display.

## Styling

  * `[data-part="error-summary"]` - error summary container.
  * `[data-part="error-summary-list"]` - error list.
  * `[data-part="error-summary-item"]` - each error item.

## Examples

    <EzAuth.UI.Core.Errors.summary errors={["Please complete all required fields"]} />

## Attributes

* `errors` (`:list`) - Defaults to `[]`.
* Global attributes are accepted.

---

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