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

@jkrmarmol/react-native-collapsible

v0.1.4

Published

A simple and customizable React Native component for collapsible content, supporting smooth expand/collapse animations and accordion behavior.

Readme

📦 React Native Collapsible Component

A simple and customizable React Native component for collapsible content, supporting smooth expand/collapse animations and accordion behavior.

Perfect for creating accordion UIs, toggle sections, or dynamically hiding/showing content with smooth animations.

✨ Features

  • 🧩 Simple API
  • ⚙️ Custom animation duration and easing
  • 📐 Supports alignments (top, center, bottom)
  • 📱 Built using React Native's Animated
  • ⚡ High performance, uses useNativeDriver option where applicable

📦 Installation

npm install @jkrmarmol/react-native-collapsible
# or
yarn add @jkrmarmol/react-native-collapsible

🚀 Usage

import React, { useState } from 'react';
import { Text, Button, View } from 'react-native';
import { Collapsible } from '@jkrmarmol/react-native-collapsible';

const MyComponent = () => {
  const [collapsed, setCollapsed] = useState(true);

  return (
    <View>
      <Button title="Toggle" onPress={() => setCollapsed(!collapsed)} />
      <Collapsible collapsed={collapsed}>
        <Text>This content can be collapsed and expanded.</Text>
      </Collapsible>
    </View>
  );
};

| Prop | Type | Default | Description | | ------------------------- | ----------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------- | | align | 'top' | 'center' | 'bottom' | 'top' | Alignment of the content when expanding. | | collapsed | boolean | true | If true, the component is collapsed. | | collapsedHeight | number | 0 | The height of the view when collapsed. | | duration | number | 300 | Duration of the expand/collapse animation in ms. | | easing | string | 'easeOutCubic' | Easing function used in animation. Accepts built-in Easing keys or custom string like easeInOutCubic. | | onAnimationEnd | () => void | () => null | Callback called after the animation completes. | | renderChildrenCollapsed | boolean | true | Whether to render children while collapsed. Useful for keeping state/mounting. | | style | StyleProp<ViewStyle> | undefined | Optional styling for the animated content container. | | enablePointerEvents | boolean | false | If false, disables pointer events when collapsed. | | children | ReactNode | - | The content to show/hide. |

🧪 Examples

Basic Collapsible

<Collapsible collapsed={true}>
  <Text>Hidden content</Text>
</Collapsible>

Collapsible with Alignment

<Collapsible collapsed={false} align="bottom">
  <Text>This will slide in from the bottom.</Text>
</Collapsible>

Custom Animation

<Collapsible collapsed={false} duration={500} easing="easeInOutQuart">
  <Text>Custom easing and duration</Text>
</Collapsible>

📌 Notes

  • This component uses React Native’s layout measurement for animation, so make sure content is rendered properly.

  • To ensure performance, do not use complex nested views inside the collapsible unless necessary.

👨‍💻 Contributing

PRs, issues, and feature requests are welcome! If you like this library, consider giving it a ⭐️.

📝 License

MIT License © 2025 Kurt Russelle Marmol