Inputs / Form Inputs - 图1

Inputs / Form Inputs

Form inputs allow you to create flexible and beautiful Form layouts.

Inputs Layout

It is recommended to use inputs with List View:

  1. <div class="list">
  2. <ul>
  3. ...
  4. <li class="item-content item-input">
  5. <div class="item-media">... icon/image here ...</div>
  6. <div class="item-inner">
  7. <div class="item-input-wrap">
  8. <input type="text" name="name">
  9. <span class="input-clear-button"></span>
  10. </div>
  11. </div>
  12. </li>
  13. ...
  14. </ul>
  15. </div>

Where:

  • item-input - required additional class on item-content. Required for correct input item layout

  • item-label - additional class on item-title required to display label correctly

  • item-input-wrap - required additional input wrapper. Must be a direct child of item-inner

  • <span class="input-clear-button"> - button that will clear input value in click. Optional

Stacked Labels

By default inputs list is displayed with stacked labels. Stacked labels always appear on top of the input:

  1. <div class="list">
  2. <ul>
  3. ...
  4. <li class="item-content item-input">
  5. <div class="item-media">... icon/image here ...</div>
  6. <div class="item-inner">
  7. <div class="item-title item-label">Name</div>
  8. <div class="item-input-wrap">
  9. <input type="text" name="name">
  10. <span class="input-clear-button"></span>
  11. </div>
  12. </div>
  13. </li>
  14. ...
  15. </ul>
  16. </div>

Where:

  • item-title item-label - input label

Inline Labels

If you want to use inline labels then you can additional inline-labels class to the whole list or inline-label class to the single item:

  1. <div class="list inline-labels">
  2. <ul>
  3. ...
  4. <li class="item-content item-input">
  5. <div class="item-media">... icon/image here ...</div>
  6. <div class="item-inner">
  7. <div class="item-title item-label">Name</div>
  8. <div class="item-input-wrap">
  9. <input type="text" name="name">
  10. <span class="input-clear-button"></span>
  11. </div>
  12. </div>
  13. </li>
  14. ...
  15. </ul>
  16. </div>
  17. <!-- or just to single item -->
  18. <div class="list">
  19. <ul>
  20. ...
  21. <!-- additional "inline-label" class -->
  22. <li class="item-content item-input inline-label">
  23. ...
  24. </li>
  25. ...
  26. </ul>
  27. </div>

Floating Labels

To add floating label, we need to use item-floating-label class instead of item-label.

  1. <div class="list">
  2. <ul>
  3. ...
  4. <li class="item-content item-input">
  5. <div class="item-media">... icon/image here ...</div>
  6. <div class="item-inner">
  7. <!-- "item-floating-label" class on item title -->
  8. <div class="item-title item-floating-label">Name</div>
  9. <div class="item-input-wrap">
  10. <input type="text" name="name">
  11. <span class="input-clear-button"></span>
  12. </div>
  13. </div>
  14. </li>
  15. ...
  16. </ul>
  17. </div>

Outline Inputs

To make input “outline” (with border around input) we need to add item-input-outline class to main list input element:

  1. <div class="list">
  2. <ul>
  3. ...
  4. <!-- additional "item-input-outline" class -->
  5. <li class="item-content item-input item-input-outline">
  6. <div class="item-inner">
  7. <div class="item-title item-label">Name</div>
  8. <div class="item-input-wrap">
  9. <input type="text" name="name">
  10. <span class="input-clear-button"></span>
  11. </div>
  12. </div>
  13. </li>
  14. ...
  15. </ul>
  16. </div>

Item Info

It is also possible to additional information about form input:

  1. <div class="list">
  2. <ul>
  3. ...
  4. <!-- additional "item-input-with-info" class on item -->
  5. <li class="item-content item-input item-input-with-info">
  6. <div class="item-media">... icon/image here ...</div>
  7. <div class="item-inner">
  8. <div class="item-title item-label">Name</div>
  9. <div class="item-input-wrap">
  10. <input type="text" name="name">
  11. <span class="input-clear-button"></span>
  12. <!-- element with additional information -->
  13. <div class="item-input-info">Some information about input field</div>
  14. </div>
  15. </div>
  16. </li>
  17. ...
  18. </ul>
  19. </div>

Where:

  • item-input-with-info - required additional class on input item

  • <div class="item-input-info">...</div> - element with additional information

Input Dropdown

It is also possible to indicate dropdown input (like select) with additional input-dropdown-wrap class. It will add small dropdown icon on the right (▼):

  1. <div class="list">
  2. <ul>
  3. ...
  4. <li class="item-content item-input">
  5. <div class="item-media">... icon/image here ...</div>
  6. <div class="item-inner">
  7. <div class="item-title item-label">Name</div>
  8. <!-- additional "input-dropdown-wrap" class -->
  9. <div class="item-input-wrap input-dropdown-wrap">
  10. <select>
  11. ...
  12. </select>
  13. </div>
  14. </div>
  15. </li>
  16. ...
  17. </ul>
  18. </div>

Supported Inputs

Here is the list of input elements that you can put inside of item-input-wrap:

