{"id":13780053,"url":"https://github.com/zoltantothcom/vanilla-js-dropdown","last_synced_at":"2025-05-11T13:31:26.799Z","repository":{"id":2884713,"uuid":"47789388","full_name":"zoltantothcom/vanilla-js-dropdown","owner":"zoltantothcom","description":"Vanilla JavaScript select replacement makes styling easy and consistent.","archived":false,"fork":false,"pushed_at":"2023-04-28T09:41:12.000Z","size":986,"stargazers_count":91,"open_issues_count":12,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T18:09:07.990Z","etag":null,"topics":["dropdown","dropdown-menus","javascript-select","select","vanilla-javascript"],"latest_commit_sha":null,"homepage":"http://zoltantothcom.github.io/vanilla-js-dropdown","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoltantothcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2015-12-10T21:48:18.000Z","updated_at":"2024-09-03T12:02:08.000Z","dependencies_parsed_at":"2023-07-06T08:01:44.791Z","dependency_job_id":null,"html_url":"https://github.com/zoltantothcom/vanilla-js-dropdown","commit_stats":{"total_commits":103,"total_committers":13,"mean_commits":7.923076923076923,"dds":0.6893203883495146,"last_synced_commit":"639b5afaff037b7a0321ce91eaa840b919de44b6"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltantothcom%2Fvanilla-js-dropdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltantothcom%2Fvanilla-js-dropdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltantothcom%2Fvanilla-js-dropdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltantothcom%2Fvanilla-js-dropdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoltantothcom","download_url":"https://codeload.github.com/zoltantothcom/vanilla-js-dropdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056760,"owners_count":17414204,"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":["dropdown","dropdown-menus","javascript-select","select","vanilla-javascript"],"created_at":"2024-08-03T18:01:11.893Z","updated_at":"2024-11-17T15:30:51.106Z","avatar_url":"https://github.com/zoltantothcom.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["Dropdowns"],"readme":"# Vanilla JavaScript Dropdown - replacement for `\u003cselect\u003e`\n\n[![Build Status](https://travis-ci.org/zoltantothcom/vanilla-js-dropdown.svg?branch=master)](https://travis-ci.org/zoltantothcom/vanilla-js-dropdown) [![Coverage Status](https://coveralls.io/repos/github/zoltantothcom/vanilla-js-dropdown/badge.svg?branch=master)](https://coveralls.io/github/zoltantothcom/vanilla-js-dropdown?branch=master) ![Dependencies](https://img.shields.io/badge/dependencies-none-brightgreen.svg)\n\nTiny (_**0.7 KB gzipped!**_) JavaScript replacement for `\u003cselect\u003e` that makes styling easy and consistent.\n\n_— Inspired by the blazing fast, lightweight, cross-platform and crazy popular [Vanilla JS](http://vanilla-js.com/) framework._\n\n## How it works\n\nReads the original `\u003cselect\u003e` element's options (_with respect of `selected`, if any_), creates and attaches the pseudo-select just before the original one, and hides the original.\n\nUpon selection it updates the original `\u003cselect\u003e`, so when you submit your form the value will be there.\n\nJavaScript disabled? No problem! Nicely degrades to original `\u003cselect\u003e`.\n\n## Demo\n\n[**CODE PLAYGROUND**](https://stackblitz.com/edit/vanilla-js-dropdown)\n\n## Detailed description and usage example\n\n[**DROPDOWN**](http://zoltantothcom.github.io/vanilla-js-dropdown)\n\n## Options\n\n| Option | Required | Description                                                        |\n| ------ | -------- | ------------------------------------------------------------------ |\n| elem   | yes      | _id_ of the select you want to replace **or** a direct DOM element |\n| bubbles   | no      | Boolean indicating whether the change event of the select bubbles |\n\n## Methods\n\n| Method    | Description                               |\n| --------- | ----------------------------------------- |\n| .toggle() | Opens the select if closed and vice-versa |\n| .close()  | Closes the select                         |\n| .open()   | Opens the select                          |\n\n## Usage example\n\n```javascript\nvar select = new CustomSelect({\n  elem: 'select',\n});\n\n// open it for the user\nselect.open();\n```\n\n## Running the tests\n\n```\nnpm test\n```\n\n## Browser support and dependencies\n\n| Browser | Support | Dependencies                                                                                                                                                                                                        |\n| ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Chrome  | yes     | -                                                                                                                                                                                                                   |\n| Firefox | yes     | -                                                                                                                                                                                                                   |\n| Safari  | yes     | -                                                                                                                                                                                                                   |\n| Opera   | yes     | -                                                                                                                                                                                                                   |\n| Edge    | yes     | -                                                                                                                                                                                                                   |\n| IE      | yes\\*   | [Polyfill](//cdn.jsdelivr.net/classlist/2014.01.31/classList.min.js) for `.classList` in IE9, [Polyfill](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill) for CustomEvent in IE9+ |\n\n\\* _IE9 and up_\n\n## Versioning\n\nThis project uses [SemVer](http://semver.org/) for versioning. For the versions available, see [the tags on this repository](https://github.com/zoltantothcom/vanilla-js-dropdown/tags).\n\n## License\n\nAnyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.\n\nSee [Unlicense](http://unlicense.org) for full details.\n\n## Related\n\n- [Vanilla JavaScript **Carousel**](https://github.com/zoltantothcom/vanilla-js-carousel)\n- [Vanilla JavaScript **Tabs**](https://github.com/zoltantothcom/vanilla-js-tabs)\n- [Vanilla JavaScript **Tooltip**](https://github.com/zoltantothcom/vanilla-js-tooltip)\n- [Vanilla JavaScript **Accordion**](https://github.com/zoltantothcom/vanilla-js-accordion)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoltantothcom%2Fvanilla-js-dropdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoltantothcom%2Fvanilla-js-dropdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoltantothcom%2Fvanilla-js-dropdown/lists"}