PhoenixPaper.Components (PhoenixPaper v0.1.0)

Copy Markdown View Source

use PhoenixPaper.Components imports every PhoenixPaper component (pp_button/1, pp_card/1, pp_icon/1, pp_checkbox/1, ...) at once.

Add it next to your app's own core_components import, typically in the html_helpers block of lib/my_app_web.ex:

defp html_helpers do
  quote do
    use PhoenixPaper.Components
    # ... existing imports ...
  end
end

Every function is prefixed pp_ so it never collides with Phoenix's generated core_components.ex (button/1, input/1, icon/1, ...) or with daisyUI class names.

PhoenixPaper.Autocomplete and PhoenixPaper.TransferList need interactive state, so they're Phoenix.LiveComponents instead of function components — use them directly with <.live_component module={...} />, they aren't imported here.