quetzal v0.1.4 Quetzal.Component behaviour View Source

The base module to make input components with custom action events

You can create input components or html components from this module, using into your own definition. Use the module options to set the built-in custom tags for events or tagging html components, also you can pass keywords as options to render into the tag.

Example:

Create an input text to capture an string:

defmodule MyComponent.Text do
  use Quetzal.Component,
    tag: "input"
    type: "text"
end

And let's use in this way:

iex(10)> MyComponent.Text.html_tag([id: "mytext"])
"<input id="mytext" type="text" phx-change="mytext"></input>"

Link to this section Summary

Link to this section Callbacks