{"id":24911433,"url":"https://github.com/accessible-ui/accordion","last_synced_at":"2025-10-16T22:30:29.907Z","repository":{"id":36931751,"uuid":"230334310","full_name":"accessible-ui/accordion","owner":"accessible-ui","description":"🅰 An accessible and versatile accordion for React with keyboard navigation and labeling features taught in w3.org's WAI-ARIA accordion best practices example","archived":false,"fork":false,"pushed_at":"2023-01-06T02:22:58.000Z","size":2122,"stargazers_count":7,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T09:27:49.653Z","etag":null,"topics":["a11y","a11y-accordion","accessibility","accessible","accessible-accordion","accessible-react","accordion","accordion-component","aria","aria-accordion","focus-management","react-accessibility","react-accordion"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/accessibleaccordion-example-7ylck","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/accessible-ui.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}},"created_at":"2019-12-26T22:11:40.000Z","updated_at":"2024-04-05T18:53:44.000Z","dependencies_parsed_at":"2023-01-17T07:30:52.730Z","dependency_job_id":null,"html_url":"https://github.com/accessible-ui/accordion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/accessible-ui/accordion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Faccordion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Faccordion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Faccordion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Faccordion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/accessible-ui","download_url":"https://codeload.github.com/accessible-ui/accordion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/accessible-ui%2Faccordion/sbom","scorecard":{"id":162334,"data":{"date":"2025-08-11","repo":{"name":"github.com/accessible-ui/accordion","commit":"4704e8b76d9f7fb4709b6f888f47af2de2943e07"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/21 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":"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":-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":"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":"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":"Vulnerabilities","score":0,"reason":"35 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"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-16T13:50:54.544Z","repository_id":36931751,"created_at":"2025-08-16T13:50:54.544Z","updated_at":"2025-08-16T13:50:54.544Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279249034,"owners_count":26133924,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"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","a11y-accordion","accessibility","accessible","accessible-accordion","accessible-react","accordion","accordion-component","aria","aria-accordion","focus-management","react-accessibility","react-accordion"],"created_at":"2025-02-02T04:20:06.912Z","updated_at":"2025-10-16T22:30:29.525Z","avatar_url":"https://github.com/accessible-ui.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003chr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003e\n    \u0026lt;Accordion\u0026gt;\n  \u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=@accessible/accordion\"\u003e\n    \u003cimg alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/@accessible/accordion?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Types\" href=\"https://www.npmjs.com/package/@accessible/accordion\"\u003e\n    \u003cimg alt=\"Types\" src=\"https://img.shields.io/npm/types/@accessible/accordion?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Code coverage report\" href=\"https://codecov.io/gh/accessible-ui/accordion\"\u003e\n    \u003cimg alt=\"Code coverage\" src=\"https://img.shields.io/codecov/c/gh/accessible-ui/accordion?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Build status\" href=\"https://travis-ci.org/accessible-ui/accordion\"\u003e\n    \u003cimg alt=\"Build status\" src=\"https://img.shields.io/travis/accessible-ui/accordion?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"NPM version\" href=\"https://www.npmjs.com/package/@accessible/accordion\"\u003e\n    \u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/@accessible/accordion?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"License\" href=\"https://jaredlunde.mit-license.org/\"\u003e\n    \u003cimg alt=\"MIT License\" src=\"https://img.shields.io/npm/l/@accessible/accordion?style=for-the-badge\u0026labelColor=24292e\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cpre align=\"center\"\u003enpm i @accessible/accordion\u003c/pre\u003e\n\u003chr\u003e\n\nAn accessible and versatile accordion for React with keyboard navigation and labeling features taught in\n[w3.org's WAI-ARIA accordion best practices example](https://www.w3.org/TR/wai-aria-practices/examples/accordion/accordion.html).\n\n## Features\n\n- **Style-agnostic** You can use this component with the styling library of your choice. It\n  works with CSS-in-JS, SASS, plain CSS, plain `style` objects, anything!\n- **a11y/aria-compliant** This component works with screen readers out of the box and manages\n  focus for you.\n\n## Quick Start\n\n[Check out the example on CodeSandbox](https://codesandbox.io/s/accessibleaccordion-example-7ylck)\n\n```jsx harmony\nimport {Accordion, Section, Trigger, Panel} from '@accessible/accordion'\n\nconst Component = () =\u003e (\n  \u003cAccordion defaultOpen={0}\u003e\n    \u003cSection\u003e\n      \u003ch3\u003e\n        \u003cTrigger\u003e\n          \u003cbutton\u003eSection 1\u003c/button\u003e\n        \u003c/Trigger\u003e\n      \u003c/h3\u003e\n      \u003cPanel\u003e\n        \u003cdiv className=\"panel\"\u003eSection 1 content\u003c/div\u003e\n      \u003c/Panel\u003e\n    \u003c/Section\u003e\n\n    \u003cSection\u003e\n      \u003ch3\u003e\n        \u003cTrigger\u003e\n          \u003cbutton\u003eSection 2\u003c/button\u003e\n        \u003c/Trigger\u003e\n      \u003c/h3\u003e\n      \u003cPanel\u003e\n        \u003cdiv className=\"panel\"\u003eSection 2 content\u003c/div\u003e\n      \u003c/Panel\u003e\n    \u003c/Section\u003e\n  \u003c/Accordion\u003e\n)\n```\n\n## API\n\n### Components\n\n| Component                   | Description                                                                                                                                                      |\n| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`\u003cAccordion\u003e`](#accordion) | This component creates the context for your accordion section and contains some configuration options.                                                           |\n| [`\u003cSection\u003e`](#section)     | This component creates the context for the accordion panel and trigger contained in this section. It must be a direct descendent of [`\u003cAccordion\u003e`](#accordion). |\n| [`\u003cTrigger\u003e`](#trigger)     | This component clones any React element and turns it into a accordion trigger that controls the visible state of the panel.                                      |\n| [`\u003cPanel\u003e`](#panel)         | This component clones any React element and turns it into a accordion panel.                                                                                     |\n| [`\u003cClose\u003e`](#close)         | This is a convenience component that clones any React element and adds an onClick handler to close its parent panel.                                             |  |\n\n### Hooks\n\n| Hook                              | Description                                                                                                           |\n| --------------------------------- | --------------------------------------------------------------------------------------------------------------------- |\n| [`useAccordion()`](#useaccordion) | This hook returns the value of the accordion's [AccordionContext object](#accordioncontextvalue).                     |\n| [`useSection()`](#usesection)     | This hook returns the value of the accordion [`\u003cSection\u003e`'s](#section) [SectionContext object](#sectioncontextvalue). |\n| [`useControls()`](#usecontrols)   | This hook returns the accordion [`\u003cSection\u003e`'s](#section) `open`, `close`, and `toggle` functions.                    |\n| [`useDisabled()`](#usedisabled)   | This hook returns the accordion [`\u003cSection\u003e`'s](#section) `disabled` value.                                           |\n| [`useIsOpen()`](#useisopen)       | This hook returns the accordion [`\u003cSection\u003e`'s](#section) `isOpen` value.                                             |\n\n### `\u003cAccordion\u003e`\n\nThis component creates the context for your accordion section and contains some configuration options.\n[`\u003cSection\u003e`s](#section) are the only type of children allowed.\n\n#### Props\n\n| Prop              | Type                                                  | Default     | Required? | Description                                                                                                                                                                      |\n| ----------------- | ----------------------------------------------------- | ----------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| defaultOpen       | \u003ccode\u003enumber \u0026#124; number[]\u003c/code\u003e                   | `undefined` | No        | The section by index (or sections if `allowMultipleOpen`) you want opened by default.                                                                                            |\n| open              | \u003ccode\u003enumber \u0026#124; number[]\u003c/code\u003e                   | `undefined` | No        | Makes this a controlled component where `open`, `close`, `toggle`, controls have no effect. The sections defined here are always the ones that are open.                         |\n| allowMultipleOpen | `boolean`                                             | `false`     | No        | Allows multiple sections to be opened at one time.                                                                                                                               |\n| allowAllClosed    | `boolean`                                             | `false`     | No        | Allows all of the sections to be closed. If `false`, you must define either the `open` or `defaultOpen` property.                                                                |\n| onChange          | \u003ccode\u003e(opened: number \u0026#124; number[]) =\u003e void\u003c/code\u003e | `undefined` | No        | Called each time the open sections change. If `allowMultipleOpen`, the argument will be an array, otherwise a single number. The number corresponds to the open section's index. |\n| children          | `React.ReactElement\u003cSectionProps\u003e[]`                  | `undefined` | Yes       | The only children allowed by this component are [`\u003cSection\u003e`s](#section).                                                                                                        |\n\n### `\u003cSection\u003e`\n\nThis component creates the context for the accordion panel and trigger contained in this section. It must be a direct\ndescendent of [`\u003cAccordion\u003e`](#accordion).\n\n#### Props\n\n| Prop     | Type                                                                                    | Default     | Required? | Description                                                                                                      |\n| -------- | --------------------------------------------------------------------------------------- | ----------- | --------- | ---------------------------------------------------------------------------------------------------------------- |\n| id       | `string`                                                                                | `undefined` | No        | Overrides the ID that is auto-generated by this component.                                                       |\n| disabled | `boolean`                                                                               | `false`     | No        | `true` if the section should not be allowed to have its `open` state changed.                                    |\n| children | \u003ccode\u003eReact.ReactNode \u0026#124; ((context: SectionContextValue) =\u003e React.ReactNode)\u003c/code\u003e | `undefined` | Yes       | Sections must include a [`\u003cTrigger\u003e`](#trigger) and a [`Panel`](#panel) in addition to anything else you'd like. |\n\n### `\u003cTrigger\u003e`\n\nThis component clones any React element and turns it into a accordion trigger that controls the visible state of\nthe [`\u003cPanel\u003e`](#panel). It must be a child of [`\u003cSection\u003e`](#section).\n\n#### Props\n\n| Prop        | Type                  | Default     | Required? | Description                                                                                                                                                                                             |\n| ----------- | --------------------- | ----------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| openClass   | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `open`.                                                                                                                        |\n| closedClass | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `closed`.                                                                                                                      |\n| openStyle   | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `open`.                                                                                                                           |\n| closedStyle | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `closed`.                                                                                                                         |\n| children    | `React.ReactElement`  | `undefined` | Yes       | The child is cloned by this component and has aria attributes injected into its props as well as keyboard events for opening the section with `space` and `enter` keys and navigating between sections. |\n\n### `\u003cPanel\u003e`\n\nThis component clones any React element and turns it into a accordion section panel. It must be\na child of [`\u003cSection\u003e`](#section).\n\n#### Props\n\n| Prop        | Type                  | Default     | Required? | Description                                                                                                                                                     |\n| ----------- | --------------------- | ----------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| openClass   | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `open`.                                                                                |\n| closedClass | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `closed`.                                                                              |\n| openStyle   | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `open`.                                                                                   |\n| closedStyle | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `closed`.                                                                                 |\n| children    | `React.ReactElement`  | `undefined` | Yes       | The child is cloned by this component and has aria attributes injected into its props as well as keyboard events for closing the section with the `escape` key. |\n\n### `\u003cClose\u003e`\n\nThis is a convenience component that clones any React element and adds an onClick handler to close its parent panel. It\nmust be a child of [`\u003cSection\u003e`](#section).\n\n#### Props\n\n| Prop     | Type                 | Default     | Required? | Description                                                                                                                                                                    |\n| -------- | -------------------- | ----------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| children | `React.ReactElement` | `undefined` | Yes       | The child is cloned by this component and has aria attributes injected into its props as keyboard events to ensure it acts like a button even if it isn't a native `\u003cbutton\u003e`. |\n\n### `useAccordion()`\n\nThis hook returns the value of the accordion's [AccordionContext object](#accordioncontextvalue). This hook\nmust be within a child of [`\u003cAccordion\u003e`](#accordion).\n\n### `AccordionContextValue`\n\n```typescript jsx\ninterface AccordionContextValue {\n  // DOM references to the accordion sections\n  sections: (HTMLElement | undefined)[]\n  // Registers a new accordion section\n  registerSection: (index: number, trigger: HTMLElement) =\u003e () =\u003e void\n  // The indexes of the open sections\n  opened: number[]\n  // Opens a section\n  open: (section: number | undefined) =\u003e void\n  // Closes a section\n  close: (section: number | undefined) =\u003e void\n  // Returns true if a section is open\n  isOpen: (section: number | undefined) =\u003e boolean\n  // Does the accordion allow all of its sections to be closed?\n  allowAllClosed: boolean\n}\n```\n\n### `useSection()`\n\nThis hook returns the value of the accordion sections's [SectionContextValue object](#sectioncontextvalue). This hook\nmust be within a child of [`\u003cSection\u003e`](#section).\n\n### `SectionContextValue`\n\n```typescript jsx\ninterface SectionContextValue {\n  // Is this section open?\n  isOpen: boolean\n  // Opens this section if not disabled\n  open: () =\u003e void\n  // Closes this section if possible\n  close: () =\u003e void\n  // Toggles the visible state of this section if possible\n  toggle: () =\u003e void\n  // The id of this section\n  id?: string\n  // The index of this section\n  index: number\n  // Is the section disabled?\n  disabled: boolean\n  // The DOM reference to the section's \u003cTrigger\u003e\n  triggerRef: React.MutableRefObject\u003cHTMLElement | null\u003e\n}\n```\n\n### `useControls()`\n\nThis hook returns the accordion sections's `open`, `close`, and `toggle` functions. This hook\nmust be within a child of [`\u003cSection\u003e`](#section).\n\n### `useDisabled()`\n\nThis hook returns the accordion sections's `disabled` value. This hook\nmust be within a child of [`\u003cSection\u003e`](#section).\n\n### `useIsOpen()`\n\nThis hook returns the accordion sections's `isOpen` value. This hook\nmust be within a child of [`\u003cSection\u003e`](#section).\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccessible-ui%2Faccordion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccessible-ui%2Faccordion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccessible-ui%2Faccordion/lists"}