Inputs

AutocompletePro

FormKit Pro Quick Installation Guide 🚀

The autocomplete input allows you to search through a list of options.

The options prop can accept three different formats of values:

  • An array of objects with value and label keys (see example above)
  • An array of strings ['A', 'B', 'C']
  • An object literal with key-value pairs { a: 'A', b: 'B', c: 'C' }
  • A function that returns any of the above
Empty options

If you assign options as an empty array, the input will be rendered in a disabled state.

Basic examples

Single-select

By default, the autocomplete input will render in single-select mode:

autocomplete-single
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      type="autocomplete"      name="country"      label="Search for a country"      placeholder="Example: United States"      :options="countries"      popover    />    <pre wrap>{{ value }}</pre>  </FormKit></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]
{}

Multi-select

By setting the multiple prop the autocomplete input will render in multi-select mode:

autocomplete-multiple
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      type="autocomplete"      name="country"      label="Search for a country"      placeholder="Example: United States"      :options="countries"      multiple      popover    />    <pre wrap>{{ value }}</pre>  </FormKit></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]
{}
Multi-select input value

Notice in the example above that because the multiple prop is set, the value prop must be an array.

Filtering

The autocomplete input will filter options with its own internal search function. You can replace this search function by providing the filter prop a function of your own. Your function will receive two arguments, the option being iterated over and the current search value:

autocomplete-filter
countries
<FormKit  type="autocomplete"  name="autocomplete"  label="Search for a country"  :options="countries"  placeholder="Example: United States"  popover  :filter="    (option, search) =>      option.label.toLowerCase().startsWith(search.toLowerCase())  "/>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]

Dynamic options

Instead of passing a static list to the options prop, you can assign it to a function. Doing so is useful when you need to load options from an API or another source.

Search parameter

In this example, we'll assign the options prop the searchMovies function. By doing so, searchMovies will receive the context object as an argument. Within this context object is the search property, which is the current search value. To perform our search, we'll use the search value as the query parameter for our API request:

<script setup>// Search movie receives FormKit's context object// which we are destructuring to get the search value.async function searchMovies({ search }) {  if (!search) return []  const res = await fetch(    `https://api.themoviedb.org/3/search/movie?query=${      search || ''    }&api_key=f48bcc9ed9cbce41f6c28ea181b67e14&language=en-US&page=1&include_adult=false`  )  if (res.ok) {    const data = await res.json()    // Iterating over results to set the required    // `label` and `value` keys.    return data.results.map((result) => {      return {        label: result.title,        value: result.id,      }    })  }  // If the request fails, we return an empty array.  return []}</script><template>  <!--Setting the `options` prop to async function `loadHorrorMovies`-->  <FormKit    name="movie"    type="autocomplete"    label="Search for your favorite movie"    placeholder="Example: Shawshank Redemption"    popover    :options="searchMovies"  /></template>

Page and hasNextPage parameters

A likely scenario you'll encounter is needing to search through a paginated API. This can be done by referencing the same context object as before. Within this object, we can utilize the page and hasNextPage properties. The page property is the current page number, and the hasNextPage property is a function to be called when there are more pages to load:

<script setup>// Search movie receives FormKit's context object// which we are destructuring to get the search value,// the page, and the hasNextPage parameters.async function searchMovies({ search, page, hasNextPage }) {  if (!search) return []  const res = await fetch(    `https://api.themoviedb.org/3/search/movie?query=${      search || ''    }&api_key=f48bcc9ed9cbce41f6c28ea181b67e14&language=en-US&page=${page}&include_adult=false`  )  if (res.ok) {    const data = await res.json()    if (page !== data.total_pages) hasNextPage()    return data.results.map((result) => {      return {        label: result.title,        value: result.id,      }    })  }  return []}</script><template>  <FormKit    name="movie"    type="autocomplete"    label="Search for your favorite movie"    placeholder="Example: Lord of the Rings"    :options="searchMovies"    popover  /></template><style scoped>:deep(.formkit-option) {  display: flex;  align-items: center;}:deep(.formkit-option img) {  width: 20%;  margin-right: 20px;}:deep(.option-overview) {  font-size: 12px;}</style>

Option loader

Rehydrating values

FormKit's autocomplete input also provides an optionLoader prop that allows you to rehydrate values that are not in the options list. In this example, we'll provide the autocomplete an initial value (a movie ID), and assign the optionLoader to a function that will make a request to the API to get the movie:

<script setup>// Search movie receives FormKit's context object// which we are destructuring to get the search value,// the page, and the hasNextPage parameters.async function searchMovies({ search, page, hasNextPage }) {  if (!search) return []  const res = await fetch(    `https://api.themoviedb.org/3/search/movie?query=${      search || ''    }&api_key=f48bcc9ed9cbce41f6c28ea181b67e14&language=en-US&page=${page}&include_adult=false`  )  if (res.ok) {    const data = await res.json()    if (page !== data.total_pages) hasNextPage()    return data.results.map((result) => {      return {        label: result.title,        value: result.id,      }    })  }  return []}// The function assigned to the `option-loader` prop will be called with the// value of the option as the first argument (in this case, the movie ID), and// the cached option as the second argument (if it exists).async function loadMovie(id, cachedOption) {  if (cachedOption) return cachedOption  const res = await fetch(    `https://api.themoviedb.org/3/movie/${id}?api_key=f48bcc9ed9cbce41f6c28ea181b67e14&language=en-US`  )  if (res.ok) {    const data = await res.json()    return {      label: data.title,      value: data.id,    }  }  return { label: 'Error loading' }}</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      name="movie"      type="autocomplete"      label="Search for your favorite movie"      placeholder="Example: Harry Potter"      :options="searchMovies"      :value="597"      :option-loader="loadMovie"      popover    />    <pre wrap>{{ value }}</pre>  </FormKit></template>e<style scoped>:deep(.formkit-option) {  display: flex;  align-items: center;}:deep(.formkit-option img) {  width: 20%;  margin-right: 20px;}:deep(.option-overview) {  font-size: 12px;}</style>
{}

