{"id":24960928,"url":"https://github.com/yohn/yoselect","last_synced_at":"2026-02-12T02:06:22.302Z","repository":{"id":273949937,"uuid":"921427791","full_name":"Yohn/YoSelect","owner":"Yohn","description":"A searchable select and tag component for PicoCSS","archived":false,"fork":false,"pushed_at":"2025-01-27T00:45:27.000Z","size":32,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T06:38:25.517Z","etag":null,"topics":["css","form","picocss","select","tag-input","tagging","tags","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"https://yohn.github.io/YoSelect/","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/Yohn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-23T23:36:59.000Z","updated_at":"2025-10-03T11:32:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7247a96-30f0-4d9f-98bc-489065bd78cd","html_url":"https://github.com/Yohn/YoSelect","commit_stats":null,"previous_names":["yohn/yoselect"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Yohn/YoSelect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FYoSelect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FYoSelect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FYoSelect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FYoSelect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yohn","download_url":"https://codeload.github.com/Yohn/YoSelect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FYoSelect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29354699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["css","form","picocss","select","tag-input","tagging","tags","vanilla-javascript","vanilla-js"],"created_at":"2025-02-03T08:32:41.472Z","updated_at":"2026-02-12T02:06:22.287Z","avatar_url":"https://github.com/Yohn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YoSelect\n\nYoSelect is a customizable select component that enhances the native HTML select element with features like searching, multiple selection, image support, and the ability to create new options.\n\n## Installation\n```\nnpm install @yohns/yoselect\n```\n1. Include the CSS and JS files in your HTML:\n```html\n\u003clink rel=\"stylesheet\" href=\"yoSelect.css\"\u003e\n\u003cscript src=\"yoSelect.js\"\u003e\u003c/script\u003e\n```\n\n## Basic Usage\n\n```html\n\u003cselect class=\"yoSelect\"\u003e\n\u003coption value=\"\"\u003eSelect an option...\u003c/option\u003e\n\u003coption value=\"1\"\u003eOption 1\u003c/option\u003e\n\u003coption value=\"2\"\u003eOption 2\u003c/option\u003e\n\u003c/select\u003e\n\u003cscript\u003e\nconst select = new YoSelect(document.querySelector('.yoSelect'));\n\u003c/script\u003e\n```\n\n## Features \u0026 Options\n\n### Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `search` | boolean | false | Enables search functionality |\n| `creatable` | boolean | false | Allows creating new options |\n| `clearable` | boolean | false | Adds ability to clear selection |\n| `searchPlaceholder` | string | 'Search...' | Placeholder text for search input |\n| `noResultsPlaceholder` | string | 'No results found' | Text shown when no options match search |\n| `addOptionPlaceholder` | string | 'Press Enter to add \"[term]\"' | Text shown when creating new option |\n| `classTag` | string | '' | Custom CSS class for selected tags in multiple mode |\n| `placeholder` | string | '' | Default placeholder text when no option is selected |\n\n### HTML Attributes\n\nYou can configure YoSelect using either JavaScript options or data attributes:\n\n```html\n\u003cselect\nclass=\"yoSelect\"\ndata-yo-search=\"true\"\ndata-yo-clearable=\"true\"\ndata-yo-creatable=\"true\"\u003e\n```\n\n### Image Support\n\nAdd images to options using the `data-yo-img` attribute:\n\n```html\n\u003coption value=\"us\" data-yo-img=\"path/to/image.png\"\u003eUnited States\u003c/option\u003e\n```\n\n### Multiple Selection\n\nEnable multiple selection using the `multiple` attribute:\n\n```html\n\u003cselect class=\"yoSelect\" multiple\u003e\n\u003coption value=\"1\"\u003eOption 1\u003c/option\u003e\n\u003coption value=\"2\"\u003eOption 2\u003c/option\u003e\n\u003c/select\u003e\n```\n### Searchable Select\n\nEnable search functionality:\n```html\n\u003cselect class=\"yoSelect\" data-yo-search=\"true\"\u003e\n\u003c!-- options --\u003e\n\u003c/select\u003e\n\u003c!-- or via JavaScript --\u003e\n\u003cscript\u003e\nnew YoSelect(element, {\nsearch: true,\nsearchPlaceholder: 'Custom search placeholder...',\nnoResultsPlaceholder: 'Custom no results message'\n});\n\u003c/script\u003e\n```\n\n### Creatable Options\n\nAllow users to create new options:\n\n```html\n\u003cselect class=\"yoSelect\" data-yo-creatable=\"true\"\u003e\n\u003c!-- options --\u003e\n\u003c/select\u003e\n\u003c!-- or via JavaScript --\u003e\n\u003cscript\u003e\nnew YoSelect(element, {\ncreatable: true,\naddOptionPlaceholder: 'Press Enter to create \"[term]\"'\n});\n\u003c/script\u003e\n```\n### Clearable Selection\n\nEnable clearing of selection:\n```html\n\u003cselect class=\"yoSelect\" data-yo-clearable=\"true\"\u003e\n\u003c!-- options --\u003e\n\u003c/select\u003e\n```\n### Placeholder Text\n\nSet placeholder text in three ways:\n\n1. Using data-placeholder attribute:\n```html\n\u003coption value=\"\" data-placeholder=\"Choose an option...\"\u003eChoose an option...\u003c/option\u003e\n```\n2. Using JavaScript:\n```html\n\u003coption value=\"\"\u003eSelect something...\u003c/option\u003e\n```\n3. Using configuration:\n```javascript\nnew YoSelect(element, {\nplaceholder: 'Please select...'\n});\n```\n### Custom Styling\n\nAdd custom classes to tags in multiple selection mode:\n```javascript\nnew YoSelect(element, {\nclassTag: 'custom-tag-class'\n});\n```\n\n### Event Listener\n\nAdd an event listener to the select element:\n```javascript\nconst select = new YoSelect(element);\nselect.element.addEventListener('change', (event) =\u003e {\nconsole.log('Selection changed:', event.target.value);\n});\n```\n## Browser Support\n\nYoSelect is compatible with all modern browsers including:\n- Chrome\n- Firefox\n- Safari\n- Edge\n\n## Examples\n\n### Basic Single Select with Search\n\n```html\n\u003cselect class=\"yoSelect\" data-yo-search=\"true\"\u003e\n\u003coption value=\"\"\u003eSelect a country\u003c/option\u003e\n\u003coption value=\"us\" data-yo-img=\"flag-us.png\"\u003eUnited States\u003c/option\u003e\n\u003coption value=\"uk\" data-yo-img=\"flag-uk.png\"\u003eUnited Kingdom\u003c/option\u003e\n\u003c/select\u003e\n```\n### Multiple Select with Create Option\n```html\n\u003cselect class=\"yoSelect\" multiple data-yo-search=\"true\" data-yo-creatable=\"true\"\u003e\n\u003coption value=\"js\"\u003eJavaScript\u003c/option\u003e\n\u003coption value=\"py\"\u003ePython\u003c/option\u003e\n\u003c/select\u003e\n```\n### Searchable Tags with Custom Styling\n```html\n\u003cselect class=\"yoSelect\" multiple data-yo-search=\"true\"\u003e\n\u003coption value=\"tag1\"\u003eTag 1\u003c/option\u003e\n\u003coption value=\"tag2\"\u003eTag 2\u003c/option\u003e\n\u003c/select\u003e\n\u003cscript\u003e\nnew YoSelect(element, {\nclassTag: 'custom-tag',\nsearchPlaceholder: 'Search tags...'\n});\n\u003c/script\u003e\n```\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohn%2Fyoselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyohn%2Fyoselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohn%2Fyoselect/lists"}