<div class="o-input o-form__item">
<label for="email">
Email
</label>
<input id="email" name="email" type="email" placeholder="Enter email address" />
<span class="o-field-note">
This is a field note.
</span>
</div>
{% set base_class = input.base_class|default('o-input') %}
{% if input.name and input.type %}
<div class="{{ bem(base_class, input.element, input.modifiers, input.extra) }}{{ input.error ? ' is-error' }}{{ input.attributes.disabled ? ' is-disabled' }} o-form__item" {{ attributes(input.container.attributes) }}>
{% if input.label %}
<label for="{{ input.name }}"{{ input.label_hidden ? ' class="is-visually-hidden"' }}>
{{ input.label }}
{% if input.attributes.required %}
<span class="o-asterisk">*</span>
{% endif %}
</label>
{% endif %}
<input id="{{ input.name }}" name="{{ input.name }}" type="{{ input.type }}" {{ attributes(input.attributes) }}/>
{% include "@field-note" with input %}
{% include "@notification" with input %}
</div>
{% endif %}
{
"input": {
"name": "email",
"label": "Email",
"type": "email",
"field_note": {
"text": "This is a field note."
},
"attributes": {
"placeholder": "Enter email address"
}
}
}
Field label and field notes aren’t yet defined in the design system, but they are included here by default.