You're seeing just the function set_component_attributes, go back to PhxComponentHelpers module for more information.
Link to this function

set_component_attributes(assigns, attributes, opts \\ [])

View Source

Extends assigns with raw_* attributes that can be interpolated within your component markup.


  • assigns - your component assigns
  • attributes - a list of attributes (atoms) that will be fetched from assigns. Attributes can either be single atoms or tuples in the form {:atom, default} to provide default values.


  • :required - raises if required attributes are absent from assigns
  • :json - when true, will JSON encode the assign value
  • :into - merges all assigns in a single one that can be interpolated at once


|> set_component_attributes(
    [:id, :name, label: "default label"],
    required: [:id, :name],
    into: :attributes
|> set_component_attributes([:value], json: true)

assigns now contains @raw_id, @raw_name, @raw_label and @raw_value. It also contains @raw_attributes which holds the values if :id, :name and :label.