Notice in the example above that the optionLoader function is passed two arguments: the value of the selected option (in this case, the movie ID) and the cachedOption. The cachedOption prop is used for preventing unnecessary lookups. If the cachedOption is not null it means that the selected option has already been loaded, and you can return the cachedOption directly.

Loading Style

Instead of requiring your users to click the Load more button to load additional options, you can set the loadOnScroll prop to true, which will paginate options as you scroll to the bottom of the options list.

Load on created

If you would rather load options when the autocomplete is created, you can set the load-on-created prop to true, and our function, loadCurrentlyPopularMovies will be called without the user needing to expand the listbox:

<script setup>// Search movie receives FormKit's context object// which we are destructuring to get the search value.async function searchMovies({ search }) {  await new Promise((resolve) => setTimeout(resolve, 1000))  if (!search)    // With no search value, lets just return a list of common movies.    return [      { label: 'Saving Private Ryan', value: 857 },      { label: 'Everything Everywhere All at Once', value: 545611 },      { label: 'Gone with the Wind', value: 770 },    ]  const res = await fetch(    `https://api.themoviedb.org/3/search/movie?query=${      search || ''    }&api_key=f48bcc9ed9cbce41f6c28ea181b67e14&language=en-US&page=1&include_adult=false`  )  if (res.ok) {    const data = await res.json()    // Iterating over results to set the required    // `label` and `value` keys.    return data.results.map((result) => {      return {        label: result.title,        value: result.id,      }    })  }  // If the request fails, we return an empty array.  return []}</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <!--Setting the `options` prop to async function `loadHorrorMovies`-->    <FormKit      name="movie"      type="autocomplete"      label="Search for your favorite movie"      placeholder="Example: Shawshank Redemption"      :options="searchMovies"      load-on-created      popover    />    <pre wrap>{{ value }}</pre>  </FormKit></template><style scoped>:deep(.formkit-option) {  display: flex;  align-items: center;}:deep(.formkit-option img) {  width: 20%;  margin-right: 20px;}:deep(.option-overview) {  font-size: 12px;}</style>
{}

Option appearance

Option slot

The autocomplete input allows you to customize the look and feel of each option by using the option slot. In this example, we are using the option slot to display each option's asset, logo, and name:

