<div class="n7-input-field gap-1 ">
<label for="" class="n7-input-field__label">
Text label
</label>
<div class="n7-input">
<input id="" class="text-sm n7-input-placeholder" type="text">
</div>
</div>
<div class="n7-input-field{% if gap %} {{ gap }}{% else %} gap-1{% endif %}{% if classes %} {{ classes }}{% endif %} {% if input.hasError %} has-error{% endif %}">
<label for="{{ input.id }}" class="n7-input-field__label{% if hiddenLabel %} n7-sr-only{% endif %}{% if labelClasses %} {{ labelClasses }}{% endif %}">
{{ label }}
{% if input.fieldRequired %}
<abbr class="n7-font-bold n7-no-underline" title="obbligatorio">*</abbr>
{% endif %}
</label>
{% block input %}
{% render '@input', input, true %}
{% endblock %}
{% if input.fieldRequired or input.ariaDescribedBy or input.hasErrorControl %}
<span class="n7-input-field__hint">
{% if input.fieldRequired or input.hasErrorControl %}
<span class="n7-input-field__error" id="{{ input.id }}Error" aria-live="assertive">
{{ errorDescription }}
</span>
{% endif %}
{% if inputDescription %}
<span class="n7-input-field__description" id="{{ input.ariaDescribedBy }}">
{{ inputDescription }}
</span>
{% endif %}
</span>
{% endif %}
</div>
{
"label": "Text label",
"inputId": "inputId"
}
/**
* INPUT FIELD
*
*/
@layer components {
.n7-input-field {
@apply grid content-start;
}
.n7-input-field__label {
@apply block text-sm font-bold n7-content-03;
}
legend:where(.n7-input-field__label) {
@apply mb-1;
}
.n7-input-field__error {
@apply n7-body-sm font-medium n7-content-error;
}
.n7-input-field__description {
@apply n7-body-sm font-medium n7-content-03;
}
.n7-input-field.has-error input {
@apply border-2 n7-border-error-dark;
}
/* INPUT FIELD INLINE */
.n7-field-inline {
@apply flex items-center gap-2;
}
.n7-field-inline .n7-input,
.n7-field-inline .n7-select {
@apply flex-1;
}
}
Composite input field component. Include input component, customized if needed with parameteres:
Blocks: