{"id":17382054,"url":"https://github.com/michu2k/Accordion","last_synced_at":"2026-08-16T11:30:16.406Z","repository":{"id":20441528,"uuid":"87917038","full_name":"michu2k/Accordion","owner":"michu2k","description":"Lightweight and accessible accordion module for JavaScript. Very useful to create FAQ lists on your website.","archived":false,"fork":false,"pushed_at":"2026-06-20T16:20:17.000Z","size":1184,"stargazers_count":397,"open_issues_count":1,"forks_count":76,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-06-20T18:13:56.423Z","etag":null,"topics":["a11y","accessibility","accordion","aria","es6","javascript","javascript-library"],"latest_commit_sha":null,"homepage":"https://michu2k.github.io/Accordion/","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/michu2k.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-04-11T09:43:20.000Z","updated_at":"2026-05-25T19:32:24.000Z","dependencies_parsed_at":"2024-01-10T08:43:31.042Z","dependency_job_id":"e86a7dc5-e845-48a9-bbbb-7c4f9a0b2c36","html_url":"https://github.com/michu2k/Accordion","commit_stats":{"total_commits":161,"total_committers":7,"mean_commits":23.0,"dds":0.5093167701863355,"last_synced_commit":"5eac06e3679d52e2740c8d6dcd1a48a7412a26c2"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/michu2k/Accordion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michu2k%2FAccordion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michu2k%2FAccordion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michu2k%2FAccordion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michu2k%2FAccordion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michu2k","download_url":"https://codeload.github.com/michu2k/Accordion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michu2k%2FAccordion/sbom","scorecard":{"id":642144,"data":{"date":"2025-08-11","repo":{"name":"github.com/michu2k/Accordion","commit":"1b2b9521fa0099e7feca56f08b4603c48558d45a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"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":"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":"Code-Review","score":0,"reason":"Found 0/26 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":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-r7jx-5m6m-cpg9","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T11:05:35.849Z","repository_id":20441528,"created_at":"2025-08-21T11:05:35.849Z","updated_at":"2025-08-21T11:05:35.849Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36713739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-16T02:00:06.462Z","response_time":62,"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":["a11y","accessibility","accordion","aria","es6","javascript","javascript-library"],"created_at":"2024-10-16T07:05:16.676Z","updated_at":"2026-08-16T11:30:16.398Z","avatar_url":"https://github.com/michu2k.png","language":"JavaScript","funding_links":[],"categories":["UI Components"],"sub_categories":["Accordion"],"readme":"# Accordion\n\nLightweight and accessible accordion module with an extensible API. With the module you can create accordion on your website, useful especially for creating FAQ lists.\n\n## Version\n\n3.4.1\n\n## Installation\n\n###### npm\n\nInstall the package \u0026 import files\n\n```\nnpm install accordion-js\n```\n\n```javascript\nimport Accordion from \"accordion-js\";\nimport \"accordion-js/dist/accordion.min.css\";\n```\n\n###### CDN\n\nInclude files using CDN.\n\n```\nhttps://unpkg.com/accordion-js@3.4.1/dist/accordion.min.css\nhttps://unpkg.com/accordion-js@3.4.1/dist/accordion.min.js\n```\n\n```html\n\u003clink rel=\"stylesheet\" href=\"[CDN CSS URL]\" /\u003e\n\u003cscript src=\"[CDN JS URL]\"\u003e\u003c/script\u003e\n```\n\n###### Github\n\nYou can also download files from Github and attach them manually to your project. \u003cbr\u003e\nNote: On production use files (JS and CSS) only from **dist/** folder.\n\n## Usage\n\n###### Include files\n\nSee the section above.\n\n###### Create HTML layout\n\nThis is just an example of a layout. You can create your own HTML structure.\n\n```html\n\u003cdiv class=\"accordion-container\"\u003e\n  \u003cdiv class=\"ac\"\u003e\n    \u003ch2 class=\"ac-header\"\u003e\n      \u003cbutton type=\"button\" class=\"ac-trigger\"\u003eLorem ipsum dolor sit amet.\u003c/button\u003e\n    \u003c/h2\u003e\n    \u003cdiv class=\"ac-panel\"\u003e\n      \u003cp class=\"ac-text\"\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit.\u003c/p\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\n  \u003cdiv class=\"ac\"\u003e\n    \u003ch2 class=\"ac-header\"\u003e\n      \u003cbutton type=\"button\" class=\"ac-trigger\"\u003eLorem ipsum dolor sit amet.\u003c/button\u003e\n    \u003c/h2\u003e\n    \u003cdiv class=\"ac-panel\"\u003e\n      \u003cp class=\"ac-text\"\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit.\u003c/p\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\n  \u003cdiv class=\"ac\"\u003e\n    \u003ch2 class=\"ac-header\"\u003e\n      \u003cbutton type=\"button\" class=\"ac-trigger\"\u003eLorem ipsum dolor sit amet.\u003c/button\u003e\n    \u003c/h2\u003e\n    \u003cdiv class=\"ac-panel\"\u003e\n      \u003cp class=\"ac-text\"\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit.\u003c/p\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n###### Initialize the module\n\n```html\n\u003cscript\u003e\n  new Accordion(\".accordion-container\");\n\u003c/script\u003e\n```\n\n## API\n\n###### Examples\n\nnew Accordion(container, options)\n\n- `container` - *string | HTMLElement | Array\u003cstring | HTMLElement\u003e (required)*, A selector string, a DOM element, or an array of selector strings or HTMLElements that specify the accordion container(s).\n- `options` - *object (optional)*, Configuration options for the accordion. See the table below for available options.\n\n```javascript\n// Default options\nnew Accordion(\".container-first\");\n\n// User options\nnew Accordion(\".container-second\", {\n  duration: 400,\n  showMultiple: true,\n  onOpen: function (currentElement) {\n    console.log(currentElement);\n  }\n});\n\n// Define several accordions with the same options (pass an array with selectors)\nnew Accordion([\".container-first\", \".container-second\"], {});\n\n// or pass an array with HTMLElements\nconst accordions = Array.from(document.querySelectorAll(\".accordion-container\"));\nnew Accordion(accordions, {});\n\n// Detach events\nconst accordion = new Accordion(\".container-first\");\naccordion.detachEvents();\n```\n\n###### Options\n\n| Option         | Type     | Default value | Description                                                                                                                               |\n| -------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| duration       | number   | 500           | Animation duration in ms                                                                                                                  |\n| ariaEnabled    | boolean  | true          | Add ARIA elements to the HTML structure                                                                                                   |\n| collapse       | boolean  | true          | Allow collapse expanded panel                                                                                                             |\n| showMultiple   | boolean  | false         | Show multiple elements at the same time                                                                                                   |\n| onlyChildNodes | boolean  | true          | Disabling this option will find all items in the container. Warning: Setting to `false` will break the functionality of nested accordions |\n| openOnInit     | array    | []            | Show accordion elements during initialization                                                                                             |\n| elementClass   | string   | \"ac\"          | Element class                                                                                                                             |\n| triggerClass   | string   | \"ac-trigger\"  | Trigger class                                                                                                                             |\n| panelClass     | string   | \"ac-panel\"    | Panel class                                                                                                                               |\n| activeClass    | string   | \"is-active\"   | Active element class                                                                                                                      |\n| beforeOpen     | function | -             | Calls before the item is opened. \u003cbr\u003e `beforeOpen: (currElement) =\u003e {}`                                                                   |\n| onOpen         | function | -             | Calls when the item is opened. \u003cbr\u003e `onOpen: (currElement) =\u003e {}`                                                                         |\n| beforeClose    | function | -             | Calls before the item is closed. \u003cbr\u003e `beforeClose: (currElement) =\u003e {}`                                                                  |\n| onClose        | function | -             | Calls when the item is closed. \u003cbr\u003e `onClose: (currElement) =\u003e {}`                                                                        |\n\n###### Methods\n\n| Option         | Description                                                                                | Arguments             |\n| -------------- | ------------------------------------------------------------------------------------------ | --------------------- |\n| attachEvents() | Attach events                                                                              | -                     |\n| detachEvents() | Detach events                                                                              | -                     |\n| open()         | Open the accordion element with the given idx \u003cbr\u003e E.g. `acc.open(1)`                      | `idx` - element index |\n| close()        | Close the accordion element with the given idx \u003cbr\u003e E.g. `acc.close(1)`                    | `idx` - element index |\n| toggle()       | Toggle the accordion element with the given idx \u003cbr\u003e E.g. `acc.toggle(1)`                  | `idx` - element index |\n| openAll()      | Open all accordion elements (without animation)                                            | -                     |\n| closeAll()     | Close all accordion elements (without animation)                                           | -                     |\n| update()       | If there are new items added by lazy load, you can run this method to update the Accordion | -                     |\n| destroy()      | Destroy accordion instance: \u003cbr\u003e Open elements, remove events, IDs \u0026 ARIA                  | -                     |\n\n## v3 Release Info\n\nThere have been a lot of changes to the API in version `3.0.0`, so if you are using previous versions of the accordion (`2.8.0` and below), I recommend updating the package to the latest version with new structure and options.\n\n## License\n\nThis project is under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichu2k%2FAccordion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichu2k%2FAccordion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichu2k%2FAccordion/lists"}