Form Textarea

form my_form_config do
  form_textarea key: :foo, #...
end

Parameters

key - required

Defines the key which should be used when posting the form data to the server.

placeholder - optional

Defines the placeholder.

label - optional

Defines the label which will be rendered right before the textarea tag. You can also use the label component in order to create more complex label structures.

required - optional

If set to true, HTML validations will be triggered on form submit.

init - optional

If given, this value will be the initial value of the input. If used in an edit form of a given ActiveRecord model, the init value will be automatically derived from the model itself.

Custom Textarea

If you want to create your own textarea component, that's easily done since v.1.3.0.

  • Create your own Ruby component:

app/matestack/components/my_form_textarea.rb

  • Register your component:

app/matestack/components/registry.rb

  • Create the corresponding Vue.js component:

app/matestack/componenst/my_form_textarea.js

  • Don't forget to require the custom component JavaScript according to your JS setup!

  • Finally, use it within a form:

Last updated

Was this helpful?