autocomplete-option-slot
car-brands
<script setup>import carBrands from './car-brands.js'</script><template>  <FormKit    type="autocomplete"    name="autocomplete"    label="Search for and select a car brand"    placeholder="Example: Toyota"    :options="carBrands"    selection-appearance="option"    popover  >    <!--OPTION SLOT-->    <template #option="{ option, classes }">      <div :class="classes.option">        <img :src="option.logo" :alt="option.label + ' logo'" />        <span>          {{ option.label }}        </span>      </div>    </template>    <!--/OPTION SLOT-->  </FormKit></template><style scoped>.formkit-option {  display: flex;  align-items: center;}.formkit-option img {  width: 20px;  height: 20px;  margin-right: 10px;}</style>
export default [  {    label: 'Audi',    value: 'audi',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/audi-logo.png',  },  {    label: 'BMW',    value: 'bmw',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/bmw-logo.png',  },  {    label: 'Citroen',    value: 'citroen',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/citroen-logo.png',  },  {    label: 'Dacia',    value: 'dacia',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/dacia-logo.png',  },  {    label: 'Fiat',    value: 'fiat',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/fiat-logo.png',  },  {    label: 'Ford',    value: 'ford',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/ford-logo.png',  },  {    label: 'Ferrari',    value: 'ferrari',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/ferrari-logo.png',  },  {    label: 'Honda',    value: 'honda',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/honda-logo.png',  },  {    label: 'Hyundai',    value: 'hyundai',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/hyundai-logo.png',  },  {    label: 'Jaguar',    value: 'jaguar',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/jaguar-logo.png',  },  {    label: 'Jeep',    value: 'jeep',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/jeep-logo.png',  },  {    label: 'Kia',    value: 'kia',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/kia-logo.png',  },  {    label: 'Land Rover',    value: 'land rover',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/land-rover-logo.png',  },  {    label: 'Mazda',    value: 'mazda',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mazda-logo.png',  },  {    label: 'Mercedes',    value: 'mercedes',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mercedes-logo.png',  },  {    label: 'Mini',    value: 'mini',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mini-logo.png',  },  {    label: 'Mitsubishi',    value: 'mitsubishi',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mitsubishi-logo.png',  },  {    label: 'Nissan',    value: 'nissan',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/nissan-logo.png',  },  {    label: 'Opel',    value: 'opel',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/opel-logo.png',  },  {    label: 'Peugeot',    value: 'peugeot',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/peugeot-logo.png',  },  {    label: 'Porsche',    value: 'porsche',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/porsche-logo.png',  },  {    label: 'Renault',    value: 'renault',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/renault-logo.png',  },  {    label: 'Saab',    value: 'saab',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/saab-logo.png',  },  {    label: 'Skoda',    value: 'skoda',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/skoda-logo.png',  },  {    label: 'Subaru',    value: 'subaru',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/subaru-logo.png',  },  {    label: 'Suzuki',    value: 'suzuki',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/suzuki-logo.png',  },  {    label: 'Toyota',    value: 'toyota',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/toyota-logo.png',  },  {    label: 'Volkswagen',    value: 'volkswagen',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/volkswagen-logo.png',  },  {    label: 'Volvo',    value: 'volvo',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/volvo-logo.png',  },]

Selection appearance

The autocomplete input allows you to customize the look and feel of the selected option.

Selection appearance prop

The autocomplete input allows you to customize the look and feel of the selected option by using the selection-appearance prop. For either the single-select or multi-select autocomplete, you can set the selection-appearance prop to text-input (default) or option:

autocomplete-selection-appearance
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit    type="autocomplete"    label="Single-select text input"    placheolder="Pick a country"    :options="countries"    popover    value="FR"  />  <FormKit    type="autocomplete"    label="Single-select option"    placheolder="Pick a country"    :options="countries"    popover    selection-appearance="option"    value="FR"  />  <FormKit    type="autocomplete"    label="Multiple text input"    placheolder="Pick a country"    :options="countries"    popover    multiple    :value="['FR', 'GR', 'ES']"  />  <FormKit    type="autocomplete"    label="Multiple option"    placheolder="Pick a country"    :options="countries"    multiple    selection-appearance="option"    :value="['FR', 'GR', 'ES']"  /></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]
France
France
Greece
Spain

Selection slot

If you only want to customize the display of the selected option, set the selection appearance to option.

autocomplete-slot-selection
car-brands
<FormKit  type="autocomplete"  name="autocomplete"  label="Search and select a car brand"  placeholder="Example: Toyota"  :options="carBrands"  popover  selection-appearance="option"  value="audi">  <!--SELECTION SLOT-->  <template #selection="{ option, classes }">    <div :class="classes.selection">      <div :class="`${classes.option} flex items-center`">        <img          :src="option.logo"          :alt="option.label + ' logo'"          class="w-10 h-10 p-2"        />        <span>          {{ option.label }}        </span>      </div>    </div>  </template>  <!--/SELECTION SLOT--></FormKit><FormKit  type="autocomplete"  name="autocomplete"  label="Search and select a car brand"  placeholder="Example: Toyota"  :options="carBrands"  selection-appearance="option"  multiple  :value="['toyota', 'honda']">  <!--SELECTION SLOT-->  <template #selection="{ option, classes }">    <div :class="`${classes.selection} !p-0`">      <div :class="`${classes.option} flex items-center`">        <img          :src="option.logo"          :alt="option.label + ' logo'"          class="w-10 h-10 p-2"        />        <span>          {{ option.label }}        </span>      </div>    </div>  </template>  <!--/SELECTION SLOT--></FormKit>
export default [  {    label: 'Audi',    value: 'audi',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/audi-logo.png',  },  {    label: 'BMW',    value: 'bmw',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/bmw-logo.png',  },  {    label: 'Citroen',    value: 'citroen',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/citroen-logo.png',  },  {    label: 'Dacia',    value: 'dacia',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/dacia-logo.png',  },  {    label: 'Fiat',    value: 'fiat',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/fiat-logo.png',  },  {    label: 'Ford',    value: 'ford',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/ford-logo.png',  },  {    label: 'Ferrari',    value: 'ferrari',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/ferrari-logo.png',  },  {    label: 'Honda',    value: 'honda',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/honda-logo.png',  },  {    label: 'Hyundai',    value: 'hyundai',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/hyundai-logo.png',  },  {    label: 'Jaguar',    value: 'jaguar',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/jaguar-logo.png',  },  {    label: 'Jeep',    value: 'jeep',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/jeep-logo.png',  },  {    label: 'Kia',    value: 'kia',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/kia-logo.png',  },  {    label: 'Land Rover',    value: 'land rover',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/land-rover-logo.png',  },  {    label: 'Mazda',    value: 'mazda',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mazda-logo.png',  },  {    label: 'Mercedes',    value: 'mercedes',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mercedes-logo.png',  },  {    label: 'Mini',    value: 'mini',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mini-logo.png',  },  {    label: 'Mitsubishi',    value: 'mitsubishi',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/mitsubishi-logo.png',  },  {    label: 'Nissan',    value: 'nissan',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/nissan-logo.png',  },  {    label: 'Opel',    value: 'opel',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/opel-logo.png',  },  {    label: 'Peugeot',    value: 'peugeot',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/peugeot-logo.png',  },  {    label: 'Porsche',    value: 'porsche',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/porsche-logo.png',  },  {    label: 'Renault',    value: 'renault',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/renault-logo.png',  },  {    label: 'Saab',    value: 'saab',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/saab-logo.png',  },  {    label: 'Skoda',    value: 'skoda',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/skoda-logo.png',  },  {    label: 'Subaru',    value: 'subaru',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/subaru-logo.png',  },  {    label: 'Suzuki',    value: 'suzuki',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/suzuki-logo.png',  },  {    label: 'Toyota',    value: 'toyota',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/toyota-logo.png',  },  {    label: 'Volkswagen',    value: 'volkswagen',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/volkswagen-logo.png',  },  {    label: 'Volvo',    value: 'volvo',    logo: 'https://s3.amazonaws.com/cdn.formk.it/example-assets/car-brands/volvo-logo.png',  },]
Audi logoAudi
Toyota logoToyota
Honda logoHonda

Behavioral props

Empty message

The autocomplete input, by default, will not expand the listbox when no search results are found while filtering. You can change this behavior by assigning the empty-message prop a message to display when no results are found:

autocomplete-empty-message
countries
<FormKit  type="autocomplete"  name="autocomplete"  label="Search for a country"  :options="countries"  placeholder="Example: United States"  empty-message="No countries found"  popover/>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]

Close on select

If you would like the listbox to remain expanded after selecting a value, you can set close-on-select to false.

autocomplete-close-on-select
countries
<FormKit  type="autocomplete"  name="autocomplete"  label="Search for a country"  :options="countries"  multiple  :close-on-select="false"  placeholder="Example: United States"  popover/>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]

Reload on commit

If you want the options to be reloaded when the user commits a selection, use the reload-on-commit prop:

