GithubHelp home page GithubHelp logo

gapur / react-native-accordion Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 8.0 1.2 MB

Animated accordion component for React Native

Home Page: https://www.npmjs.com/package/@gapur/react-native-accordion

License: MIT License

JavaScript 27.51% Starlark 8.65% Java 28.08% Ruby 3.45% Objective-C 20.01% TypeScript 12.29%
react react-native accordion react-native-accordion collapsible

react-native-accordion's Introduction

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

Prop Description Default
headerStyle Optional styling for the header title container {}
headerTitle Header title text
headerTitleStyle Header title text style
showButton Show accordion bottom button false
buttonStyle Accordion bottom button style {}
renderHeader Render own accordion header () => {}
style Optional styling for the container
renderButtonContent Render own accordion bottom button (showContent) => {}

Running example app

git clone [email protected]:Gapur/react-native-accordion.git
cd react-native-accordion/example
yarn
npm run ios

Contributors

License

MIT

react-native-accordion's People

Contributors

gapur avatar mariomurrent-softwaresolutions avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-native-accordion's Issues

Separate header and content background color

It is not possible to give the header a different background color than then content.

The content background always be also visible on the header (seems like there is a padding?)

React v17 support

Currently the peer dependency is React v16, which will throw an error for React v17 projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.