0.1.3 • Published 5 years ago

react-native-da-expandable v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

react-native-da-expandable

You have two main elements

  • CONTAINER

The container goal is for you to wrapp the collapsible elements inside of it. THis element allows you to scroll and collapse its children

  • COLLAPSIBLE

The collapsible element itself

Properties

Container

propdefaulttypeisRequireddescriptionexample
separatornullObjectfalseOne react component to use as separator between the container childs() => <View style={{marginVertical: 10}}>
footerObjectObjectfalseOne react component to use as the container footer() => FOOTER
listRefnullObjectfalseYou can get the reference for the Container in order to scroll for exref => this.containerRef = ref
changedLayoutsObjectObjectfalseThis property lets you get all the layouts of the container childs. Then you can perform your logic and scroll to where you want

Collapsible

propdefaulttypeisRequireddescriptionexample
idnullObjectfalseOne react component to use as separator between the container childs'myid'
namespaceundefinedstringfalseThe collapsible element can have one namespace. The container will then make sure only one element on the same namespace is expanded'expandall'
renderHeaderObjecttrueOne component to be rendered has the header. Here you will get toggle one function to toggle manually and one boolean indicating if it is expanded(toggle, isExpanded) => HEADER
renderContentObjecttrueOne component to be rendered has the content.() => HEADER

TODO

  • Animate the while toggling expandable state
  • Add JSDOcs
0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago