Small helpers shared by all components.
Summary
Functions
Renders a boolean as the strings "true" / "false" (for aria-* attributes).
Joins class values into a single string, dropping empties.
Functions
Renders a boolean as the strings "true" / "false" (for aria-* attributes).
iex> LedgerUI.Helpers.bool_attr(true)
"true"
iex> LedgerUI.Helpers.bool_attr(nil)
"false"
Joins class values into a single string, dropping empties.
Accepts strings, nil, false, {class, condition} tuples and nested lists.
iex> LedgerUI.Helpers.cx(["lu-btn", nil, false, {"on", true}, {"off", false}, ["a", " "], "b c"])
"lu-btn on a b c"
iex> LedgerUI.Helpers.cx([nil])
""