Socket
Socket
Sign inDemoInstall

@szhsin/react-accordion

Package Overview
Dependencies
6
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @szhsin/react-accordion

The complete accordion solution for React.


Version published
Weekly downloads
8K
increased by11.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

React-Accordion

An unstyled, accessible accordion library for React apps and design systems.

Examples and Docs

NPM NPM

Features

  • Unstyled React accordion components
  • React hooks for Headless usage
  • WAI-ARIA compliant
  • Keyboard navigable
  • Support animation
  • Can be controlled or uncontrolled
  • Control to expand/collapse specific item or all items
  • Level 3 support of React 18 concurrent rendering
  • Support server-side rendering
  • Small and tree-shakable (~3kB)
  • Strongly typed API with TypeScript

react accordion

Install

with npm

npm install @szhsin/react-accordion

or with Yarn

yarn add @szhsin/react-accordion

Usage

import { Accordion, AccordionItem } from '@szhsin/react-accordion';

export default function Example() {
  return (
    <Accordion>
      <AccordionItem header="What is Lorem Ipsum?">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
        do eiusmod tempor incididunt ut labore et dolore magna aliqua.
      </AccordionItem>

      <AccordionItem header="Where does it come from?">
        Quisque eget luctus mi, vehicula mollis lorem. Proin fringilla
        vel erat quis sodales. Nam ex enim, eleifend venenatis lectus
        vitae, accumsan auctor mi.
      </AccordionItem>

      <AccordionItem header="Why do we use it?">
        Suspendisse massa risus, pretium id interdum in, dictum sit
        amet ante. Fusce vulputate purus sed tempus feugiat.
      </AccordionItem>
    </Accordion>
  );
}

Edit on CodeSandbox

Visit more examples and docs

License

MIT Licensed.

Keywords

FAQs

Last updated on 06 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc