Input
The HTML <input>
tag, implemented in Ruby.
If you want to use the input
in context of a matestack form
, please use form_input
documented here
Parameters
This component can take various optional configuration params and either yield content or display what gets passed to the text
configuration param.
Input (optional)
Expects a symbol with that specifies the input type.
HMTL attributes (optional)
This component accepts all the canonical HTML global attributes like id
or class
.
Examples
Example 1: Basic usage as text input
input type: :text, id: "foo", class: "bar"
returns
<input type="text" id="foo" class="bar" />
Example 2: Email input
input type: :email, id: "foo", class: "bar"
returns
<input type="email" />
Example 3: Range input
input type: :range, attributes: { min: 0, max: 10, step: 0.5 }
returns
<input max="10" min="0" step="0.5" type="range" />
Last updated
Was this helpful?