# `PetalComponents.Helpers`
[🔗](https://github.com/petalframework/petal_components/blob/v3.2.0/lib/petal_components/helpers.ex#L1)

For any helper functions used across multiple components. Ideally we keep this empty - components should be copy-pastable.

# `compose_js`

Composes two `Phoenix.LiveView.JS` structs by concatenating their operations.
User JS operations execute first, followed by component JS operations.

# `uniq_id`

Generates a unique HTML ID based on the given string or iodata.

## Parameters

  - input: The input string or iodata (e.g., heading or label)
  - prefix: An optional prefix for the ID (default: "c")

## Examples

    iex> PetalComponents.Helpers.uniq_id("My Heading")
    "c-my-heading-1234"

    iex> PetalComponents.Helpers.uniq_id(["My ", {:safe, "<a>Link</a>"}, " Label"], "custom")
    "custom-my-link-label-5678"

---

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