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.

    Check out Framework7’s for their appearance.

    There are following components included:

    • - list item input element
    • **f7-input** - input 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 on 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
    calendar:change(value)Fired when type=”datepicker” Calendar value changed. As an argument it receives array with selected dates.
    colorpicker:change(value)Fired when type=”colorpicker” Color Picker value changed. As an argument it receives object with Color Picker value.

    Input Slots

    <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

    v-model is not supported on f7-list-input / f7-input vue components. Instead, just use the combination of value property and @input event:

    Examples

    Full Layout / Inline Labels

    1. <f7-list inline-labels no-hairlines-md>
    2. <f7-list-input
    3. label="Name"
    4. type="text"
    5. placeholder="Your name"
    6. clear-button
    7. >
    8. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    9. </f7-list-input>
    10. <f7-list-input
    11. label="Password"
    12. type="password"
    13. placeholder="Your password"
    14. clear-button
    15. >
    16. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    17. </f7-list-input>
    18. <f7-list-input
    19. label="E-mail"
    20. type="email"
    21. placeholder="Your e-mail"
    22. clear-button
    23. >
    24. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    25. </f7-list-input>
    26. <f7-list-input
    27. label="URL"
    28. type="url"
    29. placeholder="URL"
    30. clear-button
    31. >
    32. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    33. </f7-list-input>
    34. <f7-list-input
    35. label="Phone"
    36. type="tel"
    37. placeholder="Your phone number"
    38. clear-button
    39. >
    40. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    41. </f7-list-input>
    42. <f7-list-input
    43. label="Gender"
    44. type="select"
    45. defaultValue="Male"
    46. placeholder="Please choose..."
    47. >
    48. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    49. <option value="Male">Male</option>
    50. <option value="Female">Female</option>
    51. </f7-list-input>
    52. <f7-list-input
    53. label="Birthday"
    54. type="date"
    55. defaultValue="2014-04-30"
    56. placeholder="Please choose..."
    57. >
    58. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    59. </f7-list-input>
    60. <f7-list-input
    61. label="Date time"
    62. type="datetime-local"
    63. placeholder="Please choose..."
    64. >
    65. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    66. </f7-list-input>
    67. <f7-list-input
    68. label="Range"
    69. :input="false"
    70. >
    71. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    72. <f7-range slot="input" :value="50" :min="0" :max="100" :step="1"></f7-range>
    73. </f7-list-input>
    74. <f7-list-input
    75. label="Textarea"
    76. type="textarea"
    77. placeholder="Bio"
    78. >
    79. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    80. </f7-list-input>
    81. <f7-list-input
    82. label="Resizable"
    83. type="textarea"
    84. resizable
    85. placeholder="Bio"
    86. >
    87. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    88. </f7-list-input>
    89. </f7-list>

    Full Layout / Stacked Labels

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. label="Name"
    4. type="text"
    5. placeholder="Your name"
    6. clear-button
    7. >
    8. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    9. </f7-list-input>
    10. <f7-list-input
    11. label="Password"
    12. type="password"
    13. placeholder="Your password"
    14. clear-button
    15. >
    16. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    17. </f7-list-input>
    18. <f7-list-input
    19. label="E-mail"
    20. type="email"
    21. placeholder="Your e-mail"
    22. clear-button
    23. >
    24. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    25. </f7-list-input>
    26. <f7-list-input
    27. type="url"
    28. placeholder="URL"
    29. clear-button
    30. >
    31. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    32. </f7-list-input>
    33. <f7-list-input
    34. type="tel"
    35. placeholder="Your phone number"
    36. clear-button
    37. >
    38. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    39. </f7-list-input>
    40. <f7-list-input
    41. label="Gender"
    42. type="select"
    43. defaultValue="Male"
    44. placeholder="Please choose..."
    45. >
    46. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    47. <option value="Male">Male</option>
    48. <option value="Female">Female</option>
    49. </f7-list-input>
    50. <f7-list-input
    51. label="Birthday"
    52. type="date"
    53. defaultValue="2014-04-30"
    54. placeholder="Please choose..."
    55. >
    56. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    57. </f7-list-input>
    58. <f7-list-input
    59. label="Date time"
    60. type="datetime-local"
    61. placeholder="Please choose..."
    62. >
    63. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    64. </f7-list-input>
    65. <f7-list-input
    66. label="Range"
    67. :input="false"
    68. >
    69. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    70. <f7-range slot="input" :value="50" :min="0" :max="100" :step="1"></f7-range>
    71. </f7-list-input>
    72. <f7-list-input
    73. label="Textarea"
    74. type="textarea"
    75. placeholder="Bio"
    76. >
    77. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    78. </f7-list-input>
    79. <f7-list-input
    80. label="Resizable"
    81. type="textarea"
    82. resizable
    83. placeholder="Bio"
    84. >
    85. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    86. </f7-list-input>
    87. </f7-list>

    Date Pickers

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. label="Default setup"
    4. type="datepicker"
    5. placeholder="Your birth date"
    6. readonly
    7. ></f7-list-input>
    8. <f7-list-input
    9. label="Custom date format"
    10. type="datepicker"
    11. placeholder="Select date"
    12. readonly
    13. :calendar-params="{dateFormat: 'DD, MM dd, yyyy'}"
    14. ></f7-list-input>
    15. <f7-list-input
    16. label="Multiple Values"
    17. type="datepicker"
    18. placeholder="Select multiple dates"
    19. readonly
    20. :calendar-params="{ dateFormat: 'M dd yyyy', multiple: true }"
    21. ></f7-list-input>
    22. <f7-list-input
    23. label="Range Picker"
    24. type="datepicker"
    25. placeholder="Select date range"
    26. readonly
    27. :calendar-params="{ dateFormat: 'M dd yyyy', rangePicker: true }"
    28. ></f7-list-input>
    29. <f7-list-input
    30. label="Open in Modal"
    31. type="datepicker"
    32. placeholder="Select date"
    33. readonly
    34. :calendar-params="{openIn: 'customModal', header: true, footer: true, dateFormat: 'MM dd yyyy'}"
    35. ></f7-list-input>
    36. </f7-list>

    Color Pickers

    Floating Labels

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. label="Name"
    4. floating-label
    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. floating-label
    14. type="password"
    15. placeholder="Your password"
    16. clear-button
    17. >
    18. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    19. </f7-list-input>
    20. <f7-list-input
    21. label="E-mail"
    22. floating-label
    23. type="email"
    24. placeholder="Your e-mail"
    25. clear-button
    26. >
    27. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    28. </f7-list-input>
    29. <f7-list-input
    30. label="URL"
    31. floating-label
    32. type="url"
    33. placeholder="URL"
    34. clear-button
    35. >
    36. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    37. </f7-list-input>
    38. <f7-list-input
    39. label="Phone"
    40. floating-label
    41. type="tel"
    42. placeholder="Your phone number"
    43. clear-button
    44. >
    45. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    46. </f7-list-input>
    47. <f7-list-input
    48. label="Resizable"
    49. floating-label
    50. type="textarea"
    51. resizable
    52. placeholder="Bio"
    53. >
    54. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    55. </f7-list-input>
    56. </f7-list>

    Floating Labels + Outline Inputs

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. outline
    4. label="Name"
    5. floating-label
    6. type="text"
    7. placeholder="Your name"
    8. clear-button
    9. >
    10. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    11. </f7-list-input>
    12. <f7-list-input
    13. outline
    14. label="Password"
    15. floating-label
    16. type="password"
    17. placeholder="Your password"
    18. clear-button
    19. >
    20. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    21. </f7-list-input>
    22. outline
    23. label="E-mail"
    24. floating-label
    25. type="email"
    26. clear-button
    27. >
    28. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    29. </f7-list-input>
    30. <f7-list-input
    31. outline
    32. label="URL"
    33. floating-label
    34. type="url"
    35. placeholder="URL"
    36. clear-button
    37. >
    38. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    39. </f7-list-input>
    40. <f7-list-input
    41. outline
    42. label="Phone"
    43. floating-label
    44. type="tel"
    45. placeholder="Your phone number"
    46. clear-button
    47. >
    48. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    49. </f7-list-input>
    50. <f7-list-input
    51. outline
    52. label="Bio"
    53. floating-label
    54. type="textarea"
    55. resizable
    56. placeholder="Bio"
    57. clear-button
    58. >
    59. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    60. </f7-list-input>
    61. </f7-list>

    Validation + Additional Info

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. label="Name"
    4. type="text"
    5. placeholder="Your name"
    6. info="Default validation"
    7. required
    8. validate
    9. clear-button
    10. >
    11. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    12. </f7-list-input>
    13. <f7-list-input
    14. label="Fruit"
    15. type="text"
    16. placeholder="Type 'apple' or 'banana'"
    17. required
    18. validate
    19. pattern="apple|banana"
    20. clear-button
    21. >
    22. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    23. <span slot="info">Pattern validation (<b>apple|banana</b>)</span>
    24. </f7-list-input>
    25. <f7-list-input
    26. label="E-mail"
    27. type="email"
    28. placeholder="Your e-mail"
    29. info="Default e-mail validation"
    30. required
    31. validate
    32. clear-button
    33. >
    34. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    35. </f7-list-input>
    36. <f7-list-input
    37. label="URL"
    38. type="url"
    39. placeholder="Your URL"
    40. info="Default URL validation"
    41. required
    42. validate
    43. clear-button
    44. >
    45. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    46. </f7-list-input>
    47. <f7-list-input
    48. label="Number"
    49. type="text"
    50. placeholder="Enter number"
    51. info="With custom error message"
    52. error-message="Only numbers please!"
    53. required
    54. validate
    55. pattern="[0-9]*"
    56. clear-button
    57. >
    58. <f7-icon icon="demo-list-icon" slot="media"></f7-icon>
    59. </f7-list-input>
    60. </f7-list>

    Icon + Input

    Label + Input

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. label="Name"
    4. type="text"
    5. placeholder="Your name"
    6. clear-button
    7. ></f7-list-input>
    8. <f7-list-input
    9. label="Password"
    10. type="password"
    11. placeholder="Your password"
    12. clear-button
    13. ></f7-list-input>
    14. <f7-list-input
    15. label="E-mail"
    16. type="email"
    17. placeholder="Your e-mail"
    18. clear-button
    19. ></f7-list-input>
    20. <f7-list-input
    21. label="URL"
    22. type="url"
    23. placeholder="URL"
    24. clear-button
    25. ></f7-list-input>
    26. </f7-list>

    Only Inputs

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. type="text"
    4. placeholder="Your name"
    5. clear-button
    6. ></f7-list-input>
    7. <f7-list-input
    8. type="password"
    9. placeholder="Your password"
    10. clear-button
    11. ></f7-list-input>
    12. <f7-list-input
    13. type="email"
    14. placeholder="Your e-mail"
    15. clear-button
    16. ></f7-list-input>
    17. <f7-list-input
    18. type="url"
    19. placeholder="URL"
    20. clear-button
    21. ></f7-list-input>
    22. </f7-list>

    Inputs + Additional Info

    1. <f7-list no-hairlines-md>
    2. <f7-list-input
    3. type="text"
    4. placeholder="Your name"
    5. info="Full name please"
    6. clear-button
    7. ></f7-list-input>
    8. <f7-list-input
    9. type="password"
    10. placeholder="Your password"
    11. info="8 characters minimum"
    12. clear-button
    13. ></f7-list-input>
    14. <f7-list-input
    15. type="email"
    16. placeholder="Your e-mail"
    17. info="Your work e-mail address"
    18. clear-button
    19. ></f7-list-input>
    20. <f7-list-input
    21. type="url"
    22. placeholder="URL"
    23. info="Your website URL"
    24. clear-button
    25. ></f7-list-input>

    Only Inputs Inset