Aurora.Uix.Renderers (Aurora UIX v0.1.5)

Copy Markdown

Resolves a field's renderer to the arity-1 function to call for a given layout type.

This is the single, layout-type-aware entry point used by both the index and the field renderers. Given a field and the layout type, it applies the slot precedence and always returns a function (assigns) -> Phoenix.LiveView.Rendered.t():

  • :indexindex_renderer → default (index is independent — no renderer fallback)
  • :formedit_rendererrenderer → default
  • :showshow_rendererrenderer → default

Each slot value is a function or a predefined-renderer atom (resolved to its &render/1 via the catalog). An unknown atom or an empty slot falls through to the default. The catalog is Aurora.Uix.Renderers.BuiltIn merged with the host registrar configured under config :aurora_uix, :renderers (host keys win). Resolution happens at call time via Application.get_env/2, mirroring the component override mechanism — no recompile is needed when the host registrar changes.

Summary

Types

An arity-1 renderer function.

Functions

Returns the merged catalog of renderer name atoms to render functions (built-ins overridden by any host entry with the same key).

Renders assigns with the default renderer. Used by predefined renderers to delegate a layout type they do not specialise.

Returns the render function to call for field in the given layout type, applying the slot precedence. Always returns a function (the default renderer when no slot matches).

Types

render_fun()

@type render_fun() :: (map() -> Phoenix.LiveView.Rendered.t())

An arity-1 renderer function.

Functions

all()

@spec all() :: %{required(atom()) => render_fun()}

Returns the merged catalog of renderer name atoms to render functions (built-ins overridden by any host entry with the same key).

default(assigns)

@spec default(map()) :: Phoenix.LiveView.Rendered.t()

Renders assigns with the default renderer. Used by predefined renderers to delegate a layout type they do not specialise.

resolve(field, atom)

Returns the render function to call for field in the given layout type, applying the slot precedence. Always returns a function (the default renderer when no slot matches).