All Projects → hamidhadi → react-native-collapsible-list

hamidhadi / react-native-collapsible-list

Licence: MIT License
A ReactNative collapsible list component

Programming Languages

objective c
16641 projects - #2 most used programming language
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
java
68154 projects - #9 most used programming language
Starlark
911 projects

Projects that are alternatives of or similar to react-native-collapsible-list

react-native-reseau
[WIP] An ios-like grid view based on react-native.
Stars: ✭ 13 (-81.43%)
Mutual labels:  list
org
No description or website provided.
Stars: ✭ 15 (-78.57%)
Mutual labels:  list
macro
Customize code using closures
Stars: ✭ 135 (+92.86%)
Mutual labels:  dynamic
angular-expression-parser
This library helps in achieving AngularJs equivalents of $parse, $eval and $watch in Angular.
Stars: ✭ 17 (-75.71%)
Mutual labels:  dynamic
recyclerview-list-drag-and-drop
No description or website provided.
Stars: ✭ 50 (-28.57%)
Mutual labels:  list
sl
🍻 An utility tool to list npm scripts from package.json file
Stars: ✭ 22 (-68.57%)
Mutual labels:  list
tasuku
✅ タスク — The minimal task runner for Node.js
Stars: ✭ 1,488 (+2025.71%)
Mutual labels:  list
cs-resources
Curated Computer Science and Programming Resource Guide
Stars: ✭ 42 (-40%)
Mutual labels:  list
ienumerable
Deep immutable, Lightweight Enumerable with superpowers
Stars: ✭ 63 (-10%)
Mutual labels:  list
bowser
⭐ Bowser - Dynamic Default Browser Switch for MacOS
Stars: ✭ 42 (-40%)
Mutual labels:  dynamic
awesome-game-design
A comprehensive list of Game Design related learning materials, examples and tools.
Stars: ✭ 43 (-38.57%)
Mutual labels:  list
Competitive-Programming
This repo conatins the code of the problems practised by me on Codeforces,Codedchef,Leetcode,Geeks For Geeks
Stars: ✭ 14 (-80%)
Mutual labels:  dynamic
Fortran-code-on-GitHub
Directory of Fortran codes on GitHub, arranged by topic
Stars: ✭ 79 (+12.86%)
Mutual labels:  list
sisyphus
Lists of random resources
Stars: ✭ 24 (-65.71%)
Mutual labels:  list
ip proxy pool
Generating spiders dynamically to crawl and check those free proxy ip on the internet with scrapy.
Stars: ✭ 39 (-44.29%)
Mutual labels:  dynamic
charles
Java web crawling library
Stars: ✭ 31 (-55.71%)
Mutual labels:  dynamic
awesome
my personal collection of awesome projects, links, books.
Stars: ✭ 16 (-77.14%)
Mutual labels:  list
awesome-webvis
A curated list of awesome WebVIs
Stars: ✭ 12 (-82.86%)
Mutual labels:  list
Swash
Fonts in iOS made safe, expressive, and dynamic.
Stars: ✭ 73 (+4.29%)
Mutual labels:  dynamic
react-recycled-scrolling
Simulate normal scrolling by using only fixed number of DOM elements for large lists of items with React Hooks
Stars: ✭ 26 (-62.86%)
Mutual labels:  list

react-native-collapsible-list

A ReactNative collapsible list component

react-native-collapsible-list example

Installation

You can install this package via yarn:

yarn add react-native-collapsible-list

or npm

npm install react-native-collapsible-list --save

Basic Usage

import React, { Component } from "react";
import { Text, View } from "react-native";
import CollapsibleList from "react-native-collapsible-list";

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <CollapsibleList
          numberOfVisibleItems={1}
          wrapperStyle={styles.wrapperCollapsibleList}
          buttonContent={
            <View style={styles.button}>
              <Text style={styles.buttonText}>{buttonText}</Text>
            </View>
          }
        >
          <View style={styles.collapsibleItem}>
            <Text>Hello Collapsable List :)</Text>
          </View>
          <View style={styles.collapsibleItem}>
            <Text>Collapsable List Item</Text>
          </View>
          <View style={styles.collapsibleItem}>
            <Text>Another Collapsable List Item</Text>
          </View>
        </CollapsibleList>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "rgba(0, 0, 0, 0.1)"
  },
  wrapperCollapsibleList: {
    flex: 1,
    marginTop: 20,
    overflow: "hidden",
    backgroundColor: "#FFF",
    borderRadius: 5
  },
  collapsibleItem: {
    borderBottomWidth: StyleSheet.hairlineWidth,
    borderColor: "#CCC",
    padding: 10
  }
});

Properties

Prop Type Default Description
animationConfig ReactNative.LayoutAnimationConfig {duration: 700, update: { type: "spring", springDamping: 0.7, property: "scaleXY" }} Overrides each property of the default value if specified
buttonContent React.ReactNode null Content of collapse button
buttonPosition string (top or bottom) bottom Position of collapse button
numberOfVisibleItems number 1 Number of visible items when lis is not collapsed
onToggle function null Callback function for toggling the list with collapsed parameter which can be true(list is collapsed) or false(list is not collapsed)
wrapperStyle ReactNative.ViewStyle null The style of the list wrapper

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. 😉

License

Licensed under the MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].