Input / Form Elements Vue Components

    Form elements allow you to create flexible and beautiful Form layout. Form elements are just well known List View ( and List Item Vue components) but with few additional components.

    There are following components included:

    • - list item input element
    • **f7-input** - input element
    • **f7-label** - input label element

    Input Properties

    EventArgumentsDescription
    <f7-list-input>, <f7-input> events
    focus(event)Fired when user focused to input.
    blur(event)Fired when user lost focus from input.
    input(event)Fired immediately when input value changed. Note: Input event triggers after beforeinput, keypress, keyup, keydown events.
    change(event)Fired when blur if value changed.
    input:clear(event)Fired when input clear button clicked
    textarea:resize(event)Fired if resizable textarea resized. event.detail will contain object with the initialHeight, currentHeight and scrollHeight properties
    input:empty(event)Fired when input value becomes empty
    input:notempty(event)Fired when input value becomes not empty

    Input Slots

    Input Vue component (<f7-list-input>) has additional slots for custom elements:

    • **default** - in case of type="select" or type="textarea" - element will be placed inside of select or textarea tags.
    • **info** - element will be inserted into container with info message
    • **error-message** - element will be inserted into container with error message
    • **label** - element will be inserted into container with input’s label
    • **input** - element will be inserted instead of input element (input prop must be also set to false)
    • **root-start** - element will be inserted in the beginning of <li> element
    • **root** / **root-end** - element will be inserted in the end of <li> element
    • **content-start** - element will be inserted in the beginning of <div class="item-content"> element
    • **content** / **content-end** - element will be inserted in the end of <div class="item-content"> element
    • **inner-start** - element will be inserted in the beginning of <div class="item-inner"> element
    • **inner** / **inner-end** - element will be inserted in the end of <div class="item-inner"> element
    • **media** - element will be inserted inside of <div class="item-media"> element

    Examples

    1. <f7-block-title>Full Layout / Inline Labels</f7-block-title>
    2. <f7-list inline-labels no-hairlines-md>
    3. <f7-list-input
    4. label="Name"
    5. type="text"
    6. placeholder="Your name"
    7. clear-button
    8. >
    9. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    10. </f7-list-input>
    11. <f7-list-input
    12. label="Password"
    13. type="password"
    14. placeholder="Your password"
    15. clear-button
    16. >
    17. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    18. </f7-list-input>
    19. <f7-list-input
    20. label="E-mail"
    21. type="email"
    22. placeholder="Your e-mail"
    23. clear-button
    24. >
    25. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    26. </f7-list-input>
    27. <f7-list-input
    28. label="URL"
    29. type="url"
    30. placeholder="URL"
    31. clear-button
    32. >
    33. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    34. </f7-list-input>
    35. <f7-list-input
    36. label="Phone"
    37. type="tel"
    38. placeholder="Your phone number"
    39. clear-button
    40. >
    41. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    42. </f7-list-input>
    43. <f7-list-input
    44. label="Gender"
    45. type="select"
    46. defaultValue="Male"
    47. placeholder="Please choose..."
    48. >
    49. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    50. <option value="Male">Male</option>
    51. <option value="Female">Female</option>
    52. </f7-list-input>
    53. <f7-list-input
    54. label="Birthday"
    55. type="date"
    56. defaultValue="2014-04-30"
    57. placeholder="Please choose..."
    58. >
    59. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    60. </f7-list-input>
    61. <f7-list-input
    62. label="Date time"
    63. type="datetime-local"
    64. placeholder="Please choose..."
    65. >
    66. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    67. </f7-list-input>
    68. <f7-list-input
    69. label="Range"
    70. :input="false"
    71. >
    72. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    73. <f7-range slot="input" :value="50" :min="0" :max="100" :step="1"></f7-range>
    74. </f7-list-input>
    75. <f7-list-input
    76. label="Textarea"
    77. type="textarea"
    78. placeholder="Bio"
    79. >
    80. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    81. </f7-list-input>
    82. <f7-list-input
    83. label="Resizable"
    84. type="textarea"
    85. resizable
    86. placeholder="Bio"
    87. >
    88. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    89. </f7-list-input>
    90. </f7-list>
    91. <f7-block-title>Full Layout / Stacked Labels</f7-block-title>
    92. <f7-list no-hairlines-md>
    93. <f7-list-input
    94. label="Name"
    95. type="text"
    96. placeholder="Your name"
    97. clear-button
    98. >
    99. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    100. </f7-list-input>
    101. <f7-list-input
    102. label="Password"
    103. type="password"
    104. placeholder="Your password"
    105. clear-button
    106. >
    107. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    108. </f7-list-input>
    109. <f7-list-input
    110. label="E-mail"
    111. type="email"
    112. placeholder="Your e-mail"
    113. clear-button
    114. >
    115. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    116. </f7-list-input>
    117. label="URL"
    118. type="url"
    119. placeholder="URL"
    120. clear-button
    121. >
    122. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    123. </f7-list-input>
    124. label="Phone"
    125. type="tel"
    126. placeholder="Your phone number"
    127. clear-button
    128. >
    129. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    130. </f7-list-input>
    131. <f7-list-input
    132. label="Gender"
    133. type="select"
    134. defaultValue="Male"
    135. placeholder="Please choose..."
    136. >
    137. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    138. <option value="Male">Male</option>
    139. <option value="Female">Female</option>
    140. </f7-list-input>
    141. <f7-list-input
    142. label="Birthday"
    143. type="date"
    144. defaultValue="2014-04-30"
    145. placeholder="Please choose..."
    146. >
    147. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    148. </f7-list-input>
    149. <f7-list-input
    150. label="Date time"
    151. type="datetime-local"
    152. placeholder="Please choose..."
    153. >
    154. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    155. </f7-list-input>
    156. <f7-list-input
    157. label="Range"
    158. :input="false"
    159. >
    160. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    161. <f7-range slot="input" :value="50" :min="0" :max="100" :step="1"></f7-range>
    162. </f7-list-input>
    163. <f7-list-input
    164. label="Textarea"
    165. type="textarea"
    166. placeholder="Bio"
    167. >
    168. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    169. </f7-list-input>
    170. <f7-list-input
    171. label="Resizable"
    172. type="textarea"
    173. resizable
    174. placeholder="Bio"
    175. >
    176. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    177. </f7-list-input>
    178. </f7-list>
    179. <f7-block-title>Floating Labels (MD-theme only)</f7-block-title>
    180. <f7-list no-hairlines-md>
    181. <f7-list-input
    182. label="Name"
    183. floating-label
    184. type="text"
    185. placeholder="Your name"
    186. clear-button
    187. >
    188. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    189. </f7-list-input>
    190. <f7-list-input
    191. label="Password"
    192. floating-label
    193. type="password"
    194. placeholder="Your password"
    195. clear-button
    196. >
    197. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    198. </f7-list-input>
    199. <f7-list-input
    200. label="E-mail"
    201. floating-label
    202. type="email"
    203. placeholder="Your e-mail"
    204. clear-button
    205. >
    206. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    207. </f7-list-input>
    208. <f7-list-input
    209. label="URL"
    210. floating-label
    211. type="url"
    212. placeholder="URL"
    213. clear-button
    214. >
    215. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    216. </f7-list-input>
    217. <f7-list-input
    218. label="Phone"
    219. floating-label
    220. type="tel"
    221. placeholder="Your phone number"
    222. clear-button
    223. >
    224. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    225. </f7-list-input>
    226. <f7-list-input
    227. label="Resizable"
    228. floating-label
    229. type="textarea"
    230. resizable
    231. placeholder="Bio"
    232. >
    233. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    234. </f7-list-input>
    235. </f7-list>
    236. <f7-block-title>Validation + Additional Info</f7-block-title>
    237. <f7-list no-hairlines-md>
    238. <f7-list-input
    239. label="Name"
    240. type="text"
    241. placeholder="Your name"
    242. info="Default validation"
    243. required
    244. validate
    245. clear-button
    246. >
    247. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    248. </f7-list-input>
    249. <f7-list-input
    250. label="Fruit"
    251. type="text"
    252. placeholder="Type 'apple' or 'banana'"
    253. required
    254. validate
    255. pattern="apple|banana"
    256. clear-button
    257. >
    258. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    259. <span slot="info">Pattern validation (<b>apple|banana</b>)</span>
    260. </f7-list-input>
    261. <f7-list-input
    262. label="E-mail"
    263. type="email"
    264. placeholder="Your e-mail"
    265. info="Default e-mail validation"
    266. required
    267. validate
    268. clear-button
    269. >
    270. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    271. </f7-list-input>
    272. <f7-list-input
    273. label="URL"
    274. placeholder="Your URL"
    275. info="Default URL validation"
    276. required
    277. clear-button
    278. >
    279. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    280. </f7-list-input>
    281. <f7-list-input
    282. label="Number"
    283. type="text"
    284. placeholder="Enter number"
    285. info="With custom error message"
    286. error-message="Only numbers please!"
    287. required
    288. validate
    289. pattern="[0-9]*"
    290. clear-button
    291. >
    292. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    293. </f7-list-input>
    294. </f7-list>
    295. <f7-block-title>Icon + Input</f7-block-title>
    296. <f7-list no-hairlines-md>
    297. <f7-list-input
    298. type="text"
    299. placeholder="Your name"
    300. clear-button
    301. >
    302. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    303. </f7-list-input>
    304. <f7-list-input
    305. type="password"
    306. placeholder="Your password"
    307. clear-button
    308. >
    309. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    310. </f7-list-input>
    311. <f7-list-input
    312. type="email"
    313. placeholder="Your e-mail"
    314. clear-button
    315. >
    316. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    317. </f7-list-input>
    318. <f7-list-input
    319. type="url"
    320. placeholder="URL"
    321. clear-button
    322. >
    323. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    324. </f7-list-input>
    325. </f7-list>
    326. <f7-block-title>Label + Input</f7-block-title>
    327. <f7-list no-hairlines-md>
    328. <f7-list-input
    329. label="Name"
    330. type="text"
    331. placeholder="Your name"
    332. clear-button
    333. ></f7-list-input>
    334. <f7-list-input
    335. label="Password"
    336. type="password"
    337. placeholder="Your password"
    338. clear-button
    339. ></f7-list-input>
    340. <f7-list-input
    341. label="E-mail"
    342. type="email"
    343. placeholder="Your e-mail"
    344. clear-button
    345. ></f7-list-input>
    346. <f7-list-input
    347. label="URL"
    348. type="url"
    349. placeholder="URL"
    350. clear-button
    351. ></f7-list-input>
    352. </f7-list>
    353. <f7-block-title>Only Inputs</f7-block-title>
    354. <f7-list no-hairlines-md>
    355. <f7-list-input
    356. type="text"
    357. placeholder="Your name"
    358. clear-button
    359. ></f7-list-input>
    360. <f7-list-input
    361. type="password"
    362. placeholder="Your password"
    363. clear-button
    364. ></f7-list-input>
    365. <f7-list-input
    366. type="email"
    367. placeholder="Your e-mail"
    368. clear-button
    369. ></f7-list-input>
    370. <f7-list-input
    371. type="url"
    372. placeholder="URL"
    373. clear-button
    374. ></f7-list-input>
    375. </f7-list>
    376. <f7-block-title>Inputs + Additional Info</f7-block-title>
    377. <f7-list no-hairlines-md>
    378. <f7-list-input
    379. type="text"
    380. placeholder="Your name"
    381. info="Full name please"
    382. clear-button
    383. ></f7-list-input>
    384. <f7-list-input
    385. type="password"
    386. placeholder="Your password"
    387. info="8 characters minimum"
    388. clear-button
    389. ></f7-list-input>
    390. <f7-list-input
    391. type="email"
    392. placeholder="Your e-mail"
    393. info="Your work e-mail address"
    394. clear-button
    395. ></f7-list-input>
    396. <f7-list-input
    397. type="url"
    398. placeholder="URL"
    399. info="Your website URL"
    400. clear-button
    401. ></f7-list-input>
    402. </f7-list>
    403. <f7-block-title>Only Inputs Inset</f7-block-title>
    404. <f7-list inset>
    405. <f7-list-input
    406. type="text"
    407. placeholder="Your name"
    408. clear-button
    409. ></f7-list-input>
    410. <f7-list-input
    411. type="password"
    412. placeholder="Your password"
    413. clear-button
    414. ></f7-list-input>
    415. <f7-list-input
    416. type="email"
    417. placeholder="Your e-mail"
    418. clear-button
    419. ></f7-list-input>
    420. <f7-list-input
    421. type="url"
    422. placeholder="URL"
    423. clear-button
    424. ></f7-list-input>