All text inputsSupported types: text, password, email, tel, url, date, number, datetime-local
  1. <div class=”item-input-wrap”>
  2. <input type=”text”>
  3. </div>
  4. <div class=”item-input-wrap”>
  5. <input type=”email”>
  6. </div>
Select
  1. <div class=”item-input-wrap”>
  2. <select>…</select”>
  3. </div>
Textarea
  1. <div class=”item-input-wrap”>
  2. <textarea></textarea>
  3. </div>
Range Slider
  1. <div class=”item-input-wrap”>
  2. <div class=”range-slider”>
  3. <input type=”range min=”0 max=”100 step=”0.1”>
  4. </div>
  5. </div>

Resizable Textarea

To make textarea automatically resize based on its content we may just add resizable class:

  1. <textarea class="resizable"></textarea>

Validation

Framework7 supports HTML5 validation based on validity input property. With enabled validation, there will appear validation error messages in case of input has invalid value.

To enable validation we must add: required and validate attributes to the input element.

If we need input validation only on blur event, then we need to add data-validate-on-blur="true" attribute.

Value validation depends on input type. For example input type="email" will be validated to match email pattern, etc. It is default browser behavior. In case you want to add custom rule to validate input value, then it must be done using pattern input attribute:

  1. <!-- default validation, check for value is not empty -->
  2. <input type="text" placeholder="Your name" required validate>
  3. <!-- default email validation, value must be email -->
  4. <input type="email" placeholder="Your e-mail" required validate>
  5. <!-- default url validation -->
  6. <input type="url" placeholder="Your URL" required validate>
  7. <!-- pattern validation, value must be "apple" or "banana" -->
  8. <input type="text" required validate pattern="apple|banana" placeholder="Type 'apple' or 'banana'" >
  9. <!-- pattern validation with custom error message, value must be numbers only -->
  10. <input type="text" placeholder="Enter number" required validate pattern="[0-9]*" data-error-message="Only numbers please!">
  11. <!-- this input will be validated only on blur -->
  12. <input type="text" placeholder="Your name" required validate data-vaildate-on-blur="true">

Input State Classes

There are several classes that can be added to input element depending on its state and content:

  • input-with-value - will be added to input when it has value
  • input-focused - will be added to input when it is focused
  • input-invalid - will be added to input when its value is not valid

Same states will be added to input’s parent item-input element:

  • item-input-with-value - will be added to input item when its input has value
  • item-input-focused - will be added to input item when its input is focused
  • item-input-invalid - will be added to input item when its input’s value is not valid

Input App Parameters

It is possible to control some default input behavior using global app parameters where we can pass input-related parameters under input property:

ParameterTypeDefaultDescription
scrollIntoViewOnFocusbooleanWhen enabled will scroll input into view on input focus. By default it is enabled for android devices only, as it helps to solve issue when on-screen keyboard may overlap the input
scrollIntoViewCenteredbooleanfalseTweaks behavior of previous parameter to scroll input into the center of view on input focus
scrollIntoViewDurationnumber0Default duration for scrolling input into view
scrollIntoViewAlwaysbooleanfalseWhen enabled will scroll input into view no matter is it outside of view or not

For example:

  1. var app = new Framework7({
  2. input: {
  3. scrollIntoViewOnFocus: true,
  4. scrollIntoViewCentered: true,
  5. }
  6. });

Input App Methods

We can use following app methods available to control Inputs:

app.input.scrollIntoView(inputEl, duration, centered, force)Scroll input into view
  • inputEl - HTMLElement or string (with CSS Selector) of required input element to get into view. Required
  • duration - number - scrolling duration in ms.
  • centered - boolean - defines whether it must be scrolled into the center of view or not.
  • force - boolean - scrolls input into view no matter is it outside of view or not.
app.input.focus(inputEl)Will add additional required styles and classes on input like when it is focused
  • inputEl - HTMLElement or string (with CSS Selector) of required input element. Required.
app.input.blur(inputEl)Will remove additional required styles and classes on input like when it loses focus
  • inputEl - HTMLElement or string (with CSS Selector) of required input element. Required.
app.input.resizeTextarea(textareaEl)Force resizable textarea to resize depending on its content
  • textareaEl - HTMLElement or string (with CSS Selector) of required textarea element. Required.
app.input.checkEmptyState(inputEl)Recalculate required additional styles and classes on input element based on whether it has value or not
  • inputEl - HTMLElement or string (with CSS Selector) of required textarea element. Required.
app.input.validate(inputEl)Validate input
  • inputEl - HTMLElement or string (with CSS Selector) of required textarea element. Required.
app.input.validateInputs(containerEl)Validate all inputs in passed container
  • containerEl - HTMLElement or string (with CSS Selector) of required element with inputs inside to validate. Required.

Input Events

Inputs will fire the following DOM events input elements:

EventTargetDescription
textarea:resizeTextarea Element<textarea class=”resizable”>Event will be triggered after resizable textarea resized. event.detail will contain object with the initialHeight, currentHeight and scrollHeight properties
input:notemptyInput Element<input/textarea>Event will be triggered when input value becomes not empty
input:emptyInput Element<input/textarea>Event will be triggered when input value becomes empty
input:clearInput Element<input/textarea>Event will be triggered after input value will be cleared by clicking on input clear button

