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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mustapha-ghlissi/react-native-accordion

v1.1.0

Published

React Native Accordion: Reanimated Collapsible Sections for React Native.

Downloads

38

Readme

React Native Accordion

@mustapha-ghlissi/react-native-accordion: a Collapsible Sections for React Native.

MIT License npm npm npm npm github github github github

Screenshots

Screen 1 Screen 2 Screen 3 Screen 4 Screen 5 Screen 6

Demo

Demo

Example

You can check out this Example.

Installation

Installing the package

Use npm or yarn to install the package.

npm i @mustapha-ghlissi/react-native-accordion
yarn add @mustapha-ghlissi/react-native-accordion
Installing dependencies
npm i react-native-reanimated react-native-vector-icons
yarn add react-native-reanimated react-native-vector-icons

Note: to finish the installation, you have to finish configuring the installed dependencies react-native-reanimated and react-native-vector-icons.

Usage

import {Accordion, AccordionItem} from '@mustapha-ghlissi/react-native-accordion';

<Accordion>
    <AccordionItem
        title="Section 1"
        subTitle="SubSection 1">
        {/* Put section body content here */}
    </AccordionItem>
    <AccordionItem title="Section 2">
        {/* Put section body content here */}
    </AccordionItem>
    <AccordionItem title="Section 3">
        {/* Put section body content here */}
    </AccordionItem>
</Accordion>

Common Props

Common Props has specific effects depends on the Component.

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | androidRipple | RippleConfig: optional | Define the ripple of the pressable when pressing in the Accordion Item. | | leftIcon | string , ReactNode: optional | Accordion Item left icon. | | titleStyle | TextStyle: optional | Accordion item title style. | | subTitleStyle | TextStyle: optional | Accordion item sub-title style. | | titleContainerStyle | ViewStyle: optional | Accordion item title container style. | | headerStyle | ViewStyle: optional | Accordion item header style. | | itemContainerStyle | ViewStyle: optional | Accordion item container style. | | contentContainerStyle | ViewStyle: optional | Accordion item body style. | | contentWrapperStyle | ViewStyle: optional | Accordion item body wrapper style. |

Accordion Props

All common Props can be used here in addition to the following Props:

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | containerStyle | ViewStyle: optional | Accordion container style. | | animationDuration | number: optional | The duration of the collapse action | | compact | boolean: optional | Define if the Accordion Items are compact or not. |

Accordion Item Props

All common Props can be used here in addition to the following Props:

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | title | string: required | Accordion item title. | | subTitle | string: optional | Accordion item sub-title | | header | ReactNode: optional | Custom accordion item header component. | | rightIcon | string , ReactNode: optional | Accordion Item right icon (default = chevron-right). |

Advanced Usage

import {Accordion, AccordionItem} from '@mustapha-ghlissi/react-native-accordion';

const styles = StyleSheet.create({
    titleStyle: {
        fontSize: 16,
        fontWeight: 700,
    },
    contentContainerStyle: {
        paddingTop: 15,
        paddingBottom: 20
    }
});

<Accordion
    compact
    animationDuration={250}
    titleStyle={styles.titleStyle}
    contentContainerStyle={styles.contentContainerStyle}>
    <AccordionItem
        rightIcon='account'
        title="Section 1"
        subTitle="SubSection 1">
        {/* Put section body content here */}
    </AccordionItem>
    <AccordionItem
        rightIcon={<Icon name='cogs' size={26} color='#000' />}
        title="Section 2"
    >
        {/* Put section body content here */}
    </AccordionItem>
    <AccordionItem title="Section 3">
        {/* Put section body content here */}
    </AccordionItem>
</Accordion>

Donate

Donate with Wise by clicking this link or by scanning the following QRCode

Wise

Authors

Other libraries