{"id":21084160,"url":"https://github.com/unplugstudio/droppy","last_synced_at":"2025-06-16T04:37:48.098Z","repository":{"id":35001720,"uuid":"195467984","full_name":"unplugstudio/droppy","owner":"unplugstudio","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-04T01:53:38.000Z","size":1050,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-20T23:33:19.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unplugstudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-05T21:14:17.000Z","updated_at":"2019-07-05T21:36:28.000Z","dependencies_parsed_at":"2023-01-15T12:00:27.696Z","dependency_job_id":null,"html_url":"https://github.com/unplugstudio/droppy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugstudio%2Fdroppy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugstudio%2Fdroppy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugstudio%2Fdroppy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugstudio%2Fdroppy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unplugstudio","download_url":"https://codeload.github.com/unplugstudio/droppy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243526953,"owners_count":20305115,"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":[],"created_at":"2024-11-19T20:22:45.472Z","updated_at":"2025-03-14T05:11:28.130Z","avatar_url":"https://github.com/unplugstudio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Droppy\n\nSimple, accessible, nested dropdow menus. Inspired by Bootstrap dropdowns.\n\nSupports TAB navigation, Space/Enter to toggle the dropdowns, Esc to close. All positioning is done via CSS, so it can easily be converted to accordions / drawers for mobile users.\n\n*No dependencies. Less than 4 KB minified, less than 2 KB gzipped.*\n\nOpen `demo.html` for a complete demo.\n\n## Installation\n\nYou can include Droppy directly in your document:\n\n```html\n\u003cscript src=\"lib/droppy.min.js\"\u003e\n\u003cscript\u003e\n  droppy.Droppy(...)\n  droppy.init(...)\n\u003cscript\u003e\n```\n\nYou can also install from git and consume as a ES6 module:\n\n```bash\nnpm install git+https://gitlab.com/jerivas/droppy.git\n```\n\n```javascript\nimport Droppy, { init } from 'droppy'\n```\n\n## Required markup\n\n```html\n\u003cbutton data-toggle=\"dropdown\" aria-controls=\"dropdown-1\"\u003e\n  Open dropdown\n\u003c/button\u003e\n\u003cul id=\"dropdown-1\"\u003e\n  \u003cli\u003e\u003ca href=\"#\"\u003eItem 1\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#\"\u003eItem 2\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#\"\u003eItem 3\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cscript\u003e\n  // Single element\n  var btn = document.querySelector('[data-toggle=\"dropdown\"]')\n  var myDroppy = new droppy.Droppy(btn)\n\n  // OR: All elements with [data-toggle=\"dropdown\"] in one go\n  droppy.init()\n\u003c/script\u003e\n```\n\n- Add `data-toggle=\"dropdown\"` to the `button`\n- Add an id to the `\u003cul\u003e` and pass it to `aria-controls` on the button\n- Initialize Droppy on the `button`\n- When the dropdown is toggled, the class `open` will be added to the dropdown (you can pass a custom class to `init` and `Droppy` as the second argument)\n- Also the `aria-expanded` attribute will be toggled on the button\n- Optional: Attach event listeners to the document and listen for:\n  - `show.droppy`\n  - `shown.droppy`\n  - `hide.droppy`\n  - `hidden.droppy`\n  On each event you'll have access to the dropdown as `event.target` and the button as `event.detail.relatedTarget`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funplugstudio%2Fdroppy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funplugstudio%2Fdroppy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funplugstudio%2Fdroppy/lists"}