ExComponent
DSL for generating reusable and dynamic HTML components.
include ExComponent
defcontenttag(:alert, tag: :div, class: "alert", variants: [:success, :danger])
alert :success do
"Alert!"
end
#=> <div class="alert alert-success">Alert!</div>
alert(:success, "Alert!")
#=> <div class="alert alert-success">Alert!</div>This lib is a work in progress and its API might change.
Please see internal docs for extensive usage examples.
Installation
The package can be installed by adding ex_component to your list of dependencies in mix.exs:
def deps do
[
{:ex_component, "~> 0.1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_component.