{"id":15611774,"url":"https://github.com/mvdschee/suggestify","last_synced_at":"2025-03-29T15:12:19.826Z","repository":{"id":57151211,"uuid":"379590149","full_name":"mvdschee/suggestify","owner":"mvdschee","description":"Fully accessible search with suggestions","archived":false,"fork":false,"pushed_at":"2022-11-04T10:32:37.000Z","size":1767,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T07:18:32.581Z","etag":null,"topics":["accessible","search","suggestion","typescipt"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvdschee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-23T12:08:26.000Z","updated_at":"2024-12-05T11:17:24.000Z","dependencies_parsed_at":"2023-01-21T00:45:12.639Z","dependency_job_id":null,"html_url":"https://github.com/mvdschee/suggestify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdschee%2Fsuggestify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdschee%2Fsuggestify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdschee%2Fsuggestify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdschee%2Fsuggestify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvdschee","download_url":"https://codeload.github.com/mvdschee/suggestify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246200322,"owners_count":20739566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessible","search","suggestion","typescipt"],"created_at":"2024-10-03T06:07:45.164Z","updated_at":"2025-03-29T15:12:19.791Z","avatar_url":"https://github.com/mvdschee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](./suggestify.gif)\n\n# 🕵 Suggestify\n\n**Fully accessible search with suggestions (Suggestions served by serverless function)**\n\nPlease note: this project is a personal project I made available and will probably keep changing things to my liking or personal usage. Also, the serverless function with the suggestion logic is not included; I'm working on it and want to keep it for myself for now :)\n\n➡ [Demo](https://suggestify.maxvanderschee.nl)\n\n### 🌎 Browser support\n\n-   Chrome\n-   Edge (Chrome)\n-   Firefox\n-   Safari\n\n# 🐎 Getting started\n\n### Install\n\n```bash\n$ yarn add suggestify\n```\n\nSet up your HTML\n\n```html\n\u003cdiv id=\"suggestify\" role=\"search\"\u003e\n\t\u003cinput placeholder=\"Search...\" aria-label=\"Search input\" /\u003e\n\t\u003cbutton aria-label=\"Delete input\"\u003e\u003c/button\u003e\n\t\u003cbutton type=\"submit\" aria-label=\"Search\"\u003e\u003c/button\u003e\n\u003c/div\u003e\n```\n\nImport the files in your Javascript or TypeScript file\n\n```js\n// import Suggestify\nimport Suggestify from 'suggestify';\n\n// Init and config\nnew Suggestify(...);\n```\n\n### Configure\n\nThe selector can either be a `string` or `HTMLElement`\n\n```js\nnew Suggestify('#sugestify', {\n\t// Redirect url with search input\n\turl: '/search?q=', // default: ?q=\n\n\t// Suggestion engine url\n\tengine: 'https://example.com/search-api', // default: /api/search\n\n\t// Class to add to elements\n\tclass: 'my-class', // default: suggestify\n\n\t// Remove suggestions if user clicks outside search\n\tblur: true, // default: true\n\n\t// Add \u003ci\u003e in button element for custom icon styling\n\ticon: true, // default: true\n\n\t// Give suggestions instantly on load\n\tinstant: false, // default: false\n\n\t// Translations for banner text\n\ttranslations: {\n\t\tsuggestions: 'Most used search results', // default: Suggestions\n\t\tresults: 'Nothing to see', // default: No suggestions found\n\t},\n});\n```\n\n### 🎉 Styling\n\n`scss` is included and only works with `suggestify` class.\n\n```scss\n@import 'suggestify/style.scss';\n```\n\nThe cleaner version is to copy the styling and adjust it to your liking.\n\n# 👨‍💻 Development\n\n### 📦 Requirments\n\n-   [Node.js v14 or higher](https://nodejs.org/en/)\n-   [Yarn v1.22 or higher](https://yarnpkg.com/lang/en/)\n-   ☕ Coffee\n\n### 🏇 QuickStart\n\n1. Type in the terminal:\n\n    ```bash\n    # install dependencies\n    $ yarn\n\n    # run dev\n    $ yarn dev\n    ```\n\n2. Open your browser and navigate to [http://localhost:3000](http://localhost:3000)\n\n3. Add a suggestion engine (not included, see data model) and provide the URL in `src/main.ts`\n\n### 📐 Data model\n\nThe suggestion engine is not included in the project. Instead, I will provide you with the output, which you can use to build it yourself.\n\nThree types are used for different cases.\n\n1. suggestions: is used for initial suggestions\n\n    ```js\n    {\n        type: 'suggestions',\n        items: ['item', ...],\n        time: '0ms'\n    }\n    ```\n\n2. results: for normal suggestion results\n    ```js\n    {\n        type: 'results',\n        items: ['item', ...],\n        time: '0.05ms'\n    }\n    ```\n3. empty: if no results are found \u003e which also means the response has an empty items `array`\n    ```js\n    {\n        type: 'empty',\n        items: [],\n        time: '0.01ms'\n    }\n    ```\n\nHappy coding 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvdschee%2Fsuggestify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvdschee%2Fsuggestify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvdschee%2Fsuggestify/lists"}