BitstylesPhoenix.Components.Error (bitstyles_phoenix v0.2.0) View Source
Conveniences for translating and building error messages.
Link to this section Summary
Link to this section Functions
Generates tag for inlined form input errors.
Uses the translate_errors
callback to translate field errors.
Generates tag for custom errors.
When errors are given in tuples {error, count} they are given to the translate_errors
callback.
Examples
iex> safe_to_string ui_error_tag("Foo error")
~s(<span class="u-fg--warning">Foo error</span>)
iex> safe_to_string ui_error_tag("Foo error", phx_feedback_for: "foo")
~s(<span class="u-fg--warning" phx-feedback-for="foo">Foo error</span>)