Input
Default type text
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "First Name", }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">First Name</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="text"> </span> </div>
Phone
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "Phone type", type: "tel" }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">Phone type</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="tel"> </span> </div>
Password
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "Password type", type: "password" }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">Password type</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="password"> </span> </div>
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "Email type", type: "email" }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">Email type</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="email"> </span> </div>
Url
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "Url type", type: "url" }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">Url type</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="url"> </span> </div>
Search
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "Search type", type: "search" }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">Search type</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="search"> </span> </div>
Required
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "Required", required: true }} %} -
<div class="f-wrap "> <label class="f-label --required"> <span class="f-label__title">Required</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="text"> </span> </div>
Without label
Placeholder
-
-
{% include "@Components/forms/input-field/input-field.twig" with {props: { label: "With Placeholder", placeholder: "Enter your first name" }} %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">With Placeholder</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="text" placeholder="Enter your first name"> </span> </div>
Value
-
-
{% include "@Components/forms/input-field/input-field.twig" with { props: { label: "With value", value: "prefilled value" } } %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">With value</span> </label> <span class="f-input__wrapper "> <input class="f-base" type="text" value="prefilled value"> </span> </div>
With icon
-
-
{% include "@Components/forms/input-field/input-field.twig" with { props: { label: "With icon", placeholder: "Jmeno a prijmeni", icon: { src: 'images/svg/user.svg', } } } %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">With icon</span> </label> <span class="f-input__wrapper --with-icon"> <input class="f-base" type="text" placeholder="Jmeno a prijmeni"> <span class="input__icon" aria-hidden="true"> <span class="icon"> <img src="images/svg/user.svg" loading="lazy"> </span> </span> </span> </div>
Datepicker
-
-
{% include "@Components/forms/input-field/input-field.twig" with { props: { label: "Date", type: 'date', icon: { src: 'images/svg/calendar-home.svg', } } } %} -
<div class="f-wrap "> <label class="f-label"> <span class="f-label__title">Date</span> </label> <span class="f-input__wrapper --with-icon"> <input class="f-base --datepicker" type="text"> <span class="input__icon" aria-hidden="true"> <span class="icon"> <img src="images/svg/calendar-home.svg" loading="lazy"> </span> </span> </span> </div>
Icon on the right (decorative)
-
-
{% include "@Components/forms/input-field/input-field.twig" with { props : { id: "input-watchdog-name", name: "watchdog-name", label: "Název hlídače", value: "Domy České Budějovice", icon: { src: "svg/user-section/pencil.svg", position: "right", insertAsSvg: true } } } %} -
<div class="f-wrap "> <label class="f-label" for="input-watchdog-name"> <span class="f-label__title">Název hlídače</span> </label> <span class="f-input__wrapper --with-icon-right"> <input class="f-base" type="text" id="input-watchdog-name" value="Domy České Budějovice" name=watchdog-name> <span class="input__icon" aria-hidden="true"> <span class="icon"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.4 3.6l3 3L8 15H5v-3l8.4-8.4z"/></svg> </span> </span> </span> </div>
Schema
{
"props": {
"label": {
"type": "string",
"description": "Label of the input"
},
"id": {
"type": "string",
"description": "Id of the input (also links the label)"
},
"name": {
"type": "string",
"description": "Name attribute"
},
"type": {
"type": "string",
"description": "text (default) | email | password | url | tel | search | date"
},
"value": {
"type": "string",
"description": "Value attribute"
},
"placeholder": {
"type": "string",
"description": "Placeholder"
},
"required": {
"type": "boolean",
"description": "Marks the label as required"
},
"autocomplete": {
"type": "boolean",
"description": "true = on | false = off"
},
"icon": {
"type": "object",
"description": "{ src, position: left (default) | right, insertAsSvg } – ikona uvnitř pole; vpravo je dekorativní a klik na ni fokusuje input"
},
"background": {
"type": "string",
"description": "gray-100"
},
"variant": {
"type": "string",
"description": "highlited"
},
"validators": {
"type": "object",
"description": "Config for form validation (data-validators)"
},
"attributes": {
"type": "array",
"description": "Raw attributes appended to the input"
},
"extraClass": {
"type": "string",
"description": "Extra CSS class on the input"
}
}
}