1.0.0 • Published 1 year ago

@syeadmaaz/react-native-accordion v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-accordion library

User customisable Animated React Native Accordion with React 18 and React Native 0.69.3 Support and the downward show content button extends the content

Example Screenshot

Installation

npm install --save @syeadmaaz/react-native-accordion

Usage

import Accordion from "@syeadmaaz/react-native-accordion";

<Accordion headerTitle="Title">
  <View>
    <Image source={imageUrl} />
    <Text>{description}</Text>
  </View>
</Accordion>;

You can also show arrow button on the bottom and override accordion header content:

<Accordion
  showButton
  style={styles.accordion}
  renderHeader={() => renderAccordionHeader()}
>
  <View>
    <Image source={imageUrl} />
    <View style={styles.headerValue}>
      <Text style={styles.headerLabelText}>{title}</Text>
      <Text style={styles.headerValueText}>{description}</Text>
    </View>
  </View>
</Accordion>

Properties

PropDescriptionDefault
headerStyleOptional styling for the header title container{}
headerTitleHeader title text
headerTitleStyleHeader title text style
showButtonShow accordion bottom buttonfalse
buttonStyleAccordion bottom button style{}
renderHeaderRender own accordion header() => {}
styleOptional styling for the container
renderButtonContentRender own accordion bottom button(showContent) => {}

License

MIT