Autocomplete search with CMS

The Webflow Advanced Search with Autocomplete script enhances your Webflow site with powerful search capabilities. It provides real-time filtering of CMS items, keyboard navigation, and customizable search result actions.

Overview

Solution Highlights

  • Real-time Search
  • Autocomplete Functionality
  • Keyboard Navigation
  • Keyboard Shortcut
  • Customizable Search Actions
  • No Results Handling
  • Form Submission Control

The Advanced Search solution includes several keyboard shortcuts and navigation features to enhance user experience:

Shortcut Action
Ctrl + K (Cmd + K on Mac) Focus the search input
↓ (Down Arrow) Move focus to the next search result
↑ (Up Arrow) Move focus to the previous search result
Enter Select the currently focused search result
Esc (Escape) Clear the search input and hide results
Script

Copy the <script> & paste in </body>

<script src="https://cdn.jsdelivr.net/gh/shreyas-ws/autocomplete-search-with-cms@main/autocomplete-search-cms.min.js"></script>
Copy Script
<!--Tuesday Tools - Autocomplete with CMS-->
<script src="https://cdn.jsdelivr.net/gh/shreyas-ws/autocomplete-search-with-cms@main/autocomplete-search-cms.min.js"></script>
Copy Component
{"type":"@webflow/XscpData","payload":{"nodes":[{"_id":"6f0ee72e-f922-e99d-715f-d34132bb9e28","type":"Block","tag":"div","classes":["1542230a-4fa4-2037-2781-dd0c07bc4a02"],"children":["66f5a524-ae88-ccf9-8b0b-032d38359fbf","27aee5bd-3203-1012-e389-e7e57ac0cb55"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"66f5a524-ae88-ccf9-8b0b-032d38359fbf","type":"Block","tag":"div","classes":["a1815a70-6730-2b00-0a8a-c20b4badbf0f","17ad419a-7f8c-fc20-70e3-10c37f919f3b"],"children":["1a777d85-ea62-a11c-9aff-07216c50cc9b"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"1a777d85-ea62-a11c-9aff-07216c50cc9b","type":"Heading","tag":"h2","classes":["07815991-952a-8d98-0e00-e4c25af27133"],"children":["a53fe40b-a7a5-36d4-7952-ee98ba0e6cde"],"data":{"tag":"h2","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"a53fe40b-a7a5-36d4-7952-ee98ba0e6cde","text":true,"v":"Component"},{"_id":"27aee5bd-3203-1012-e389-e7e57ac0cb55","type":"FormWrapper","tag":"div","classes":["1824d781-e130-df44-15e1-80a0aab7d88d"],"children":["404cf0e9-d8a8-e077-ab8c-a9a80f08335f","e1f9a653-98eb-5d93-17e3-da6d3361ee6e","94173443-c281-d8e6-b30d-733bbf6acae0"],"data":{"search":{"exclude":true},"form":{"type":"wrapper"},"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"visibility":{"conditions":[]}}},{"_id":"404cf0e9-d8a8-e077-ab8c-a9a80f08335f","type":"FormForm","tag":"form","classes":["47197db5-b4d2-cd6c-1ac1-1d034fc5a3bd"],"children":["2e4f9f9a-0ec1-c723-0c97-67a70950957d","ee86d3fd-66bc-d585-1d81-5e21588a8f37","046efb8a-8ff4-a297-8af6-c273ae0ea5db"],"data":{"Source":{"tag":"Default form","val":{}},"form":{"type":"form","name":"Search Form"},"attr":{"id":"wf-form-Search-Form","name":"wf-form-Search-Form","data-name":"Search Form","redirect":"","data-redirect":"","action":"","method":"get"},"devlink":{"runtimeProps":{},"slot":""},"displayName":"","xattr":[{"name":"tu-autosearch-element","value":"search-form"},{"name":"tu-autosearch-form-submit","value":"false"}],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"2e4f9f9a-0ec1-c723-0c97-67a70950957d","type":"Block","tag":"div","classes":["7ae308a8-59d0-9aea-f2e6-b173b84f30a0"],"children":["e33921b7-2089-08c4-6af4-94de594e7200","6209e30f-8263-f2fb-4c7f-0f2b48ac7d59"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"e33921b7-2089-08c4-6af4-94de594e7200","type":"FormTextInput","tag":"input","classes":["07815991-952a-8d98-0e00-e4c25af2713a","7ae308a8-59d0-9aea-f2e6-b173b84f30a4"],"children":[],"data":{"form":{"name":"Search Input 2","type":"input","passwordPage":false},"attr":{"id":"Search-Input-2","name":"Search-Input-2","maxlength":256,"data-name":"Search Input 2","placeholder":"Search recipes...","disabled":false,"type":"text","required":false,"autofocus":false},"devlink":{"runtimeProps":{},"slot":""},"displayName":"","xattr":[{"name":"tu-autosearch-element","value":"search-input"}],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"6209e30f-8263-f2fb-4c7f-0f2b48ac7d59","type":"Block","tag":"div","classes":["7ae308a8-59d0-9aea-f2e6-b173b84f30a1"],"children":["aa7273cc-d762-b5de-52d6-623d34723634"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"aa7273cc-d762-b5de-52d6-623d34723634","type":"HtmlEmbed","tag":"div","classes":["7ae308a8-59d0-9aea-f2e6-b173b84f30a2"],"children":[],"v":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ic\" width=\"100%\" height=\"100%\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0s.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14\"></path></svg>","data":{"search":{"exclude":false},"embed":{"meta":{"html":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ic\" width=\"100%\" height=\"100%\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0s.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14\"></path></svg>","div":false,"script":false,"compilable":false,"iframe":false},"type":"html"},"insideRTE":false,"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"visibility":{"conditions":[]}}},{"_id":"ee86d3fd-66bc-d585-1d81-5e21588a8f37","type":"Block","tag":"div","classes":["07815991-952a-8d98-0e00-e4c25af27118","421d17ec-1e91-accb-916b-bb6178885058"],"children":["5896867b-c34b-19c1-46ee-ad77913b1121"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"5896867b-c34b-19c1-46ee-ad77913b1121","text":true,"v":"Try searching Tacos, Risotto, Crepes"},{"_id":"046efb8a-8ff4-a297-8af6-c273ae0ea5db","type":"Block","tag":"div","classes":["52c21438-1ec3-b6b0-3ee0-71d791ea8848"],"children":["5fb7d111-e02f-ed07-f589-a5c282ce2837","1505c6f5-7d34-dadf-8059-5d7625b9bc81","d8ce2c0e-b351-7df4-cae7-9adef2803fc0"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[{"name":"tu-autosearch-element","value":"search-results"}],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"5fb7d111-e02f-ed07-f589-a5c282ce2837","type":"DynamoWrapper","tag":"div","classes":["e6fb9966-f25a-5352-f668-e4a7cf8d9c5e"],"children":["ba0481cf-795e-7284-9595-f689c696e608","21d9b298-3710-478e-6b80-ace143bd2678"],"data":{"search":{"exclude":true},"tag":"div","displayName":"","attr":{"id":""},"xattr":[],"visibility":{"conditions":[]},"dyn":{"type":"wrapper","query":{"usePrimaryLocale":false}}}},{"_id":"ba0481cf-795e-7284-9595-f689c696e608","type":"DynamoList","tag":"div","classes":["1f3a8ff1-036a-242c-5cb3-7dd635a714a7"],"children":["780b5231-3ddb-84c1-620e-70523bd93ac4"],"data":{"tag":"div","displayName":"","attr":{"id":""},"xattr":[{"name":"tu-autosearch-element","value":"search-results-list"}],"search":{"exclude":false},"visibility":{"conditions":[]},"dyn":{"type":"list"}}},{"_id":"780b5231-3ddb-84c1-620e-70523bd93ac4","type":"DynamoItem","tag":"div","classes":["4938e4d9-a3af-9aad-a29b-6df620b7174b"],"children":["7135188f-3af3-acde-c802-e206d10146c9"],"data":{"displayName":"","attr":{"id":""},"xattr":[{"name":"tu-autosearch-element","value":"search-result-item"},{"name":"tu-autosearch-action","value":"autocomplete"},{"name":"tu-autosearch-class","value":"is-active"}],"search":{"exclude":false},"visibility":{"conditions":[]},"dyn":{"type":"item","grid":12}}},{"_id":"7135188f-3af3-acde-c802-e206d10146c9","type":"Link","tag":"a","classes":["c0332851-1b56-3a54-be73-19a04e55248d"],"children":["6aef1c4a-1337-fa84-daee-7811c6384922","7f828794-5f8d-def4-8cd0-9a3368702f59"],"data":{"button":false,"block":"inline","link":{"mode":"external"},"eventIds":[],"attr":{"id":""},"devlink":{"runtimeProps":{},"slot":""},"displayName":"","xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"6aef1c4a-1337-fa84-daee-7811c6384922","type":"Block","tag":"div","classes":[],"children":["0c3e8ff9-3b59-718d-4119-92bd8cb38f31"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"0c3e8ff9-3b59-718d-4119-92bd8cb38f31","text":true,"v":"Search Text"},{"_id":"7f828794-5f8d-def4-8cd0-9a3368702f59","type":"HtmlEmbed","tag":"div","classes":["0dbc67e0-9423-8b94-b559-ec17dfce831c"],"children":[],"v":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ic\" width=\"100%\" height=\"100%\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6 6v2h8.59L5 17.59L6.41 19L16 9.41V18h2V6z\"></path></svg>","data":{"search":{"exclude":false},"embed":{"meta":{"html":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ic\" width=\"100%\" height=\"100%\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M6 6v2h8.59L5 17.59L6.41 19L16 9.41V18h2V6z\"></path></svg>","div":false,"script":false,"compilable":false,"iframe":false},"type":"html"},"insideRTE":false,"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"visibility":{"conditions":[]}}},{"_id":"21d9b298-3710-478e-6b80-ace143bd2678","type":"DynamoEmpty","tag":"div","classes":[],"children":["e106f47f-e708-fd58-beb6-39c147b08e92"],"data":{"tag":"div","displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]},"dyn":{"type":"empty"}}},{"_id":"e106f47f-e708-fd58-beb6-39c147b08e92","type":"Block","tag":"div","classes":[],"children":["3465afb4-6791-cef5-089a-10131feaa7ac"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"3465afb4-6791-cef5-089a-10131feaa7ac","text":true,"v":"No items found."},{"_id":"1505c6f5-7d34-dadf-8059-5d7625b9bc81","type":"Block","tag":"div","classes":["49817765-615f-8450-d7c9-918d848a9364"],"children":["52ab998c-2fec-b16e-3441-a9cf45585837"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[{"name":"tu-autosearch-element","value":"empty"}],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"52ab998c-2fec-b16e-3441-a9cf45585837","type":"Block","tag":"div","classes":["4dd72c62-dff1-6760-e022-811dfdc5157d"],"children":["0da953e7-4cb9-f027-63b5-b21ef6652f7c","68a60d4c-90c1-929f-2386-2e348287a101"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"0da953e7-4cb9-f027-63b5-b21ef6652f7c","type":"Block","tag":"div","classes":[],"children":["fa925c37-5088-386f-75d3-8cb5a01d8337"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"fa925c37-5088-386f-75d3-8cb5a01d8337","text":true,"v":"No items found."},{"_id":"68a60d4c-90c1-929f-2386-2e348287a101","type":"Link","tag":"a","classes":[],"children":["de57c59a-0150-6460-d150-7d0fb860dfa7"],"data":{"button":false,"block":"","link":{"mode":"external","url":"#"},"eventIds":[],"attr":{"id":""},"devlink":{"runtimeProps":{},"slot":""},"displayName":"","xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"de57c59a-0150-6460-d150-7d0fb860dfa7","text":true,"v":"Go to All Recipes"},{"_id":"d8ce2c0e-b351-7df4-cae7-9adef2803fc0","type":"Block","tag":"div","classes":["aa24cddb-e349-3973-7778-40dc3714680a"],"children":["e31cc8d2-de3f-5ace-a180-45548ef08e30","4efd293f-7fb8-1991-388c-6ce952164245","e623095f-1f49-4545-ca8e-e9bbb0a04fe3","1896dc6f-05e8-fae2-529e-987e86390072"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"e31cc8d2-de3f-5ace-a180-45548ef08e30","type":"Block","tag":"div","classes":["377837e9-d594-61d7-d4ad-5c6aaa84b379"],"children":["ca8ca12d-7398-123b-5684-ff55ea8b50ce"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"ca8ca12d-7398-123b-5684-ff55ea8b50ce","type":"Block","tag":"div","classes":[],"children":["aafaace9-5463-a983-a2e3-d7ee11644c37","d8b3bc60-dbfe-8420-d044-07e978546f79","3d861639-af90-18ca-1d71-9462f1b4a7a6","157b9e38-aec3-016b-6fd5-1acd97f2cc2f","1ac7717a-9c4e-4dbe-754c-83500d5c806c"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"aafaace9-5463-a983-a2e3-d7ee11644c37","text":true,"v":"Arrow "},{"_id":"d8b3bc60-dbfe-8420-d044-07e978546f79","type":"Strong","tag":"strong","classes":[],"children":["843b36f8-6681-2e7b-d817-da21ef1e47bc"],"data":{"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"843b36f8-6681-2e7b-d817-da21ef1e47bc","text":true,"v":"↑"},{"_id":"3d861639-af90-18ca-1d71-9462f1b4a7a6","text":true,"v":" & "},{"_id":"157b9e38-aec3-016b-6fd5-1acd97f2cc2f","type":"Strong","tag":"strong","classes":[],"children":["e0aea41a-70c7-8125-0096-caba969d658d"],"data":{"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"e0aea41a-70c7-8125-0096-caba969d658d","text":true,"v":"↓"},{"_id":"1ac7717a-9c4e-4dbe-754c-83500d5c806c","text":true,"v":" to navigate"},{"_id":"4efd293f-7fb8-1991-388c-6ce952164245","type":"Block","tag":"div","classes":["377837e9-d594-61d7-d4ad-5c6aaa84b379"],"children":["9ddd7bc0-739c-a565-b81e-9870dfa913f2"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"9ddd7bc0-739c-a565-b81e-9870dfa913f2","type":"Block","tag":"div","classes":[],"children":["5aa6d158-fd9e-0c66-ef2f-61be60736f59"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"5aa6d158-fd9e-0c66-ef2f-61be60736f59","text":true,"v":"esc to close"},{"_id":"e623095f-1f49-4545-ca8e-e9bbb0a04fe3","type":"Block","tag":"div","classes":["377837e9-d594-61d7-d4ad-5c6aaa84b379"],"children":["fa01153b-2cdd-301f-08cc-aefda2a554e2"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"fa01153b-2cdd-301f-08cc-aefda2a554e2","type":"Block","tag":"div","classes":[],"children":["19eca2d6-b92e-7bf0-2f12-995a49dd2ea3"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"19eca2d6-b92e-7bf0-2f12-995a49dd2ea3","text":true,"v":"Ctrl / Cmd K to focus"},{"_id":"1896dc6f-05e8-fae2-529e-987e86390072","type":"Block","tag":"div","classes":["377837e9-d594-61d7-d4ad-5c6aaa84b379"],"children":["27ed59ad-c4b9-3e08-0265-d735221e53a4"],"data":{"text":false,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"27ed59ad-c4b9-3e08-0265-d735221e53a4","type":"Block","tag":"div","classes":[],"children":["d592e4a0-6b76-23ba-4382-dd834fc42251"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"d592e4a0-6b76-23ba-4382-dd834fc42251","text":true,"v":"↲ to Select"},{"_id":"e1f9a653-98eb-5d93-17e3-da6d3361ee6e","type":"FormSuccessMessage","tag":"div","classes":[],"children":["0c95da84-97d6-2272-efb5-3d6f6728c804"],"data":{"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]},"form":{"type":"msg-done"}}},{"_id":"0c95da84-97d6-2272-efb5-3d6f6728c804","type":"Block","tag":"div","classes":[],"children":["f0a82236-530e-7b9a-745e-32004cbe2df9"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"f0a82236-530e-7b9a-745e-32004cbe2df9","text":true,"v":"Thank you! Your submission has been received!"},{"_id":"94173443-c281-d8e6-b30d-733bbf6acae0","type":"FormErrorMessage","tag":"div","classes":[],"children":["34d00927-1228-43fe-6df0-4502e8cd8f69"],"data":{"devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]},"form":{"type":"msg-fail"}}},{"_id":"34d00927-1228-43fe-6df0-4502e8cd8f69","type":"Block","tag":"div","classes":[],"children":["8b0a1d1c-40dc-b31b-3e98-55d49c362a46"],"data":{"text":true,"tag":"div","devlink":{"runtimeProps":{},"slot":""},"displayName":"","attr":{"id":""},"xattr":[],"search":{"exclude":false},"visibility":{"conditions":[]}}},{"_id":"8b0a1d1c-40dc-b31b-3e98-55d49c362a46","text":true,"v":"Oops! Something went wrong while submitting the form."}],"styles":[{"_id":"aa24cddb-e349-3973-7778-40dc3714680a","fake":false,"type":"class","name":"auto-search_instructions","namespace":"","comb":"","styleLess":"position: sticky; left: 0%; top: auto; right: 0%; bottom: 0%; display: flex; padding-top: 0.25rem; padding-right: 0.5rem; padding-bottom: 0.25rem; padding-left: 0.5rem; justify-content: space-between; background-color: #fcf8d8;","variants":{"medium":{"styleLess":"display: none;"}},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"7ae308a8-59d0-9aea-f2e6-b173b84f30a0","fake":false,"type":"class","name":"auto-search_input","namespace":"","comb":"","styleLess":"position: relative; display: flex; align-items: center;","variants":{},"children":[],"createdBy":"5fd200f5276a22745616a7bd","origin":null,"selector":null},{"_id":"1f3a8ff1-036a-242c-5cb3-7dd635a714a7","fake":false,"type":"class","name":"recipes_list","namespace":"","comb":"","styleLess":"display: flex; flex-direction: column; flex-wrap: nowrap; grid-column-gap: 1px; grid-row-gap: 1px;","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"07815991-952a-8d98-0e00-e4c25af27118","fake":false,"type":"class","name":"text-size-tiny","namespace":"","comb":"","styleLess":"font-size: 0.75rem;","variants":{},"children":["421d17ec-1e91-accb-916b-bb6178885058"],"origin":null,"selector":null},{"_id":"c0332851-1b56-3a54-be73-19a04e55248d","fake":false,"type":"class","name":"recipes_link","namespace":"","comb":"","styleLess":"display: flex; padding-top: 0.75rem; padding-right: 1rem; padding-bottom: 0.75rem; padding-left: 1rem; justify-content: space-between; align-items: center; transition-property: background-color; transition-duration: 200ms; transition-timing-function: ease; color: hsla(0, 0.00%, 0.00%, 1.00); text-decoration: none;","variants":{"main_hover":{"styleLess":"background-color: #eee;"}},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"07815991-952a-8d98-0e00-e4c25af2713a","fake":false,"type":"class","name":"form_input","namespace":"","comb":"","styleLess":"min-height: 3rem; margin-bottom: 0.25rem; padding-top: 0.5rem; padding-right: 1rem; padding-bottom: 0.5rem; padding-left: 1rem; border-top-style: solid; border-top-width: 1px; border-top-color: #aaa; border-right-style: solid; border-right-width: 1px; border-right-color: #aaa; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #aaa; border-left-style: solid; border-left-width: 1px; border-left-color: #aaa; background-color: transparent; color: hsla(0, 0.00%, 0.00%, 1.00); font-size: 1rem;","variants":{"main_placeholder":{"styleLess":"color: #222;"}},"children":["07815991-952a-8d98-0e00-e4c25af27169","07815991-952a-8d98-0e00-e4c25af2716a","7ae308a8-59d0-9aea-f2e6-b173b84f30a4"],"origin":null,"selector":null},{"_id":"1542230a-4fa4-2037-2781-dd0c07bc4a02","fake":false,"type":"class","name":"auto-search_component","namespace":"","comb":"","styleLess":"","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"e6fb9966-f25a-5352-f668-e4a7cf8d9c5e","fake":false,"type":"class","name":"recipes_list-wrapper","namespace":"","comb":"","styleLess":"z-index: 99; background-color: hsla(0, 0.00%, 100.00%, 1.00);","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"7ae308a8-59d0-9aea-f2e6-b173b84f30a1","fake":false,"type":"class","name":"form-icon-left","namespace":"","comb":"","styleLess":"position: absolute; left: 0.75rem;","variants":{},"children":[],"createdBy":"5fd200f5276a22745616a7bd","origin":null,"selector":null},{"_id":"0dbc67e0-9423-8b94-b559-ec17dfce831c","fake":false,"type":"class","name":"icon-embed-xxsmall","namespace":"","comb":"","styleLess":"display: flex; width: 1rem; height: 1rem; flex-direction: column; justify-content: center; align-items: center;","variants":{},"children":[],"createdBy":"6075409192d886a671499223","origin":null,"selector":null},{"_id":"7ae308a8-59d0-9aea-f2e6-b173b84f30a2","fake":false,"type":"class","name":"icon-embed-xsmall","namespace":"","comb":"","styleLess":"display: flex; width: 1.5rem; height: 1.5rem; flex-direction: column; justify-content: center; align-items: center;","variants":{},"children":[],"createdBy":"6075409192d886a671499223","origin":null,"selector":null},{"_id":"7ae308a8-59d0-9aea-f2e6-b173b84f30a4","fake":false,"type":"class","name":"is-icon-both","namespace":"","comb":"&","styleLess":"padding-right: 2.75rem; padding-left: 2.75rem;","variants":{},"children":[],"createdBy":"5fd200f5276a22745616a7bd","origin":null,"selector":null},{"_id":"49817765-615f-8450-d7c9-918d848a9364","fake":false,"type":"class","name":"auto-search_results-empty","namespace":"","comb":"","styleLess":"padding-top: 0.75rem; padding-right: 1rem; padding-bottom: 0.75rem; padding-left: 1rem; background-color: #eee;","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"4938e4d9-a3af-9aad-a29b-6df620b7174b","fake":false,"type":"class","name":"recipes_list-item","namespace":"","comb":"","styleLess":"","variants":{},"children":["cc7e63fc-e2d6-9969-3856-3e09fac0b3af"],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"07815991-952a-8d98-0e00-e4c25af27133","fake":false,"type":"class","name":"heading-style-h4","namespace":"","comb":"","styleLess":"font-size: 1.5rem; line-height: 1.4; font-weight: 700;","variants":{"small":{"styleLess":"font-size: 1rem;"}},"children":[],"origin":null,"selector":null},{"_id":"47197db5-b4d2-cd6c-1ac1-1d034fc5a3bd","fake":false,"type":"class","name":"auto-search_form","namespace":"","comb":"","styleLess":"position: relative;","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"421d17ec-1e91-accb-916b-bb6178885058","fake":false,"type":"class","name":"text-style-muted","namespace":"","comb":"&","styleLess":"","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"4dd72c62-dff1-6760-e022-811dfdc5157d","fake":false,"type":"class","name":"recipes_list-empty-content","namespace":"","comb":"","styleLess":"display: flex; justify-content: space-between;","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"52c21438-1ec3-b6b0-3ee0-71d791ea8848","fake":false,"type":"class","name":"auto-search_results","namespace":"","comb":"","styleLess":"position: absolute; left: 0%; top: 3.25rem; right: 0%; bottom: auto; z-index: 99; display: block; overflow: auto; max-height: 14rem; border-top-style: solid; border-top-width: 1px; border-top-color: black; border-right-style: solid; border-right-width: 1px; border-right-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: black; border-left-style: solid; border-left-width: 1px; border-left-color: black; background-color: hsla(0, 0.00%, 100.00%, 1.00);","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"17ad419a-7f8c-fc20-70e3-10c37f919f3b","fake":false,"type":"class","name":"margin-small","namespace":"","comb":"&","styleLess":"","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"1824d781-e130-df44-15e1-80a0aab7d88d","fake":false,"type":"class","name":"auto-search_form-block","namespace":"","comb":"","styleLess":"margin-bottom: 0px;","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null},{"_id":"a1815a70-6730-2b00-0a8a-c20b4badbf0f","fake":false,"type":"class","name":"margin-bottom","namespace":"","comb":"","styleLess":"margin-top: 0rem; margin-right: 0rem; margin-left: 0rem;","variants":{"medium":{"styleLess":"margin-top: 0rem; margin-right: 0rem; margin-left: 0rem;"},"small":{"styleLess":"margin-top: 0rem; margin-right: 0rem; margin-left: 0rem;"},"tiny":{"styleLess":"margin-top: 0rem; margin-right: 0rem; margin-left: 0rem;"}},"children":["17ad419a-7f8c-fc20-70e3-10c37f919f3b","4e18feb4-d35e-5f3b-e649-f2eef8d48b94","49754ef2-379d-bf36-8f44-b00f78fedd82","bc91dc1a-b08c-a6d9-7613-cedcfdc63895","5b6ca485-4d81-3dc1-599d-3b541db6153f"],"origin":null,"selector":null},{"_id":"377837e9-d594-61d7-d4ad-5c6aaa84b379","fake":false,"type":"class","name":"auto-search_instruction-item","namespace":"","comb":"","styleLess":"font-size: 0.75rem;","variants":{},"children":[],"createdBy":"66d814ef3f854ea620d6c7b7","origin":null,"selector":null}],"assets":[],"ix1":[],"ix2":{"interactions":[],"events":[],"actionLists":[]}},"meta":{"droppedLinks":0,"dynBindRemovedCount":0,"dynListBindRemovedCount":0,"paginationRemovedCount":1,"universalBindingsRemovedCount":0,"unlinkedSymbolCount":0}}
Documentation

Apply attributes to elements on the page

Name
tu-autosearch-element
Value
search-form

This attribute identifies the main form container for the search functionality.

Do's:

  • Apply this to the outermost form element that contains all search-related elements.
  • Ensure only one element on the page has this attribute (unless implementing multiple independent search forms).

Don'ts:

  • Don't apply this to inner elements or non-form elements.
  • Avoid using this attribute on elements not related to the search functionality.

Notes:

  • This is a required attribute for the search functionality to work properly.
  • Apply this to the Form element.
Name
tu-autosearch-form-submit
Value
false

This attribute prevents the form from being submitted when the user presses Enter.

Do's:

  • Use this when you want to handle the search entirely via JavaScript without page reloads.
  • Set the value explicitly to "false" for the intended behavior.

Don'ts:

  • Don't use this if you want to allow traditional form submission.
  • Avoid setting this to any value other than "false" if you intend to prevent submission.

Notes:

  • If omitted or set to any other value, the form will submit normally.
  • This is particularly useful for single-page applications or when you want to provide a seamless search experience without page refreshes.
Name
tu-autosearch-element
Value
search-input

This attribute identifies the main search input field.

Do's:

  • Apply this to the text input element where users will type their search queries.
  • Ensure only one element has this attribute per search form.

Don'ts:

  • Don't apply this to non-input elements or hidden fields.
  • Avoid using this on multiple input fields within the same search form.

Notes:

  • This is a required attribute for the search functionality to work.
  • In Webflow, apply this to the Form Text Input element inside your Form Block.
Name
tu-autosearch-element
Value
search-results

This attribute identifies the outer container where search results will be displayed.

Do's:

  • Apply this to a div or similar container element that will hold the search result list and items.
  • Ensure this container is a parent of your Collection List if using Webflow CMS.

Don'ts:

  • Don't apply this to the Collection List itself or individual search result items.
  • Avoid using this on elements that should not be manipulated by the search script.

Notes:

  • This container's visibility will be toggled by the script based on search activity.
  • If using with Webflow CMS, apply this to a div that contains your Collection List.
Name
tu-autosearch-element
Value
search-results-list

This attribute identifies the immediate parent of the search result items, typically the Collection List in Webflow.

Do's:

  • Apply this to the Collection List element in Webflow.
  • Ensure this element is a child element to tu-autosearch-element="search-results".

Don'ts:

  • Don't apply this to the outer container or individual search result items.
  • Avoid using on non-list elements or containers that don't directly wrap search result items.

Notes:

  • This is crucial for proper functioning when using Webflow's Collection Lists.
  • The script uses this to correctly identify and manipulate the list of results.
Name
tu-autosearch-element
Value
empty

This attribute identifies the element that displays a message when no search results are found.

Do's:

  • Apply this to a div or text element that contains your "No results found" message.
  • Style this element appropriately to match your design.

Don'ts:

  • Don't apply this to elements that should always be visible.
  • Avoid putting this outside of the search results container.

Notes:

  • The script will automatically show/hide this element based on search results.
  • Initially set this element's display to 'none' in Webflow's style settings.
Name
tu-autosearch-element
Value
search-result-item

This attribute identifies individual search result items.

Do's:

  • Apply this to each item in your search results list.
  • If using Webflow CMS, apply this to the Collection List Item.

Don'ts:

  • Don't apply this to the container of all search results or the Collection List itself.
  • Avoid using on elements that aren't part of the search results.

Notes:

  • Each item with this attribute will be filtered and displayed based on the search query.
  • Ensure all searchable content is contained within elements with this attribute.
  • In Webflow, this should be on the Collection Item, not on individual elements within the item.
Name
tu-autosearch-element
Value
autocomplete
OR
Name
tu-autosearch-element
Value
open-link

This attribute defines the action to be taken when a search result item is selected.

Do's:

  • Use "autocomplete" if you want the search input to be filled with the selected item's text.
  • Use "open-link" if you want to navigate to a link contained within the search result item.
  • Apply this attribute to the same element that has tu-autosearch-element="search-result-item".

Don'ts:

  • Don't use both "autocomplete" and "open-link" on the same element.
  • Avoid using values other than "autocomplete" or "open-link".

Notes:

  • For "open-link" action, ensure the item contains an <a> tag with the desired link.
  • The "autocomplete" action is useful for search suggestions or filtering, while "open-link" is better for navigating to specific pages.
Name
tu-autosearch-element
Value
is-active

This attribute specifies the class name to be added to a search result item when it's active or focused.

Do's:

  • Apply this to the same element that has tu-autosearch-element="search-result-item".
  • Use a class name that's specific to your active state styling.
  • Create corresponding CSS styles for the class you specify.

Don'ts:

  • Don't use class names that conflict with existing Webflow classes.
  • Avoid using overly generic class names that might interfere with other styles.

Notes:

  • The class specified here will be dynamically added/removed by the script as users navigate through results.
  • This is particularly useful for keyboard navigation, allowing you to style the currently focused item.
  • Example usage: tu-autosearch-class="is-focused" or tu-autosearch-class="search-item-active".
DEMO

Autocomplete search with CMS Demo

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Need Webflow design or development services on Demand?

We offer on demand services that give you the flexibility to design pages and build them on Webflow as and when needed. No wait times and quick turnarounds.