The values nil, "", [] and %{} are treated as empty values.
This component optionally applies a formatter function to non-empty values.
The primary purpose of this component is to enhance accessibility. If a
table cell or property list property has no value, an alternative text must
be provided for screen readers.
Maturity: Developing
Usage
Render the value of @some_value if it's available, or display the
default placeholder otherwise:
<.fallback value={@some_value} />
Apply a formatter function to @some_value if it is not nil:
<.fallback value={@some_value} formatter={&format_date/1} />
Set a custom placeholder and text for screen readers:
<.fallback
value={@some_value}
placeholder="n/a"
accessibility_text="not available"
/>