autocomplete-reload-on-commit
countries
<FormKit  type="autocomplete"  name="country"  label="Search for a country"  placeholder="Example: United States"  :options="countries"  :reload-on-commit="true"  :close-on-select="false"  multiple  popover/>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]

Open on click

To enable opening the autocomplete's listbox on click of its search input, set the open-on-click prop to true:

autocomplete-open-on-click
countries
<FormKit  type="autocomplete"  name="country"  label="Search for a country"  placeholder="Example: United States"  :options="countries"  open-on-click  popover/>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]

Open on focus

If you would like to open the autocomplete's listbox anytime the input is clicked, set the open-on-focus prop to true:

<FormKit type="button" @click="focusAutocomplete">  Click me to focus autocomplete</FormKit><FormKit  id="autocomplete"  type="autocomplete"  name="framework"  label="Choose a frontend framework"  placeholder="Example placeholder"  :options="frameworks"  open-on-focus  popover/>
Open on focus vs Open on click

If open-on-focus is used, open-on-click will implicitly be set.

Clear search on open

For single-select autocompletes only, if you would like to clear the search input when the listbox is opened, set the clear-search-on-open:

autocomplete-clear-search-on-open
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      type="autocomplete"      name="country"      label="Search for a country"      placeholder="Example: United States"      :options="countries"      clear-search-on-open      value="US"      popover    />    <pre wrap>{{ value }}</pre>  </FormKit></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]
{}

Selection removable

For a single-select autocomplete, you can set the selection-removable prop. When set to true, a remove button will be displayed next to the selected option. This prop is by default set to true for autocompletes with selection appearance of option.

Single select only

The selection-removable prop cannot be used for multi-selects.

autocomplete-selection-removable
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      type="autocomplete"      name="country"      label="Search for a country"      placeholder="Example: United States"      :options="countries"      value="US"      popover      selection-removable    />    <pre wrap>{{ value }}</pre>  </FormKit></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]
{}

Open on remove

If you want the listbox to expand when an selection is removed, use the open-on-remove prop:

autocomplete-open-on-remove
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      type="autocomplete"      name="country"      label="Search for a country"      placeholder="Example: United States"      :options="countries"      open-on-remove      selection-removable      popover      value="US"    />    <pre wrap>{{ value }}</pre>  </FormKit></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]
{}

Max

If you would like to limit the number of options that can be selected, you can use the max prop:

