1.0.7 • Published 2 years ago

@gapur/react-native-accordion v1.0.7

Weekly downloads
48
License
MIT
Repository
github
Last release
2 years ago

react-native-accordion

Animated accordion component for React Native with React 17 and React Native 0.64.3 Support

Example app

image

Installation

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

Usage

import Accordion from "@gapur/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() => {}

Running example app

git clone git@github.com:Gapur/react-native-accordion.git
cd react-native-accordion/example
yarn
npm run ios

License

MIT