<!-- FIELD Component -->
<div class="kx-form__element">
<input class="kx-field kx-field--size-base" id="--38274" type="color" value="#03A2F8" />
<label class="kx-label" for="--38274">
Label
</label>
</div>
{%- if id -%}
{% set random_number = range(0, 100000) | random -%}
{% set id = id | replace(' ', '-') | lower + '--' + random_number -%}
{%- else -%}
{% set random_number = range(0, 100000) | random -%}
{% set id = label | replace(' ', '-') | lower + '--' + random_number -%}
{% endif -%}
<!-- FIELD Component -->
<div class="kx-form__element{% for class in classes %} {{ class }}{% endfor %}">
{% if hint -%}
<span class="kx-form__hint">
<span class="kx-form__hint__txt">{{ hint }}</span>
</span>
{% endif -%}
{% if error -%}
<span class="kx-form__hint kx-form__hint--error">
{% render '@icon', { symbol: 'warning', size: 'small' } %}
<span class="kx-form__hint__txt">{{ error }}</span>
</span>
{% endif -%}
<input class="kx-field{% if size %} kx-field--size-{{ size }}{% endif %}{% if hideSpinBtn == true %} kx-hide-spin-button{% endif %}{{ ' kx-is-invalid' if error }}{{ ' kx-hide-required' if hideRequired }}" id="{{ id }}" type="{{ type }}"{% if placeholder %} placeholder="{{ placeholder }}"{% endif %}{% if value %} value="{{ value }}"{% endif %}{{ ' disabled="disabled"' if disabled }}{{ ' required="required"' if required }}{{ ' readonly' if readonly }}{% if type == 'range' %} step="any"{% endif %} />
<label class="kx-label{% if hideLabel == true %} kx-is-vishidden{% endif %}" for="{{ id }}">
{{ labelTxt }}{%- if optionalTxt %}<span class="kx-form__optional">({{ optionalTxt }})</span>{% endif %}
</label>
</div>
{
"element": "input",
"type": "text",
"id": null,
"classes": null,
"name": null,
"labelTxt": null,
"hideLabel": null,
"hideSpinBtn": null,
"required": null,
"hideRequired": null,
"readonly": null,
"optional": null,
"value": null,
"disabled": null,
"placeholder": null,
"hint": null,
"error": null,
"size": "base",
"regex": null
}
- Handle: @input
- Variants (6): Type Color , Type Date , Type Month , Type Text , Type Time , Type Url
- Preview:
- Filesystem Path: src\components\form\input\input.njk
- References (1): @icon
There are no notes for this item.