BitstylesPhoenix.Form.ui_textarea
You're seeing just the function
ui_textarea
, go back to BitstylesPhoenix.Form module for more information.
Renders <textarea>
elements, with the associated <label>
s, and any errors for that field.
This is a shortcut for ui_input/3
with type: :textarea
, accepting the same options as above.
See the bitstyles textarea docs for examples of textareas and labels in use.
Textarea
iex> safe_to_string ui_textarea(@user_form, :about_me)
~s(<label for="user_about_me">About me</label><textarea id="user_about_me" name="user[about_me]">
</textarea>)
Textarea with options
iex> safe_to_string ui_textarea(@user_form, :metadata, label: "Metadata", value: "Value here", rows: 10, style: "height: auto;", label_opts: [class: "extra"])
~s(<label class="extra" for="user_metadata">Metadata</label><textarea id="user_metadata" name="user[metadata]" rows="10" style="height: auto;">
Value here</textarea>)
Textarea with hidden label
iex> safe_to_string ui_textarea(@user_form, :address, hidden_label: true)
~s(<label class="u-sr-only" for="user_address">Address</label><textarea id="user_address" name="user[address]">
</textarea>)