CSS Variables

Below is the list of related CSS variables (CSS custom properties).

Note that commented variables are not specified by default and their values is what they fallback to in this case.

  1. :root {
  2. --f7-input-bg-color: transparent;
  3. --f7-label-font-weight: 400;
  4. --f7-label-line-height: 1.2;
  5. --f7-input-padding-left: 0px;
  6. --f7-input-padding-right: 0px;
  7. --f7-input-error-text-color: #ff3b30;
  8. --f7-input-error-font-size: 12px;
  9. --f7-input-error-line-height: 1.4;
  10. --f7-input-error-font-weight: 400;
  11. --f7-input-info-font-size: 12px;
  12. --f7-input-info-line-height: 1.4;
  13. --f7-input-outline-height: 40px;
  14. --f7-input-outline-border-color: #999;
  15. --f7-input-outline-border-radius: 4px;
  16. --f7-input-outline-padding-horizontal: 12px;
  17. --f7-textarea-height: 100px;
  18. /*
  19. --f7-input-outline-focused-border-color: var(--f7-theme-color);
  20. --f7-input-outline-invalid-border-color: var(--f7-input-error-text-color);
  21. */
  22. }
  23. :root .theme-dark,
  24. :root.theme-dark {
  25. --f7-input-outline-border-color: #444;
  26. }
  27. .ios {
  28. --f7-input-height: 44px;
  29. --f7-input-text-color: #000000;
  30. --f7-input-font-size: 17px;
  31. --f7-input-placeholder-color: #a9a9a9;
  32. --f7-textarea-padding-vertical: 11px;
  33. /*
  34. --f7-input-focused-border-color: var(--f7-list-item-border-color);
  35. --f7-input-invalid-border-color: var(--f7-list-item-border-color);
  36. --f7-input-invalid-text-color: var(--f7-input-error-text-color);
  37. */
  38. --f7-label-font-size: 12px;
  39. --f7-label-text-color: inherit;
  40. /*
  41. --f7-label-focused-text-color: var(--f7-label-text-color);
  42. --f7-label-invalid-text-color: var(--f7-label-text-color);
  43. */
  44. --f7-floating-label-scale: calc(17 / 12);
  45. --f7-inline-label-font-size: 17px;
  46. --f7-inline-label-line-height: 1.4;
  47. --f7-inline-label-padding-top: 3px;
  48. --f7-input-info-text-color: #8e8e93;
  49. --f7-input-clear-button-size: 14px;
  50. --f7-input-clear-button-color: #8e8e93;
  51. }
  52. .ios .theme-dark,
  53. .ios.theme-dark {
  54. --f7-input-text-color: #fff;
  55. }
  56. .md {
  57. --f7-input-height: 36px;
  58. --f7-input-text-color: #212121;
  59. --f7-input-font-size: 16px;
  60. --f7-input-placeholder-color: rgba(0, 0, 0, 0.35);
  61. --f7-textarea-padding-vertical: 7px;
  62. /*
  63. --f7-input-focused-border-color: var(--f7-theme-color);
  64. --f7-input-invalid-border-color: var(--f7-input-error-text-color);
  65. --f7-input-invalid-text-color: var(--f7-input-text-color);
  66. */
  67. --f7-label-font-size: 12px;
  68. --f7-label-text-color: rgba(0, 0, 0, 0.65);
  69. /*
  70. --f7-label-focused-text-color: var(--f7-theme-color);
  71. --f7-label-invalid-text-color: var(--f7-input-error-text-color );
  72. */
  73. --f7-floating-label-scale: calc(16 / 12);
  74. --f7-inline-label-font-size: 16px;
  75. --f7-inline-label-line-height: 1.5;
  76. --f7-inline-label-padding-top: 7px;
  77. --f7-input-info-text-color: rgba(0, 0, 0, 0.45);
  78. --f7-input-clear-button-size: 18px;
  79. --f7-input-clear-button-color: #aaa;
  80. }
  81. .md .theme-dark,
  82. .md.theme-dark {
  83. --f7-input-text-color: rgba(255, 255, 255, 0.87);
  84. --f7-input-placeholder-color: rgba(255, 255, 255, 0.35);
  85. --f7-label-text-color: rgba(255, 255, 255, 0.54);
  86. --f7-input-info-text-color: rgba(255, 255, 255, 0.35);
  87. }
  88. .aurora {
  89. --f7-input-height: 24px;
  90. --f7-input-text-color: #000000;
  91. --f7-input-font-size: 13px;
  92. --f7-input-placeholder-color: rgba(0, 0, 0, 0.32);
  93. --f7-textarea-padding-vertical: 2px;
  94. /*
  95. --f7-input-focused-border-color: var(--f7-list-item-border-color);
  96. --f7-input-invalid-border-color: var(--f7-list-item-border-color);
  97. --f7-input-invalid-text-color: var(--f7-input-error-text-color);
  98. */
  99. --f7-label-font-size: 11px;
  100. --f7-label-text-color: inherit;
  101. /*
  102. --f7-label-focused-text-color: var(--f7-label-text-color);
  103. --f7-label-invalid-text-color: var(--f7-label-text-color);
  104. */
  105. --f7-floating-label-scale: calc(13 / 11);
  106. --f7-inline-label-font-size: 14px;
  107. --f7-inline-label-line-height: 1.4;
  108. --f7-inline-label-padding-top: 1px;
  109. --f7-input-info-text-color: rgba(0, 0, 0, 0.5);
  110. --f7-input-clear-button-size: 14px;
  111. --f7-input-clear-button-color: #666;
  112. --f7-input-outline-height: 32px;
  113. --f7-input-outline-padding-horizontal: 8px;
  114. }
  115. .aurora .theme-dark,
  116. .aurora.theme-dark {
  117. --f7-input-text-color: #fff;
  118. --f7-input-clear-button-color: #aaa;
  119. --f7-input-placeholder-color: rgba(255, 255, 255, 0.35);
  120. }

