# `LedgerUI.Helpers`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/helpers.ex#L1)

Small helpers shared by all components.

# `bool_attr`

```elixir
@spec bool_attr(term()) :: String.t()
```

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"

# `cx`

```elixir
@spec cx(term()) :: String.t()
```

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])
    ""

---

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