1
0
mirror of https://github.com/tabler/tabler.git synced 2026-07-22 13:31:50 +04:00

form demos

This commit is contained in:
codecalm
2021-02-17 22:38:56 +01:00
parent 300c225636
commit 9246295721
9 changed files with 128 additions and 83 deletions
+15
View File
@@ -37,6 +37,21 @@ forms:
form-helpers:
title: Form helpers
url: docs/form-helpers.html
validation-states:
title: Validation states
url: docs/form-validation.html
image-check:
title: Image check
url: docs/form-image-check.html
color-check:
title: Color check
url: docs/form-color-check.html
selectboxes:
title: Form selectboxes
url: docs/form-selectboxes.html
fieldset:
title: Form fieldset
url: docs/form-fieldset.html
components:
+21
View File
@@ -0,0 +1,21 @@
---
title: Color check
menu: docs.forms.color-check
---
Your input controls can come in a variety of colors, depending on your preferences. Click [here]({% docs_url colors %}) to see the list of available colors.
{% capture code %}
{% include parts/form/input-color.html %}
{% endcapture %}
{% include example.html code=code %}
## Input color picker
Add an color picker to your form to let users customise it according to their preferences.
{% capture code %}
{% include parts/form/input-colorpicker.html %}
{% endcapture %}
{% include example.html code=code %}
-80
View File
@@ -79,26 +79,6 @@ Add one of the available selects - either a dropdown or a multiple choice select
{% include example.html code=code %}
## Validation states
To inform users whether the entered value is correct or not, use either of the validation states. Thanks to that, users will immediately know which form elements they need to correct and, if the state displays as invalid, why the value is incorrect.
{% capture code %}
{% include parts/form/validation-states.html %}
{% endcapture %}
{% include example.html code=code %}
### Subtle validation states
If you prefer a more subtle manner of informing users of the input control validation state, you can use tick and cross symbols and resign from colored control frames and the validation feedback.
{% capture code %}
{% include parts/form/validation-states.html lite=true %}
{% endcapture %}
{% include example.html code=code %}
## Input size
Choose the size of an input control that will go well with your form design. Apart from the default size, you can also use small and large input controls.
@@ -109,35 +89,6 @@ Choose the size of an input control that will go well with your form design. Apa
{% include example.html code=code %}
## Image check
Add an image check to your form and give users visually attractive options to choose from.
{% capture code %}
{% include parts/form/input-image.html %}
{% endcapture %}
{% include example.html code=code max-width="25rem" %}
## Input color
Your input controls can come in a variety of colors, depending on your preferences. Click [here]({% docs_url colors %}) to see the list of available colors.
{% capture code %}
{% include parts/form/input-color.html %}
{% endcapture %}
{% include example.html code=code %}
## Input color picker
Add an color picker to your form to let users customise it according to their preferences.
{% capture code %}
{% include parts/form/input-colorpicker.html %}
{% endcapture %}
{% include example.html code=code %}
## Datalists
@@ -149,27 +100,6 @@ Use the ``datalist`` element to add an autocomplete feature to your input contro
{% include example.html code=code %}
## Custom selectboxes
Add selectboxes to make your form more intuitive by providing users with a set of options to choose from. You can add simple selectboxes with a label, use icons only or icons with labels. Alternatively, you can use pill selectboxes if they go well with your design.
{% capture code %}
{% include parts/form/input-selectgroups.html %}
{% endcapture %}
{% include example.html code=code %}
## Advanced selectboxes
Use more advanced selectboxes to display the range of available options. You can choose selectboxes with radio buttons, if you want users to select only one option or with checkboxes, if they are allowed to choose multiple options.
{% capture code %}
{% include parts/form/selectgroup-payments.html %}
{% include parts/form/selectgroup-project-manager.html %}
{% endcapture %}
{% include example.html code=code %}
## Toggle switches
Use toggle switches for the elements of your form which require choosing between two opposing states.
@@ -213,16 +143,6 @@ Add a range slider to make it possible for users to set a value or range, such a
{% include example.html code=code %}
## Fieldset
Group parts of your form to make it well-structured and clearer for users, using the ``fieldset`` element.
{% capture code %}
{% include parts/form/fieldset.html %}
{% endcapture %}
{% include example.html code=code %}
## Input group
Create a group of input controls and place add-ons on either side of an input.
+11
View File
@@ -0,0 +1,11 @@
---
title: Form fieldset
menu: docs.forms.fieldset
---
Group parts of your form to make it well-structured and clearer for users, using the ``fieldset`` element.
{% capture code %}
{% include parts/form/fieldset.html %}
{% endcapture %}
{% include example.html code=code %}
+17
View File
@@ -0,0 +1,17 @@
---
title: Image check
menu: docs.forms.image-check
---
Add an image check to your form and give users visually attractive options to choose from.
{% capture code %}
{% include parts/form/input-image.html %}
{% endcapture %}
{% include example.html code=code max-width="25rem" %}
{% capture code %}
{% include parts/form/input-image-people.html %}
{% endcapture %}
{% include example.html code=code %}
+23
View File
@@ -0,0 +1,23 @@
---
title: Form selectboxes
menu: docs.forms.selectboxes
---
Add selectboxes to make your form more intuitive by providing users with a set of options to choose from. You can add simple selectboxes with a label, use icons only or icons with labels. Alternatively, you can use pill selectboxes if they go well with your design.
{% capture code %}
{% include parts/form/input-selectgroups.html %}
{% endcapture %}
{% include example.html code=code %}
## Advanced selectboxes
Use more advanced selectboxes to display the range of available options. You can choose selectboxes with radio buttons, if you want users to select only one option or with checkboxes, if they are allowed to choose multiple options.
{% capture code %}
{% include parts/form/selectgroup-payments.html %}
{% include parts/form/selectgroup-project-manager.html %}
{% endcapture %}
{% include example.html code=code %}
+20
View File
@@ -0,0 +1,20 @@
---
title: Validation states
menu: docs.forms.validation-states
description: To inform users whether the entered value is correct or not, use either of the validation states. Thanks to that, users will immediately know which form elements they need to correct and, if the state displays as invalid, why the value is incorrect.
---
{% capture code %}
{% include parts/form/validation-states.html %}
{% endcapture %}
{% include example.html code=code %}
## Subtle validation states
If you prefer a more subtle manner of informing users of the input control validation state, you can use tick and cross symbols and resign from colored control frames and the validation feedback.
{% capture code %}
{% include parts/form/validation-states.html lite=true %}
{% endcapture %}
{% include example.html code=code %}
+3 -3
View File
@@ -15,8 +15,8 @@
<label class="form-label">Phone number</label>
<input type="tel" class="form-control" autocomplete="off"/>
</div>
<div class="form-check">
<label class="form-check">
<input type="checkbox" class="form-check-input"/>
<label class="form-check-label required">I agree to the Terms & Conditions</label>
</div>
<span class="form-check-label required">I agree to the Terms & Conditions</span>
</label>
</fieldset>
@@ -0,0 +1,18 @@
{% assign limit = include.limit | default: 9 %}
<div class="mb-3">
<label class="form-label">Person Check</label>
<div class="row g-2">
{% for person in site.data.people limit: limit offset: 8 %}
<div class="col-auto">
<label class="form-imagecheck mb-2">
<input name="form-imagecheck" type="checkbox" value="{{ forloop.index }}" class="form-imagecheck-input" {% if forloop.index == 2 or forloop.index == 4 or forloop.index == 7 %} checked{% endif %}/>
<span class="form-imagecheck-figure">
<span class="form-imagecheck-image">
{% include ui/avatar.html size="md" person=person %}
</span>
</span>
</label>
</div>
{% endfor %}
</div>
</div>