Examples

  1. <div class="block-title">Full Layout / Inline Labels</div>
  2. <div class="list inline-labels no-hairlines-md">
  3. <ul>
  4. <li class="item-content item-input">
  5. <div class="item-media">
  6. <i class="icon demo-list-icon"></i>
  7. </div>
  8. <div class="item-inner">
  9. <div class="item-title item-label">Name</div>
  10. <div class="item-input-wrap">
  11. <input type="text" placeholder="Your name">
  12. <span class="input-clear-button"></span>
  13. </div>
  14. </div>
  15. </li>
  16. <li class="item-content item-input">
  17. <div class="item-media">
  18. <i class="icon demo-list-icon"></i>
  19. </div>
  20. <div class="item-inner">
  21. <div class="item-title item-label">Password</div>
  22. <div class="item-input-wrap">
  23. <input type="password" placeholder="Your password">
  24. <span class="input-clear-button"></span>
  25. </div>
  26. </div>
  27. </li>
  28. <li class="item-content item-input">
  29. <div class="item-media">
  30. <i class="icon demo-list-icon"></i>
  31. </div>
  32. <div class="item-inner">
  33. <div class="item-title item-label">E-mail</div>
  34. <div class="item-input-wrap">
  35. <input type="email" placeholder="Your e-mail">
  36. <span class="input-clear-button"></span>
  37. </div>
  38. </div>
  39. </li>
  40. <li class="item-content item-input">
  41. <div class="item-media">
  42. <i class="icon demo-list-icon"></i>
  43. </div>
  44. <div class="item-inner">
  45. <div class="item-title item-label">URL</div>
  46. <div class="item-input-wrap">
  47. <input type="url" placeholder="URL">
  48. <span class="input-clear-button"></span>
  49. </div>
  50. </div>
  51. </li>
  52. <li class="item-content item-input">
  53. <div class="item-media">
  54. <i class="icon demo-list-icon"></i>
  55. </div>
  56. <div class="item-inner">
  57. <div class="item-title item-label">Phone</div>
  58. <div class="item-input-wrap">
  59. <input type="tel" placeholder="Your phone number">
  60. <span class="input-clear-button"></span>
  61. </div>
  62. </div>
  63. </li>
  64. <li class="item-content item-input">
  65. <div class="item-media">
  66. <i class="icon demo-list-icon"></i>
  67. </div>
  68. <div class="item-inner">
  69. <div class="item-title item-label">Gender</div>
  70. <div class="item-input-wrap input-dropdown-wrap">
  71. <select placeholder="Please choose...">
  72. <option value="Male">Male</option>
  73. <option value="Female">Female</option>
  74. </select>
  75. </div>
  76. </div>
  77. </li>
  78. <li class="item-content item-input">
  79. <div class="item-media">
  80. <i class="icon demo-list-icon"></i>
  81. </div>
  82. <div class="item-inner">
  83. <div class="item-title item-label">Birthday</div>
  84. <div class="item-input-wrap">
  85. <input type="date" value="2014-04-30" placeholder="Please choose...">
  86. </div>
  87. </div>
  88. </li>
  89. <li class="item-content item-input">
  90. <div class="item-media">
  91. <i class="icon demo-list-icon"></i>
  92. </div>
  93. <div class="item-inner">
  94. <div class="item-title item-label">Date time</div>
  95. <div class="item-input-wrap">
  96. <input type="datetime-local" placeholder="Please choose...">
  97. </div>
  98. </div>
  99. </li>
  100. <li class="item-content item-input">
  101. <div class="item-media">
  102. <i class="icon demo-list-icon"></i>
  103. </div>
  104. <div class="item-inner">
  105. <div class="item-title item-label">Range</div>
  106. <div class="item-input-wrap">
  107. <div class="range-slider range-slider-init" data-label="true">
  108. <input type="range" value="50" min="0" max="100" step="1">
  109. </div>
  110. </div>
  111. </div>
  112. </li>
  113. <li class="item-content item-input">
  114. <div class="item-media">
  115. <i class="icon demo-list-icon"></i>
  116. </div>
  117. <div class="item-inner">
  118. <div class="item-title item-label">Textarea</div>
  119. <div class="item-input-wrap">
  120. <textarea placeholder="Bio"></textarea>
  121. </div>
  122. </div>
  123. </li>
  124. <li class="item-content item-input">
  125. <div class="item-media">
  126. <i class="icon demo-list-icon"></i>
  127. </div>
  128. <div class="item-inner">
  129. <div class="item-title item-label">Resizable</div>
  130. <div class="item-input-wrap">
  131. <textarea class="resizable" placeholder="Bio"></textarea>
  132. </div>
  133. </div>
  134. </li>
  135. </ul>
  136. </div>
  137. <div class="block-title">Full Layout / Stacked Labels</div>
  138. <div class="list no-hairlines-md">
  139. <ul>
  140. <li class="item-content item-input">
  141. <div class="item-media">
  142. <i class="icon demo-list-icon"></i>
  143. </div>
  144. <div class="item-inner">
  145. <div class="item-title item-label">Name</div>
  146. <div class="item-input-wrap">
  147. <input type="text" placeholder="Your name">
  148. <span class="input-clear-button"></span>
  149. </div>
  150. </div>
  151. </li>
  152. <li class="item-content item-input">
  153. <div class="item-media">
  154. <i class="icon demo-list-icon"></i>
  155. </div>
  156. <div class="item-inner">
  157. <div class="item-title item-label">Password</div>
  158. <div class="item-input-wrap">
  159. <input type="password" placeholder="Your password">
  160. <span class="input-clear-button"></span>
  161. </div>
  162. </div>
  163. </li>
  164. <li class="item-content item-input">
  165. <div class="item-media">
  166. <i class="icon demo-list-icon"></i>
  167. </div>
  168. <div class="item-inner">
  169. <div class="item-title item-label">E-mail</div>
  170. <div class="item-input-wrap">
  171. <input type="email" placeholder="Your e-mail">
  172. <span class="input-clear-button"></span>
  173. </div>
  174. </div>
  175. </li>
  176. <li class="item-content item-input">
  177. <div class="item-media">
  178. <i class="icon demo-list-icon"></i>
  179. </div>
  180. <div class="item-inner">
  181. <div class="item-title item-label">URL</div>
  182. <div class="item-input-wrap">
  183. <input type="url" placeholder="URL">
  184. <span class="input-clear-button"></span>
  185. </div>
  186. </div>
  187. </li>
  188. <li class="item-content item-input">
  189. <div class="item-media">
  190. <i class="icon demo-list-icon"></i>
  191. </div>
  192. <div class="item-inner">
  193. <div class="item-title item-label">Phone</div>
  194. <div class="item-input-wrap">
  195. <input type="tel" placeholder="Your phone number">
  196. <span class="input-clear-button"></span>
  197. </div>
  198. </div>
  199. </li>
  200. <li class="item-content item-input">
  201. <div class="item-media">
  202. <i class="icon demo-list-icon"></i>
  203. </div>
  204. <div class="item-inner">
  205. <div class="item-title item-label">Gender</div>
  206. <div class="item-input-wrap input-dropdown-wrap">
  207. <select placeholder="Please choose...">
  208. <option value="Male">Male</option>
  209. <option value="Female">Female</option>
  210. </select>
  211. </div>
  212. </div>
  213. </li>
  214. <li class="item-content item-input">
  215. <div class="item-media">
  216. <i class="icon demo-list-icon"></i>
  217. </div>
  218. <div class="item-inner">
  219. <div class="item-title item-label">Birthday</div>
  220. <div class="item-input-wrap">
  221. <input type="date" value="2014-04-30" placeholder="Please choose...">
  222. </div>
  223. </div>
  224. </li>
  225. <li class="item-content item-input">
  226. <div class="item-media">
  227. <i class="icon demo-list-icon"></i>
  228. </div>
  229. <div class="item-inner">
  230. <div class="item-title item-label">Date time</div>
  231. <div class="item-input-wrap">
  232. <input type="datetime-local" placeholder="Please choose...">
  233. </div>
  234. </div>
  235. </li>
  236. <li class="item-content item-input">
  237. <div class="item-media">
  238. <i class="icon demo-list-icon"></i>
  239. </div>
  240. <div class="item-inner">
  241. <div class="item-title item-label">Range</div>
  242. <div class="item-input-wrap">
  243. <div class="range-slider range-slider-init" data-label="true">
  244. <input type="range" value="50" min="0" max="100" step="1">
  245. </div>
  246. </div>
  247. </div>
  248. </li>
  249. <li class="item-content item-input">
  250. <div class="item-media">
  251. <i class="icon demo-list-icon"></i>
  252. </div>
  253. <div class="item-inner">
  254. <div class="item-title item-label">Textarea</div>
  255. <div class="item-input-wrap">
  256. <textarea placeholder="Bio"></textarea>
  257. </div>
  258. </div>
  259. </li>
  260. <li class="item-content item-input">
  261. <div class="item-media">
  262. <i class="icon demo-list-icon"></i>
  263. </div>
  264. <div class="item-inner">
  265. <div class="item-title item-label">Resizable</div>
  266. <div class="item-input-wrap">
  267. <textarea class="resizable" placeholder="Bio"></textarea>
  268. </div>
  269. </div>
  270. </li>
  271. </ul>
  272. </div>
  273. <div class="block-title">Floating Labels</div>
  274. <div class="list no-hairlines-md">
  275. <ul>
  276. <li class="item-content item-input">
  277. <div class="item-media">
  278. <i class="icon demo-list-icon"></i>
  279. </div>
  280. <div class="item-inner">
  281. <div class="item-title item-floating-label">Name</div>
  282. <div class="item-input-wrap">
  283. <input type="text" placeholder="Your name">
  284. <span class="input-clear-button"></span>
  285. </div>
  286. </div>
  287. </li>
  288. <li class="item-content item-input">
  289. <div class="item-media">
  290. <i class="icon demo-list-icon"></i>
  291. </div>
  292. <div class="item-inner">
  293. <div class="item-title item-floating-label">Password</div>
  294. <div class="item-input-wrap">
  295. <input type="password" placeholder="Your password">
  296. <span class="input-clear-button"></span>
  297. </div>
  298. </div>
  299. </li>
  300. <li class="item-content item-input">
  301. <div class="item-media">
  302. <i class="icon demo-list-icon"></i>
  303. </div>
  304. <div class="item-inner">
  305. <div class="item-title item-floating-label">E-mail</div>
  306. <div class="item-input-wrap">
  307. <input type="email" placeholder="Your e-mail">
  308. <span class="input-clear-button"></span>
  309. </div>
  310. </div>
  311. </li>
  312. <li class="item-content item-input">
  313. <div class="item-media">
  314. <i class="icon demo-list-icon"></i>
  315. </div>
  316. <div class="item-inner">
  317. <div class="item-title item-floating-label">URL</div>
  318. <div class="item-input-wrap">
  319. <input type="url" placeholder="URL">
  320. <span class="input-clear-button"></span>
  321. </div>
  322. </div>
  323. </li>
  324. <li class="item-content item-input">
  325. <div class="item-media">
  326. <i class="icon demo-list-icon"></i>
  327. </div>
  328. <div class="item-inner">
  329. <div class="item-title item-floating-label">Phone</div>
  330. <div class="item-input-wrap">
  331. <input type="tel" placeholder="Your phone number">
  332. <span class="input-clear-button"></span>
  333. </div>
  334. </div>
  335. </li>
  336. <li class="item-content item-input">
  337. <div class="item-media">
  338. <i class="icon demo-list-icon"></i>
  339. </div>
  340. <div class="item-inner">
  341. <div class="item-title item-floating-label">Bio</div>
  342. <div class="item-input-wrap">
  343. <textarea class="resizable" placeholder="Bio"></textarea>
  344. <span class="input-clear-button"></span>
  345. </div>
  346. </div>
  347. </li>
  348. </ul>
  349. </div>
  350. <div class="block-title">Floating Labels + Outline Inputs</div>
  351. <div class="list no-hairlines-md">
  352. <ul>
  353. <li class="item-content item-input item-input-outline">
  354. <div class="item-media">
  355. <i class="icon demo-list-icon"></i>
  356. </div>
  357. <div class="item-inner">
  358. <div class="item-title item-floating-label">Name</div>
  359. <div class="item-input-wrap">
  360. <input type="text" placeholder="Your name">
  361. <span class="input-clear-button"></span>
  362. </div>
  363. </div>
  364. </li>
  365. <li class="item-content item-input item-input-outline">
  366. <div class="item-media">
  367. <i class="icon demo-list-icon"></i>
  368. </div>
  369. <div class="item-inner">
  370. <div class="item-title item-floating-label">Password</div>
  371. <div class="item-input-wrap">
  372. <input type="password" placeholder="Your password">
  373. <span class="input-clear-button"></span>
  374. </div>
  375. </div>
  376. </li>
  377. <li class="item-content item-input item-input-outline">
  378. <div class="item-media">
  379. <i class="icon demo-list-icon"></i>
  380. </div>
  381. <div class="item-inner">
  382. <div class="item-title item-floating-label">E-mail</div>
  383. <div class="item-input-wrap">
  384. <input type="email" placeholder="Your e-mail">
  385. <span class="input-clear-button"></span>
  386. </div>
  387. </div>
  388. </li>
  389. <li class="item-content item-input item-input-outline">
  390. <div class="item-media">
  391. <i class="icon demo-list-icon"></i>
  392. </div>
  393. <div class="item-inner">
  394. <div class="item-title item-floating-label">URL</div>
  395. <div class="item-input-wrap">
  396. <input type="url" placeholder="URL">
  397. <span class="input-clear-button"></span>
  398. </div>
  399. </div>
  400. </li>
  401. <li class="item-content item-input item-input-outline">
  402. <div class="item-media">
  403. <i class="icon demo-list-icon"></i>
  404. </div>
  405. <div class="item-inner">
  406. <div class="item-title item-floating-label">Phone</div>
  407. <div class="item-input-wrap">
  408. <input type="tel" placeholder="Your phone number">
  409. <span class="input-clear-button"></span>
  410. </div>
  411. </div>
  412. </li>
  413. <li class="item-content item-input item-input-outline">
  414. <div class="item-media">
  415. <i class="icon demo-list-icon"></i>
  416. </div>
  417. <div class="item-inner">
  418. <div class="item-title item-floating-label">Bio</div>
  419. <div class="item-input-wrap">
  420. <textarea class="resizable" placeholder="Bio"></textarea>
  421. <span class="input-clear-button"></span>
  422. </div>
  423. </div>
  424. </li>
  425. </ul>
  426. </div>
  427. <div class="block-title">Validation + Additional Info</div>
  428. <div class="list no-hairlines-md">
  429. <ul>
  430. <li class="item-content item-input item-input-with-info">
  431. <div class="item-media">
  432. <i class="icon demo-list-icon"></i>
  433. </div>
  434. <div class="item-inner">
  435. <div class="item-title item-label">Name</div>
  436. <div class="item-input-wrap">
  437. <input type="text" placeholder="Your name" required validate>
  438. <span class="input-clear-button"></span>
  439. <div class="item-input-info">Default "required" validation</div>
  440. </div>
  441. </div>
  442. </li>
  443. <li class="item-content item-input item-input-with-info">
  444. <div class="item-media">
  445. <i class="icon demo-list-icon"></i>
  446. </div>
  447. <div class="item-inner">
  448. <div class="item-title item-label">Fruit</div>
  449. <div class="item-input-wrap">
  450. <input type="text" placeholder="Type 'apple' or 'banana'" required validate pattern="apple|banana">
  451. <span class="input-clear-button"></span>
  452. <div class="item-input-info">Pattern validation (<b>apple|banana</b>)</div>
  453. </div>
  454. </div>
  455. </li>
  456. <li class="item-content item-input item-input-with-info">
  457. <div class="item-media">
  458. <i class="icon demo-list-icon"></i>
  459. </div>
  460. <div class="item-inner">
  461. <div class="item-title item-label">E-mail</div>
  462. <div class="item-input-wrap">
  463. <input type="email" placeholder="Your e-mail" required validate>
  464. <span class="input-clear-button"></span>
  465. <div class="item-input-info">Default e-mail validation</div>
  466. </div>
  467. </div>
  468. </li>
  469. <li class="item-content item-input item-input-with-info">
  470. <div class="item-media">
  471. <i class="icon demo-list-icon"></i>
  472. </div>
  473. <div class="item-inner">
  474. <div class="item-title item-label">URL</div>
  475. <div class="item-input-wrap">
  476. <input type="url" placeholder="Your URL" required validate>
  477. <span class="input-clear-button"></span>
  478. <div class="item-input-info">Default URL validation</div>
  479. </div>
  480. </div>
  481. </li>
  482. <li class="item-content item-input item-input-with-info">
  483. <div class="item-media">
  484. <i class="icon demo-list-icon"></i>
  485. </div>
  486. <div class="item-inner">
  487. <div class="item-title item-label">Number</div>
  488. <div class="item-input-wrap">
  489. <input type="text" placeholder="Enter number" required validate pattern="[0-9]*" data-error-message="Only numbers please!">
  490. <span class="input-clear-button"></span>
  491. <div class="item-input-info">With custom error message</div>
  492. </div>
  493. </div>
  494. </li>
  495. </ul>
  496. </div>
  497. <div class="block-title">Icon + Input</div>
  498. <div class="list no-hairlines-md">
  499. <ul>
  500. <li class="item-content item-input">
  501. <div class="item-media">
  502. <i class="icon demo-list-icon"></i>
  503. </div>
  504. <div class="item-inner">
  505. <div class="item-input-wrap">
  506. <input type="text" placeholder="Your name">
  507. <span class="input-clear-button"></span>
  508. </div>
  509. </div>
  510. </li>
  511. <li class="item-content item-input">
  512. <div class="item-media">
  513. <i class="icon demo-list-icon"></i>
  514. </div>
  515. <div class="item-inner">
  516. <div class="item-input-wrap">
  517. <input type="password" placeholder="Your password">
  518. <span class="input-clear-button"></span>
  519. </div>
  520. </div>
  521. </li>
  522. <li class="item-content item-input">
  523. <div class="item-media">
  524. <i class="icon demo-list-icon"></i>
  525. </div>
  526. <div class="item-inner">
  527. <div class="item-input-wrap">
  528. <input type="email" placeholder="Your e-mail">
  529. <span class="input-clear-button"></span>
  530. </div>
  531. </div>
  532. </li>
  533. <li class="item-content item-input">
  534. <div class="item-media">
  535. <i class="icon demo-list-icon"></i>
  536. </div>
  537. <div class="item-inner">
  538. <div class="item-input-wrap">
  539. <input type="url" placeholder="URL">
  540. <span class="input-clear-button"></span>
  541. </div>
  542. </div>
  543. </li>
  544. </ul>
  545. </div>
  546. <div class="block-title">Label + Input</div>
  547. <div class="list no-hairlines-md">
  548. <ul>
  549. <li class="item-content item-input">
  550. <div class="item-inner">
  551. <div class="item-title item-label">Name</div>
  552. <div class="item-input-wrap">
  553. <input type="text" placeholder="Your name">
  554. <span class="input-clear-button"></span>
  555. </div>
  556. </div>
  557. </li>
  558. <li class="item-content item-input">
  559. <div class="item-inner">
  560. <div class="item-title item-label">Password</div>
  561. <div class="item-input-wrap">
  562. <input type="password" placeholder="Your password">
  563. <span class="input-clear-button"></span>
  564. </div>
  565. </div>
  566. </li>
  567. <li class="item-content item-input">
  568. <div class="item-inner">
  569. <div class="item-title item-label">E-mail</div>
  570. <div class="item-input-wrap">
  571. <input type="email" placeholder="Your e-mail">
  572. <span class="input-clear-button"></span>
  573. </div>
  574. </div>
  575. </li>
  576. <li class="item-content item-input">
  577. <div class="item-inner">
  578. <div class="item-title item-label">URL</div>
  579. <div class="item-input-wrap">
  580. <input type="url" placeholder="URL">
  581. <span class="input-clear-button"></span>
  582. </div>
  583. </div>
  584. </li>
  585. </ul>
  586. </div>
  587. <div class="block-title">Only Inputs</div>
  588. <div class="list no-hairlines-md">
  589. <ul>
  590. <li class="item-content item-input">
  591. <div class="item-inner">
  592. <div class="item-input-wrap">
  593. <input type="text" placeholder="Your name">
  594. <span class="input-clear-button"></span>
  595. </div>
  596. </div>
  597. </li>
  598. <li class="item-content item-input">
  599. <div class="item-inner">
  600. <div class="item-input-wrap">
  601. <input type="password" placeholder="Your password">
  602. <span class="input-clear-button"></span>
  603. </div>
  604. </div>
  605. </li>
  606. <li class="item-content item-input">
  607. <div class="item-inner">
  608. <div class="item-input-wrap">
  609. <input type="email" placeholder="Your e-mail">
  610. <span class="input-clear-button"></span>
  611. </div>
  612. </div>
  613. </li>
  614. <li class="item-content item-input">
  615. <div class="item-inner">
  616. <div class="item-input-wrap">
  617. <input type="url" placeholder="URL">
  618. <span class="input-clear-button"></span>
  619. </div>
  620. </div>
  621. </li>
  622. </ul>
  623. </div>
  624. <div class="block-title">Inputs + Additional Info</div>
  625. <div class="list no-hairlines-md">
  626. <ul>
  627. <li class="item-content item-input item-input-with-info">
  628. <div class="item-inner">
  629. <div class="item-input-wrap">
  630. <input type="text" placeholder="Your name">
  631. <span class="input-clear-button"></span>
  632. <div class="item-input-info">Full name please</div>
  633. </div>
  634. </div>
  635. </li>
  636. <li class="item-content item-input item-input-with-info">
  637. <div class="item-inner">
  638. <div class="item-input-wrap">
  639. <input type="password" placeholder="Your password">
  640. <span class="input-clear-button"></span>
  641. <div class="item-input-info">8 characters minimum</div>
  642. </div>
  643. </div>
  644. </li>
  645. <li class="item-content item-input item-input-with-info">
  646. <div class="item-inner">
  647. <div class="item-input-wrap">
  648. <input type="email" placeholder="Your e-mail">
  649. <span class="input-clear-button"></span>
  650. <div class="item-input-info">Your work e-mail address</div>
  651. </div>
  652. </div>
  653. </li>
  654. <li class="item-content item-input item-input-with-info">
  655. <div class="item-inner">
  656. <div class="item-input-wrap">
  657. <input type="url" placeholder="URL">
  658. <span class="input-clear-button"></span>
  659. <div class="item-input-info">Your website URL</div>
  660. </div>
  661. </div>
  662. </li>
  663. </ul>
  664. </div>
  665. <div class="block-title">Only Inputs Inset</div>
  666. <div class="list inset">
  667. <ul>
  668. <li class="item-content item-input">
  669. <div class="item-inner">
  670. <div class="item-input-wrap">
  671. <input type="text" placeholder="Your name">
  672. <span class="input-clear-button"></span>
  673. </div>
  674. </div>
  675. </li>
  676. <li class="item-content item-input">
  677. <div class="item-inner">
  678. <div class="item-input-wrap">
  679. <input type="password" placeholder="Your password">
  680. <span class="input-clear-button"></span>
  681. </div>
  682. </div>
  683. </li>
  684. <li class="item-content item-input">
  685. <div class="item-inner">
  686. <div class="item-input-wrap">
  687. <input type="email" placeholder="Your e-mail">
  688. <span class="input-clear-button"></span>
  689. </div>
  690. </div>
  691. </li>
  692. <li class="item-content item-input">
  693. <div class="item-inner">
  694. <div class="item-input-wrap">
  695. <input type="url" placeholder="URL">
  696. <span class="input-clear-button"></span>
  697. </div>
  698. </div>
  699. </li>
  700. </ul>
  701. </div>