Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-reanimated-animated-accordion

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-reanimated-animated-accordion

test

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

react-native-reanimated-accordion

A simple animated expandable section for react native apps using reanimated

🦄 Features

  • ✅ Customizable
  • ✅ Includes option to not render collapsed compnent. (For less rendring).
  • ✅ Uses Reanimated v3

How we use it

Installation

npm install react-native-reanimated-animated-accordion

or using yarn

yarn add react-native-reanimated-animated-accordion

⚠️ Make sure you have react-native-reanimated installed in your project.

Usage

import Expandable from 'react-native-reanimated-animated-accordion';

<View
  style={{
    width: '80%',
    borderRadius: 20,
    backgroundColor: 'white',
    shadowOffset: {
      height: -2,
      width: 0,
    },
    elevation: 2,
    shadowRadius: 20,
    shadowOpacity: 0.07,
  }}
>
  <TouchableOpacity
    style={{
      padding: 20,
    }}
    onPress={() => {
      setExpanded(!expanded);
    }}
  >
    <Text>Toggle</Text>
  </TouchableOpacity>
  <View style={{ width: '100%' }}>
    <Expandable
      duration={speed}
      expanded={expanded}
    >
      <View style={{ width: '100%', padding: 20, paddingTop: 0 }}>
        <Text>
          Lorem ipsum dolor sit amet consectetur, adipisicing elit.
          Necessitatibus ab placeat alias commodi voluptatibus possimus
          ducimus sit repellat praesentium fugit similique aut quam nemo
          libero, aperiam deleniti modi natus quia!
        </Text>
        <Text>
          Lorem ipsum dolor sit amet consectetur, adipisicing elit.
          Necessitatibus ab placeat alias commodi voluptatibus possimus
          ducimus sit repellat praesentium fugit similique aut quam nemo
          libero, aperiam deleniti modi natus quia!
        </Text>

        <View
          style={{ marginTop: 20, width: '100%', alignItems: 'center' }}
        >
          <Image
            source={testImage}
            style={{ height: 100, width: 100, resizeMode: 'contain' }}
          />
        </View>
      </View>
    </Expandable>
  </View>
</View>

Reduce Rendering

If you would like to prevent collapsed components from being rendered, just add a renderWhenCollapsed={false}. this can help if you have heavy collapsed compoennts as it may reduce your boot time + ram.

<Expandable
  duration={speed}
  renderWhenCollapsed={false}
  expanded={expanded}
>
//
</Expandable>

License

MIT


Made with create-react-native-library

Keywords

FAQs

Package last updated on 03 Oct 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc