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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@smith6423/react-accordion

v2.5.1

Published

Component for animating height during mount/unmount using a CSS transition - React 18 compatible. Based on react-slidedown by Frank Wallis.

Readme

@smith6423/react-accordion

🚀 설치

npm install @smith6423/react-accordion

📖 사용법

import React, { useState } from "react";
import { Accordion } from "@smith6423/react-accordion";
import "@smith6423/react-accordion/lib/accordion.css";

function MyComponent() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <div>
      <button onClick={() => setIsOpen(!isOpen)}>Toggle</button>

      <Accordion>
        {isOpen && (
          <div style={{ padding: "20px" }}>
            <h3>아코디언 내용</h3>
            <p>이 내용은 부드러운 애니메이션과 함께 나타납니다!</p>
          </div>
        )}
      </Accordion>
    </div>
  );
}

⚡ 속도 제어

{
  /* 빠른 애니메이션 (200ms) */
}
<Accordion speed="fast">{isOpen && <div>빠른 애니메이션</div>}</Accordion>;

{
  /* 보통 애니메이션 (500ms, 기본값) */
}
<Accordion speed="normal">{isOpen && <div>보통 애니메이션</div>}</Accordion>;

{
  /* 느린 애니메이션 (800ms) */
}
<Accordion speed="slow">{isOpen && <div>느린 애니메이션</div>}</Accordion>;

{
  /* 커스텀 속도 (밀리초) */
}
<Accordion speed={1200}>{isOpen && <div>1.2초 애니메이션</div>}</Accordion>;

🎛️ Props

| Prop | Type | Default | 설명 | | -------------------- | ---------------------------------------- | ---------- | ------------------------- | | children | ReactNode | - | 아코디언 내용 | | speed | 'fast' \| 'normal' \| 'slow' \| number | 'normal' | 애니메이션 속도 | | closed | boolean | false | 강제로 닫힌 상태 | | transitionOnAppear | boolean | true | 초기 마운트 시 애니메이션 | | className | string | - | 추가 CSS 클래스 | | as | string | 'div' | HTML 요소 타입 |

🎨 스타일 커스터마이징

/* 기본 스타일 수정 */
.react-accordion {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 커스텀 클래스 추가 */
.my-accordion {
  border: 1px solid #ddd;
  border-radius: 8px;
}
<Accordion className="my-accordion">{children}</Accordion>

✨ 특징

  • React 18 완벽 지원
  • TypeScript 지원
  • 부드러운 CSS 애니메이션
  • 커스터마이징 가능한 속도
  • 가벼운 번들 크기
  • 접근성 고려

🙏 크레딧

이 프로젝트는 react-slidedown (Frank Wallis)을 기반으로 하여 React 18 호환성과 속도 제어 기능을 추가한 버전입니다.

📝 라이선스

MIT License


Made with ❤️ for React developers