autocomplete-max
countries
<script setup>import countries from './countries.js'</script><template>  <FormKit    type="autocomplete"    label="Autocomplete (option appearance) with max prop set to 2"    :options="countries"    selection-appearance="option"    multiple    popover    max="2"  />  <FormKit    type="autocomplete"    label="Autocomplete (text-input appearance) with max prop set to 2"    :options="countries"    selection-appearance="text-input"    multiple    popover    max="2"  /></template>
export default [  { label: 'Afghanistan', value: 'AF' },  { label: 'Åland Islands', value: 'AX' },  { label: 'Albania', value: 'AL' },  { label: 'Algeria', value: 'DZ' },  { label: 'American Samoa', value: 'AS' },  { label: 'AndorrA', value: 'AD' },  { label: 'Angola', value: 'AO' },  { label: 'Anguilla', value: 'AI' },  { label: 'Antarctica', value: 'AQ' },  { label: 'Antigua and Barbuda', value: 'AG' },  { label: 'Argentina', value: 'AR' },  { label: 'Armenia', value: 'AM' },  { label: 'Aruba', value: 'AW' },  { label: 'Australia', value: 'AU' },  { label: 'Austria', value: 'AT' },  { label: 'Azerbaijan', value: 'AZ' },  { label: 'Bahamas', value: 'BS' },  { label: 'Bahrain', value: 'BH' },  { label: 'Bangladesh', value: 'BD' },  { label: 'Barbados', value: 'BB' },  { label: 'Belarus', value: 'BY' },  { label: 'Belgium', value: 'BE' },  { label: 'Belize', value: 'BZ' },  { label: 'Benin', value: 'BJ' },  { label: 'Bermuda', value: 'BM' },  { label: 'Bhutan', value: 'BT' },  { label: 'Bolivia', value: 'BO' },  { label: 'Bosnia and Herzegovina', value: 'BA' },  { label: 'Botswana', value: 'BW' },  { label: 'Bouvet Island', value: 'BV' },  { label: 'Brazil', value: 'BR' },  { label: 'British Indian Ocean Territory', value: 'IO' },  { label: 'Brunei Darussalam', value: 'BN' },  { label: 'Bulgaria', value: 'BG' },  { label: 'Burkina Faso', value: 'BF' },  { label: 'Burundi', value: 'BI' },  { label: 'Cambodia', value: 'KH' },  { label: 'Cameroon', value: 'CM' },  { label: 'Canada', value: 'CA' },  { label: 'Cape Verde', value: 'CV' },  { label: 'Cayman Islands', value: 'KY' },  { label: 'Central African Republic', value: 'CF' },  { label: 'Chad', value: 'TD' },  { label: 'Chile', value: 'CL' },  { label: 'China', value: 'CN' },  { label: 'Christmas Island', value: 'CX' },  { label: 'Cocos (Keeling) Islands', value: 'CC' },  { label: 'Colombia', value: 'CO' },  { label: 'Comoros', value: 'KM' },  { label: 'Congo', value: 'CG' },  { label: 'Congo, The Democratic Republic of the', value: 'CD' },  { label: 'Cook Islands', value: 'CK' },  { label: 'Costa Rica', value: 'CR' },  { label: "Cote D'Ivoire", value: 'CI' },  { label: 'Croatia', value: 'HR' },  { label: 'Cuba', value: 'CU' },  { label: 'Cyprus', value: 'CY' },  { label: 'Czech Republic', value: 'CZ' },  { label: 'Denmark', value: 'DK' },  { label: 'Djibouti', value: 'DJ' },  { label: 'Dominica', value: 'DM' },  { label: 'Dominican Republic', value: 'DO' },  { label: 'Ecuador', value: 'EC' },  { label: 'Egypt', value: 'EG' },  { label: 'El Salvador', value: 'SV' },  { label: 'Equatorial Guinea', value: 'GQ' },  { label: 'Eritrea', value: 'ER' },  { label: 'Estonia', value: 'EE' },  { label: 'Ethiopia', value: 'ET' },  { label: 'Falkland Islands (Malvinas)', value: 'FK' },  { label: 'Faroe Islands', value: 'FO' },  { label: 'Fiji', value: 'FJ' },  { label: 'Finland', value: 'FI' },  { label: 'France', value: 'FR' },  { label: 'French Guiana', value: 'GF' },  { label: 'French Polynesia', value: 'PF' },  { label: 'French Southern Territories', value: 'TF' },  { label: 'Gabon', value: 'GA' },  { label: 'Gambia', value: 'GM' },  { label: 'Georgia', value: 'GE' },  { label: 'Germany', value: 'DE' },  { label: 'Ghana', value: 'GH' },  { label: 'Gibraltar', value: 'GI' },  { label: 'Greece', value: 'GR' },  { label: 'Greenland', value: 'GL' },  { label: 'Grenada', value: 'GD' },  { label: 'Guadeloupe', value: 'GP' },  { label: 'Guam', value: 'GU' },  { label: 'Guatemala', value: 'GT' },  { label: 'Guernsey', value: 'GG' },  { label: 'Guinea', value: 'GN' },  { label: 'Guinea-Bissau', value: 'GW' },  { label: 'Guyana', value: 'GY' },  { label: 'Haiti', value: 'HT' },  { label: 'Heard Island and Mcdonald Islands', value: 'HM' },  { label: 'Holy See (Vatican City State)', value: 'VA' },  { label: 'Honduras', value: 'HN' },  { label: 'Hong Kong', value: 'HK' },  { label: 'Hungary', value: 'HU' },  { label: 'Iceland', value: 'IS' },  { label: 'India', value: 'IN' },  { label: 'Indonesia', value: 'ID' },  { label: 'Iran, Islamic Republic Of', value: 'IR' },  { label: 'Iraq', value: 'IQ' },  { label: 'Ireland', value: 'IE' },  { label: 'Isle of Man', value: 'IM' },  { label: 'Israel', value: 'IL' },  { label: 'Italy', value: 'IT' },  { label: 'Jamaica', value: 'JM' },  { label: 'Japan', value: 'JP' },  { label: 'Jersey', value: 'JE' },  { label: 'Jordan', value: 'JO' },  { label: 'Kazakhstan', value: 'KZ' },  { label: 'Kenya', value: 'KE' },  { label: 'Kiribati', value: 'KI' },  { label: "Korea, Democratic People'S Republic of", value: 'KP' },  { label: 'Korea, Republic of', value: 'KR' },  { label: 'Kuwait', value: 'KW' },  { label: 'Kyrgyzstan', value: 'KG' },  { label: "Lao People'S Democratic Republic", value: 'LA' },  { label: 'Latvia', value: 'LV' },  { label: 'Lebanon', value: 'LB' },  { label: 'Lesotho', value: 'LS' },  { label: 'Liberia', value: 'LR' },  { label: 'Libyan Arab Jamahiriya', value: 'LY' },  { label: 'Liechtenstein', value: 'LI' },  { label: 'Lithuania', value: 'LT' },  { label: 'Luxembourg', value: 'LU' },  { label: 'Macao', value: 'MO' },  { label: 'Macedonia, The Former Yugoslav Republic of', value: 'MK' },  { label: 'Madagascar', value: 'MG' },  { label: 'Malawi', value: 'MW' },  { label: 'Malaysia', value: 'MY' },  { label: 'Maldives', value: 'MV' },  { label: 'Mali', value: 'ML' },  { label: 'Malta', value: 'MT' },  { label: 'Marshall Islands', value: 'MH' },  { label: 'Martinique', value: 'MQ' },  { label: 'Mauritania', value: 'MR' },  { label: 'Mauritius', value: 'MU' },  { label: 'Mayotte', value: 'YT' },  { label: 'Mexico', value: 'MX' },  { label: 'Micronesia, Federated States of', value: 'FM' },  { label: 'Moldova, Republic of', value: 'MD' },  { label: 'Monaco', value: 'MC' },  { label: 'Mongolia', value: 'MN' },  { label: 'Montenegro', value: 'ME' },  { label: 'Montserrat', value: 'MS' },  { label: 'Morocco', value: 'MA' },  { label: 'Mozambique', value: 'MZ' },  { label: 'Myanmar', value: 'MM' },  { label: 'Namibia', value: 'NA' },  { label: 'Nauru', value: 'NR' },  { label: 'Nepal', value: 'NP' },  { label: 'Netherlands', value: 'NL' },  { label: 'Netherlands Antilles', value: 'AN' },  { label: 'New Caledonia', value: 'NC' },  { label: 'New Zealand', value: 'NZ' },  { label: 'Nicaragua', value: 'NI' },  { label: 'Niger', value: 'NE' },  { label: 'Nigeria', value: 'NG' },  { label: 'Niue', value: 'NU' },  { label: 'Norfolk Island', value: 'NF' },  { label: 'Northern Mariana Islands', value: 'MP' },  { label: 'Norway', value: 'NO' },  { label: 'Oman', value: 'OM' },  { label: 'Pakistan', value: 'PK' },  { label: 'Palau', value: 'PW' },  { label: 'Palestinian Territory, Occupied', value: 'PS' },  { label: 'Panama', value: 'PA' },  { label: 'Papua New Guinea', value: 'PG' },  { label: 'Paraguay', value: 'PY' },  { label: 'Peru', value: 'PE' },  { label: 'Philippines', value: 'PH' },  { label: 'Pitcairn', value: 'PN' },  { label: 'Poland', value: 'PL' },  { label: 'Portugal', value: 'PT' },  { label: 'Puerto Rico', value: 'PR' },  { label: 'Qatar', value: 'QA' },  { label: 'Reunion', value: 'RE' },  { label: 'Romania', value: 'RO' },  { label: 'Russian Federation', value: 'RU' },  { label: 'RWANDA', value: 'RW' },  { label: 'Saint Helena', value: 'SH' },  { label: 'Saint Kitts and Nevis', value: 'KN' },  { label: 'Saint Lucia', value: 'LC' },  { label: 'Saint Pierre and Miquelon', value: 'PM' },  { label: 'Saint Vincent and the Grenadines', value: 'VC' },  { label: 'Samoa', value: 'WS' },  { label: 'San Marino', value: 'SM' },  { label: 'Sao Tome and Principe', value: 'ST' },  { label: 'Saudi Arabia', value: 'SA' },  { label: 'Senegal', value: 'SN' },  { label: 'Serbia', value: 'RS' },  { label: 'Seychelles', value: 'SC' },  { label: 'Sierra Leone', value: 'SL' },  { label: 'Singapore', value: 'SG' },  { label: 'Slovakia', value: 'SK' },  { label: 'Slovenia', value: 'SI' },  { label: 'Solomon Islands', value: 'SB' },  { label: 'Somalia', value: 'SO' },  { label: 'South Africa', value: 'ZA' },  { label: 'South Georgia and the South Sandwich Islands', value: 'GS' },  { label: 'Spain', value: 'ES' },  { label: 'Sri Lanka', value: 'LK' },  { label: 'Sudan', value: 'SD' },  { label: 'Suriname', value: 'SR' },  { label: 'Svalbard and Jan Mayen', value: 'SJ' },  { label: 'Swaziland', value: 'SZ' },  { label: 'Sweden', value: 'SE' },  { label: 'Switzerland', value: 'CH' },  { label: 'Syrian Arab Republic', value: 'SY' },  { label: 'Taiwan, Province of China', value: 'TW' },  { label: 'Tajikistan', value: 'TJ' },  { label: 'Tanzania, United Republic of', value: 'TZ' },  { label: 'Thailand', value: 'TH' },  { label: 'Timor-Leste', value: 'TL' },  { label: 'Togo', value: 'TG' },  { label: 'Tokelau', value: 'TK' },  { label: 'Tonga', value: 'TO' },  { label: 'Trinidad and Tobago', value: 'TT' },  { label: 'Tunisia', value: 'TN' },  { label: 'Turkey', value: 'TR' },  { label: 'Turkmenistan', value: 'TM' },  { label: 'Turks and Caicos Islands', value: 'TC' },  { label: 'Tuvalu', value: 'TV' },  { label: 'Uganda', value: 'UG' },  { label: 'Ukraine', value: 'UA' },  { label: 'United Arab Emirates', value: 'AE' },  { label: 'United Kingdom', value: 'GB' },  { label: 'United States', value: 'US' },  { label: 'United States Minor Outlying Islands', value: 'UM' },  { label: 'Uruguay', value: 'UY' },  { label: 'Uzbekistan', value: 'UZ' },  { label: 'Vanuatu', value: 'VU' },  { label: 'Venezuela', value: 'VE' },  { label: 'Viet Nam', value: 'VN' },  { label: 'Virgin Islands, British', value: 'VG' },  { label: 'Virgin Islands, U.S.', value: 'VI' },  { label: 'Wallis and Futuna', value: 'WF' },  { label: 'Western Sahara', value: 'EH' },  { label: 'Yemen', value: 'YE' },  { label: 'Zambia', value: 'ZM' },  { label: 'Zimbabwe', value: 'ZW' },]

