You would do this when you want to avoid a lot of work with tweaking font sizes at certain breakpoints to make everything demanded by users fit without wrapping.
I guess that's why Google Sites uses this pattern as a default for their navigation.
This duplicates the behavior of the Sites approach in that we collapse the entire menu down on portrait mobile – turn your phone sideways to see the effect if visiting on mobile.
PHOTO GALLERY Bootstrap 5 and Fancybox 4
NOTE: Fancybox-4 is still in Alpha. Be sure to check CDN for updates before using in production.
Bootstrap Maxlength is a visual feedback indicator for the maxlength attribute. For more info please visit the plugin's
Homeor
Github Repo.
Usage
Bootstrap Maxlength's Javascript files are bundled in the global plugin bundles and globally included in all pages. However, the maxlength functionality requires a manual Javascript initialization.
<labelclass="form-label">Basic example</label><inputtype="text"class="form-control"id="kt_docs_maxlength_basic"maxlength="10"/><spanclass="fs-6 text-muted">The badge will show up by default when the remaining chars are 3 or less</span>
Threshold
An example of Bootstrap Maxlength with a treshold option. The
thresholdoption is to set the minimum number of characters that will display the badge.
Set threshold value to show there are 20 chars or less left
<labelclass="form-label">Threshold example</label><inputtype="text"class="form-control"id="kt_docs_maxlength_threshold"maxlength="25"/><spanclass="fs-6 text-muted">Set threshold value to show there are 20 chars or less left</span>
Always Show
An example of Bootstrap Maxlength with an always show option. Add
alwaysShow: truein the Javascript.
<labelclass="form-label">Threshold example</label><inputtype="text"class="form-control"id="kt_docs_maxlength_always_show"maxlength="20"/><spanclass="fs-6 text-muted">Show the counter on input focus</span>
Custom Text
An example of Bootstrap Maxlength with some custom text in the badge. Please refer to the code sample below for the JS options.
$('#kt_docs_maxlength_custom_text').maxlength({threshold:20,warningClass:"badge badge-danger",limitReachedClass:"badge badge-success",separator:' of ',preText:'You have ',postText:' chars remaining.',validate:true});
<labelclass="form-label">Custom text example</label><inputtype="text"class="form-control"id="kt_docs_maxlength_custom_text"maxlength="20"/><spanclass="fs-6 text-muted">Display custom text on input focus</span>
Textarea
Bootstrap Maxlength can also be applied to
textarea.
Bootstrap maxlength supports textarea as well as inputs
<labelclass="form-label">Textarea example</label><textareaclass="form-control"id="kt_docs_maxlength_textarea"maxlength="20"placeholder=""rows="6"></textarea><spanclass="fs-6 text-muted">Bootstrap maxlength supports textarea as well as inputs</span>
Set Position
Here's an example of predefining the badge position, relative to the input.
The field counter can be positioned at the top, bottom, left or right.
<labelclass="form-label">Set Position example</label><inputtype="text"class="form-control"id="kt_docs_maxlength_position_top_left"maxlength="20"/><inputtype="text"class="form-control"id="kt_docs_maxlength_position_top_right"maxlength="20"/><inputtype="text"class="form-control"id="kt_docs_maxlength_position_bottom_left"maxlength="20"/><inputtype="text"class="form-control"id="kt_docs_maxlength_position_bottom_right"maxlength="20"/><spanclass="fs-6 text-muted">The field counter can be positioned at the top, bottom, left or right.</span>
Modal Example
Use Date Range Picker within Bootstrap Modal:
Modal title
The badge will show up by default when the remaining chars are 10 or less
<!--begin::Modal--><divclass="modal fade"tabindex="-1"id="kt_modal_1"><divclass="modal-dialog"><divclass="modal-content"><divclass="modal-header"><h5class="modal-title">Modal title</h5><!--begin::Close--><divclass="btn btn-icon btn-sm btn-active-light-primary ms-2"data-bs-dismiss="modal"aria-label="Close"><spanclass="svg-icon svg-icon-2x"></span></div><!--end::Close--></div><divclass="modal-body"><labelclass="form-label">Basic example</label><inputtype="text"class="form-control mb-3"id="kt_docs_maxlength_basic"maxlength="10"/><spanclass="fs-6 text-muted">The badge will show up by default when the remaining chars are 10 or less</span></div><divclass="modal-footer"><buttontype="button"class="btn btn-light"data-bs-dismiss="modal">Close</button><buttontype="button"class="btn btn-primary">Save changes</button></div></div></div></div><!--end::Modal-->