npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-flare-accordion

v1.0.1

Published

React Flare Accordion is a simple and customizable accordion component for React applications.

Downloads

14

Readme

react-flare-accordion

A highly configurable and lightweight React accordion component with customizable animations and icons.

🚀 Features

  • Custom Icons: Pass your own expand/collapse icons.
  • Animations: Choose from multiple animation effects.
  • Dynamic Data: Accepts an array of objects with title and content.
  • Minimal & Fast: Small bundle size with zero dependencies.
  • Dynamically Update Content: Modify accordion data in real-time.

📦 Installation

npm install react-flare-accordion

or

yarn add react-flare-accordion

🛠️ Usage

Basic Example

import React from 'react';
import useAccordion from 'react-flare-accordion';

const App = () => {
  const [Accordion] = useAccordion([
    { title: 'First Item', content: 'This is the first content' },
    { title: 'Second Item', content: 'This is the second content' },
    { title: 'Third Item', content: 'This is the third content' },
  ]);

  return <Accordion />;
};

export default App;

🎨 Custom Icons & Animation

You can pass custom icons (React components or images) and an animation type:

import { FaPlus, FaMinus } from 'react-icons/fa';

const [Accordion] = useAccordion(
  [
    { title: 'Item 1', content: 'Content for item 1' },
    { title: 'Item 2', content: 'Content for item 2' },
  ],
  {
    animation: 'fade',
    icons: {
      collapse: <FaPlus />, // Icon for collapsed state
      expand: <FaMinus />,  // Icon for expanded state
    },
  }
);

🎬 Available Animations

You can customize the accordion animations using the animation option. Available animations include:

  • rotate (default) - Rotates the expand/collapse icon.
  • fade - Fades in and out.
  • scale - Zoom in/out effect.

Example usage:

const [Accordion] = useAccordion(data, { animation: 'scale' });

🔧 API Reference

useAccordion(data, options)

Parameters:

  • data (array) - List of accordion items. Each item must have:
    { title: "Your Title", content: "Your Content" }
  • options (object, optional) - Additional configurations:
    • icons (object) - Custom icons for expand/collapse.
      { collapse: <CustomCollapseIcon />, expand: <CustomExpandIcon /> }
    • animation (string) - Animation effect (default: 'rotate').

Returns:

  • [AccordionComponent, setAccordionData]
    • AccordionComponent: The rendered accordion.
    • setAccordionData(newData): Function to update accordion items dynamically.

🔄 Dynamically Updating Data

You can update the accordion items using setAccordionData:

const [Accordion, setAccordionData] = useAccordion([]);

useEffect(() => {
  setAccordionData([
    { title: 'New Item 1', content: 'Updated content' },
  ]);
}, []);

🌟 License

This project is licensed under the MIT License. Feel free to use and modify it.


📢 Contributing

If you find any bugs or have suggestions, feel free to open an issue or submit a pull request!


⭐ If you find this package useful, please give it a star on GitHub!