Full example

Now let's combine what we've learned so far by leveraging the option slot for custom markup, and setting the options prop to a function that will return pages of movies from an API:

autocomplete-full
top-movies
<script setup>import topMovies from './top-movies.js'// Search movie receives FormKit's context object// which we are destructuring to get the search value,// the page, and the hasNextPage parameters.async function searchMovies({ search, page, hasNextPage }) {  if (!search) {    // When there is no search value we return a static list of top movies    return topMovies  }  const res = await fetch(    `https://api.themoviedb.org/3/search/movie?query=${      search || ''    }&api_key=f48bcc9ed9cbce41f6c28ea181b67e14&language=en-US&page=${page}&include_adult=false`  )  if (res.ok) {    const data = await res.json()    if (page !== data.total_pages) hasNextPage()    return data.results.map((result) => {      return {        label: result.title,        value: result.id,        poster_path: result.poster_path,        overview: result.overview,      }    })  }  return []}</script><template>  <FormKit type="form" #default="{ value }" :actions="false">    <FormKit      name="movie"      type="autocomplete"      label="Search for your favorite movie"      placeholder="Example placeholder"      :options="searchMovies"      selection-appearance="option"      multiple      popover      remove-selection-class="p-2 pl-0"    >      <template #option="{ option }">        <div class="flex items-center justify-between">          <div class="image-container w-1/4 mr-2">            <img              :src="`https://image.tmdb.org/t/p/w500${option.poster_path}`"              alt="optionAvatar"              class="w-full"            />          </div>          <div class="text-container w-full">            <div class="text-base leading-none font-bold">              {{ option.label }}            </div>            <p class="option-overview text-xs">              {{ option.overview }}            </p>          </div>        </div>      </template>    </FormKit>    <pre wrap>{{ value }}</pre>  </FormKit></template>
export default [  {    label: 'The Shawshank Redemption',    value: 278,    poster_path: '/lyQBXzOQSuE59IsHyhrp0qIiPAz.jpg',    overview:      'Framed in the 1940s for the double murder of his w…for his integrity and unquenchable sense of hope.',  },  {    label: 'The Godfather',    value: 238,    poster_path: '/3bhkrj58Vtu7enYsRolD1fZdja1.jpg',    overview:      'Spanning the years 1945 to 1955, a chronicle of th… killers, launching a campaign of bloody revenge.',  },  {    label: 'The Dark Knight',    value: 155,    poster_path: '/qJ2tW6WMUDux911r6m7haRef0WH.jpg',    overview:      'Batman raises the stakes in his war on crime. With…to the terrified citizens of Gotham as the Joker.',  },  {    label: '12 Angry Men',    value: 389,    poster_path: '/ow3wq89wM8qd5X7hWKxiRfsFf9C.jpg',    overview:      'The defense and the prosecution have rested and th…ons about the trial, the accused, and each other.',  },  {    label: "Schindler's List",    value: 424,    poster_path: '/sF1U4EUQS8YHUYjNl3pMGNIQyr0.jpg',    overview:      'The true story of how businessman Oskar Schindler …ked as slaves in his factory during World War II.',  },  {    label: 'Lord of the Rings 1',    value: '__mask_1',    poster_path: '/6oom5QYQ2yQTMJIbnvbkBL9cHo6.jpg',    overview:      'Young hobbit Frodo Baggins, after inheriting a mys…. Doom, the only place where it can be destroyed.',    __original: 120,  },  {    label: 'Pulp Fiction',    value: '__mask_1',    poster_path: '/d5iIlFn5s0ImszYzBPb8JPIfbXD.jpg',    overview:      'A burger-loving hit man, his philosophical partner…ies that ingeniously trip back and forth in time.',    __original: 680,  },  {    label: 'The Good, the Bad and the Ugly',    value: '__mask_1',    poster_path: '/bX2xnavhMYjWDoZp1VM6VnU1xwe.jpg',    overview:      'While the Civil War rages on between the Union and…f a strongbox containing $200,000 in stolen gold.',    __original: 429,  },  {    label: 'Forrest Gump',    value: '__mask_3',    poster_path: '/arw2vcBveWOVZr6pxd9XTd1TdQa.jpg',    overview:      'A man with a low IQ has accomplished great things …ll he has achieved, his one true love eludes him.',    __original: 13,  },  {    label: 'Fight Club',    value: '__mask_1',    poster_path: '/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg',    overview:      'A ticking-time-bomb insomniac and a slippery soap …ignites an out-of-control spiral toward oblivion.',    __original: 550,  },]
{}

