Chakra UI is a component system for building products with speed ⚡️
Installations
npm install @chakra-ui/accordion
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
18.17.1
NPM Version
9.6.7
Score
89.1
Supply Chain
88
Quality
77.6
Maintenance
100
Vulnerability
99.3
License
Releases
@chakra-ui/react@3.5.1
Published on 24 Jan 2025
@chakra-ui/panda-preset@3.5.1
Published on 24 Jan 2025
@chakra-ui/cli@3.5.1
Published on 24 Jan 2025
@chakra-ui/react@3.5.0
Published on 24 Jan 2025
@chakra-ui/panda-preset@3.5.0
Published on 24 Jan 2025
@chakra-ui/cli@3.5.0
Published on 24 Jan 2025
Contributors
Languages
TypeScript (82.77%)
MDX (16.42%)
JavaScript (0.66%)
CSS (0.08%)
HTML (0.07%)
Developer
Download Statistics
Total Downloads
74,053,940
Last Day
79,961
Last Week
347,931
Last Month
1,579,812
Last Year
26,269,502
GitHub Statistics
38,399 Stars
10,411 Commits
3,343 Forks
202 Watching
12 Branches
674 Contributors
Bundle Size
24.83 kB
Minified
7.01 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.3.1
Package Id
@chakra-ui/accordion@2.3.1
Unpacked Size
233.92 kB
Size
29.85 kB
File Count
73
NPM Version
9.6.7
Node Version
18.17.1
Publised On
08 Sept 2023
Total Downloads
Cumulative downloads
Total Downloads
74,053,940
Last day
-2.8%
79,961
Compared to previous day
Last week
-15.4%
347,931
Compared to previous week
Last month
-3.4%
1,579,812
Compared to previous month
Last year
10.3%
26,269,502
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
7
Peer Dependencies
3
@chakra-ui/accordion
An accordion is a vertically stacked set of interactive headings that each contain a title or content snippet representing a section of content.
The headings function as controls that enable users to reveal or hide their associated sections of content.
Installation
1yarn add @chakra-ui/accordion 2 3# or 4 5npm i @chakra-ui/accordion
Import Components
1import { 2 Accordion, 3 AccordionItem, 4 AccordionButton, 5 AccordionPanel, 6} from "@chakra-ui/accordion"
Component:
Accordion
: manages the global state of all opened accordion items via context.AccordionItem
: manages the state for a single accordion item.AccordionButton
: the trigger to open/close an accordion item.AccordionPanel
: the main content area for the accordion item.
Usage
By default, only one accordion can be visible at a time, and it can't be toggled.
Note 🚨: Each accordion button must be wrapped in a heading tag, that is appropriate for the information architecture of the page.
1<Accordion> 2 <AccordionItem> 3 <h2> 4 <AccordionButton>Section 1 title</AccordionButton> 5 </h2> 6 <AccordionPanel>Panel 1</AccordionPanel> 7 </AccordionItem> 8 9 <AccordionItem> 10 <h2> 11 <AccordionButton>Section 2 title</AccordionButton> 12 </h2> 13 <AccordionPanel>Panel 2</AccordionPanel> 14 </AccordionItem> 15</Accordion>
To make each accordion toggle (expand/collapse) on click, pass the allowToggle
prop.
1<Accordion allowToggle> 2 <AccordionItem> 3 <AccordionButton> 4 <chakra.div flex="1" textAlign="left"> 5 Section 1 title 6 </chakra.div> 7 <AccordionIcon /> 8 </AccordionButton> 9 <AccordionPanel pb={4}>Panel 1</AccordionPanel> 10 </AccordionItem> 11 12 <AccordionItem> 13 <AccordionButton> 14 <chakra.div flex="1" textAlign="left"> 15 Section 2 title 16 </chakra.div> 17 <AccordionIcon /> 18 </AccordionButton> 19 <AccordionPanel pb={4}>Panel 2</AccordionPanel> 20 </AccordionItem> 21</Accordion>
To allow multiple accordions to be visible at a time, pass the allowMultiple
prop.
1<Accordion allowMultiple> 2 <AccordionItem> 3 <AccordionButton> 4 <chakra.div flex="1" textAlign="left"> 5 Section 1 title 6 </chakra.div> 7 <AccordionIcon /> 8 </AccordionButton> 9 <AccordionPanel pb={4}>Panel 1</AccordionPanel> 10 </AccordionItem> 11 12 <AccordionItem> 13 <AccordionButton> 14 <chakra.div flex="1" textAlign="left"> 15 Section 2 title 16 </chakra.div> 17 <AccordionIcon /> 18 </AccordionButton> 19 <AccordionPanel pb={4}>Panel 2</AccordionPanel> 20 </AccordionItem> 21</Accordion>
References:
https://www.w3.org/TR/wai-aria-practices/examples/accordion/accordion.html https://inclusive-components.design/collapsible-sections/ https://github.com/stereobooster/react-accessible-accordion https://jqueryui.com/accordion/
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
30 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no binaries found in the repo
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975
Reason
Found 7/21 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: topLevel 'actions' permission set to 'write': .github/workflows/issue-stale.yml:10
- Warn: no topLevel permission defined: .github/workflows/pkg-pr.yml:1
- Warn: no topLevel permission defined: .github/workflows/quality.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
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
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/issue-stale.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/issue-stale.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-pr.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/pkg-pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-pr.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/pkg-pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/release.yml/main?enable=pin
- Info: 0 out of 10 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Score
4.6
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @chakra-ui/accordion
@zag-js/accordion
Core logic for the accordion widget implemented as a state machine
@chakra-ui/c-accordion
Chakra UI Vue | CAccordion component
@hackr/chakra-ui-accordion
A simple and accessible accordion component for React & Chakra UI
@teste-ui/accordion
A simple and accessible accordion component for React & Chakra UI