input_unit¶
The input_unit
macro is used to render a unit. It can be used to have more control over how the input control is rendered.
Definition¶
Input parameters¶
unit¶
string
A unit value.
Example¶
Here is an example of rendering an input control with a unit with the additional help of h-control webcomponents.
{% from "@macros/input_unit.twig" import input_unit %}
<h-control>
<h-control-label>
<label for="price">
Price
{{ input_unit('$') }}
</label>
</h-control-label>
<h-control-content>
<h-control-element>
<h-input controlId="price" controlName="price">
<h-input-control></h-input-control>
</h-input>
</h-control-element>
</h-control-content>
</h-control>
Macro source code¶
Form reference¶
-
form controls
-
checkboxes
-
inputs
-
radios
-
switches
-
textareas
-
file_picker
-
select
-