Props & Attributes

PropType Default Description
debouncenumber200Number of milliseconds to debounce calls to an options function.
optionsany[]The list of options the user can select from.
load-on-scrollbooleanfalseWhen set to true, the autocomplete will try loading more options based on the end-user`s scroll position
selection-appearancestringtext-inputChanges the way the option label is display.
multiplebooleanfalseAllows for multiple selections.
open-on-clickbooleanfalseThe autocomplete is expanded upon focus of the input, as opposed to waiting to expand until a search value is entered.
filterfunctionnullUsed to apply your own custom filter function for static options.
option-loaderfunctionnullUsed for hydrating initial value, or performing an additional request to load more information of a selected option.
empty-messagestringundefinedRenders a message when there are no options to display.
maxnumberundefinedLimits the number of options that can be selected.
open-on-removebooleanfalseWhen the selection-removable prop is set to true, the autocomplete will not open after the selected value is removed. You can change this behavior by setting the open-on-remove prop to true.
open-on-focusbooleanfalse
options-appearancestringundefinedFor multi-select autocompletes, this prop allows you to customize the look and feel of the selected options. Possible values are default (the default) or checkbox.
always-load-on-openbooleantrueDetermines whether the autocomplete should always load its options when opened or whether it should reference the options that were previously found when opening.
load-on-createdbooleanfalseWhen set to true, the autocomplete will load the options when the node is created.
clear-search-on-openbooleanfalseWhen set to true, the search input will be cleared when the listbox is opened.
maxnumber | stringundefinedIf you would like to limit the number of options that can be selected, you can use the max prop (applies only to multi-select).
popoverbooleanfalseRenders the input's listbox using the browser Popover API.
Show Universal props
configObject{}Configuration options to provide to the input’s node and any descendent node of this input.
delayNumber20Number of milliseconds to debounce an input’s value before the commit hook is dispatched.
dirtyBehaviorstringtouchedDetermines how the "dirty" flag of this input is set. Can be set to touched or comparetouched (the default) is more performant, but will not detect when the form is once again matching its initial state.
errorsArray[]Array of strings to show as error messages on this field.
helpString''Text for help text associated with the input.
idStringinput_{n}The unique id of the input. Providing an id also allows the input’s node to be globally accessed.
ignoreBooleanfalsePrevents an input from being included in any parent (group, list, form etc). Useful when using inputs for UI instead of actual values.
indexNumberundefinedAllows an input to be inserted at the given index if the parent is a list. If the input’s value is undefined, it inherits the value from that index position. If it has a value it inserts it into the lists’s values at the given index.
labelString''Text for the label element associated with the input.
nameStringinput_{n}The name of the input as identified in the data object. This should be unique within a group of fields.
parentFormKitNodecontextualBy default the parent is a wrapping group, list or form — but this props allows explicit assignment of the parent node.
prefix-iconString''Specifies an icon to put in the prefixIcon section.
preserveBooleanfalsePreserves the value of the input on a parent group, list, or form when the input unmounts.
preserve-errorsBooleanfalseBy default errors set on inputs using setErrors are automatically cleared on input, setting this prop to true maintains the error until it is explicitly cleared.
sections-schemaObject{}An object of section keys and schema partial values, where each schema partial is applied to the respective section.
suffix-iconString''Specifies an icon to put in the suffixIcon section.
typeStringtextThe type of input to render from the library.
validationString, Array[]The validation rules to be applied to the input.
validation-visibilityStringblurDetermines when to show an input's failing validation rules. Valid values are blur, dirty, and live.
validation-labelString{label prop}Determines what label to use in validation error messages, by default it uses the label prop if available, otherwise it uses the name prop.
validation-rulesObject{}Additional custom validation rules to make available to the validation prop.
valueAnyundefinedSeeds the initial value of an input and/or its children. Not reactive. Can seed entire groups (forms) and lists..

Sections & slot data

You can target a specific section of an input using that section's "key", allowing you to modify that section's classes, HTML (via :sections-schema, or content (via slots)). Read more about sections here.

The autocomplete's structure changes depending on a few different scenarios:

  • Whether selection-appearance has been set to text-input (the default) or option.
  • Whether multiple selections are enabled via the multiple attribute.

Selection appearance text-input

When selection-appearance="text-input" (the default), the selected value(s) appear as comma-separated text in the input field.

Your favorite athletes
Serena, Pelé
(See diagram below)
Search for your favorite athletes.
Sorry, that athlete could not be found.

Selection appearance option

When selection-appearance="option", the selected value(s) render as styled chips. For single-select, the selections section appears inside inner. For multi-select, it appears inside wrapper below inner.

Your favorite athlete
Pelé
X
(See diagram below)
Search for your favorite athlete.
Sorry, that athlete could not be found.

Listbox (dropdown) structure

The listbox section contains the dropdown options. It is rendered inside a dropdownWrapper that handles positioning.

No options to display.
✔️
Serena
Section-key Description
selectorThe selector section is a button element that opens the dropdown options list.
selectionsContains individual selection sections.
selectionContains the selected option.
listitemA list item element that contains the option section.
optionA div that contains the option content.
listboxThe listbox section is a ul element that contains the options list.
dropdownWrapperWraps the listbox section. A div that handles scrolling the listbox.
optionLoadingA span element that is conditionally rendered within the selected option when loading is occurring.
loaderIconAn element for outputting an icon in the selector element when loading is occurring.
selectIconAn element for outputting an icon in the selector element when the dropdown is closed.
loadMoreA list item element that is conditionally rendered at the bottom of the options list when there are more pages to load.
loadMoreInnerA span element that acts as a wrapper for the loaderIcon within the loadMore section.
removeSelectionA button element used for removing a specific selection.
closeIconAn element for outputting an icon within the removeSelection button.
listboxButtonA button element that is used to open the dropdown.
emptyMessageA list item element that is conditionally rendered when there are no options to display.
emptyMessageInnerA span element that acts as a wrapper for the emptyMessage section.
Show Universal section keys
outerThe outermost wrapping element.
wrapperA wrapper around the label and input.
labelThe label of the input.
prefixHas no output by default, but allows content directly before an input element.
prefixIconAn element for outputting an icon before the prefix section.
innerA wrapper around the actual input element.
suffixHas no output by default, but allows content directly after an input element.
suffixIconAn element for outputting an icon after the suffix section.
inputThe input element itself.
helpThe element containing help text.
messagesA wrapper around all the messages.
messageThe element (or many elements) containing a message — most often validation and error messages.

Accessibility

All FormKit inputs are designed with the following accessibility considerations in mind. Help us continually improve accessibility for all by filing accessibility issues here:

  • Semantic markup
  • ARIA attributes
  • Keyboard accessibility
  • Focus indicators
  • Color contrast with the provided theme
  • Accessible labels, help text, and errors

Accessibility attributes

Section KeyAttributeValueDescription
inputtabindex-1 or 0Prioritizes keyboard focus order by setting it to -1 when disabled and 0 when enabled.
rolecomboboxIndicates to assistive technologies that this element functions as a combobox.
readonlyRestrict user edits, ensuring data integrity and a controlled, informative user experience.
aria-autocompletelistGuides input suggestions, presenting a collection of values that could complete the user's input.
aria-activedescendantManage focus to the current active descendent element.
aria-expandedConveys the expandable state when the element is in focus.
aria-controlsAssociates the listbox element, with this element.
listboxButtontabindex-1 or 0Prioritizes keyboard focus order by setting it to -1 when disabled and 0 when enabled.
rolebuttonIndicates to assistive technologies that this element functions as a button.
aria-haspopuptrueSignals that an element triggers a pop-up or menu
aria-expandedConveys the expandable state when the element is in focus.
aria-controlsAssociates the listbox element, with this element.
aria-disabledCommunicates the disabled state when the input is disabled.
selectionWrappertabindex-1 or 0Prioritizes keyboard focus order by setting it to -1 when disabled and 0 when enabled.
selectionsaria-livepoliteCommunicates dynamic content changes when selections are on the screen.
removeSelectiontabindex-1Removes the prioritization of keyboard focus on this element.
aria-controlsAssociates the input element, with this element.
Universal Accessibility Attributes
labellabelforAssociates a label to an input element. Users can click on the label to focus the input or to toggle between states.
inputinputdisabledDisables an HTML element, preventing user interaction and signaling a non-interactive state.
aria-describedbyAssociates an element with a description, aiding screen readers.
aria-requiredAdded when input validation is set to required.
iconiconforLinks icon to input element when icon in rendered as a label.

Keyboard Interactions

Keyboard EventDescription
EnterOpens the listbox when the input is focused. Selects an item when a list item is focused
SpaceOpens the listbox when the input is focused. Selects an item when a list item is focused
EscCloses the listbox when the input is focused.
Navigates to previous list item in list box. Closes listbox if most-previous item is selected
Opens the listbox when input is focused. Navigates to next list item in list box.
Universal Keyboard Events
TabMoves the focus to the next focusable element on the page.
Shift+TabMoves the focus to the previous focusable element on the page.