phoenix_components v0.2.0 PhoenixComponents.View View Source
Link to this section Summary
Functions
Helper to render a component by name
Helper to render a component by name and a list of attributes
Helper to render a component by name and a list of attributes
Macro to generate helpers for components inside views
Link to this section Functions
Helper to render a component by name.
## Examples
<%= component :button %>
Helper to render a component by name and a list of attributes.
Note that attributes are available in the template as the map @attrs.
## Examples
<%= component :button, color: "red", size: "small", label: "Submit" %>
Helper to render a component by name and a list of attributes.
Note that attributes are available in the template as the map @attrs.
## Examples
<%= component :button, color: "red", size: "small" do %>
Submit
<% end %>
Macro to generate helpers for components inside views.
## Examples
import_components [:button, :jumbotron]
Then you can use the component directly
<%= button type: "submit" %>