# `Xenia.Provider`
[🔗](https://github.com/uzaydurdu/xenia/blob/v0.1.1/lib/xenia/core/provider.ex#L1)

Publishes application-wide values to Xenia adapters.

A provider renders a hidden element and wraps nothing, so it can sit
anywhere on the page, typically once in the layout. When its value changes,
LiveView patches the element and every adapter that consumes the provider
receives the new value.

## Example

    <Xenia.Provider.provider name="theme" value={@theme} />

Adapters receive these values by declaring:

    consumes: ["theme"]

The `XeniaProvider` hook must be registered, which `createHooks/1` does.

# `provider`

Renders a hidden element that publishes `value` under `name`.
## Attributes

* `name` (`:string`) (required) - Name of the shared provider, e.g. `theme` or `locale`.
* `value` (`:any`) (required) - A JSON-serializable application-wide value.
* `id` (`:string`) - DOM id. Defaults to `"xenia-provider-<name>"`. Defaults to `nil`.

---

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