{"id":17979057,"url":"https://github.com/sidvishnoi/better-select","last_synced_at":"2026-03-07T22:31:26.829Z","repository":{"id":119737631,"uuid":"242148664","full_name":"sidvishnoi/better-select","owner":"sidvishnoi","description":"progressively enhanced select auto-complete","archived":false,"fork":false,"pushed_at":"2024-03-19T12:42:52.000Z","size":23,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T13:53:37.924Z","etag":null,"topics":["autocomplete","custom-elements","html-select","input","progressive-enhancement","select"],"latest_commit_sha":null,"homepage":"https://sidvishnoi.github.io/better-select/","language":"TypeScript","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/sidvishnoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2020-02-21T13:45:11.000Z","updated_at":"2024-03-19T12:42:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"91171e80-df8f-450c-a2f2-0fda2430a28d","html_url":"https://github.com/sidvishnoi/better-select","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"533646804bb63a02352349581cdea0ce4cd15e8f"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sidvishnoi/better-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidvishnoi%2Fbetter-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidvishnoi%2Fbetter-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidvishnoi%2Fbetter-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidvishnoi%2Fbetter-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidvishnoi","download_url":"https://codeload.github.com/sidvishnoi/better-select/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidvishnoi%2Fbetter-select/sbom","scorecard":{"id":822693,"data":{"date":"2025-08-11","repo":{"name":"github.com/sidvishnoi/better-select","commit":"a6e246f44a6d09c4ec04cecaace18856befd86a3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npmpublish.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/static.yml:14","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/sidvishnoi/better-select/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sidvishnoi/better-select/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/sidvishnoi/better-select/static.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/sidvishnoi/better-select/static.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/sidvishnoi/better-select/static.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/sidvishnoi/better-select/static.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/npmpublish.yml:16","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T15:58:39.234Z","repository_id":119737631,"created_at":"2025-08-23T15:58:39.235Z","updated_at":"2025-08-23T15:58:39.235Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30234496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["autocomplete","custom-elements","html-select","input","progressive-enhancement","select"],"created_at":"2024-10-29T17:36:05.212Z","updated_at":"2026-03-07T22:31:26.795Z","avatar_url":"https://github.com/sidvishnoi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# better-select\n\nA progressively enhanced, lightweight, customizable, and accessible `\u003cselect\u003e` custom element with text input.\n\n## Features\n\n### Lightweight\n\nA single file, weighing only ![minified size](https://badgen.net/bundlephobia/min/better-select) ![gzipped size](https://badgen.net/bundlephobia/minzip/react), and having no dependencies.\n\n### Accessible\n\nBased on Adam Silver's article [Building an accessible auto-complete control](https://adamsilver.io/articles/building-an-accessible-autocomplete-control/), and some improvements of my own.\n\n### Progressively enhanced\n\nAll you need to do is wrap your `\u003cselect\u003e` element inside a `\u003cbetter-select\u003e` element, and the `\u003cselect\u003e` will be enhanced. If for some reason, your JavaScript fails to load (or until it loads), users will still be able to access a working `\u003cselect\u003e` menu. You don't need to change your forms input handling either.\n\n## Basic Usage\n\n```html\n\u003cscript src=\"./better-select.js\" type=\"module\"\u003e\u003c/script\u003e\n\n\u003cbetter-select\u003e\n  \u003cselect name=\"country\" id=\"country\"\u003e\n    \u003coption value=\"\"\u003eSelect\u003c/option\u003e\n    \u003coption value=\"in\"\u003eIndia\u003c/option\u003e\n    \u003coption value=\"au\"\u003eAustralia\u003c/option\u003e\n    \u003coption value=\"ja\"\u003eJapan\u003c/option\u003e\n  \u003c/select\u003e\n\u003c/better-select\u003e\n```\n\nYou can import better-select.js from CDNs like [unpkg](https://unpkg.com/better-select/better-select.js). The package is also available on [npm](https://www.npmjs.com/package/better-select).\n\n## Advanced Usage\n\n### Need to use some other name for custom element?\n\n```html\n\u003cscript type=\"module\"\u003e\n  import BetterSelect from \"./better-select.js\";\n  customElements.define(\"my-better-select\", BetterSelect);\n\u003c/script\u003e\n```\n\n### Styling?\n\nThe custom element can be styled using CSS custom properties. Following properties are presently available along with their default values:\n\n```css\nbetter-select {\n  /* input box */\n  --input-color: #000;\n  --input-background: #fff;\n  --input-border-width: 2px;\n  --input-border-color: #718096;\n  /* focused/active input box */\n  --outline-width: 3px;\n  --outline-color: #ecc94b;\n  /* options list wrapper */\n  --menu-max-height: 16em;\n  --menu-background: var(--input-background);\n  /* options */\n  --item-padding: 0.5em;\n  --item-color: #000;\n  --item-background: #fff;\n  --item-color-active: #fff;\n  --item-background-active: #111;\n  /* dropdown arrow */\n  --caret-color: var(--input-color);\n}\n```\n\n### Custom filter function\n\n**Method 1:** Extend `isMatch` method of `BetterSelect` class:\n\n```js\nimport BetterSelect from \"./better-select.js\";\n\nclass MyBetterSelect extends BetterSelect {\n  constructor() {\n    super();\n  }\n\n  /**\n   * @param {HTMLOptionElement} option an option from select element\n   * @param {string} value the value user has typed\n   * @returns {boolean} whether this option be listed or not\n   */\n  isMatch(option, value) {\n    return option.getAttribute(\"data-value\").startsWith(value);\n  }\n}\n\ncustomElements.define(\"my-better-select\", MyBetterSelect);\n```\n\n**Method 2:** Add a globally available function name as an attribute to the element\n\n```html\n\u003cbetter-select match=\"myMatcherFunction\"\u003e\n  \u003cselect name=\"country\" id=\"country\"\u003e\n    \u003coption value=\"in\"\u003eIndia\u003c/option\u003e\n    \u003c!-- … --\u003e\n  \u003c/select\u003e\n\u003c/better-select\u003e\n\n\u003cscript\u003e\n  function myMatcherFunction(option, value) {\n    return option.value.startsWith(value);\n  }\n\u003c/script\u003e\n```\n\n## Contributing\n\n- Reporting issues is welcome.\n- Sending pull requests is more welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidvishnoi%2Fbetter-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidvishnoi%2Fbetter-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidvishnoi%2Fbetter-select/lists"}