Defines a social card using HEEx, HTML, and CSS.
A card implements metadata/1 and render/1. Using this module also imports
Phoenix.Component, so ~H and component attributes are available.
Summary
Callbacks
Returns Open Graph and Twitter/X metadata for the card assigns.
Returns the HEEx representation that OgEx sends to the configured renderer.
Returns the stable data used to version the generated image.
Functions
Configures a module as an OgEx card.
Types
Callbacks
Returns Open Graph and Twitter/X metadata for the card assigns.
@callback render(assigns :: map()) :: Phoenix.LiveView.Rendered.t()
Returns the HEEx representation that OgEx sends to the configured renderer.
Returns the stable data used to version the generated image.
This callback is optional. When omitted, OgEx versions the complete assigns map.
Functions
Configures a module as an OgEx card.
Supported options are :width, :height, and :format. Formats may be
:png, :jpeg, :webp, or :svg. The macro imports Phoenix.Component,
records the render dimensions, and installs the OgEx.Card behaviour.