{"id":22403317,"url":"https://github.com/springload/react-accessible-details","last_synced_at":"2025-06-28T12:33:33.387Z","repository":{"id":66138682,"uuid":"226787000","full_name":"springload/react-accessible-details","owner":"springload","description":"HTML5 \u003cdetails\u003e and \u003csummary\u003e tags in React with managed state and a few accessibility improvements","archived":false,"fork":false,"pushed_at":"2019-12-10T20:22:19.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-11T03:06:31.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-accessible-details","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/springload.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"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":"2019-12-09T04:48:55.000Z","updated_at":"2019-12-10T20:22:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"c633211b-a1a3-4d97-a3f6-00d1e7207ecf","html_url":"https://github.com/springload/react-accessible-details","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/springload/react-accessible-details","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-accessible-details","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-accessible-details/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-accessible-details/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-accessible-details/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/react-accessible-details/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-accessible-details/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262431770,"owners_count":23310111,"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-12-05T09:16:48.357Z","updated_at":"2025-06-28T12:33:33.368Z","avatar_url":"https://github.com/springload.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Accessible `\u003cDetails\u003e` / `\u003cSummary\u003e`\n\nThe little runt brother of [React Accessible Accordion](https://www.npmjs.com/package/react-accessible-accordion) which is probably what you want instead of this.\n\nBut if you do want HTML5 [`\u003cdetails\u003e`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) and [`\u003csummary\u003e`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary) tags in React with managed state and a few accessibility improvements then this is it.\n\n## Install\n\n```\nyarn add react-accessible-details\n```\n\nor\n\n```\nnpm i react-accessible-details\n```\n\n## Stale?\n\nOften projects on NPM are considered stale if they're not under active development, but that's a problem for software that does one thing and that may not need further development (unless Issues are raised). So this project is deemed **stable and complete** unless Github Issues are raised, so please don't be scared off by the fact that this project isn't under active development.\n\n## Usage\n\n```jsx\nimport { Details, Summary } from \"react-accessible-details\";\n\nexport default () =\u003e (\n  \u003cDetails\u003e\n    \u003cSummary\u003eFAQ: Why Is New Zealand Missing From Maps?\u003c/Summary\u003e\n    Shush, don't tell anyone.\n  \u003c/Details\u003e\n);\n```\n\n- `Details` takes optional props of `isOpen` (boolean to force open/closed), `isOpenDefault` (boolean to set initial value), and `className` (string).\n- `Summary` takes an optional prop of `className` (string).\n\n## Features\n\nAccessibility fixes like `role=\"button\"` on the `\u003csummary\u003e`, setting an appropriate `tabindex`, and using `aria-expanded` to help screen readers know whether it's open or not.\n\nAs it's a React component it integrates better with a React state manager, and it implements `\u003cdetails\u003e\u003csummary\u003e` in browsers that don't support it, like IE11.\n\nIt works without JavaScript (ie, server-side rendered React when browsers have JavaScript disabled) providing that [browsers natively support `\u003cdetails\u003e` and `\u003csummary\u003e`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#Browser_compatibility).\n\nIt's 2KB.\n\n## Requirements\n\nNo dependencies except peer dependencies on React 16.8 or later as it uses useState and the new context API.\n\n## Styling\n\nThis component doesn't include any styling, and although it will work in IE11 you may need to provide some default styles for that browser such as `display:block` on the `\u003csummary\u003e` tag.\n\nBecause both components support `className` props they're compatible with [Styled Components](https://www.styled-components.com/).\n\n## Credit\n\nMatthew Holloway at https://springload.co.nz/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Freact-accessible-details","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Freact-accessible-details","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Freact-accessible-details/lists"}